/* =============================================
   NAVIGATION STYLES
   Dark Nav (V1, About) + Transparent Nav (V4, V5)
   ============================================= */

/* ---- Dark Navigation (V1, About) ---- */
.nav-dark {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1.25rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(10, 10, 10, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-dark .logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.nav-dark .logo img {
    height: 52px;
    width: auto;
    transition: transform 0.3s;
}

.nav-dark .logo:hover img {
    transform: scale(1.05);
}

.nav-dark .nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

.nav-dark .nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    transition: color 0.3s;
}

.nav-dark .nav-links a:hover {
    color: var(--green-primary);
}

.nav-dark .nav-cta {
    background: var(--green-primary);
    color: var(--black);
    padding: 0.7rem 1.5rem;
    border-radius: 0;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    transition: all 0.3s;
    box-shadow: 0 0 20px var(--green-glow);
}

.nav-dark .nav-cta:hover {
    background: var(--text-primary);
    color: var(--black);
    transform: translateY(-2px);
    box-shadow: 0 0 30px var(--green-glow);
}

/* ---- Transparent Navigation (V4, V5) ---- */
body.theme-light nav,
body.theme-cinematic nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 1.5rem 4%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.4s ease;
}

/* Light theme (V4) - transparent to light */
body.theme-light nav {
    background: rgba(250, 250, 249, 0);
    backdrop-filter: blur(0px);
}

body.theme-light nav.scrolled {
    padding: 1rem 4%;
    background: rgba(250, 250, 249, 0.92);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--stone-200);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.06);
}

/* Cinematic theme (V5) - transparent to dark */
body.theme-cinematic nav {
    background: transparent;
}

body.theme-cinematic nav.scrolled {
    padding: 1rem 4%;
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(20px);
}

/* Shared transparent nav logo */
.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.nav-logo img {
    height: 44px;
    width: auto;
    transition: opacity 0.3s;
}

/* Logo state: hero (white) */
.nav-logo .logo-hero {
    display: block;
    filter: brightness(0) invert(1);
}

.nav-logo .logo-scrolled {
    display: none;
}

/* V4 scrolled: show dark-text logo */
body.theme-light nav.scrolled .nav-logo .logo-hero {
    display: none;
}

body.theme-light nav.scrolled .nav-logo .logo-scrolled {
    display: block;
}

/* V5 scrolled: keep inverted */
body.theme-cinematic nav.scrolled .nav-logo .logo-hero {
    display: none;
}

body.theme-cinematic nav.scrolled .nav-logo .logo-scrolled {
    display: block;
    filter: brightness(0) invert(1);
}

/* Shared nav links list */
.nav-links-list {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
}

/* V4 nav link colors */
body.theme-light .nav-links-list a {
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 400;
    transition: color 0.3s;
    color: var(--stone-600);
}

body.theme-light nav:not(.scrolled) .nav-links-list a {
    color: rgba(255, 255, 255, 0.95);
}

body.theme-light .nav-links-list a:hover {
    color: var(--eg-green);
}

/* V5 nav link colors */
body.theme-cinematic .nav-links-list a {
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.5);
    transition: color 0.3s;
}

body.theme-cinematic .nav-links-list a:hover {
    color: var(--white);
}

/* V4 nav CTA */
body.theme-light .nav-cta {
    background: var(--stone-950);
    color: var(--stone-50);
    padding: 0.65rem 1.75rem;
    border-radius: 100px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

body.theme-light nav:not(.scrolled) .nav-cta {
    background: rgba(255, 255, 255, 0.18);
    color: white;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.25);
}

body.theme-light .nav-cta:hover {
    background: var(--eg-green) !important;
    color: white !important;
    border-color: var(--eg-green) !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(61, 155, 107, 0.3);
}

/* V5 nav CTA */
body.theme-cinematic .nav-cta {
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    padding: 0.6rem 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.25);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.8rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

body.theme-cinematic nav.scrolled .nav-cta {
    background: var(--signal);
    color: var(--void);
    border-color: var(--signal);
}

body.theme-cinematic .nav-cta:hover {
    background: var(--white) !important;
    color: var(--void) !important;
    border-color: var(--white) !important;
}

