/* ── Photo gallery ───────────────────────────────────────────
   Figma (Gallery): desktop 1366:89862, mobile 1366:89967. The
   photos keep their own shape, three columns (desktop) or two.
   ─────────────────────────────────────────────────────────── */

.photo-gallery {
    padding: 40px var(--pad-x) 96px;
}

.photo-gallery__inner {
    display: flex;
    flex-direction: column;
    gap: 38px;
    max-width: var(--site-max-w);
    margin: 0 auto;
}

.photo-gallery__header {
    display: flex;
    flex-direction: column;
    gap: 24px;
    min-width: 0;
}

/* Figma Desktop/H2 */
.photo-gallery__title {
    font-size: 64px;
    font-weight: 300;
    line-height: 0.9;
    letter-spacing: -0.96px;
}

/* All, Rooms, Dining…: outlined pills, the chosen one filled */
.photo-gallery__filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.photo-gallery__chip {
    flex-shrink: 0;
    padding: 12px 20px;
    border: 1px solid rgba(20, 13, 12, 0.2);
    border-radius: 999px;
    background: none;
    color: var(--color-beamwood);
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 3.36px;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--transition), border-color var(--transition), color var(--transition);
}

.photo-gallery__chip:hover {
    border-color: var(--color-beamwood);
}

.photo-gallery__chip[aria-pressed="true"] {
    border-color: var(--color-beamwood);
    background: var(--color-beamwood);
    color: #FCFBFA;
}

.photo-gallery__chip:focus-visible {
    outline: 2px solid var(--color-copper);
    outline-offset: 2px;
}

/* Masonry, in order across the rows: photo-gallery.js gives each photo
   as many 1px rows as it is tall (plus the gap under it). Without the
   script, a plain grid. */
.photo-gallery__grid {
    --row-gap: 32px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: var(--row-gap) 24px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.photo-gallery__grid.is-masonry {
    grid-auto-rows: 1px;
    row-gap: 0;
}

.photo-gallery__item[hidden] {
    display: none;
}

.photo-gallery__figure {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0;
}

.photo-gallery__image {
    display: block;
    width: 100%;
    height: auto;
}

.photo-gallery__caption {
    font-family: var(--font-heading);
    font-size: 14px;
    font-style: italic;
    color: var(--color-beamwood);
}

/* Show more, and the count beside it */
.photo-gallery__more {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 16px 24px;
}

.photo-gallery__show-more.button--primary {
    height: 53px;
    padding: 0 32px;
    font-size: 12px;
    letter-spacing: 3.84px;
}

.photo-gallery__count {
    font-family: var(--font-heading);
    font-size: 15px;
    font-style: italic;
    color: var(--color-walnut);
}


/* Tablet and mobile — 1024px and below: two columns, the chips in one
   row that scrolls sideways, Show more the full width with the count under */
@media (max-width: 1024px) {
    .photo-gallery {
        padding: var(--pad-y) var(--pad-x) 32px;
    }

    .photo-gallery__inner {
        gap: 32px;
    }

    .photo-gallery__title {
        font-size: 32px;
        line-height: 1.06;
        letter-spacing: -0.32px;
    }

    .photo-gallery__filters {
        flex-wrap: nowrap;
        margin: 0 calc(-1 * var(--pad-x));
        padding: 0 var(--pad-x);
        overflow-x: auto;
        scrollbar-width: none;
    }

    .photo-gallery__filters::-webkit-scrollbar {
        display: none;
    }

    .photo-gallery__grid {
        --row-gap: 12px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 16px;
    }

    .photo-gallery__figure {
        gap: 8px;
    }

    .photo-gallery__more {
        flex-direction: column;
    }

    .photo-gallery__show-more.button--primary {
        width: 100%;
    }
}


/* A photo is a button that opens the lightbox */
.photo-gallery__open {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: none;
    cursor: zoom-in;
}

.photo-gallery__open:focus-visible {
    outline: 2px solid var(--color-beamwood);
    outline-offset: 3px;
}


/* ── The lightbox: the count and close over the photo, arrows
   either side, the thumbnails along the bottom. Black, as the
   site's photo overlays. ───────────────────────────────────── */
html:has(.photo-gallery__lightbox[open]) {
    overflow: hidden;
}

.photo-gallery__lightbox {
    width: 100%;
    max-width: none;
    height: 100%;
    max-height: none;
    padding: 0;
    border: 0;
    background: #000;
    color: #FCFBFA;
    overflow: hidden;
}

.photo-gallery__lightbox[open] {
    display: flex;
    flex-direction: column;
}

.photo-gallery__lightbox::backdrop {
    background: #000;
}

.photo-gallery__lightbox-top {
    display: flex;
    flex: none;
    align-items: center;
    justify-content: space-between;
    padding: 12px 12px 12px var(--pad-x);
}

.photo-gallery__lightbox-count {
    color: #FCFBFA;
    font-variant-numeric: tabular-nums;
}

.photo-gallery__lightbox-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    padding: 0;
    border: 0;
    background: none;
    color: #FCFBFA;
    cursor: pointer;
    transition: opacity var(--transition);
}

