/* ── snp-nav.css ─────────────────────────────────────────────────────────────
   Main navigation with mega-menu dropdowns.
   Requires snp.css to be loaded first (uses its :root custom properties).
   Depends on Alpine.js for show/hide behaviour.
   ────────────────────────────────────────────────────────────────────────── */

.main-nav {
    position: relative;
    z-index: 100;
    padding-top: 14px;
}

/* position: relative here makes the dropdown's left/right/top anchor to the
   container, not the full-width nav — giving a container-width dropdown */
.main-nav-bar {
    display: flex;
    align-items: center;
    height: 58px;
    position: relative;
    background: transparent;
    border-radius: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0), 0 1px 3px rgba(0, 0, 0, 0);
    margin: 5px -20px 0;
    width: calc(100% + 40px);
    padding: 0 20px;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.main-nav-bar.nav-bar-open {
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.10), 0 1px 3px rgba(0, 0, 0, 0.06);
}

.nav-logo {
    width: 110px;
    flex-shrink: 0;
    margin-right: 28px;
    margin-top: 20px;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 44px;
    gap: 20px;
}

.nav-item {
    display: flex;
    align-items: center;
}

.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 4px;
    font-size: .82rem;
    color: var(--light-muted-3);
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
    white-space: nowrap;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 3px;
    background: var(--light-muted-4);
    transition: width 0.2s ease;
}

.nav-item:hover > .nav-link:not(.is-active)        { color: var(--light-muted-3); }
.nav-item:hover > .nav-link:not(.is-active)::after { width: calc(100% - 8px); background: var(--light-muted-3); }

.nav-link.is-active                 { color: var(--color-1); }
.nav-link.is-active::after          { width: calc(100% - 8px); background: var(--color-1); }

/* Container-width dropdown — Alpine.js controls show/hide */
.nav-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    right: 0;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.14), 0 1px 4px rgba(0, 0, 0, 0.07);
    padding: 28px 28px 32px;
    border-radius: 12px;
}

.nav-dropdown-grid {
    display: flex;
    width: fit-content;
}

.nav-col {
    display: flex;
    flex-direction: column;
    padding: 0 28px;
    border-right: 1px solid var(--light-muted-2);
}

.nav-col:first-child { padding-left: 0; }
.nav-col:last-child  { border-right: none; padding-right: 0; }

.nav-sub-link {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: fit-content;
    padding: 10px 28px 10px 10px;
    font-size: .78rem;
    font-weight: 500;
    color: var(--dark-1);
    text-decoration: none;
    border-bottom: none;
    transition: color 0.15s;
}

.nav-sub-desc {
    font-size: .65rem;
    color: var(--light-muted-3);
    line-height: 1.35;
    font-weight: 400;
    max-width: 210px;
    transition: color 0.15s;
}

.nav-sub-link:hover .nav-sub-desc {
    color: var(--light-muted-4);
}

.nav-sub-link::after {
    content: '\203A';
    position: absolute;
    right: 10px;
    top: 14px;
    transform: translateX(6px);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    font-size: 1.1em;
    font-weight: 400;
    line-height: 1;
    pointer-events: none;
    color: var(--dark-1);
}

.nav-sub-link:hover {
    color: var(--dark-1);
}

.nav-sub-link.is-navigating,
.nav-sub-link.is-navigating .nav-sub-desc,
.nav-sub-link.is-navigating::after {
    color: var(--color-1);
}

.nav-sub-link:hover::after {
    opacity: 1;
    transform: translateX(0);
}

/* Dark-container overrides — e.g. nav-sub-link used inside .s-card.dark on pages */
.s-card.dark .nav-sub-link              { color: var(--light-muted-1); }
.s-card.dark .nav-sub-link:hover        { color: var(--light-muted-1); }
.s-card.dark .nav-sub-link::after       { color: var(--light-muted-1); }

/* Page backdrop — shown when any dropdown is open.
   4 colour orbs orbit the cursor in different quadrants at different speeds.
        radial-gradient(ellipse 130% 110% at var(--nb-x4, 24%) var(--nb-y4, 76%),
            rgba(151, 147, 189, 0.72) 0%, transparent 60%),
        radial-gradient(ellipse 140% 120% at var(--nb-x2, 76%) var(--nb-y2, 76%),
            rgba(255, 255, 255, 0.40) 0%, transparent 65%),
        radial-gradient(ellipse 130% 110% at var(--nb-x3, 76%) var(--nb-y3, 24%),
            rgba(255, 125, 30, 0.65) 0%, transparent 60%),
        rgba(29, 25, 39, 0.38);
   */
