/* ================================================================
   Hokseggen Gallery – Visual Scroll Experience
   Parallax · Horizontal scroll · Zoom-on-scroll · Lightbox
   ================================================================ */

/* ────────────────────────────────────────────────────────────────
   0. GALLERY HERO
   ──────────────────────────────────────────────────────────────── */
.gallery-hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #0a1a0f;
}

.gallery-hero__bg {
    position: absolute;
    inset: -20%;
    background-size: cover;
    background-position: center;
    will-change: transform;
    transition: none;
}

.gallery-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(8, 26, 16, 0.3) 0%,
        rgba(8, 26, 16, 0.6) 50%,
        rgba(8, 26, 16, 0.85) 100%
    );
    z-index: 1;
}

.gallery-hero__content {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
    padding: 0 var(--sp-6);
    max-width: 700px;
}

.gallery-hero__badge {
    display: inline-block;
    font-family: var(--f-body);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--c-gold-light);
    border: 1px solid rgba(196, 163, 90, 0.4);
    padding: 6px 18px;
    border-radius: 999px;
    margin-bottom: var(--sp-6);
    backdrop-filter: blur(8px);
    background: rgba(196, 163, 90, 0.08);
}

.gallery-hero__title {
    font-family: var(--f-heading);
    font-size: clamp(2.5rem, 4vw + 1rem, 5rem);
    font-weight: 700;
    color: #fff;
    line-height: 1.05;
    margin-bottom: var(--sp-4);
    text-shadow: 0 2px 40px rgba(0,0,0,0.5);
}

.gallery-hero__subtitle {
    font-size: var(--fs-lg);
    color: rgba(255,255,255,0.75);
    line-height: 1.6;
    max-width: 500px;
    margin: 0 auto;
}

.gallery-hero__scroll-hint {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    color: rgba(255,255,255,0.5);
    animation: gallery-bounce 2s ease-in-out infinite;
}

@keyframes gallery-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%     { transform: translateX(-50%) translateY(12px); }
}

/* ────────────────────────────────────────────────────────────────
   1. ZOOM-ON-SCROLL SECTION
   ──────────────────────────────────────────────────────────────── */
.gallery-zoom-section {
    position: relative;
    height: 150vh;
    overflow: hidden;
    background: var(--c-green-950);
}

.gallery-zoom-section__inner {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.gallery-zoom-section__img {
    width: 60%;
    max-width: 900px;
    height: auto;
    object-fit: cover;
    border-radius: var(--radius-xl);
    transition: transform 0.05s linear;
    will-change: transform;
    box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}

.gallery-zoom-section__caption {
    position: absolute;
    bottom: 15vh;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    text-align: center;
    color: #fff;
}

.gallery-zoom-section__caption h2 {
    font-family: var(--f-heading);
    font-size: var(--fs-3xl);
    color: #fff;
    margin-top: var(--sp-3);
}

/* ────────────────────────────────────────────────────────────────
   2. SECTION TAGS & HEADERS (shared)
   ──────────────────────────────────────────────────────────────── */
.gallery-section-tag {
    display: inline-block;
    font-family: var(--f-body);
    font-size: var(--fs-xs);
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--c-green-400);
    margin-bottom: var(--sp-3);
}

.gallery-grid-section__header,
.gallery-all-section__header,
.gallery-hscroll__header {
    text-align: center;
    margin-bottom: var(--sp-12);
}

.gallery-grid-section__header h2,
.gallery-all-section__header h2,
.gallery-hscroll__header h2 {
    font-family: var(--f-heading);
    font-size: var(--fs-3xl);
    color: var(--c-green-800);
    margin-top: var(--sp-2);
}

.gallery-all-section__header p {
    color: var(--c-muted);
    margin-top: var(--sp-2);
    font-size: var(--fs-sm);
}

/* ────────────────────────────────────────────────────────────────
   3. STAGGERED MASONRY GRID
   ──────────────────────────────────────────────────────────────── */
.gallery-grid-section {
    padding: var(--sp-24) var(--sp-6);
    max-width: var(--max-w);
    margin: 0 auto;
}

.gallery-masonry {
    columns: 3;
    column-gap: var(--sp-5);
}

.gallery-masonry__item {
    break-inside: avoid;
    margin-bottom: var(--sp-5);
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease);
}

.gallery-masonry__item:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
    z-index: 2;
}

.gallery-masonry__img-wrap {
    overflow: hidden;
    border-radius: var(--radius-lg);
}

.gallery-masonry__img-wrap img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.8s var(--ease);
    will-change: transform;
}

.gallery-masonry__item:hover .gallery-masonry__img-wrap img {
    transform: scale(1.08);
}

.gallery-masonry__shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(255,255,255,0) 40%,
        rgba(255,255,255,0.08) 50%,
        rgba(255,255,255,0) 60%
    );
    opacity: 0;
    transition: opacity 0.4s;
    pointer-events: none;
}

.gallery-masonry__item:hover .gallery-masonry__shine {
    opacity: 1;
}

/* ────────────────────────────────────────────────────────────────
   4. PARALLAX DIVIDER
   ──────────────────────────────────────────────────────────────── */
.gallery-parallax-divider {
    position: relative;
    height: 60vh;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #0a1a0f;
}

.gallery-parallax-divider__bg {
    position: absolute;
    inset: -25%;
    background-size: cover;
    background-position: center;
    will-change: transform;
}

