/* gallery.svaff.org — Gallery Styles
   Design system: sharp edges (border-radius: 0), Daintree #032235,
   Sundance gold #bfa854, Dull Red #bf4040. Plus Jakarta Sans only.
   Matches svaff.org exactly.
*/

/* =========================================================
   FONTS — Plus Jakarta Sans only (matches svaff.org brand-mesh.css)
   ========================================================= */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400&display=swap');

/* =========================================================
   RESET / BASE
   ========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --daintree:    #032235;
    --daintree-80: rgba(3,34,53,.8);
    --gold:        #bfa854;
    --gold-dark:   #9e8a3f;
    --red:         #bf4040;
    --white:       #ffffff;
    --off-white:   #f4f1ea;
    --mid:         #8ea4b2;

    --font-body:   'Plus Jakarta Sans', ui-sans-serif, system-ui, -apple-system, sans-serif;

    --max-w:       1280px;
    --gutter:      clamp(1rem, 4vw, 2.5rem);
}

html { scroll-behavior: smooth; }

body {
    background: var(--daintree);
    color: var(--white);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a   { color: var(--gold); text-decoration: none; }
a:hover { text-decoration: underline; }
button { cursor: pointer; font-family: var(--font-body); }

/* =========================================================
   GALLERY HERO
   ========================================================= */
.gallery-hero {
    background: linear-gradient(160deg, #021b2e 0%, var(--daintree) 100%);
    border-bottom: 2px solid var(--gold);
    padding: clamp(3rem, 8vw, 6rem) var(--gutter) clamp(2.5rem, 6vw, 4rem);
    text-align: center;
}

.gallery-hero__inner { max-width: var(--max-w); margin: 0 auto; }

.gallery-hero__eyebrow {
    font-family: var(--font-body);
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: .75rem;
}

.gallery-hero__title {
    font-family: var(--font-body);
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    font-weight: 700;
    color: var(--white);
    line-height: 1.1;
    margin-bottom: 1rem;
}

.gallery-hero__lead {
    font-size: clamp(1rem, 1.5vw, 1.2rem);
    color: var(--mid);
    max-width: 560px;
    margin: 0 auto;
}

/* =========================================================
   GALLERY INDEX (home page)
   ========================================================= */
.gallery-index { padding: clamp(2.5rem, 6vw, 4.5rem) var(--gutter) clamp(2rem, 4vw, 3rem); }
.gallery-index__inner { max-width: var(--max-w); margin: 0 auto; }

.gallery-year { margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.gallery-year:last-child { margin-bottom: 0; }

.gallery-year__heading {
    font-family: var(--font-body);
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 700;
    color: var(--gold);
    border-bottom: 1px solid rgba(191,168,84,.25);
    padding-bottom: .6rem;
    margin-bottom: 2rem;
}

.gallery-photographer { margin-bottom: 2.5rem; }

.gallery-photographer__name {
    font-family: var(--font-body);
    font-size: .95rem;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: none;
    color: var(--mid);
    margin-bottom: 1.25rem;
}

/* Collection cards grid */
.gallery-collections {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.25rem;
}

.gallery-card {
    display: block;
    text-decoration: none;
    color: inherit;
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(255,255,255,.08);
    border-top: 3px solid transparent;
    transition: border-color .2s, transform .2s;
}

.gallery-card:hover {
    border-color: var(--gold);
    border-top-color: var(--gold);
    transform: translateY(-3px);
    text-decoration: none;
}

.gallery-card__thumb {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: rgba(255,255,255,.07);
    display: block;
    width: 100%;
}

.gallery-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform .4s ease;
}

.gallery-card:hover .gallery-card__thumb img {
    transform: scale(1.04);
}

.gallery-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(3,34,53,.8) 0%, transparent 60%);
    display: flex;
    align-items: flex-end;
    padding: .75rem 1rem;
    opacity: 0;
    transition: opacity .25s;
}

