/* =========================================
    GLOBAL VARIABLES & RESET
    ========================================= */
:root {
    --charcoal: #ffffff;      
    --slate: #94a3b8;         
    --cream: #0b0f19;         
    --border: rgba(255, 255, 255, 0.1); 
    --accent: #cda85c;        
    --light-bg: #0f172a;      
}

/* Global reset now lives in core.css (loaded first by base.html) */

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--cream);
    color: var(--charcoal);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: inherit;
}

/* =========================================
    TOP NAVIGATION HEADER
    ========================================= */
.top-nav {
    position: fixed; /* NEW: Header is now fixed */
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 40px 60px;
    z-index: 1000;
    transition: background-color 0.3s ease, padding 0.3s ease, box-shadow 0.3s ease;
}

/* NEW: The dark background applied via JS when scrolled */
.top-nav.header-scroll {
    background-color: rgba(11, 15, 25, 0.98); /* var(--cream) slightly transparent */
    padding: 15px 60px;
    box-shadow: 0 4px 30px rgba(0,0,0,0.5);
}

.top-nav .logo {
    font-family: 'Cinzel', serif;
    font-size: 1.8rem;
    color: white;
    letter-spacing: 3px;
    text-transform: uppercase;
    transition: color 0.3s;
}

.top-nav .logo:hover {
    color: var(--accent);
}

.top-nav .nav-links {
    display: flex;
    gap: 30px;
}

.top-nav .nav-links a {
    font-size: 0.8rem;
    color: white;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 500;
    transition: color 0.3s;
}

.top-nav .nav-links a:hover {
    color: var(--accent);
}

/* =========================================
    HERO SECTION
    ========================================= */
.hero {
    height: 60vh;
    min-height: 500px;
    background: linear-gradient(to bottom, rgba(11, 15, 25, 0.8), rgba(11, 15, 25, 1)), url('https://images.unsplash.com/photo-1464366400600-7168b8af9bc3?ixlib=rb-4.0.3&auto=format&fit=crop&w=1920&q=80') center/cover no-repeat;
    display: flex;
    align-items: flex-end;
    padding: 80px 10%;
}

.hero-content {
    color: white;
    max-width: 800px;
}

.hero-content h1 {
    font-family: 'Playfair Display', serif;
    font-size: 4rem;
    font-weight: 400;
    letter-spacing: 2px;
    margin-bottom: 20px;
}

.hero-content p {
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    font-size: 1.1rem;
    letter-spacing: 1px;
    line-height: 1.8;
    color: #e2e8f0;
}

/* =========================================
    GALLERY DIRECTORY SECTION
    ========================================= */
/* Follow band: sits above the venue-space tabs */
.social-follow-section {
    padding: 80px 10% 0 10%;
    background-color: var(--cream);
}

/* =========================================
    TOP-LEVEL VIEW SWITCH (Gallery / Testimonials)
    A centered segmented control. Sits a tier above the venue-space filters,
    so its filled "pill" active state reads as the higher-level navigation
    while the space filters keep their lighter underline-row treatment.
    ========================================= */
.page-tabs-section {
    padding: 70px 10% 0 10%;
    background-color: var(--cream);
    text-align: center;
}

.page-tabs {
    display: inline-flex;
    gap: 6px;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: 999px;
    background-color: var(--light-bg);
}

.page-tab {
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Cinzel', serif;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--slate);
    padding: 12px 34px;
    border-radius: 999px;
    transition: color 0.3s ease, background-color 0.3s ease;
}

.page-tab:hover { color: var(--charcoal); }

.page-tab.active {
    color: var(--cream);
    background-color: var(--accent);
    font-weight: 600;
}

/* View panels: only the active one is shown (pure class toggle, no inline style) */
.view-panel { display: none; }
.view-panel.active { display: block; }

/* Uniform breathing room under the switch for whichever panel is showing */
.view-panel > section { padding-top: 50px; }

.directory-section {
    padding: 80px 10%;
    background-color: var(--cream);
}