/* ---- Dropdown Menus ---- */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
}

.nav-dropdown-toggle svg {
    transition: transform 0.3s ease;
}

.nav-dropdown:hover .nav-dropdown-toggle svg {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 200px;
    padding: 0.75rem 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
    pointer-events: none;
    padding-top: 1rem;
}

.nav-dropdown:hover .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.nav-dropdown-menu::before {
    content: '';
    position: absolute;
    top: 0.5rem;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 12px;
    z-index: -1;
}

.nav-dropdown-menu li {
    padding: 0;
}

.nav-dropdown-menu a {
    display: block;
    padding: 0.6rem 1.25rem;
    font-size: 0.85rem !important;
    white-space: nowrap;
    transition: all 0.2s ease;
}

/* V4 Light theme dropdown — always dark */
body.theme-light .nav-dropdown-menu::before {
    background: rgba(12, 10, 9, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    backdrop-filter: blur(16px);
}

body.theme-light .nav-dropdown-menu a {
    color: rgba(255, 255, 255, 0.7) !important;
}

body.theme-light .nav-dropdown-menu a:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.08);
}

/* Rounded hover states — match dropdown border-radius */
.nav-dropdown-menu li:first-child a {
    border-radius: 8px 8px 0 0;
}

.nav-dropdown-menu li:last-child a {
    border-radius: 0 0 8px 8px;
}

/* V5 Cinematic theme dropdown */
body.theme-cinematic .nav-dropdown-menu::before {
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(20px);
}

body.theme-cinematic .nav-dropdown-menu a {
    color: rgba(255, 255, 255, 0.6) !important;
}

body.theme-cinematic .nav-dropdown-menu a:hover {
    color: white !important;
    background: rgba(255, 255, 255, 0.06);
}

/* ---- WordPress Admin Bar offset ---- */
.admin-bar .nav-dark,
.admin-bar.theme-light nav,
.admin-bar.theme-cinematic nav {
    top: 32px;
}

/* ---- Mobile Hamburger ---- */
/* ---- Mobile Hamburger ---- */
.nav-mobile-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    z-index: 1002;
    -webkit-tap-highlight-color: transparent;
}

.nav-mobile-cta-item {
    display: none;
}

.nav-mobile-toggle span {
    display: block;
    width: 26px;
    height: 3px;
    background: var(--stone-800);
    border-radius: 2px;
    transition: all 0.3s ease;
    pointer-events: none;
}

/* White bars on dark hero states so the icon remains visible */
body.theme-cinematic nav:not(.scrolled) .nav-mobile-toggle:not(.active) span,
body.page-news-clean nav:not(.scrolled) .nav-mobile-toggle:not(.active) span,
body.landing-clean nav:not(.scrolled) .nav-mobile-toggle:not(.active) span,
body.page-consulting-clean nav:not(.scrolled) .nav-mobile-toggle:not(.active) span,
.nav-dark .nav-mobile-toggle:not(.active) span {
    background: white;
}

/* Always dark bars when menu is open */
.nav-mobile-toggle.active span {
    background: var(--stone-800);
}

/* Animate to X when open */
.nav-mobile-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
}

.nav-mobile-toggle.active span:nth-child(2) {
    opacity: 0;
}

.nav-mobile-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
}

