/* section-room-photo-gallery-01: layout and lightbox belong to this template. */
.section-room-photo-gallery-01 {
    --room-photo-gutter: 140px;
    position: relative;
    isolation: isolate;
    min-width: 0;
    padding: 80px 0 0;
    background: #fff;
    color: #191919;
    font-family: "rixsinhead-pro", "SUIT Variable", sans-serif;
}

/* With multiple galleries, leave 80px after the final gallery at every width. */
.section-room-photo-gallery-01 ~ .section-room-photo-gallery-01:not(:has(~ .section-room-photo-gallery-01)) {
    padding-bottom: 80px;
}

.section-room-photo-gallery-01 *,
.section-room-photo-gallery-01 *::before,
.section-room-photo-gallery-01 *::after {
    box-sizing: border-box;
}

[data-room-photo-gallery] [hidden] {
    display: none !important;
}

.section-room-photo-gallery-01 .section-room-photo-gallery-01-inner {
    width: min(1640px, calc(100% - 2 * var(--room-photo-gutter)));
    margin: 0 auto;
}

.section-room-photo-gallery-01 .section-room-photo-gallery-01-heading {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    margin-bottom: 25px;
}

.section-room-photo-gallery-01 .section-room-photo-gallery-01-heading > div {
    min-width: 0;
}

.section-room-photo-gallery-01 h2 {
    margin: 0;
    font-size: 18px;
    line-height: 24px;
    font-weight: 700;
    overflow-wrap: anywhere;
    word-break: keep-all;
}

.section-room-photo-gallery-01 .section-room-photo-gallery-01-heading ul {
    margin: 9px 0 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
    line-height: 22px;
    font-weight: 400;
    overflow-wrap: anywhere;
    word-break: keep-all;
}

.section-room-photo-gallery-01 .section-room-photo-gallery-01-heading li {
    position: relative;
    padding-left: 8px;
    margin-top: var(--section-list-space-before, 0px);
}

.section-room-photo-gallery-01 .section-room-photo-gallery-01-hint {
    position: relative;
    padding-left: 8px;
    flex-shrink: 0;
    margin: 0;
    font-size: 14px;
    line-height: 22px;
}

/* Same 4px marker and 4px text gap as section-room-amenity-01. */
.section-room-photo-gallery-01 .section-room-photo-gallery-01-heading li::before,
.section-room-photo-gallery-01 .section-room-photo-gallery-01-hint::before {
    content: "";
    position: absolute;
    left: 0;
    top: 8px;
    width: 4px;
    height: 4px;
    background: currentColor;
}

.section-room-photo-gallery-01 .section-room-photo-gallery-01-grid {
    display: grid;
    grid-template-columns: repeat(var(--room-photo-columns, 3), minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.section-room-photo-gallery-01 .section-room-photo-gallery-01-column {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 16px;
}

.section-room-photo-gallery-01 .section-room-photo-gallery-01-photo {
    display: block;
    width: 100%;
    overflow: hidden;
    border-radius: 3px;
    color: inherit;
    cursor: zoom-in;
}

/* Default: original ratio. Optional per-photo ratios reproduce XD portrait crops. */
.section-room-photo-gallery-01 .section-room-photo-gallery-01-photo img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: inherit;
}

.section-room-photo-gallery-01 .section-room-photo-gallery-01-photo img[data-room-photo-crop] {
    aspect-ratio: var(--room-photo-ratio);
    object-fit: cover;
}

.section-room-photo-gallery-01 .section-room-photo-gallery-01-photo:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 4px;
}

