/* ============================================================
   MITCON Forum — Header / Navbar
   Top navigation bar — visible on every page
   Depends on: tokens.css, base.css
   ============================================================ */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index:99999;
  padding: 18px 0;
  background: transparent;
  transition: all 0.35s var(--ease);
}

.site-header.is-scrolled {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  padding: 12px 0;
  box-shadow: 0 1px 0 var(--border), 0 8px 30px rgba(0, 0, 0, 0.06);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
}

/* ---------- BRAND / LOGO ---------- */
.navbar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  text-decoration: none;
}

.navbar-brand:hover {
  color: inherit;
}

.brand-mark {
  width: 44px;
  height: 44px;
  /* background: var(--accent); */
  color: #ffffff00;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  letter-spacing: -0.02em;
  box-shadow: 0 8px 22px rgba(21, 90, 61, 0.30);
}

.brand-text-wrap {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text-wrap strong {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 17px;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.brand-text-wrap small {
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 2px;
}

/* When header is on transparent background (not scrolled), keep brand readable */
.site-header:not(.is-scrolled) .brand-text-wrap strong,
.site-header:not(.is-scrolled) .brand-text-wrap small {
  color: var(--ink);
}

/* ---------- NAV LINKS ---------- */
.nav-links {
  display: flex;
  gap: 28px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link-custom {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
  position: relative;
  /* padding: 6px 0; */
  transition: color 0.25s var(--ease);
}

.nav-link-custom::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s var(--ease);
}

.nav-link-custom:hover::after,
.nav-link-custom.active::after {
  width: 100%;
}

.nav-link-custom:hover,
.nav-link-custom.active {
  color: var(--accent);
}

/* ---------- NAV ACTIONS (right side) ---------- */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.theme-toggle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  font-size: 16px;
}

.theme-toggle:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  transform: rotate(20deg);
}

/* ---------- MOBILE TOGGLER (hamburger) ---------- */
.navbar-toggler {
  display: none;
  width: 38px;
  height: 38px;
  cursor: pointer;
  padding: 0;
  background: none;
  border: none;
}

.navbar-toggler span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  margin: 5px auto;
  transition: all 0.3s var(--ease);
}

.navbar-toggler.is-open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.navbar-toggler.is-open span:nth-child(2) {
  opacity: 0;
}

.navbar-toggler.is-open span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* ---------- RESPONSIVE — MOBILE NAV ---------- */
@media (max-width: 991px) {
  .navbar-toggler {
    display: block;
  }

  .nav-menu {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 380px;
    height: 100vh;
    background: #fff;
    padding: 90px 32px 40px;
    display: flex;
    flex-direction: column;
    gap: 30px;
    box-shadow: -20px 0 50px rgba(0, 0, 0, 0.12);
    transition: right 0.4s var(--ease);
    z-index: 99;
    overflow-y: auto;
  }

  .nav-menu.is-open {
    right: 0;
  }

  .nav-links {
    flex-direction: column;
    gap: 18px;
  }

  .nav-link-custom {
    font-size: 18px;
  }

  .nav-actions {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .nav-actions .btn-pill {
    justify-content: center;
  }

  /* Mobile menu open — prevent body scroll */
  body.menu-open {
    overflow: hidden;
  }

  /* Backdrop when menu is open */
  body.menu-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 98;
    animation: fadeIn 0.3s ease;
  }

  @keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}

/* ---------- NAV DROPDOWN (Pages) ---------- */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}

.nav-dropdown-toggle .bi-chevron-down {
  font-size: 11px;
  transition: transform 0.3s var(--ease);
}

.nav-dropdown-menu {
  list-style: none;
  margin: 0;
  padding: 8px;
  position: absolute;
  top: calc(100% + 14px);
  left: 0;
  transform: translateY(10px);
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.12);
  opacity: 0;
  visibility: hidden;
  transition: all 0.28s var(--ease);
  z-index: 100;
}

/* little arrow on top of the dropdown */
.nav-dropdown-menu::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 26px;
  transform: rotate(45deg);
  height: 12px;
  background: #fff;
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
}

/* Desktop: open on hover */
@media (min-width: 992px) {
  .nav-dropdown:hover .nav-dropdown-menu,
  .nav-dropdown.is-open .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }
  .nav-dropdown:hover .nav-dropdown-toggle .bi-chevron-down,
  .nav-dropdown.is-open .nav-dropdown-toggle .bi-chevron-down {
    transform: rotate(180deg);
  }
}

.nav-dropdown-menu li {
  list-style: none;
}

.nav-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 9px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  transition: all 0.2s var(--ease);
}

.nav-dropdown-menu a:hover,
.nav-dropdown-menu a.active {
  background: var(--accent-soft, rgba(230, 57, 70, 0.1));
  color: var(--accent);
}

.nav-dropdown-menu a i {
  font-size: 16px;
  opacity: 0.85;
}

/* ---------- MOBILE: dropdown becomes an inline expandable block ---------- */
@media (max-width: 991px) {
  .nav-dropdown-menu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    border: none;
    border-left: 2px solid var(--line);
    border-radius: 0;
    margin: 10px 0 0 6px;
    padding: 0 0 0 14px;
    min-width: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s var(--ease);
  }
  .nav-dropdown-menu::before { display: none; }

  .nav-dropdown.is-open .nav-dropdown-menu {
    max-height: 300px;
  }
  .nav-dropdown.is-open .nav-dropdown-toggle .bi-chevron-down {
    transform: rotate(180deg);
  }
  .nav-dropdown-menu a { font-size: 16px; }
}
/* ============================================================
   DARK-HERO PAGES — header sits over a dark green banner,
   so use light text until the user scrolls (then it goes white-bg).
   Activated by <body class="dark-hero"> on those pages.
   ============================================================ */

/* Brand text — light on the dark banner (overrides the default dark rule) */
.dark-hero .site-header:not(.is-scrolled) .brand-text-wrap strong,
.dark-hero .site-header:not(.is-scrolled) .brand-text-wrap small {
    color: #fff;
}

@media (min-width: 992px) {
    .dark-hero .site-header:not(.is-scrolled) .nav-link-custom,
    .dark-hero .site-header:not(.is-scrolled) .theme-toggle {
        color: #fff;
    }
    .dark-hero .site-header:not(.is-scrolled) .theme-toggle {
        border-color: rgba(255, 255, 255, 0.4);
    }
    .dark-hero .site-header:not(.is-scrolled) .nav-link-custom::after {
        background: #fff;
    }
    /* hover/active: use bright mint so it's visible on dark */
    .dark-hero .site-header:not(.is-scrolled) .nav-link-custom:hover,
    .dark-hero .site-header:not(.is-scrolled) .nav-link-custom.active {
        color: var(--accent-mint);
    }
    .dark-hero .site-header:not(.is-scrolled) .nav-link-custom:hover::after,
    .dark-hero .site-header:not(.is-scrolled) .nav-link-custom.active::after {
        background: var(--accent-mint);
    }
}

@media (max-width: 991px) {
    /* hamburger bars white over the dark banner */
    .dark-hero .site-header:not(.is-scrolled) .navbar-toggler span {
        background: #fff;
    }
    /* but when the white slide-in menu is open, the bars sit over white → keep them dark */
    .dark-hero.menu-open .site-header .navbar-toggler span {
        background: var(--ink);
    }
}