.gallery-card:hover .gallery-card__overlay { opacity: 1; }

.gallery-card__count {
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .05em;
    color: var(--white);
    text-transform: uppercase;
}

.gallery-card__info {
    padding: .9rem 1rem 1rem;
}

.gallery-card__title {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    color: var(--white);
    margin-bottom: .25rem;
}

.gallery-card__meta {
    font-size: .8rem;
    color: var(--mid);
}

/* =========================================================
   COLLECTION HEADER
   ========================================================= */
.col-header {
    background: linear-gradient(160deg, #021b2e 0%, var(--daintree) 100%);
    border-bottom: 2px solid var(--gold);
    padding: clamp(2rem, 5vw, 3.5rem) var(--gutter) clamp(1.5rem, 4vw, 2.5rem);
}

.col-header__inner { max-width: var(--max-w); margin: 0 auto; }

.col-breadcrumb {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1rem;
    font-size: .85rem;
}

.col-breadcrumb__link { color: var(--gold); }
.col-breadcrumb__link:hover { text-decoration: underline; }
.col-breadcrumb__sep { color: var(--mid); }
.col-breadcrumb__current { color: var(--mid); }

.col-header__title {
    font-family: var(--font-body);
    font-size: clamp(1.8rem, 4vw, 3rem);
    font-weight: 700;
    color: var(--white);
    line-height: 1.15;
    margin-bottom: .5rem;
}

.col-header__meta {
    font-size: .9rem;
    color: var(--mid);
    margin-bottom: 1.25rem;
}

.col-header__count { color: var(--gold); font-weight: 600; }

.col-header__back {
    display: inline-block;
    font-size: .85rem;
    font-weight: 600;
    color: var(--gold);
    letter-spacing: .02em;
}

.col-header__back:hover { text-decoration: underline; }

/* =========================================================
   COLLECTION GRID
   ========================================================= */
.col-grid-section { padding: clamp(1.5rem, 4vw, 3rem) var(--gutter) clamp(3rem, 6vw, 5rem); }

.col-grid {
    max-width: var(--max-w);
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 6px;
}

.col-thumb {
    position: relative;
    aspect-ratio: 3/2;
    overflow: hidden;
    background: rgba(255,255,255,.06);
    border: none;
    padding: 0;
    display: block;
    cursor: zoom-in;
    width: 100%;
}

.col-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    display: block;
    transition: transform .3s ease, opacity .3s;
}

/* Hide broken-icon state for lazy-loaded images not yet swapped in */
.col-thumb img.lazy,
.gallery-card__thumb img[data-src] {
    opacity: 0;
}

.col-thumb:hover img {
    transform: scale(1.05);
    opacity: .9;
}

.col-thumb:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
    z-index: 1;
}

/* =========================================================
   LIGHTBOX
   ========================================================= */
.lb {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(2,18,29,.96);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.lb[hidden] { display: none; }

.lb__stage {
    max-width: min(90vw, 1200px);
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lb__img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    box-shadow: 0 20px 60px rgba(0,0,0,.6);
    user-select: none;
}

.lb__close,
.lb__nav {
    position: fixed;
    background: rgba(3,34,53,.8);
    border: 1px solid rgba(191,168,84,.3);
    color: var(--white);
    padding: .6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s, border-color .2s;
}

.lb__close:hover,
.lb__nav:hover {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--daintree);
}

.lb__close {
    top: 1rem;
    right: 1rem;
    border-radius: 0;
}

.lb__nav { top: 50%; transform: translateY(-50%); }
.lb__nav--prev { left: 1rem; }
.lb__nav--next { right: 1rem; }

.lb__counter {
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .08em;
    color: var(--mid);
    background: rgba(3,34,53,.7);
    padding: .3rem .75rem;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 600px) {
    .gallery-collections {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: .75rem;
    }
    .col-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 4px;
    }
    .lb__nav--prev { left: .25rem; }
    .lb__nav--next { right: .25rem; }
}