/* XD photo viewer: a 15px blurred backdrop and a full-height centered image. */
[data-room-photo-gallery] .section-room-photo-gallery-01-dialog {
    --room-viewer-gutter: max(140px, calc((100vw - 1640px) / 2));
    --room-viewer-track: #ffffff80;
    --room-viewer-icon-shadow: drop-shadow(1px 1px .5px #00000029);
    position: fixed;
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    overflow: hidden;
}
[data-room-photo-gallery] .section-room-photo-gallery-01-dialog[data-photo-fills-viewer] {
    --room-viewer-track: #d8d8d8;
    --room-viewer-icon-shadow: none;
    color: #191919;
}
[data-room-photo-gallery] .section-room-photo-gallery-01-dialog::backdrop {
    background: rgb(0 0 0 / 40%);
    -webkit-backdrop-filter: blur(15px) brightness(1.05);
    backdrop-filter: blur(15px) brightness(1.05);
}
[data-room-photo-gallery] .section-room-photo-gallery-01-dialog[open] {
    display: grid;
    place-items: center;
}
[data-room-photo-gallery] .section-room-photo-gallery-01-expanded {
    display: grid;
    place-items: center;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    pointer-events: none;
}
[data-room-photo-gallery] .section-room-photo-gallery-01-expanded img {
    grid-area: 1 / 1;
    display: block;
    width: var(--room-photo-expanded-width, 100%);
    height: var(--room-photo-expanded-height, 100%);
    max-width: 100%;
    max-height: 100%;
    border-radius: 3px;
    object-fit: cover;
    transition: none;
    pointer-events: auto;
    touch-action: pan-y;
    user-select: none;
}
[data-room-photo-gallery] .section-room-photo-gallery-01-expanded img[data-room-photo-outgoing] {
    pointer-events: none;
}
[data-room-photo-gallery] .section-room-photo-gallery-01-status {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
[data-room-photo-gallery] .section-room-photo-gallery-01-close {
    position: absolute;
    z-index: 2;
    top: 24px;
    right: calc(var(--room-viewer-gutter) - 9px);
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 50%;
    outline: none;
    -webkit-tap-highlight-color: transparent;
    color: inherit;
    background: transparent;
    cursor: pointer;
}
[data-room-photo-gallery] .section-room-photo-gallery-01-close svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}
[data-room-photo-gallery] .section-room-photo-gallery-01-controls {
    position: absolute;
    z-index: 2;
    left: var(--room-viewer-gutter);
    right: var(--room-viewer-gutter);
    bottom: clamp(24px, 5.277778vh, 57px);
    display: flex;
    align-items: center;
    gap: 28px;
    height: 32px;
}
[data-room-photo-gallery] .section-room-photo-gallery-01-progress {
    position: relative;
    flex: 1;
    min-width: 0;
    height: 32px;
    cursor: pointer;
    touch-action: none;
}
[data-room-photo-gallery] .section-room-photo-gallery-01-track,
[data-room-photo-gallery] .section-room-photo-gallery-01-fill {
    position: absolute;
    left: 0;
    top: 16px;
    width: 100%;
    height: 2px;
    background: var(--room-viewer-track);
    pointer-events: none;
}
[data-room-photo-gallery] .section-room-photo-gallery-01-fill {
    top: 15px;
    height: 4px;
    background: currentColor;
    transform: scaleX(var(--room-photo-progress, 0));
    transform-origin: left center;
    transition: transform 420ms cubic-bezier(.22, .61, .36, 1);
}
@media (prefers-reduced-motion: reduce) {
    [data-room-photo-gallery] .section-room-photo-gallery-01-fill { transition: none; }
}
[data-room-photo-gallery] .section-room-photo-gallery-01-buttons {
    display: flex;
    flex: 0 0 110px;
}
[data-room-photo-gallery] .section-room-photo-gallery-01-buttons button {
    display: grid;
    place-items: center;
    flex: 1;
    height: 44px;
    padding: 0;
    border: 0;
    color: inherit;
    background: transparent;
    cursor: pointer;
}
[data-room-photo-gallery] .section-room-photo-gallery-01-buttons svg {
    width: 10px;
    height: 17px;
    fill: currentColor;
}
[data-room-photo-gallery] .section-room-photo-gallery-01-close svg,
[data-room-photo-gallery] .section-room-photo-gallery-01-buttons svg {
    filter: var(--room-viewer-icon-shadow);
}
[data-room-photo-gallery] .section-room-photo-gallery-01-buttons :is([data-room-photo-pause], [data-room-photo-play]) { height: 16px; }
[data-room-photo-gallery] .section-room-photo-gallery-01-dialog button:hover { opacity: .65; }
[data-room-photo-gallery] .section-room-photo-gallery-01-dialog :is(button, [role="slider"]):focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 3px;
}
[data-room-photo-gallery] .section-room-photo-gallery-01-dialog [data-room-photo-close]:focus-visible {
    border-color: currentColor;
    outline: none;
}
@media (max-width: 1199px) {
    .section-room-photo-gallery-01 {
        padding-top: clamp(30px, calc(30px + (100vw - 390px) * 50 / 810), 80px);
    }
    [data-room-photo-gallery] .section-room-photo-gallery-01-dialog { --room-viewer-gutter: 30px; }
}

