/* ═══════════════════════════════════════════════════════════════
   GLEN THEME — NAVIGATION
   Fixed header. Transparent from first paint (critical CSS is
   inlined in header.php so it fires before any stylesheet loads).
   Transitions to white sticky bar on first scroll via body.gt-scrolled.
   Mobile: hamburger button → full-screen dark glass overlay.
   ═══════════════════════════════════════════════════════════════ */

:root {
    --gt-nav-height:   64px;
    --gt-nav-pad-x:   clamp(1.5rem, 5vw, 4rem);
}

/* ── Header ─────────────────────────────────────────────────── */

#gt-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--gt-nav-height);
    z-index: 1000;
    /* background and transition are inlined in header.php for flash prevention */
}

/* WP admin bar offset */
body.admin-bar #gt-header {
    top: 32px;
}
@media (max-width: 782px) {
    body.admin-bar #gt-header {
        top: 46px;
    }
}

/* Scrolled: white with shadow */
body.gt-scrolled #gt-header {
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* ── Inner layout ───────────────────────────────────────────── */

.gt-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding-inline: var(--gt-nav-pad-x);
}

/* ── Logo ───────────────────────────────────────────────────── */

.gt-header__logo {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
    height: 35px;
}

.gt-logo-player {
    height: 35px;
    width: auto;
    display: block;
    transition: opacity var(--dur-fast) var(--ease);
}

/* ── Desktop nav ────────────────────────────────────────────── */

.gt-header__nav {
    display: flex;
    align-items: center;
}

.gt-nav__list {
    display: flex;
    align-items: center;
    gap: 2.25rem;
    list-style: none;
    margin: 0;
    padding: 0;
}

.gt-nav__list .menu-item a {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    color: rgba(0, 0, 0, 0.72);
    text-decoration: none;
    transition: color var(--dur-fast) var(--ease);
    white-space: nowrap;
}

.gt-nav__list .menu-item a:hover,
.gt-nav__list .menu-item a:focus-visible {
    color: rgba(0, 0, 0, 1);
}

/* Active/current page */
.gt-nav__list .current-menu-item > a,
.gt-nav__list .current-page-ancestor > a {
    color: var(--c-orange);
}

/* Dark-hero pages: body.gt-hero-page flips nav text to white while transparent */
body.gt-hero-page:not(.gt-scrolled) .gt-nav__list .menu-item a {
    color: rgba(255, 255, 255, 0.85);
}
body.gt-hero-page:not(.gt-scrolled) .gt-nav__list .menu-item a:hover,
body.gt-hero-page:not(.gt-scrolled) .gt-nav__list .menu-item a:focus-visible {
    color: #fff;
}
body.gt-hero-page:not(.gt-scrolled) .gt-nav__list .current-menu-item > a,
body.gt-hero-page:not(.gt-scrolled) .gt-nav__list .current-page-ancestor > a {
    color: var(--c-orange);
}

/* ── Hamburger toggle ───────────────────────────────────────── */

.gt-header__toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    flex-shrink: 0;
}

.gt-toggle__bar {
    display: block;
    width: 22px;
    height: 1.5px;
    background: rgba(0, 0, 0, 0.72);
    border-radius: 1px;
    transition:
        transform  var(--dur-fast) var(--ease),
        opacity    var(--dur-fast) var(--ease),
        background var(--dur-fast) var(--ease);
    transform-origin: center;
}

/* White bars on dark-hero pages before scroll */
body.gt-hero-page:not(.gt-scrolled) .gt-header__toggle .gt-toggle__bar {
    background: rgba(255, 255, 255, 0.85);
}

/* Animate to × when open */
.gt-header__toggle[aria-expanded="true"] .gt-toggle__bar:first-child {
    transform: translateY(3.25px) rotate(45deg);
}
.gt-header__toggle[aria-expanded="true"] .gt-toggle__bar:last-child {
    transform: translateY(-3.25px) rotate(-45deg);
}

