.rdpg-module-grid {
    --rdpg-count: var(--rdpg-desktop);
    display: grid;
    grid-template-columns: repeat(var(--rdpg-count), minmax(0, 1fr));
    align-items: start;
    gap: var(--rdpg-gap, 12px);
}
.rdpg-module-equal-height {
    container-type: inline-size;
    min-width: 0;
}
.rdpg-module-equal-height .rdpg-module-carousel {
    --rdpg-photo-height: max(48px, calc(((100cqw + var(--rdpg-gap, 12px)) / var(--rdpg-count) - var(--rdpg-gap, 12px)) * 0.75));
}
.rdpg-module-equal-height .rdpg-module-photo {
    height: var(--rdpg-photo-height);
    width: auto;
    aspect-ratio: var(--rdpg-photo-ratio, 4 / 3);
}
.rdpg-module-carousel {
    direction: ltr;
    scrollbar-width: none;
}
.rdpg-module-carousel::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}
.rdpg-module-photo {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: var(--rdpg-radius);
    scroll-snap-align: start;
    aspect-ratio: 4 / 3;
}
.rdpg-module-photo > img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: var(--rdpg-fit, cover);
    object-position: center;
}
.rdpg-module-watermark {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: var(--rdpg-wm-x);
    align-items: var(--rdpg-wm-y);
    box-sizing: border-box;
    padding: min(var(--rdpg-wm-margin), 15%);
    overflow: hidden;
    overflow-wrap: anywhere;
    color: var(--rdpg-wm-color);
    font-size: var(--rdpg-wm-font);
    line-height: 1.15;
    text-align: center;
    text-shadow: 0 1px 3px #000;
    opacity: var(--rdpg-wm-opacity);
    pointer-events: none;
}
.rdpg-module-watermark > .rdpg-module-watermark-logo {
    display: block;
    width: var(--rdpg-wm-size);
    height: auto;
    max-height: 100%;
    object-fit: contain;
}
.rdpg-module-controls:not([hidden]) {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.6rem;
}
.rdpg-module .rdpg-module-controls button,
.rdpg-module .rdpg-module-dialog button {
    appearance: none;
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgb(255 255 255 / 14%);
    color: #fff;
    box-shadow: none;
    font: 400 2rem/1 system-ui, sans-serif;
    cursor: pointer;
    transition: background-color 0.2s;
}
.rdpg-module .rdpg-module-controls button {
    background: #18181a;
}
.rdpg-module .rdpg-module-controls button[data-rdpg-play] {
    width: auto;
    padding-inline: 1rem;
    border-radius: 999px;
    font-size: 0.875rem;
}
.rdpg-module .rdpg-module-controls button:hover {
    background: #343437;
}
.rdpg-module .rdpg-module-dialog button:hover {
    background: rgb(255 255 255 / 26%);
}
.rdpg-module .rdpg-module-controls button:focus-visible,
.rdpg-module .rdpg-module-dialog button:focus-visible {
    outline: 2px solid #fff;
    outline-offset: -4px;
}
.rdpg-module-dialog:not([open]) { display: none; }
.rdpg-module-dialog {
    box-sizing: border-box;
    max-width: min(100vw, 85rem);
    max-height: 100vh;
    padding: 64px 72px;
    border: 0;
    border-radius: 0;
    color: #fff;
    background: transparent;
}
.rdpg-module-dialog::backdrop { background: rgb(0 0 0 / 94%); }
.rdpg-module .rdpg-module-dialog button {
    position: absolute;
    z-index: 1;
}
.rdpg-module-dialog [data-rdpg-close] { top: 12px; right: 12px; }
.rdpg-module-dialog [data-step] { top: 50%; transform: translateY(-50%); }
.rdpg-module-dialog [data-step="-1"] { left: 12px; }
.rdpg-module-dialog [data-step="1"] { right: 12px; }
.rdpg-module-dialog figure { position: relative; margin: 0; }
.rdpg-module-dialog figure > img {
    display: block;
    margin-inline: auto;
    max-width: 100%;
    max-height: calc(100vh - 128px);
    max-height: calc(100dvh - 128px);
    object-fit: contain;
}
@media (max-width: 1023px) {
    .rdpg-module-grid { --rdpg-count: var(--rdpg-tablet); }
}
@media (max-width: 767px) {
    .rdpg-module-grid { --rdpg-count: var(--rdpg-mobile); }
}

@media (max-width: 575px) {
    .rdpg-module-dialog { padding-inline: 8px; }
    .rdpg-module-dialog [data-step] { top: auto; bottom: 8px; transform: none; }
}