/* PC keeps at least 140px per side; tablet gutters follow the room header. */
@media (min-width: 768px) and (max-width: 1199px) {
    .section-room-photo-gallery-01 {
        --room-photo-gutter: clamp(30px, calc(56px + (100vw - 1024px) * .4772727273), 140px);
    }
}

/* XD room_390: two masonry columns, retaining every configured photo. */
@media (max-width: 1023px) {
    .section-room-photo-gallery-01 {
        padding-bottom: clamp(0px, calc(30px - (100vw - 390px) * 30 / 633), 30px);
    }

    .section-room-photo-gallery-01 .section-room-photo-gallery-01-grid {
        display: block;
        column-count: min(2, var(--room-photo-columns, 3));
        column-gap: clamp(10px, calc(10px + (100vw - 390px) * 6 / 633), 16px);
    }

    .section-room-photo-gallery-01 .section-room-photo-gallery-01-column {
        display: contents;
    }

    .section-room-photo-gallery-01 .section-room-photo-gallery-01-photo {
        /* Keep the trailing gutter with its photo at a Safari column break. */
        display: inline-block;
        vertical-align: top;
        break-inside: avoid;
        margin-bottom: clamp(10px, calc(10px + (100vw - 390px) * 6 / 633), 16px);
    }
}

@media (max-width: 767px) {
    .section-room-photo-gallery-01 {
        --room-photo-gutter: 15px;
    }

    .section-room-photo-gallery-01 .section-room-photo-gallery-01-heading {
        flex-direction: column;
        align-items: stretch;
        gap: 11px;
        margin-bottom: 6px;
    }

    .section-room-photo-gallery-01 h2 {
        font-size: 16px;
        line-height: 21px;
    }

    .section-room-photo-gallery-01 .section-room-photo-gallery-01-heading ul {
        margin-top: 6px;
        font-size: 13px;
        line-height: 18px;
    }

    .section-room-photo-gallery-01 .section-room-photo-gallery-01-heading li + li {
        margin-top: calc(2px + var(--section-list-space-before, 0px));
    }

    .section-room-photo-gallery-01 .section-room-photo-gallery-01-heading li::before {
        top: 7px;
    }

    .section-room-photo-gallery-01 .section-room-photo-gallery-01-hint {
        align-self: flex-end;
        max-width: 100%;
        text-align: right;
        font-size: 11px;
        line-height: 15px;
    }

    .section-room-photo-gallery-01 .section-room-photo-gallery-01-hint::before {
        top: 5px;
    }

    [data-room-photo-gallery] .section-room-photo-gallery-01-dialog { --room-viewer-gutter: 15px; }
    [data-room-photo-gallery] .section-room-photo-gallery-01-close { top: max(12px, env(safe-area-inset-top)); }
    [data-room-photo-gallery] .section-room-photo-gallery-01-controls {
        gap: 14px;
        bottom: max(24px, env(safe-area-inset-bottom));
    }
    [data-room-photo-gallery] .section-room-photo-gallery-01-buttons { flex-basis: 90px; }
}
