/* ════════════════════════════
   GALLERY PAGE
   ════════════════════════════ */

#gallery-page {
    min-height: 100vh;
    background: #FFFFFF;
    padding-top: 82px;
}

/* Hero */
.gallery-hero {
    text-align: center;
    padding: 60px 40px 40px;
}

.gallery-title {
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(48px, 7vw, 80px);
    font-weight: 400;
    font-style: italic;
    color: #2D5A3D;
    margin-bottom: 8px;
    line-height: 1.1;
}

.gallery-subtitle {
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    color: #999;
    letter-spacing: 1px;
}

/* ── TOP CATEGORY CAROUSEL ── */
.gallery-top-section {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 40px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.cat-track-wrap {
    flex: 1;
    overflow: hidden;
}

.cat-track {
    display: flex;
    gap: 16px;
    transition: transform 0.4s ease;
    will-change: transform;
}

.cat-card {
    flex-shrink: 0;
    width: 200px;
    height: 160px;
    border-radius: 20px;
    overflow: hidden;
    position: relative;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.2);
}

.cat-card.active {
    box-shadow: 0 0 0 3px #2D5A3D, 0 8px 24px rgba(45,90,61,0.3);
}

.cat-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: brightness(0.65);
    transition: filter 0.3s ease;
}

.cat-card:hover img,
.cat-card.active img {
    filter: brightness(0.5);
}

.cat-card-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    padding: 16px;
}

.cat-card-label {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: #FFFFFF;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.cat-arrow {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1.5px solid #ccc;
    background: #fff;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    flex-shrink: 0;
    transition: all 0.2s ease;
    line-height: 1;
}

.cat-arrow:hover {
    border-color: #2D5A3D;
    color: #2D5A3D;
}

/* ── TAG FILTER PILLS ── */
.gallery-tag-section {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 40px 40px;
    max-width: 1200px;
    margin: 0 auto;
}

.tag-track-wrap {
    flex: 1;
    overflow: hidden;
}

.tag-track {
    display: flex;
    gap: 10px;
    transition: transform 0.4s ease;
}

.tag-pill {
    flex-shrink: 0;
    padding: 10px 24px;
    border-radius: 100px;
    border: 1.5px solid #ccc;
    background: #fff;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #444;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.tag-pill:hover {
    border-color: #2D5A3D;
    color: #2D5A3D;
}

.tag-pill.active {
    background: #2D5A3D;
    border-color: #2D5A3D;
    color: #FFFFFF;
    font-weight: 600;
}

