/* Extracted from includes/navbar.php */
:root {
    --nb:      #0c1f3f;
    --nb-h:    48px;
    --nb-red:  #dc2626;
    --nb-gold: #f59e0b;
    --nb-txt:  rgba(255,255,255,.88);
    --nb-dim:  rgba(255,255,255,.45);
    --nb-hov:  rgba(255,255,255,.09);
    --nb-ff:   'DM Sans','Inter',system-ui,sans-serif;
    --nb-ease: cubic-bezier(.4,0,.2,1);
    --nb-sh:   0 12px 40px rgba(0,0,0,.2), 0 2px 8px rgba(0,0,0,.1);
}


.main-nav {
    background: var(--nb);
    width: 100%;
    position: relative;
    z-index: 850;
}
.main-nav::after {
    content: '';
    display: block;
    height: 2px;
    background: linear-gradient(90deg, var(--nb-red) 0%, var(--nb-gold) 50%, var(--nb-red) 100%);
    opacity: .6;
}
.nav-strip-outer {
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.nav-strip-outer::-webkit-scrollbar { display: none; }
.nav-strip-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
    overflow: visible;
}
.nav-menu {
    display: flex;
    list-style: none;
    align-items: stretch;
    height: var(--nb-h);
    margin: 0;
    padding: 0;
    white-space: nowrap;
    overflow: visible;
    gap: 0;
}
.nav-item {
    display: flex;
    align-items: stretch;
    position: relative;
    flex-shrink: 0;
}