/* ── Overlay (mobile full-screen menu) ──────────────────────── */

.gt-overlay {
    position: fixed;
    inset: 0;
    z-index: 999;
    pointer-events: none;
    visibility: hidden;
    transition: visibility 0s var(--dur-med);
}

html.gt-menu-open .gt-overlay {
    pointer-events: auto;
    visibility: visible;
    transition: visibility 0s 0s;
}

/* WP admin bar offset */
body.admin-bar .gt-overlay {
    top: 32px;
}
@media (max-width: 782px) {
    body.admin-bar .gt-overlay {
        top: 46px;
    }
}

/* Dark glass background */
.gt-overlay__bg {
    position: absolute;
    inset: 0;
    background: rgba(10, 18, 32, 0.78);
    backdrop-filter: blur(18px) saturate(120%);
    -webkit-backdrop-filter: blur(18px) saturate(120%);
    opacity: 0;
    transition: opacity var(--dur-med) var(--ease);
}

html.gt-menu-open .gt-overlay__bg {
    opacity: 1;
}

.gt-overlay__inner {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding: 0 var(--gt-nav-pad-x);
}

/* Close button — positioned to match the hamburger's location */
.gt-overlay__close {
    align-self: flex-end;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0;
    width: 44px;
    height: var(--gt-nav-height);
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    flex-shrink: 0;
}

.gt-overlay__close .gt-toggle__bar {
    background: rgba(255, 255, 255, 0.85);
}
.gt-overlay__close .gt-toggle__bar:first-child {
    transform: translateY(0.75px) rotate(45deg);
}
.gt-overlay__close .gt-toggle__bar:last-child {
    transform: translateY(-0.75px) rotate(-45deg);
}
.gt-overlay__close:hover .gt-toggle__bar,
.gt-overlay__close:focus-visible .gt-toggle__bar {
    background: #fff;
}

/* Overlay nav */
.gt-overlay__nav {
    margin-top: auto;
    margin-bottom: auto;
    padding-bottom: 2rem;
}

.gt-overlay__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.gt-overlay__list .menu-item a {
    display: block;
    font-family: var(--font-sans);
    font-size: clamp(1.75rem, 6vw, 3rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    padding: 0.35em 0;
    line-height: 1.1;
    opacity: 0;
    transform: translateY(12px);
    transition:
        color      var(--dur-fast) var(--ease),
        opacity    var(--dur-med)  var(--ease),
        transform  var(--dur-med)  var(--ease);
}

html.gt-menu-open .gt-overlay__list .menu-item a {
    opacity: 1;
    transform: translateY(0);
}

.gt-overlay__list .menu-item a:hover,
.gt-overlay__list .menu-item a:focus-visible {
    color: rgba(255, 255, 255, 0.92);
}

.gt-overlay__list .current-menu-item > a {
    color: rgba(255, 255, 255, 0.92);
}

/* Staggered entrance */
.gt-overlay__list .menu-item:nth-child(1) a { transition-delay:  60ms; }
.gt-overlay__list .menu-item:nth-child(2) a { transition-delay: 100ms; }
.gt-overlay__list .menu-item:nth-child(3) a { transition-delay: 140ms; }
.gt-overlay__list .menu-item:nth-child(4) a { transition-delay: 180ms; }
.gt-overlay__list .menu-item:nth-child(5) a { transition-delay: 220ms; }

/* ── Breakpoints ─────────────────────────────────────────────── */

@media (max-width: 959px) {
    .gt-header__nav {
        display: none;
    }
    .gt-header__toggle {
        display: flex;
    }
}

@media (min-width: 960px) {
    .gt-overlay {
        display: none;
    }
}

/* ── Reduced motion ─────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    #gt-header,
    .gt-overlay__bg,
    .gt-toggle__bar,
    .gt-overlay,
    .gt-overlay__list .menu-item a {
        transition: none;
    }
}