/* Horizontally Scrollable Tab Filter */
.filters {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 20px;
    margin-bottom: 60px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.filters::-webkit-scrollbar {
    display: none;
}

.filter-btn {
    background: none;
    border: none;
    font-family: 'Cinzel', serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--slate);
    cursor: pointer;
    padding: 10px 15px;
    transition: all 0.3s;
    flex-shrink: 0;
}

.filter-btn:hover {
    color: var(--charcoal);
}

.filter-btn.active {
    color: var(--accent);
    font-weight: 600;
}

/* Gallery Layout: NEW - Structured CSS Grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    width: 100%;
}

/* Gallery Cards - Flex column ensures badges stay at bottom */
.gallery-card {
    background-color: var(--light-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    transition: transform 0.4s ease, border-color 0.4s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    overflow: hidden;
    opacity: 0;
    animation: fadeInCard 0.6s ease forwards;
}

.gallery-card:hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.3);
}

@keyframes fadeInCard {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* This replicates the homepage! It fills the box without squishing */
    object-position: center 15%; /* Anchors the visual center near the top to protect faces */
    aspect-ratio: 3 / 2; /* Optional: Forces a perfect horizontal rectangle if your card needs it */
}


.gallery-card:hover .gallery-img {
    filter: brightness(1.1);
}

.gallery-info {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.gallery-category {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 0.7rem;
    color: var(--accent);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 10px;
}

.gallery-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    color: var(--charcoal);
    margin-bottom: 20px;
    font-weight: 400;
}

.approval-badge {
    margin-top: auto; /* Pushes the badge perfectly to the bottom of the card */
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 15px;
    border-top: 1px solid var(--border);
    font-family: 'Cinzel', serif;
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--slate);
    font-weight: 600;
    width: 100%;
}

.badge-label { display: inline-flex; align-items: center; gap: 8px; }

.gallery-date {
    font-family: 'Cinzel', serif;
    font-size: 0.6rem;
    letter-spacing: 1.5px;
    color: var(--slate);
    font-weight: 600;
    white-space: nowrap;
}

.gallery-post-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 14px;
    font-family: 'Cinzel', serif;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: var(--accent);
    transition: color 0.2s ease, gap 0.2s ease;
}
.gallery-post-link svg { width: 13px; height: 13px; }
.gallery-post-link:hover { color: var(--charcoal); gap: 9px; }

.approval-badge svg {
    color: var(--accent);
    width: 14px;
    height: 14px;
}

/* =========================================
    SOCIAL SECTION
    ========================================= */
.social-section {
    padding: 0 10% 80px 10%;
    background-color: var(--cream);
}

.social-title {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    margin-bottom: 20px;
    text-align: center;
    color: var(--charcoal);
}

/* NEW: Social Links Bar */
.social-icons-bar {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 50px;
}

.social-icons-bar a {
    color: var(--charcoal);
    transition: color 0.3s ease, transform 0.3s ease;
}

.social-icons-bar a:hover {
    color: var(--accent);
    transform: translateY(-3px);
}

.social-icons-bar svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Masonry for social cards */
.social-grid {
    column-count: 3;
    column-gap: 20px;
}

.social-card {
    break-inside: avoid;
    margin-bottom: 20px;
    background: var(--light-bg);
    border-radius: 4px;
    padding: 25px;
    border: 1px solid var(--border);
}

.social-meta {
    font-size: 0.85rem;
    color: var(--slate);
    margin-bottom: 15px;
    font-weight: 500;
}

.social-img {
    width: 100%;
    border-radius: 4px;
    margin-bottom: 15px;
}

.social-text {
    font-size: 0.95rem;
    color: var(--charcoal);
    line-height: 1.6;
}

/* =========================================
    LIGHTBOX MODAL
    ========================================= */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.lightbox-overlay.active {
    opacity: 1;
    visibility: visible;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    background: none;
    border: none;
    color: white;
    font-size: 3.5rem;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s;
}

.lightbox-close:hover {
    color: var(--accent);
}

.lightbox-img {
    max-width: 90vw;
    max-height: 80vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}

