/* ==========================================================================
 * navigation.css — Mega-menu navbar, breadcrumb.
 * Palette tuned to match editorial dark theme in style.css.
 * ========================================================================== */

/* Reset only html — never reset body here, or you wipe out
   `margin: 0 auto` (centering) and `padding: 0 64px 60px` (left/right
   breathing room) set by style.css. */
html { margin: 0; padding: 0; overflow-x: hidden; }

/* Zero only the top padding/margin on body so the navbar sits flush
   against the top of the viewport. Left/right/bottom come from style.css. */
body { margin-top: 0; padding-top: 0 !important; }

.navbar {
    background: #000000;
    border-bottom: 1px solid #1f1f1f;
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    position: relative;
    z-index: 9999;
    width: 100vw;
    margin-left: -50px;
    overflow: visible;
}

.navbar > ul {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 0 50px;
    list-style: none;
}

@media (max-width: 720px) {
    .navbar > ul { padding: 0 16px; }
}

.navbar > ul > li {
    position: static;
    margin: 0 !important;
    padding: 0 !important;
}

.navbar a {
    display: block;
    padding: 11px 16px;
    color: #d8dbe2;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    white-space: nowrap;
    border-bottom: 0 !important;
    transition: color 0.15s ease, background 0.15s ease;
}

.navbar > ul > li:hover > a,
.navbar > ul > li > a:focus {
    background: #141414;
    color: #ffffff;
}

/* --- Breadcrumb --------------------------------------------------------- */
.breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    font-size: 0.82rem;
    gap: 6px;
    margin: 12px 0 18px;
    padding: 0;
    color: #6b7180;
}

.breadcrumb a {
    color: #7aa7ff;
    text-decoration: none;
    border-bottom: 0;
}

.breadcrumb a:hover {
    color: #a5c4ff;
    border-bottom: 1px solid #a5c4ff;
}

/* === MEGA MENU DROPDOWN ================================================= */

/* The dropdown becomes a full-width mega panel */
.navbar .dropdown {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100vw;
    background: #0c1222;
    list-style: none;
    margin: 0;
    padding: 24px 50px 28px;
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.9);
    z-index: 10000;
    border-top: 1px solid #1a2744;
    border-bottom: 2px solid #1a2744;
    flex-wrap: wrap;
    gap: 8px 36px;
    max-height: 80vh;
    overflow-y: auto;
    align-content: flex-start;
}

.dropdown-compact { /* no special sizing needed for mega menu */ }

.navbar > ul > li:hover > .dropdown {
    display: flex !important;
}

/* --- Top-level links in dropdown (non-submenu items like "Index") -------- */
.navbar .dropdown > li {
    margin: 0;
    padding: 0;
    position: relative;
}

/* Regular dropdown items (non-submenu) - inline links at top */
.navbar .dropdown > li:not(.has-submenu) {
    width: auto;
    flex-shrink: 0;
}

.navbar .dropdown > li:not(.has-submenu) > a {
    padding: 6px 14px;
    font-size: 0.84rem;
    font-weight: 500;
    color: #7aa7ff;
    border-radius: 4px;
    white-space: nowrap;
}

.navbar .dropdown > li:not(.has-submenu) > a:hover {
    background: #141414;
    color: #a5c4ff;
}

/* --- Submenu category columns ------------------------------------------- */
.has-submenu {
    position: relative !important;
    min-width: 180px;
    max-width: 280px;
    flex: 0 0 auto;
}

/* Category heading link */
.has-submenu > a {
    display: block;
    padding: 0 0 6px 0 !important;
    font-size: 0.72rem !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #7aa7ff !important;
    border-bottom: 1px solid #1f1f1f !important;
    margin-bottom: 6px;
    white-space: nowrap;
}

/* Remove the old flyout arrow */
.has-submenu > a::after {
    content: none !important;
}

.has-submenu > a::before { content: none !important; }

.has-submenu > a:hover {
    color: #a5c4ff !important;
    background: transparent !important;
}

/* The submenu is always visible (no flyout) — it's the list under the heading */
.submenu {
    display: block !important;
    position: static !important;
    background: transparent !important;
    min-width: unset !important;
    list-style: none;
    margin: 0;
    padding: 0 !important;
    box-shadow: none !important;
    z-index: auto !important;
    border: none !important;
}

.submenu li {
    position: relative;
    margin: 0;
    padding: 0;
}

.submenu li a {
    padding: 4px 0;
    font-size: 0.82rem;
    color: #c8ccd4;
    display: block;
    line-height: 1.45;
    white-space: normal;
    border-bottom: none !important;
}

.submenu li a:hover {
    color: #ffffff;
    background: transparent;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* --- Dropdown section headers (if used) -------------------------------- */
.dropdown-section-header {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #7aa7ff;
    padding: 10px 0 5px;
    margin-top: 6px;
    border-top: 1px solid #1a2744;
    font-weight: 600;
    pointer-events: none;
}

.dropdown-section-header:first-child {
    margin-top: 0;
    border-top: 0;
}

/* --- Scrollbar in mega panel ------------------------------------------- */
.dropdown::-webkit-scrollbar { width: 8px; }
.dropdown::-webkit-scrollbar-track { background: #0c1222; }
.dropdown::-webkit-scrollbar-thumb { background: #1f1f1f; border-radius: 4px; }
.dropdown::-webkit-scrollbar-thumb:hover { background: #3a414e; }

/* --- Subtle entrance animation ----------------------------------------- */
@keyframes megaSlideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.navbar > ul > li:hover > .dropdown {
    animation: megaSlideDown 0.18s ease-out;
}

/* --- Responsive: stack columns on small screens ------------------------ */
@media (max-width: 720px) {
    .navbar .dropdown {
        padding: 16px 16px 20px;
        gap: 6px 20px;
    }
    .has-submenu {
        min-width: 140px;
        max-width: 100%;
    }
}