.nav-backdrop {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 130% 110% at var(--nb-x4, 24%) var(--nb-y4, 76%),
            rgba(255, 255, 255, 0.40) 0%, transparent 60%),
        radial-gradient(ellipse 140% 120% at var(--nb-x2, 76%) var(--nb-y2, 76%),
            rgba(255, 255, 255, 0.80) 0%, transparent 65%),
        radial-gradient(ellipse 130% 110% at var(--nb-x3, 76%) var(--nb-y3, 24%),
            rgba(255, 255, 255, 0.20) 0%, transparent 60%),
        rgba(29, 25, 39, 0.38);
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
    z-index: 50;
}

/* Alpine x-transition helper classes */
.nd-enter { transition: opacity 0.15s ease, transform 0.15s ease; }
.nd-from  { opacity: 0; transform: translateY(-4px); }
.nd-to    { opacity: 1; transform: translateY(0); }

.nb-enter { transition: opacity 0.2s ease; }
.nb-from  { opacity: 0; }
.nb-to    { opacity: 1; }


/* ── Hamburger button (mobile only) ─────────────────────────────────────── */
.nav-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--dark-1);
    border-radius: 6px;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.nav-hamburger:hover { background: rgba(0,0,0,0.06); color: var(--dark-1); }

.nav-hamburger .ham-bars,
.nav-hamburger .ham-chevron { transition: opacity 0.2s ease; }
.nav-hamburger .ham-chevron { opacity: 0; }
.nav-hamburger.is-open .ham-bars { opacity: 0; }
.nav-hamburger.is-open .ham-chevron { opacity: 1; }

.nav-cta-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

@media (max-width: 992px) {
    .nav-list        { display: none; }
    .nav-cta         { display: none; }
    .nav-cta-group   { display: none; }
    .nav-hamburger   { display: flex; }
}


/* ── Dark drawer variant (mobile nav) ───────────────────────────────────── */
.drawer-dark                      { background: var(--dark-1); }
.drawer-dark .drawer-header       { border-bottom-color: rgba(255,255,255,0.1); }
.drawer-dark .drawer-title        { color: var(--light-muted-1); }
.drawer-dark .drawer-close        { color: var(--light-muted-2); }
.drawer-dark .drawer-close:hover  { background: rgba(255,255,255,0.08); color: var(--light-muted-1); }
.drawer-dark .drawer-body         { color: var(--light-muted-3); }
.drawer-dark .drawer-footer       { border-top-color: rgba(255,255,255,0.1); }


/* ── Mobile nav links inside drawer ─────────────────────────────────────── */
.mob-nav-section {
    border-bottom: 1px solid var(--light-muted-1-5);
}

.mob-nav-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 14px 0;
    background: none;
    border: none;
    cursor: pointer;
    font-size: .88rem;
    font-weight: 500;
    font-family: inherit;
    color: var(--light-muted-4);
    transition: color 0.15s;
}
.mob-nav-trigger:hover               { color: var(--dark-1); }

.mob-nav-trigger-icon {
    font-size: .75rem;
    color: var(--light-muted-3);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
.mob-nav-trigger.is-open .mob-nav-trigger-icon { transform: rotate(90deg); }

.mob-nav-links {
    display: flex;
    flex-direction: column;
    padding-bottom: 10px;
    gap: 2px;
}

.mob-nav-link {
    position: relative;
    display: block;
    width: fit-content;
    padding: 8px 24px 8px 14px;
    font-size: .82rem;
    color: var(--light-muted-3);
    text-decoration: none;
    border: none;
    transition: color 0.15s;
}
.mob-nav-link::after {
    content: '\203A';
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%) translateX(6px);
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    font-size: 1.1em;
    font-weight: 400;
    line-height: 1;
    pointer-events: none;
    color: var(--dark-1);
}
.mob-nav-link:hover { color: var(--dark-1); }
.mob-nav-link:hover::after {
    opacity: 1;
    transform: translateY(-50%) translateX(0);
}

.mob-nav-standalone {
    display: block;
    padding: 14px 0;
    font-size: .88rem;
    font-weight: 500;
    color: var(--light-muted-4);
    text-decoration: none;
    border: none;
    border-bottom: 1px solid var(--light-muted-1-5);
    transition: color 0.15s;
}
.mob-nav-standalone:hover { color: var(--dark-1); }

/* Mobile nav backdrop — same gradient palette as .nav-backdrop but static */
.mob-nav-backdrop {
    background:
        radial-gradient(ellipse 120% 80% at 78% 18%,
            rgba(255, 255, 255, 0.80) 0%, transparent 60%),
        radial-gradient(ellipse 110% 70% at 20% 72%,
            rgba(255, 255, 255, 0.40) 0%, transparent 60%),
        radial-gradient(ellipse 100% 80% at 82% 78%,
            rgba(255, 255, 255, 0.20) 0%, transparent 55%),
        rgba(29, 25, 39, 0.38) !important;
    backdrop-filter: blur(1px);
    -webkit-backdrop-filter: blur(1px);
}
