/* ==========================================================================
 * 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: calc(100% + 80px);
    margin-left: -40px;
    overflow: visible;
}

.navbar > ul {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    /* 24px + the link's 16px side padding = text starts at 40px, the same
       column as the breadcrumb and chip bar below it */
    padding: 0 24px;
    list-style: none;
}

@media (max-width: 720px) {
    .navbar > ul { padding: 0 2px; }
    .navbar a { padding: 11px 14px; }
}

.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: 1rem;
    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 40px 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%;
    }
}

/* --- 2026-04-25: Mobile responsive additions ----------------------------- */
@media (max-width: 768px) {
    /* Navbar: realign full-bleed against the new 16px body padding */
    .navbar {
        margin-left: -16px;
        width: calc(100% + 32px);
    }
    .navbar > ul {
        padding: 0 8px;
        gap: 0;
    }
    .navbar a {
        padding: 9px 10px;
        font-size: 0.8rem;
    }

    /* Mega-menu dropdown: collapse to single column, scrollable */
    .navbar .dropdown {
        padding: 12px 14px 16px;
        gap: 4px 0;
        flex-direction: column;
        flex-wrap: nowrap;
        max-height: 70vh;
    }
    .has-submenu {
        min-width: 100%;
        max-width: 100%;
        flex: 1 1 100%;
        margin-bottom: 8px;
    }
    .has-submenu > a {
        font-size: 0.7rem !important;
        padding: 4px 0 4px 0 !important;
    }
    .submenu li a {
        font-size: 0.82rem;
        padding: 5px 0;
    }
    .navbar .dropdown > li:not(.has-submenu) > a {
        font-size: 0.82rem;
        padding: 5px 10px;
    }

    .breadcrumb {
        font-size: 0.78rem;
        margin: 8px 0 12px;
    }
}

@media (max-width: 480px) {
    .navbar {
        margin-left: -10px;
        width: calc(100% + 20px);
    }
    .navbar > ul { padding: 0 4px; }
    .navbar a {
        padding: 8px 8px;
        font-size: 0.76rem;
    }

    .navbar .dropdown {
        padding: 10px 10px 12px;
        max-height: 65vh;
    }
    .submenu li a { font-size: 0.8rem; }
    .breadcrumb { font-size: 0.74rem; }
}

/* === SECONDARY MENU: breadcrumb-bar + place-chips ======================
   Copied from nitra.net (static/style115.css: .breadcrumb-bar, .place-chips,
   pc-self / pc-up) with this site's palette. /static/subnav.js builds the
   markup from the folder tree in menu<N>.html:
     breadcrumb (every level)  +  [parent] [this folder] [children ...]
   aria-current="page" = this page (solid gold), "true" = the folder you are
   in (outlined). */
.breadcrumb-bar {
  width: calc(100% + 80px);
  margin-left: -40px;
  padding: .7rem 40px .75rem;
  background: #05080f;
  color: #e3ecf5;
  border-bottom: 1px solid #1a2744;
  display: flex; flex-wrap: wrap; align-items: center;
  gap: .55rem 1.2rem;
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  margin-bottom: 18px;
}
.breadcrumb-bar .breadcrumb { margin: 0; font-size: .82rem; color: #8a93a6; flex-basis: 100%; }
.breadcrumb-bar .breadcrumb a { color: #7aa7ff; text-decoration: none; border-bottom: 0; }
.breadcrumb-bar .breadcrumb a:hover { color: #a5c4ff; border-bottom: 1px solid #a5c4ff; }
.breadcrumb-bar .breadcrumb span { color: #c0c6d0; }
.place-chips {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: .3rem; flex-basis: 100%;
}
.place-chips a {
  flex: 0 0 auto;
  display: flex; align-items: center;
  min-height: 30px;
  padding: 0 .62rem;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.18);
  font-size: .7rem; font-weight: 600; letter-spacing: .05em; text-transform: uppercase;
  white-space: nowrap; text-decoration: none;
  color: rgba(235,240,247,.84);
  transition: color .18s ease, background .18s ease, border-color .18s ease;
}
.place-chips a:hover, .place-chips a:focus-visible {
  color: #fff; background: rgba(255,255,255,.08); border-color: rgba(255,204,0,.55);
}
.place-chips a.pc-self {
  font-weight: 700; color: #7aa7ff;
  background: rgba(122,167,255,.12); border-color: rgba(122,167,255,.45);
  margin-right: .2rem;
}
.place-chips a.pc-self::before { content: "\2190\00a0"; }
.place-chips a.pc-up { margin-right: .25rem; }
.place-chips a[aria-current="true"] {
  color: #ffcc00; background: rgba(255,204,0,.10); border-color: rgba(255,204,0,.55); font-weight: 700;
}
.place-chips a[aria-current="page"] {
  color: #0a0f1c; background: #ffcc00; border-color: #ffcc00; font-weight: 700;
}
.place-chips a.pc-page { text-transform: none; letter-spacing: 0; font-size: .76rem; font-weight: 500; }
.place-chips a.pc-page[aria-current="page"] { font-weight: 700; }
.navbar a.nav-current { color: #ffffff; box-shadow: inset 0 -2px 0 #ffcc00; }
@media (max-width: 720px) {
  .breadcrumb-bar { padding: .6rem 16px .65rem; width: calc(100% + 32px); margin-left: -16px; }
  .place-chips a { font-size: .64rem; padding: 0 .5rem; min-height: 28px; }
}