.gallery-parallax-divider__overlay {
    position: absolute;
    inset: 0;
    background: rgba(8, 26, 16, 0.55);
    z-index: 1;
}

.gallery-parallax-divider__content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 var(--sp-6);
    max-width: 700px;
}

.gallery-parallax-divider__content blockquote {
    font-family: var(--f-heading);
    font-size: var(--fs-2xl);
    font-style: italic;
    color: #fff;
    line-height: 1.5;
    border: none;
    padding: 0;
    margin: 0;
}

/* ────────────────────────────────────────────────────────────────
   5. HORIZONTAL SCROLL SECTION
   ──────────────────────────────────────────────────────────────── */
.gallery-hscroll {
    /* Height = number of cards * some viewport fraction + buffer */
    height: 300vh;
    position: relative;
    background: var(--c-green-950);
    color: #fff;
}

.gallery-hscroll__sticky {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
    padding-top: var(--sp-12);
}

.gallery-hscroll__header h2 {
    color: #fff;
}

.gallery-hscroll__track {
    display: flex;
    gap: var(--sp-6);
    padding: 0 var(--sp-10);
    will-change: transform;
}

.gallery-hscroll__card {
    flex: 0 0 auto;
    width: clamp(280px, 35vw, 480px);
    aspect-ratio: 3/4;
    border-radius: var(--radius-xl);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform 0.5s var(--ease);
}

.gallery-hscroll__card:hover {
    transform: scale(1.04);
}

.gallery-hscroll__card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.8s var(--ease);
}

.gallery-hscroll__card:hover img {
    transform: scale(1.1);
}

.gallery-hscroll__card-num {
    position: absolute;
    bottom: var(--sp-4);
    left: var(--sp-4);
    font-family: var(--f-heading);
    font-size: var(--fs-4xl);
    font-weight: 700;
    color: rgba(255,255,255,0.2);
    line-height: 1;
    pointer-events: none;
}

/* ────────────────────────────────────────────────────────────────
   6. FULL COLLECTION GRID
   ──────────────────────────────────────────────────────────────── */
.gallery-all-section {
    padding: var(--sp-24) var(--sp-6);
    max-width: var(--max-w);
    margin: 0 auto;
}

.gallery-full-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: var(--sp-4);
}

.gallery-full-grid__item {
    aspect-ratio: 4/3;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    position: relative;
    transition: transform 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.gallery-full-grid__item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
    z-index: 2;
}

.gallery-full-grid__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease);
}

.gallery-full-grid__item:hover img {
    transform: scale(1.06);
}

/* ────────────────────────────────────────────────────────────────
   7. SCROLL REVEAL ANIMATIONS
   ──────────────────────────────────────────────────────────────── */
.gs-reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s var(--ease), transform 0.8s var(--ease);
}

.gs-reveal.gs-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger support via data-gs-delay — set in JS */

/* ────────────────────────────────────────────────────────────────
   8. LIGHTBOX
   ──────────────────────────────────────────────────────────────── */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(0, 0, 0, 0.92);
    backdrop-filter: blur(20px);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s var(--ease);
    pointer-events: none;
}

.gallery-lightbox[hidden] {
    display: none;
}

.gallery-lightbox.gallery-lightbox--open {
    opacity: 1;
    pointer-events: auto;
}

.gallery-lightbox__img-wrap {
    max-width: 90vw;
    max-height: 85vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-lightbox__img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius);
    box-shadow: 0 20px 80px rgba(0,0,0,0.6);
    transform: scale(0.9);
    transition: transform 0.4s var(--ease);
}

.gallery-lightbox--open .gallery-lightbox__img {
    transform: scale(1);
}

.gallery-lightbox__close {
    position: absolute;
    top: 20px;
    right: 24px;
    background: none;
    border: none;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 3;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
}
.gallery-lightbox__close:hover {
    opacity: 1;
    transform: scale(1.15);
}

.gallery-lightbox__prev,
.gallery-lightbox__next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 2rem;
    cursor: pointer;
    z-index: 3;
    transition: background 0.2s, transform 0.2s;
    line-height: 1;
}
.gallery-lightbox__prev { left: 20px; }
.gallery-lightbox__next { right: 20px; }
.gallery-lightbox__prev:hover,
.gallery-lightbox__next:hover {
    background: rgba(255,255,255,0.2);
    transform: translateY(-50%) scale(1.1);
}

.gallery-lightbox__counter {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255,255,255,0.5);
    font-size: var(--fs-sm);
    font-family: var(--f-body);
}

/* ────────────────────────────────────────────────────────────────
   9. RESPONSIVE
   ──────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .gallery-masonry {
        columns: 2;
    }
}

@media (max-width: 768px) {
    .gallery-hero {
        min-height: 500px;
    }

    .gallery-hero__title {
        font-size: clamp(2rem, 6vw, 3.5rem);
    }

    .gallery-masonry {
        columns: 1;
        max-width: 500px;
        margin: 0 auto;
    }

    .gallery-zoom-section__img {
        width: 90%;
    }

    .gallery-hscroll__card {
        width: 260px;
    }

    .gallery-full-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        gap: var(--sp-2);
    }

    .gallery-lightbox__prev,
    .gallery-lightbox__next {
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
    }
    .gallery-lightbox__prev { left: 10px; }
    .gallery-lightbox__next { right: 10px; }
}

@media (max-width: 480px) {
    .gallery-full-grid {
        grid-template-columns: 1fr 1fr;
    }

    .gallery-hscroll {
        height: 200vh;
    }
}
