/* ==========================================================================
   Photos — the gallery page, the photo tiles on /amenities, and the
   lightbox they all open into.
   ========================================================================== */

/* --- Photo tile: a cropped thumbnail that opens the lightbox ------------- */

.photo-tile {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 3 / 2;
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--bb-hairline-soft);
    border-radius: var(--bb-radius);
    background-color: var(--bb-surface-raised);
    cursor: zoom-in;
}

.photo-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 600ms var(--bb-ease), filter var(--bb-dur) var(--bb-ease);
}

.photo-tile::after {
    content: "";
    position: absolute;
    inset: 0;
    box-shadow: inset 0 0 0 1px rgba(192, 141, 48, 0);
    transition: box-shadow var(--bb-dur) var(--bb-ease);
    pointer-events: none;
}

.photo-tile:hover img,
.photo-tile:focus-visible img {
    transform: scale(1.04);
    filter: brightness(1.08);
}

.photo-tile:hover::after,
.photo-tile:focus-visible::after {
    box-shadow: inset 0 0 0 1px var(--bb-gold-500);
}

.photo-tile:focus-visible {
    outline: 1px solid var(--bb-gold-500);
    outline-offset: 3px;
}

.photo-tile__badge {
    position: absolute;
    right: 0.6rem;
    bottom: 0.6rem;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    background: rgba(5, 4, 3, 0.72);
    color: var(--bb-gold-100);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.photo-tile__badge svg {
    width: 0.95rem;
    height: 0.95rem;
}

/* --- Album tiles (/amenities "Photo gallery") ---------------------------- */

.album-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 11rem), 1fr));
    gap: clamp(0.75rem, 1.4vw, 1.25rem);
}

.album-tile {
    aspect-ratio: 4 / 3;
}

.album-tile__label {
    position: absolute;
    inset: auto 0 0;
    display: grid;
    gap: 0.15rem;
    padding: 2.5rem 1rem 0.9rem;
    background: linear-gradient(to top, rgba(5, 4, 3, 0.9), transparent);
    text-align: left;
}

.album-tile__title {
    color: var(--bb-text-warm);
    font-family: var(--bb-font-display);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.album-tile__count {
    color: var(--bb-gold-300);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* --- /gallery ------------------------------------------------------------ */

.gallery-page__inner {
    padding-bottom: clamp(4rem, 8vw, 7rem);
}

.gallery-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: clamp(1.75rem, 3vw, 2.25rem);
}

.gallery-nav__link {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.5rem 0.95rem;
    border: 1px solid var(--bb-rule);
    border-radius: 999px;
    background: rgba(5, 4, 3, 0.55);
    color: var(--bb-text-warm);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: border-color var(--bb-dur) var(--bb-ease), color var(--bb-dur) var(--bb-ease);
}

.gallery-nav__link:hover,
.gallery-nav__link:focus-visible {
    border-color: var(--bb-gold-500);
    color: var(--bb-gold-200);
}

.gallery-nav__count {
    color: var(--bb-gold-500);
    font-weight: 500;
}

.gallery-album {
    padding-top: clamp(3.5rem, 6vw, 5.5rem);
    /* Clears the fixed header when jumped to from the album links. */
    scroll-margin-top: calc(var(--bb-logo-h-compact) + (var(--bb-header-pad) * 2) + 1.5rem);
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
    gap: clamp(0.5rem, 1vw, 0.9rem);
    margin-top: clamp(1.75rem, 3vw, 2.5rem);
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    grid-template-rows: auto 1fr;
    background: rgba(5, 4, 3, 0.95);
    color: var(--bb-text);
}

.lightbox[hidden] {
    display: none;
}

.lightbox__bar {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem var(--bb-gutter);
}

.lightbox__title {
    color: var(--bb-gold-300);
    font-family: var(--bb-font-display);
    font-size: clamp(0.9375rem, 0.9rem + 0.3vw, 1.125rem);
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.lightbox__count {
    color: var(--bb-text-dim);
    font-size: 0.8125rem;
    letter-spacing: 0.1em;
}

.lightbox__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2.5rem;
    height: 2.5rem;
    margin-left: auto;
    border: 1px solid var(--bb-rule);
    border-radius: 999px;
    background: none;
    color: var(--bb-text);
    cursor: pointer;
}

.lightbox__close svg {
    width: 1.15rem;
    height: 1.15rem;
}

.lightbox__close:hover,
.lightbox__close:focus-visible {
    border-color: var(--bb-gold-500);
    color: var(--bb-gold-200);
}

.lightbox__stage {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.85rem;
    min-height: 0;
    padding: 0 clamp(3.75rem, 7vw, 6rem) 1.25rem;
}

.lightbox__img {
    max-width: 100%;
    max-height: calc(100svh - 9rem);
    object-fit: contain;
    border-radius: var(--bb-radius);
    box-shadow: var(--bb-shadow-lg);
    transition: opacity 200ms var(--bb-ease);
}

.lightbox.is-loading .lightbox__img {
    opacity: 0.35;
}

.lightbox__caption {
    max-width: 48rem;
    color: var(--bb-text-dim);
    font-size: 0.875rem;
    line-height: 1.5;
    text-align: center;
}

.lightbox__nav {
    position: absolute;
    top: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border: 1px solid var(--bb-rule);
    border-radius: 999px;
    background: rgba(5, 4, 3, 0.6);
    color: var(--bb-text);
    cursor: pointer;
    transform: translateY(-50%);
}

.lightbox__nav svg {
    width: 1.35rem;
    height: 1.35rem;
}

.lightbox__nav:hover,
.lightbox__nav:focus-visible {
    border-color: var(--bb-gold-500);
    color: var(--bb-gold-200);
}

.lightbox__nav--prev {
    left: clamp(0.5rem, 1.5vw, 1.5rem);
}

.lightbox__nav--prev svg {
    transform: scaleX(-1);
}

.lightbox__nav--next {
    right: clamp(0.5rem, 1.5vw, 1.5rem);
}

.lightbox.is-single .lightbox__nav,
.lightbox.is-single .lightbox__count {
    display: none;
}

/* On phones the arrows sit over the photo's edges rather than beside it, so
   the photo gets the full width; swiping works too. */
@media (max-width: 719px) {
    .lightbox__stage {
        padding-inline: 0.5rem;
    }

    .lightbox__nav {
        width: 2.5rem;
        height: 2.5rem;
    }
}
