/* ============================================================================
   Show Photos gallery + lightbox (PROTOTYPE — setlist-test-images).
   Owner's photos of the printed setlist / ticket stub for a show. Tiles are a
   uniform-height row that handles ANY aspect ratio (tall setlist sheets, square
   or wide ticket stubs) by letting each tile's width follow the image; clicking
   a tile opens the full image in a lightbox. Red accent matches the site theme.
   Delete with the rest of the setlist-test-images prototype if not adopted.
   ============================================================================ */

:root {
    --photo-red: #c8102e;
}

.setlist-photos-intro {
    margin-bottom: 1.25rem;
}

/* Small per-tile type label (Printed Setlist / Ticket Stub) — replaces the old
   full-width group header band, since there's at most one of each per show. */
.setlist-photo__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #444;
}
.setlist-photo__badge i {
    color: var(--photo-red);
}

/* The tiles: a wrapping flex row. Each tile is a fixed HEIGHT and shrink-wraps to
   the image's natural width (flex-grow:0, so a tile never stretches past its image
   — the row is left-packed with a ragged right edge). This keeps a tall setlist
   sheet and a wide ticket stub on the same tidy baseline without cropping either. */
.setlist-photos__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    align-items: flex-start;
}

.setlist-photo {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;   /* caption doesn't stretch the figure past the image */
    flex: 0 0 auto;            /* size to the image, don't grow to fill the row */
    max-width: 100%;
}

.setlist-photo__link {
    position: relative;
    display: block;
    height: 220px;            /* uniform tile height; image width follows ratio */
    border-radius: 10px;
    overflow: hidden;
    background: #f0f0f0;
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.setlist-photo__link:hover,
.setlist-photo__link:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.22);
    outline: none;
}

.setlist-photo__img {
    height: 100%;
    width: auto;
    max-width: 420px;         /* keep one very-wide image from dominating the row */
    display: block;
    object-fit: cover;
}

/* Zoom affordance, revealed on hover. */
.setlist-photo__zoom {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 0.9rem;
    opacity: 0;
    transform: scale(0.8);
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.setlist-photo__link:hover .setlist-photo__zoom,
.setlist-photo__link:focus-visible .setlist-photo__zoom {
    opacity: 1;
    transform: scale(1);
}

.setlist-photo__caption {
    font-size: 0.8rem;
    color: #555;
    margin-top: 0.4rem;
    max-width: 420px;
    line-height: 1.3;
}

@media (max-width: 575.98px) {
    /* On phones, each photo takes its own row and shows whole (no crop), capped to
       the viewport — a wide ticket and a tall setlist both fit without stretching. */
    .setlist-photo { flex: 1 1 100%; }
    .setlist-photo__link {
        height: auto;
        max-width: 100%;
        display: inline-block;     /* shrink-wrap to the image so the frame isn't full-width */
    }
    .setlist-photo__img {
        height: auto;
        width: auto;
        max-width: 100%;
        max-height: 65vh;
        object-fit: contain;
    }
    .setlist-photo__caption { max-width: 100%; }
}

/* ---- Lightbox ---- */
.setlist-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1080;            /* above the navbar */
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(2px);
    padding: clamp(1rem, 4vw, 3rem);
    animation: setlist-lightbox-in 0.15s ease;
}
.setlist-lightbox[hidden] { display: none; }

@keyframes setlist-lightbox-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.setlist-lightbox__figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
    max-height: 100%;
}
.setlist-lightbox__img {
    max-width: 100%;
    max-height: 82vh;         /* full image, never cropped, fits the viewport */
    width: auto;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    background: #fff;
}
.setlist-lightbox__caption {
    color: #eee;
    font-size: 0.9rem;
    margin-top: 0.8rem;
    text-align: center;
    max-width: 60ch;
}

.setlist-lightbox__close,
.setlist-lightbox__nav {
    position: absolute;
    background: rgba(255, 255, 255, 0.12);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.15s ease;
}
.setlist-lightbox__close:hover,
.setlist-lightbox__nav:hover {
    background: var(--photo-red);
}
.setlist-lightbox__close {
    top: 1rem;
    right: 1rem;
    width: 2.6rem;
    height: 2.6rem;
    font-size: 1.1rem;
}
.setlist-lightbox__nav {
    top: 50%;
    transform: translateY(-50%);
    width: 3rem;
    height: 3rem;
    font-size: 1.4rem;
}
.setlist-lightbox__nav--prev { left: 1rem; }
.setlist-lightbox__nav--next { right: 1rem; }
.setlist-lightbox__nav[hidden] { display: none; }

@media (max-width: 575.98px) {
    .setlist-lightbox__nav { width: 2.4rem; height: 2.4rem; font-size: 1.1rem; }
    .setlist-lightbox__nav--prev { left: 0.3rem; }
    .setlist-lightbox__nav--next { right: 0.3rem; }
}