@media (max-width: 1024px) {
    .nav-dark,
    body.theme-light nav,
    body.theme-cinematic nav {
        display: grid;
        grid-template-columns: auto 1fr auto;
        align-items: center;
        column-gap: 0.75rem;
    }

    .nav-dark .logo,
    .nav-logo {
        justify-self: start;
    }

    .nav-mobile-toggle {
        display: flex !important;
        justify-self: end;
    }

    .nav-cta {
        padding: 0.5rem 1.2rem;
        font-size: 0.8rem;
        justify-self: center;
    }

    /* ---- Slide-in drawer from right ---- */
    .nav-links-list {
        display: none !important;
        position: fixed !important;
        top: 0;
        right: 0;
        bottom: 0;
        left: auto !important;
        width: 80vw;
        max-width: 320px;
        height: 100vh;
        background: white;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0;
        z-index: 1001;
        transform: none !important;
        visibility: hidden !important;
        transition: none !important;
        padding: 5rem 2rem 2rem;
        overflow-y: auto;
        box-shadow: -8px 0 30px rgba(0, 0, 0, 0.1);
        opacity: 0 !important;
        pointer-events: none !important;
    }

    .nav-links-list.mobile-open {
        display: flex !important;
        transform: none !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        transition: none !important;
    }

    /* Scrim overlay behind drawer */
    .nav-links-list.mobile-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: -100vw;
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.3);
        z-index: -1;
    }

    /* Top-level standalone links */
    body.theme-light .nav-links-list.mobile-open > li > a:not(.nav-dropdown-toggle):not(.nav-mobile-cta-link),
    body.theme-cinematic .nav-links-list.mobile-open > li > a:not(.nav-dropdown-toggle):not(.nav-mobile-cta-link),
    body.theme-dark .nav-links-list.mobile-open > li > a:not(.nav-dropdown-toggle):not(.nav-mobile-cta-link) {
        color: var(--stone-800) !important;
        font-size: 1.05rem;
        font-weight: 500;
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--stone-200);
        display: block;
    }

    /* Dropdown groups */
    .nav-links-list.mobile-open .nav-dropdown {
        border-bottom: 1px solid var(--stone-200);
        padding: 0.75rem 0;
    }

    /* Dropdown toggle labels — small category headers */
    .nav-links-list.mobile-open .nav-dropdown-toggle {
        color: var(--stone-400) !important;
        font-weight: 600 !important;
        font-size: 0.65rem !important;
        text-transform: uppercase;
        letter-spacing: 0.12em;
        pointer-events: none;
        padding: 0;
        margin-bottom: 0.35rem;
    }

    .nav-links-list.mobile-open .nav-dropdown-toggle svg {
        display: none;
    }

    /* Show dropdown items inline */
    .nav-links-list.mobile-open .nav-dropdown-menu {
        display: block !important;
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        padding: 0;
        min-width: auto;
    }

    .nav-links-list.mobile-open .nav-dropdown-menu::before {
        display: none;
    }

    .nav-links-list.mobile-open .nav-dropdown-menu a {
        display: block;
        padding: 0.4rem 0;
        color: var(--stone-600) !important;
        font-size: 0.95rem !important;
        font-weight: 400 !important;
    }

    body.theme-light .nav-links-list.mobile-open a:hover:not(.nav-mobile-cta-link) {
        color: var(--eg-green) !important;
    }

    /* CTA at bottom of drawer (real link, not pseudo-element) */
    .nav-links-list.mobile-open .nav-mobile-cta-item {
        display: block;
        margin-top: 2rem;
        border-bottom: none;
        padding: 0;
    }

    body.theme-light .nav-links-list.mobile-open > li > a.nav-mobile-cta-link,
    body.theme-cinematic .nav-links-list.mobile-open > li > a.nav-mobile-cta-link,
    body.theme-dark .nav-links-list.mobile-open > li > a.nav-mobile-cta-link {
        display: block;
        background: var(--eg-green);
        color: white !important;
        padding: 0.85rem 1.5rem;
        border-radius: 100px;
        font-weight: 600;
        font-size: 0.95rem !important;
        text-align: center;
        text-decoration: none;
        border-bottom: none !important;
    }

    body.theme-light .nav-links-list.mobile-open > li > a.nav-mobile-cta-link:hover,
    body.theme-cinematic .nav-links-list.mobile-open > li > a.nav-mobile-cta-link:hover,
    body.theme-dark .nav-links-list.mobile-open > li > a.nav-mobile-cta-link:hover {
        color: white !important;
    }
}

@media screen and (max-width: 1024px) {
    .admin-bar .nav-dark,
    .admin-bar.theme-light nav,
    .admin-bar.theme-cinematic nav {
        top: 46px;
    }
}

/* Keep desktop CTA hover consistent on light-theme pages */
@media (min-width: 1025px) {
    body.theme-light .nav-cta:hover {
        background: var(--eg-green) !important;
        color: white !important;
        border-color: var(--eg-green) !important;
    }
}