.photo-gallery__lightbox-close:hover {
    opacity: 0.7;
}

.photo-gallery__lightbox-close:focus-visible,
.photo-gallery__thumb:focus-visible {
    outline: 2px solid #FCFBFA;
    outline-offset: 2px;
}

/* The photo as big as fits, its caption under it */
.photo-gallery__stage {
    position: relative;
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 0 88px;
    touch-action: pan-y;
}

.photo-gallery__view {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: 100%;
    max-height: 100%;
    margin: 0;
}

.photo-gallery__view-image {
    display: block;
    max-width: 100%;
    max-height: calc(100dvh - 72px - 120px - 48px);
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.photo-gallery__view-caption {
    font-family: var(--font-heading);
    font-size: 16px;
    font-style: italic;
    text-align: center;
    color: rgba(252, 251, 250, 0.8);
}

.photo-gallery__view-caption:empty {
    display: none;
}

.photo-gallery__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.photo-gallery__arrow--prev {
    left: 20px;
}

.photo-gallery__arrow--next {
    right: 20px;
}

/* The thumbnails: a row that scrolls sideways, the one showing lit */
.photo-gallery__thumbs {
    display: flex;
    flex: none;
    gap: 8px;
    margin: 0;
    padding: 20px var(--pad-x);
    list-style: none;
    overflow-x: auto;
    scrollbar-width: none;
}

.photo-gallery__thumbs::-webkit-scrollbar {
    display: none;
}

.photo-gallery__thumbs li {
    flex: none;
}

.photo-gallery__thumb {
    display: block;
    width: 96px;
    height: 72px;
    padding: 0;
    border: 2px solid transparent;
    background: none;
    opacity: 0.5;
    cursor: pointer;
    transition: opacity var(--transition), border-color var(--transition);
}

.photo-gallery__thumb:hover {
    opacity: 0.8;
}

.photo-gallery__thumb[aria-current="true"] {
    border-color: #FCFBFA;
    opacity: 1;
}

.photo-gallery__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Tablet and mobile: the arrows over the photo's edges, smaller thumbnails */
@media (max-width: 1024px) {
    .photo-gallery__stage {
        padding: 0;
    }

    .photo-gallery__arrow--prev {
        left: 12px;
    }

    .photo-gallery__arrow--next {
        right: 12px;
    }

    .photo-gallery__view-caption {
        padding: 0 var(--pad-x);
    }

    .photo-gallery__thumb {
        width: 72px;
        height: 54px;
    }
}

/* The film card: a silent loop in the grid; in the lightbox the photo or
   the film shows, never both (display: block above beats [hidden]). */
.photo-gallery__video {
    object-fit: cover;
    background: var(--colour-black, #000);
}

.photo-gallery__view-image[hidden] {
    display: none;
}