.nav-link, .nav-dd-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 14px;
    color: var(--nb-txt);
    font-family: var(--nb-ff);
    font-size: .84rem;
    font-weight: 600;
    white-space: nowrap;
    background: transparent;
    border: none;
    cursor: pointer;
    text-decoration: none;
    height: 100%;
    position: relative;
    transition: background .16s, color .16s;
}
.nav-link::after, .nav-dd-btn::after {
    content: '';
    position: absolute; bottom: 0; left: 50%; right: 50%;
    height: 2px; background: var(--nb-red);
    transition: left .22s var(--nb-ease), right .22s var(--nb-ease);
}
.nav-link:hover, .nav-dd-btn:hover,
.nav-dd.is-open > .nav-dd-btn { background: var(--nb-hov); color: #fff; }
.nav-link:hover::after, .nav-link.is-active::after,
.nav-dd-btn:hover::after, .nav-dd.is-open > .nav-dd-btn::after { left: 10px; right: 10px; }
.nav-link i:first-child, .nav-dd-btn i:first-child { font-size: .72rem; color: var(--nb-gold); opacity: .75; }
.nav-link:hover i:first-child, .nav-dd-btn:hover i:first-child { opacity: 1; }
.nav-chev {
    font-size: .58rem !important;
    color: var(--nb-dim) !important;
    margin-left: 2px;
    transition: transform .22s var(--nb-ease) !important;
    opacity: 1 !important;
}
.nav-dd.is-open .nav-chev { transform: rotate(180deg); color: var(--nb-gold) !important; }


.nav-dd-panel {
    position: fixed;
    top: 0; left: 0;
    min-width: 230px;
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--nb-sh);
    border: 1px solid rgba(0,0,0,.07);
    z-index: 9500;
    display: none;
    overflow: hidden;
    animation: panel-drop .18s var(--nb-ease);
    /* Invisible bridge above panel fills the gap between navbar and panel */
    /* This is handled via padding-top + negative margin instead */
}
@keyframes panel-drop {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.nav-dd-panel.is-open { display: block; }


.nav-dd-panel::before {
    content: '';
    display: block;
    height: 8px;            /* matches the 6px gap + 2px buffer */
    margin-top: -8px;       /* pulls it above the panel visually */
    position: absolute;
    top: -8px;
    left: 0; right: 0;
    background: transparent;
    pointer-events: all;    /* catches mouse so hover stays active */
}

.ndp-cat-link {
    display: flex; align-items: center; justify-content: space-between;
    padding: 11px 16px;
    border-bottom: 1px solid #f1f5f9;
    text-decoration: none; color: inherit;
    transition: background .14s;
}
.ndp-cat-link:hover { background: #f8fafc; }
.ndp-cat-name {
    display: flex; align-items: center; gap: 7px;
    font-family: var(--nb-ff); font-size: .78rem; font-weight: 800;
    text-transform: uppercase; letter-spacing: .9px; color: #0c1f3f;
}
.ndp-cat-name i { color: #dc2626; font-size: .7rem; }
.ndp-cat-arrow {
    width: 22px; height: 22px; border-radius: 50%;
    background: #0c1f3f; color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: .62rem; flex-shrink: 0;
    transition: background .14s, transform .14s;
}
.ndp-cat-link:hover .ndp-cat-arrow { background: #dc2626; transform: translateX(2px); }
.ndp-list { list-style: none; padding: 6px 0; margin: 0; }
.ndp-item {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 16px;
    font-family: var(--nb-ff); font-size: .87rem; font-weight: 500;
    color: #334155; text-decoration: none;
    transition: background .12s, color .12s, padding-left .15s;
    position: relative;
}
.ndp-item:hover { background: #f8fafc; color: #0c1f3f; padding-left: 20px; }
.ndp-item:hover .ndp-dot { background: #dc2626; transform: scale(1.35); }
.ndp-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #cbd5e1; flex-shrink: 0;
    transition: background .13s, transform .13s;
}
.ndp-dot-sm { width: 5px; height: 5px; }
.ndp-gc-chev {
    margin-left: auto; font-size: .6rem !important;
    color: #94a3b8;
    transition: transform .15s, color .13s;
}
.ndp-has-gc:hover .ndp-gc-chev { color: #0c1f3f; transform: translateX(3px); }
.ndp-submenu {
    display: none;
    position: absolute; left: 100%; top: -1px;
    min-width: 200px;
    background: #fff;
    border-radius: 10px;
    box-shadow: var(--nb-sh);
    border: 1px solid rgba(0,0,0,.07);
    list-style: none; padding: 6px 0;
    z-index: 9600;
    animation: panel-drop .16s var(--nb-ease);
}
.ndp-has-gc:hover > .ndp-submenu { display: block; }
.ndp-sub-item {
    display: flex; align-items: center; gap: 9px;
    padding: 9px 16px;
    font-family: var(--nb-ff); font-size: .85rem; font-weight: 500;
    color: #334155; text-decoration: none;
    transition: background .12s, color .12s, padding-left .14s;
}
.ndp-sub-item:hover { background: #f8fafc; color: #0c1f3f; padding-left: 20px; }
.ndp-sub-item:hover .ndp-dot { background: #dc2626; transform: scale(1.35); }


.nav-mob-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.5);
    backdrop-filter: blur(3px);
    z-index: 699;
}
.nav-mob-overlay.show { display: block; }


.mob-only { display: none !important; }


@media (max-width: 768px) {

    .main-nav {
        position: fixed;
        top: 60px; left: -100%;
        width: 300px;
        height: calc(100dvh - 60px);
        overflow-y: auto;
        overflow-x: hidden;
        transition: left .3s var(--nb-ease);
        z-index: 700;
    }
    .main-nav::after { display: none; }
    .main-nav.mob-open {
        left: 0;
        box-shadow: 6px 0 40px rgba(0,0,0,.35);
    }

    .nav-strip-outer,
    .nav-strip-inner { overflow: visible; padding: 0; max-width: 100%; }

    .nav-menu {
        flex-direction: column;
        height: auto;
        white-space: normal;
        overflow: visible;
        padding: 12px 0 60px;
        gap: 0;
    }

    .nav-item { width: 100%; flex-shrink: 0; display: block; }

    .mob-only    { display: block !important; }
    .desktop-home { display: none !important; }

    .mob-home, .mob-authors, .mob-assist { padding: 0 12px 8px; }
    .nlmob {
        display: flex; width: 100%;
        border-radius: 9px; padding: 12px 16px;
        height: auto; font-size: .88rem;
        justify-content: center; gap: 9px;
    }
    .nlmob::after { display: none !important; }
    .nlmob-home    { background: rgba(255,255,255,.1);  border: 1px solid rgba(255,255,255,.18); color: #fff; }
    .nlmob-authors { background: rgba(30,42,80,.7);     border: 1px solid rgba(255,255,255,.15); color: #fff; }
    .nlmob-assist  { background: var(--nb-red);          border: 1px solid transparent;           color: #fff; }

    .nav-item:not(.mob-only):not(.desktop-home) .nav-link,
    .nav-item:not(.mob-only):not(.desktop-home) .nav-dd-btn {
        display: flex;
        width: 100%; height: auto;
        padding: 13px 18px;
        border-radius: 0;
        border-bottom: 1px solid rgba(255,255,255,.08);
        justify-content: space-between;
        align-items: center;
        text-align: left;
    }
    .nav-item:not(.mob-only):not(.desktop-home) .nav-link::after,
    .nav-item:not(.mob-only):not(.desktop-home) .nav-dd-btn::after { display: none; }

    .nav-dd-btn > i:first-child,
    .nav-dd-btn > span { flex-shrink: 0; }
    .nav-chev { margin-left: auto !important; }

    .nav-dd-panel {
        position: static  !important;
        top:  auto        !important;
        left: auto        !important;
        width: 100%       !important;
        min-width: 0      !important;
        border-radius: 0  !important;
        box-shadow: none  !important;
        border: none      !important;
        border-left: 3px solid rgba(220,38,38,.5) !important;
        background: rgba(255,255,255,.05) !important;
        z-index: auto     !important;
        animation: none   !important;
        overflow: hidden  !important;
        display: block    !important;
        max-height: 0;
        transition: max-height .32s ease;
    }
    /* Remove bridge on mobile */
    .nav-dd-panel::before { display: none !important; }

    .nav-dd-panel.mob-open {
        max-height: 1000px !important;
        transition: max-height .4s ease !important;
    }

    .ndp-cat-link { display: none; }

    .ndp-list { padding: 4px 0 6px; margin: 0; list-style: none; }

    .ndp-item {
        display: flex; align-items: center;
        padding: 11px 16px 11px 28px;
        color: rgba(255,255,255,.78);
        font-size: .86rem; font-weight: 500;
        border-bottom: 1px solid rgba(255,255,255,.05);
        transition: background .12s, color .12s;
    }
    .ndp-item:last-child { border-bottom: none; }
    .ndp-item:hover,
    .ndp-item:active { background: rgba(255,255,255,.08); color: #fff; padding-left: 28px; }
    .ndp-dot { background: rgba(220,38,38,.6); }
    .ndp-item:hover .ndp-dot { background: var(--nb-gold); transform: none; }

    .ndp-gc-chev {
        margin-left: auto !important;
        transition: transform .22s ease !important;
    }
    .ndp-has-gc.mob-gc-open .ndp-gc-chev { transform: rotate(90deg) !important; }

    .ndp-submenu {
        position: static  !important;
        left: auto        !important;
        top:  auto        !important;
        box-shadow: none  !important;
        border-radius: 0  !important;
        border: none      !important;
        border-left: 2px solid rgba(245,158,11,.3) !important;
        background: rgba(255,255,255,.03) !important;
        list-style: none;
        animation: none   !important;
        z-index: auto     !important;
        display: block    !important;
        max-height: 0;
        overflow: hidden  !important;
        transition: max-height .28s ease;
    }
    .ndp-has-gc:hover > .ndp-submenu { display: block !important; max-height: 0 !important; }
    .ndp-has-gc.mob-gc-open > .ndp-submenu {
        max-height: 600px !important;
        transition: max-height .32s ease !important;
    }

    .ndp-sub-item {
        display: flex; align-items: center;
        padding: 10px 16px 10px 44px;
        color: rgba(255,255,255,.65);
        font-size: .83rem;
        border-bottom: 1px solid rgba(255,255,255,.04);
        transition: background .12s, color .12s;
    }
    .ndp-sub-item:last-child { border-bottom: none; }
    .ndp-sub-item:hover,
    .ndp-sub-item:active { background: rgba(255,255,255,.06); color: #fff; padding-left: 44px; }
    .ndp-dot-sm { background: rgba(245,158,11,.5); }
}
