/**
 * Header Styles - Nomad Labs
 *
 * Fixed centered menu with glassmorphism dropdown.
 * Transitions match reference: cubic-bezier(.72,.23,0,.83)
 *
 * @package NomadLabs
 */

/* ============================================
   HEADER
   ============================================ */

   .site-header {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: var(--z-header);
    margin-top: 16px;
    pointer-events: none;
}

/* ============================================
   NAV HEADER â€” wrapper (unified glassmorphism box)
   ============================================ */

.nav-header {
    display: flex;
    flex-direction: column;
    gap: 1px;
    pointer-events: auto;
    width: 222px;
    border-radius: 4px;
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    background-color: rgba(245, 245, 245, 0.7);
    transition-property: opacity;
    transition-duration: 0.5s;
    transition-timing-function: cubic-bezier(0.25, 0, 0.25, 1);
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* Kill all selection & focus highlights inside nav */
.nav-header *,
.nav-header *::before,
.nav-header *::after {
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.nav-header *::selection {
    background: transparent;
}

.nav-header *::-moz-selection {
    background: transparent;
}

/* ============================================
   NAV TRIGGER â€” the "Menu" button
   ============================================ */

.nav-trigger {
    z-index: 10;
    height: 40px;
    padding: 12px;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    border: none;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    color: var(--color-text, #1A1A1A);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-normal);
    letter-spacing: var(--tracking-wide);
    transition-property: all, opacity;
    transition-duration: 0.5s, 0.3s;
    transition-delay: 0.35s, 0s;
    transition-timing-function: cubic-bezier(0.72, 0.23, 0, 0.83), cubic-bezier(0.25, 0, 0.25, 1);
}

.nav-header.is-active .nav-trigger {
    transition-delay: 0s;
}

/* ============================================
   NAV DROPDOWN â€” expandable panel
   ============================================ */

.nav-dropdown {
    height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    padding: 0 12px;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    overflow: hidden;
    pointer-events: none;
    transition-property: all, opacity;
    transition-duration: 0.5s, 0.3s;
    transition-timing-function: cubic-bezier(0.72, 0.23, 0, 0.83), cubic-bezier(0.25, 0, 0.25, 1);
}

/* Active state: expand */
.nav-header.is-active .nav-dropdown {
    pointer-events: all;
    padding-top: 12px;
    padding-bottom: 12px;
    height: 152px;
    transition-delay: 0.2s;
}

/* ============================================
   NAV ITEMS
   ============================================ */

.nav-item {
    padding-top: 2px;
    position: relative;
    z-index: 10;
    color: var(--color-text, #1A1A1A);
    font-size: var(--font-size-base);
    font-weight: var(--font-weight-medium);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    transform: translateX(-6px);
    opacity: 0;
    transition-duration: 0.5s;
    transition-timing-function: cubic-bezier(0.25, 0, 0.25, 1);
}

.nav-item > span {
    opacity: 0.33;
    transition-duration: 0.5s;
    transition-timing-function: cubic-bezier(0.25, 0, 0.25, 1);
}

.nav-item.is-current > span {
    opacity: 1;
}

/* Items visible when active */
.nav-header.is-active .nav-item {
    transform: translateX(0);
    opacity: 1;
}

/* Staggered delays */
.nav-header.is-active .nav-item:nth-child(1) { transition-delay: 0.55s; }
.nav-header.is-active .nav-item:nth-child(2) { transition-delay: 0.65s; }
.nav-header.is-active .nav-item:nth-child(3) { transition-delay: 0.7s; }
.nav-header.is-active .nav-item:nth-child(4) { transition-delay: 0.75s; }
.nav-header.is-active .nav-item:nth-child(5) { transition-delay: 0.8s; }

/* Hover state */
@media (hover: hover) {
    .nav-item:hover > span {
        opacity: 1;
    }

    .nav-trigger:hover > span {
        opacity: 0.33;
    }
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 809px) {
    .site-header {
        margin-top: 16px;
    }

    .nav-trigger {
        height: 36px;
    }

    .nav-trigger,
    .nav-dropdown {
        transition-timing-function: cubic-bezier(0.72, 0.23, 0.2, 0.8);
    }

    /* Reduce blur on mobile for performance */
    .nav-header {
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        background-color: rgba(245, 245, 245, 0.85);
    }
}
