/* ==========================================================================
   Hall of Shame gallery (HallofShame.html)
   Depends on css/tokens.css and css/style.css.
   ========================================================================== */

/* ==========================================================================
   Header
   --------------------------------------------------------------------------
   This page has no hero photograph, so the translucent header would sit on
   the light page as a washed-out grey band. Only this page needs it solid,
   and this stylesheet is only loaded here.
   ========================================================================== */

header {
    background: rgb(20 20 16 / 0.96);
    border-bottom-color: rgb(255 255 255 / 0.06);
}


/* ==========================================================================
   Page title
   --------------------------------------------------------------------------
   Sat on vh padding before, which broke on short viewports. Now a normal
   section with room for the fixed header.
   ========================================================================== */

.Title {
    padding: calc(var(--space-7) + 3rem) var(--gutter) var(--space-5);
    text-align: center;
}

.Title h1 {
    max-width: var(--container-narrow);
    margin-inline: auto;
    font-size: var(--text-3xl);
    font-weight: 700;
    letter-spacing: -0.02em;
}


/* ==========================================================================
   Grid
   --------------------------------------------------------------------------
   auto-fill with a minimum tile width, so the column count follows the
   viewport instead of stepping through hardcoded breakpoints.
   ========================================================================== */

.gallery-container {
    width: 100%;
    max-width: var(--container);
    margin-inline: auto;
    padding: 0 var(--gutter) var(--section-y);
}

.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    grid-auto-rows: 210px;
    /* dense backfills the holes left by portrait tiles spanning two rows */
    grid-auto-flow: dense;
    gap: var(--space-2);
}

.gallery img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--surface-sunken);
    opacity: 0;
    cursor: pointer;
    transition: opacity 0.6s var(--ease), transform 0.3s var(--ease),
                box-shadow 0.3s var(--ease);
}

.gallery img.loaded {
    opacity: 1;
}

.gallery img:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow);
}

/* Portrait shots get a taller tile so they are not cropped to a letterbox */
.gallery img.portrait {
    grid-row: span 2;
}

@media (max-width: 600px) {
    .gallery {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        grid-auto-rows: 150px;
    }
}


/* ==========================================================================
   Lightbox
   ========================================================================== */

#lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: var(--space-4);
    background: rgb(12 12 10 / 0.94);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    cursor: pointer;
}

#lightbox.active {
    display: flex;
}

.lightbox-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-3);
    max-width: min(1100px, 92vw);
    max-height: 90svh;
}

.lightbox-image {
    max-width: 100%;
    max-height: 76svh;
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: 0 24px 64px rgb(0 0 0 / 0.5);
}

.lightbox-caption {
    max-width: 46rem;
    color: var(--on-dark-muted);
    font-size: var(--text-base);
    line-height: var(--leading-snug);
    text-align: center;
    text-wrap: pretty;
}

/* --- Controls ------------------------------------------------------------
   Circular translucent buttons, sized to the 44px minimum touch target. */

.lightbox-close,
.lightbox-prev,
.lightbox-next {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    z-index: 1001;
    border: 1px solid rgb(255 255 255 / 0.2);
    border-radius: var(--radius-pill);
    background: rgb(255 255 255 / 0.12);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: var(--on-dark);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    transition: background 0.2s var(--ease), transform 0.2s var(--ease);
}

.lightbox-close:hover,
.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgb(255 255 255 / 0.26);
    transform: scale(1.06);
}

.lightbox-close {
    top: var(--space-4);
    right: var(--space-4);
}

.lightbox-prev,
.lightbox-next {
    top: 50%;
    transform: translateY(-50%);
}

.lightbox-prev:hover,
.lightbox-next:hover {
    transform: translateY(-50%) scale(1.06);
}

.lightbox-prev { left: var(--space-4); }
.lightbox-next { right: var(--space-4); }

@media (max-width: 600px) {
    .lightbox-prev { left: var(--space-2); }
    .lightbox-next { right: var(--space-2); }
}
