/* ---------------------------------------------------------------------
 * Gallery + lightbox styles for matchchaser.com home page.
 *
 * Two pieces:
 *   .gallery-strip — horizontally-scrolling thumb row with snap points
 *   .gal-lightbox  — full-viewport overlay for click-to-enlarge
 *
 * No external dependencies. Mobile-first; the strip works with touch +
 * the lightbox supports swipe-style nav via the prev/next buttons.
 * Colors / fonts pulled from CSS variables defined on the page itself.
 * --------------------------------------------------------------------- */

.gal-section {
    padding: 80px 0 60px;
}
.gal-section h2 {
    font-family: var(--display, 'Fraunces', serif);
    font-size: clamp(28px, 4vw, 44px);
    margin: 8px 0 12px;
}
.gal-section .section-intro {
    color: var(--paper-dim, #c9c2b4);
    max-width: 60ch;
    margin-bottom: 28px;
}

/* ---- strip ---- */
.gallery-strip {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding: 8px 0 24px;
    margin: 0 -8px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.2) transparent;
}
.gallery-strip::-webkit-scrollbar { height: 8px; }
.gallery-strip::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.2);
    border-radius: 4px;
}
.gallery-strip::-webkit-scrollbar-track { background: transparent; }

.gal-item {
    flex: 0 0 auto;
    scroll-snap-align: start;
    width: 320px;
    background: var(--ink-soft, #14130f);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 8px;
    padding: 0;
    margin: 0;
    cursor: pointer;
    overflow: hidden;
    transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
    color: var(--paper, #f5efe1);
    font: inherit;
    text-align: left;
}
.gal-item:hover, .gal-item:focus-visible {
    transform: translateY(-4px);
    border-color: var(--hit, #ff7a1a);
    box-shadow: 0 12px 32px rgba(0,0,0,0.4);
    outline: none;
}
.gal-item img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16/10;
    object-fit: cover;
    object-position: top;
    background: rgba(0,0,0,0.3);
}
.gal-cap {
    display: block;
    padding: 10px 14px 12px;
    font-size: 13px;
    color: var(--paper-dim, #c9c2b4);
    line-height: 1.4;
}

@media (max-width: 640px) {
    .gal-item { width: 78vw; max-width: 320px; }
    .gal-section { padding: 56px 0 44px; }
}

/* ---- lightbox ---- */
.gal-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0,0,0,0.94);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overscroll-behavior: contain;
}
.gal-lightbox[hidden] { display: none; }
.gal-lightbox.open { display: flex; }

.gal-lb-figure {
    margin: 0;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
}
.gal-lb-img {
    max-width: min(95vw, 1600px);
    max-height: 85vh;
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: 0 16px 60px rgba(0,0,0,0.7);
    border-radius: 4px;
}
.gal-lb-cap {
    text-align: center;
    color: #d4d0c4;
    font-size: 14px;
    line-height: 1.5;
    max-width: 80vw;
}

.gal-lb-close, .gal-lb-prev, .gal-lb-next {
    position: absolute;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s ease, transform 0.1s ease;
    font: inherit;
}
.gal-lb-close {
    top: 18px;
    right: 24px;
    width: 40px;
    height: 40px;
    font-size: 24px;
    line-height: 1;
}
.gal-lb-prev, .gal-lb-next {
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    font-size: 22px;
}
.gal-lb-prev { left: 24px; }
.gal-lb-next { right: 24px; }
.gal-lb-close:hover, .gal-lb-prev:hover, .gal-lb-next:hover {
    background: rgba(255,255,255,0.15);
}
.gal-lb-prev:hover { transform: translateY(-50%) translateX(-2px); }
.gal-lb-next:hover { transform: translateY(-50%) translateX(2px); }

.gal-lb-counter {
    position: absolute;
    bottom: 18px;
    left: 0;
    right: 0;
    text-align: center;
    color: rgba(255,255,255,0.55);
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    letter-spacing: 0.08em;
}

@media (max-width: 640px) {
    .gal-lb-prev, .gal-lb-next { width: 44px; height: 44px; font-size: 18px; }
    .gal-lb-prev { left: 10px; } .gal-lb-next { right: 10px; }
    .gal-lb-close { top: 10px; right: 12px; }
    .gal-lb-img { max-width: 100vw; max-height: 78vh; }
}

@media (prefers-reduced-motion: reduce) {
    .gal-item, .gal-lb-close, .gal-lb-prev, .gal-lb-next { transition: none; }
    .gal-item:hover { transform: none; }
}