.tag-arrow {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1.5px solid #ccc;
    background: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.tag-arrow:hover {
    border-color: #2D5A3D;
    color: #2D5A3D;
}

/* ── FAN CAROUSEL ── */
.gallery-fan-section {
    padding: 0 0 80px;
    background: #FAFAF8;
}

.fan-carousel {
    position: relative;
    height: 520px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.fan-item {
    position: absolute;
    border-radius: 24px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}

.fan-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Video play button overlay */
.fan-item.has-video::after {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 56px;
    height: 56px;
    background: rgba(255,255,255,0.9);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #2D5A3D;
}

.fan-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 40px 20px 20px;
    background: linear-gradient(transparent, rgba(0,0,0,0.6));
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: #FFFFFF;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.fan-item.center .fan-caption {
    opacity: 1;
}

/* Fan positions — 5 items */
/* Far left */
.fan-item.pos-0 {
    width: 200px;
    height: 300px;
    left: calc(50% - 480px);
    top: 110px;
    z-index: 1;
    opacity: 0.6;
    transform: rotate(-3deg);
}

/* Near left */
.fan-item.pos-1 {
    width: 260px;
    height: 380px;
    left: calc(50% - 340px);
    top: 70px;
    z-index: 2;
    opacity: 0.85;
    transform: rotate(-1.5deg);
}

/* Center */
.fan-item.pos-2 {
    width: 340px;
    height: 440px;
    left: calc(50% - 170px);
    top: 40px;
    z-index: 5;
    opacity: 1;
    transform: rotate(0deg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

/* Near right */
.fan-item.pos-3 {
    width: 260px;
    height: 380px;
    left: calc(50% + 80px);
    top: 70px;
    z-index: 2;
    opacity: 0.85;
    transform: rotate(1.5deg);
}

/* Far right */
.fan-item.pos-4 {
    width: 200px;
    height: 300px;
    left: calc(50% + 280px);
    top: 110px;
    z-index: 1;
    opacity: 0.6;
    transform: rotate(3deg);
}

/* Fan footer */
.fan-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 40px 0;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
}

.fan-nav {
    display: flex;
    gap: 12px;
}

.fan-nav-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 1.5px solid #ccc;
    background: #fff;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    transition: all 0.2s ease;
}

.fan-nav-btn:hover {
    border-color: #2D5A3D;
    color: #2D5A3D;
    background: #F0F7F3;
}

.fan-page-link {
    position: absolute;
    right: 40px;
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: #2D5A3D;
    text-decoration: none;
    transition: color 0.2s ease;
}

.fan-page-link:hover {
    color: #1A3A2E;
    text-decoration: underline;
}

/* Album description strip */
.gallery-album-desc {
    text-align: center;
    padding: 12px 40px 0;
    max-width: 800px;
    margin: 0 auto;
}

.gallery-album-desc p {
    font-family: 'DM Sans', sans-serif;
    font-size: 14px;
    color: #888;
    font-style: italic;
    line-height: 1.6;
}

/* Empty state */
.gallery-empty {
    text-align: center;
    padding: 80px 40px;
    font-family: 'DM Sans', sans-serif;
    font-size: 16px;
    color: #999;
}

/* ── LIGHTBOX ── */
.gallery-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(13, 20, 16, 0.96);
    backdrop-filter: blur(12px);
    align-items: center;
    justify-content: center;
    flex-direction: column;
    animation: lbFadeIn 0.25s ease;
}

.gallery-lightbox.open {
    display: flex;
}

@keyframes lbFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.lb-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90vw;
    max-height: 90vh;
    animation: lbZoom 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes lbZoom {
    from { transform: scale(0.85); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}

.lb-media {
    max-width: 85vw;
    max-height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lb-media img {
    max-width: 100%;
    max-height: 75vh;
    border-radius: 12px;
    box-shadow: 0 0 60px rgba(0,0,0,0.5);
    object-fit: contain;
}

.lb-media video {
    max-width: 85vw;
    max-height: 75vh;
    border-radius: 12px;
    box-shadow: 0 0 60px rgba(0,0,0,0.5);
    outline: none;
}

.lb-caption {
    margin-top: 16px;
    font-family: 'DM Sans', sans-serif;
    font-size: 15px;
    color: rgba(255,255,255,0.85);
    text-align: center;
    max-width: 600px;
    line-height: 1.6;
}

.lb-counter {
    margin-top: 8px;
    font-family: 'DM Sans', sans-serif;
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    letter-spacing: 1px;
}

.lb-close {
    position: absolute;
    top: 24px;
    right: 32px;
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lb-close:hover {
    background: rgba(255,255,255,0.2);
    transform: rotate(90deg);
}

.lb-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.1);
    border: none;
    color: #fff;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    font-size: 22px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.lb-nav:hover {
    background: rgba(198, 168, 103, 0.4);
}

.lb-nav--prev { left: 24px; }
.lb-nav--next { right: 24px; }

/* Video play overlay on fan items */
.fan-item.is-video::before {
    content: '▶';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    width: 52px;
    height: 52px;
    background: rgba(255,255,255,0.88);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #2D5A3D;
    pointer-events: none;
}

@media (max-width: 768px) {
    .gallery-top-section,
    .gallery-tag-section {
        padding-left: 20px;
        padding-right: 20px;
    }

    .cat-card {
        width: 160px;
        height: 130px;
    }

    .fan-carousel {
        height: 420px;
    }

    .fan-item.pos-0,
    .fan-item.pos-4 {
        display: none;
    }

    .fan-item.pos-1 {
        width: 180px;
        height: 280px;
        left: calc(50% - 230px);
    }

    .fan-item.pos-2 {
        width: 240px;
        height: 360px;
        left: calc(50% - 120px);
    }

    .fan-item.pos-3 {
        width: 180px;
        height: 280px;
        left: calc(50% + 50px);
    }
}