.lightbox-title {
    margin-top: 20px;
    font-family: 'Cinzel', serif;
    color: var(--accent);
    letter-spacing: 2px;
    font-weight: 400;
}

/* =========================================
    MOBILE RESPONSIVE
    ========================================= */
.mobile-menu-btn, .mobile-close-btn { display: none; }

@media (max-width: 900px) {
    .top-nav {
        padding: 15px 20px;
    }
    .top-nav.header-scroll {
        padding: 15px 20px;
    }
    .top-nav .logo {
        font-size: 1.2rem;
        position: relative;
        z-index: 101;
    }

    .hero {
        padding-top: 100px;
        height: auto;
        min-height: 40vh;
        text-align: center;
        justify-content: center;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .mobile-menu-btn {
        display: flex;
        flex-direction: column;
        align-items: center;
        background: none;
        border: none;
        color: white;
        cursor: pointer;
        position: relative;
        z-index: 101;
    }

    .mobile-menu-btn span {
        font-size: 0.55rem;
        margin-top: 4px;
        letter-spacing: 1px;
        font-family: 'Montserrat', sans-serif;
    }

    .nav-links {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        background: var(--cream);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 40px;
        z-index: 1001;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    body.menu-open .nav-links {
        opacity: 1;
        visibility: visible;
    }

    body.menu-open { overflow: hidden; }

    .mobile-close-btn {
        display: block;
        position: absolute;
        top: 20px;
        right: 20px;
        background: none;
        border: none;
        color: white;
        font-size: 2rem;
        cursor: pointer;
    }

    .top-nav .nav-links a {
        font-family: 'Montserrat', sans-serif;
        font-size: 1.2rem;
        text-transform: uppercase;
        letter-spacing: 2px;
        font-weight: 500;
    }

    .directory-section {
        padding: 40px 5%;
    }

    .page-tabs-section {
        padding-left: 5%;
        padding-right: 5%;
    }

    .page-tab {
        padding: 10px 18px;
        font-size: 0.7rem;
        letter-spacing: 1.5px;
    }


    .gallery-grid {
        grid-template-columns: 1fr;
    }

    .social-grid {
        column-count: 1;
    }
}

/* Card entrance stagger (was inline style="animation-delay" in events.js) */
.gallery-card { animation-delay: 0s; }
.gallery-card:nth-child(2) { animation-delay: 0.1s; }
.gallery-card:nth-child(3) { animation-delay: 0.2s; }
.gallery-card:nth-child(4) { animation-delay: 0.3s; }
.gallery-card:nth-child(5) { animation-delay: 0.4s; }
.gallery-card:nth-child(6) { animation-delay: 0.5s; }
.gallery-card:nth-child(7) { animation-delay: 0.6s; }
.gallery-card:nth-child(8) { animation-delay: 0.7s; }
.gallery-card:nth-child(9) { animation-delay: 0.8s; }
.gallery-card:nth-child(10) { animation-delay: 0.9s; }
.gallery-card:nth-child(11) { animation-delay: 1.0s; }
.gallery-card:nth-child(12) { animation-delay: 1.1s; }

/* Empty-state messages (were inline style in events.js) */
.gallery-empty { grid-column: 1 / -1; text-align: center; padding: 40px; color: var(--slate); }
.feed-empty { grid-column: 1 / -1; text-align: center; color: var(--slate); font-style: italic; }

/* Lightbox scroll lock (was document.body.style.overflow in events.js) */
.no-scroll { overflow: hidden; }

/* =========================================
    "LOAD MORE" (gallery + testimonials pagination)
    Hidden until the API reports a next page; JS toggles .visible.
    ========================================= */
.load-more-wrap {
    display: none;
    justify-content: center;
    margin-top: 50px;
}
.load-more-wrap.visible { display: flex; }

.load-more-btn {
    background: none;
    border: 1px solid var(--accent);
    color: var(--accent);
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    padding: 14px 38px;
    border-radius: 999px;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease, opacity 0.3s ease;
}
.load-more-btn:hover { background-color: var(--accent); color: var(--cream); }
.load-more-btn:disabled { opacity: 0.55; cursor: default; }

/* =========================================
    TESTIMONIALS WALL (replaces the live social feed)
    ========================================= */
.testimonial-grid {
    column-count: 3;
    column-gap: 20px;
}

.testimonial-card {
    break-inside: avoid;
    margin-bottom: 20px;
    background: var(--light-bg);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 30px;
}

.quote-mark { width: 30px; height: 30px; color: var(--accent); opacity: 0.55; margin-bottom: 14px; }

.testimonial-quote {
    font-family: 'Playfair Display', serif;
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--charcoal);
    font-style: italic;
    margin-bottom: 24px;
}

.testimonial-author { display: flex; align-items: center; gap: 14px; }

.testimonial-photo, .testimonial-initial {
    width: 46px; height: 46px; border-radius: 50%;
    object-fit: cover; flex-shrink: 0;
}

.testimonial-initial {
    display: inline-flex; align-items: center; justify-content: center;
    background: var(--accent); color: var(--cream);
    font-family: 'Cinzel', serif; font-size: 1.1rem; font-weight: 600;
}

.testimonial-meta { line-height: 1.35; }

.testimonial-name {
    font-family: 'Cinzel', serif; font-size: 0.8rem; letter-spacing: 1px;
    text-transform: uppercase; color: var(--charcoal);
}

.testimonial-role { font-size: 0.78rem; color: var(--slate); margin-top: 3px; }

.social-follow { text-align: center; }
.social-follow-label {
    display: block;
    font-family: 'Cinzel', serif;
    font-size: 0.7rem; letter-spacing: 2px; text-transform: uppercase;
    color: var(--slate); margin-bottom: 20px;
}
.social-follow .social-icons-bar { margin-bottom: 0; }

@media (max-width: 900px) {
    .testimonial-grid { column-count: 1; }
}

/* =========================================
    LIGHT / DARK THEME
    The default (dark) palette lives in :root above; body.light-mode
    swaps the same tokens. The choice is made in events.js — it
    remembers the visitor's pick, otherwise follows the OS (leaning light).
    ========================================= */
body.light-mode {
    --charcoal: #2a2520;   /* primary text */
    --slate: #8b8170;      /* muted text */
    --cream: #ece6da;      /* page background */
    --border: rgba(42, 37, 32, 0.10);
    --accent: #9a6f1f;     /* gold, darkened for contrast on light */
    --light-bg: #fbf9f4;   /* card background */
}

/* The fixed header is transparent over the dark hero (white text is correct
   in both themes). Once scrolled it gains a solid background — in light mode
   that background and its nav text flip so everything stays legible. */
body.light-mode .top-nav.header-scroll {
    background-color: rgba(236, 230, 218, 0.98);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.12);
}
body.light-mode .top-nav.header-scroll .logo,
body.light-mode .top-nav.header-scroll .nav-links a,
body.light-mode .top-nav.header-scroll .mobile-menu-btn,
body.light-mode .top-nav.header-scroll .theme-toggle {
    color: var(--charcoal);
}
body.light-mode .top-nav.header-scroll .theme-toggle { border-color: rgba(42, 37, 32, 0.25); }

/* Avatar initials sit on the gold chip — light text reads better in light mode */
body.light-mode .testimonial-initial { color: #fff; }

/* Theme toggle button (lives at the end of the nav) */
.top-nav .nav-links { align-items: center; }
.theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 50%;
    color: white;
    cursor: pointer;
    transition: color 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }
.theme-toggle .moon-icon { display: none; }
body.light-mode .theme-toggle .sun-icon { display: none; }
body.light-mode .theme-toggle .moon-icon { display: block; }

/* The mobile slide-in menu becomes a light panel in light mode — flip its items dark */
@media (max-width: 900px) {
    body.light-mode .nav-links a,
    body.light-mode .nav-links .theme-toggle,
    body.light-mode .mobile-close-btn { color: var(--charcoal); }
    body.light-mode .nav-links .theme-toggle { border-color: var(--border); }
}
