/* ────────────────────────────────────────────────────────────────────
   ODiGE shared site styles
   --------------------------------------------------------------------
   Currently scoped to the global navigation (top-bar, mega-menu,
   hamburger, mobile flatten). Pages link this BEFORE their own
   <style> block. Page-specific rules remain inline for now.
   ──────────────────────────────────────────────────────────────────── */

/* ─── Anchor scroll offset: clear the fixed nav when jumping to #section ── */
[id]:target,
.panel-card[id] {
  scroll-margin-top: 100px;
}

.top-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 40px;
  gap: 16px;
  background: rgba(0,0,0,0);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.logo-img { height: 60px; width: auto; display: block; }

/* ─── Nav links container ───────────────────────────────────────── */
.nav-links {
  display: flex;
  gap: 4px;
  align-items: center;
}

/* ─── Top-level nav buttons (leaves and dropdown triggers) ──────── */
.nav-btn {
  font-family: "Montserrat", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.nav-btn:hover {
  background: rgba(255,255,255,0.08);
  color: #fff;
  border-color: rgba(255,255,255,0.2);
}
.nav-btn.active-page {
  background: rgba(105,159,255,0.14);
  color: #699FFF;
  border-color: rgba(105,159,255,0.35);
}

.nav-chevron {
  width: 11px;
  height: 11px;
  opacity: 0.7;
  transition: transform 0.2s ease;
}

/* ─── Dropdown wrapper, hover-to-open on desktop ────────────────── */
.dropdown-wrap {
  position: relative;
  display: inline-block;
}
.dropdown-wrap:hover .nav-chevron,
.dropdown-wrap.open .nav-chevron {
  transform: rotate(180deg);
}

/* ─── Mega menu panel ───────────────────────────────────────────── */
.mega-menu {
  position: absolute;
  /* Touch the trigger so there's no hover gap */
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  /* Bridge the visual gap with a transparent top spacer that's still hoverable */
  padding-top: 14px;
  margin-top: -8px;
  min-width: 380px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
  z-index: 1100;
}
/* The actual styled panel is the inner mega-menu-items + footer wrapper */
.mega-menu-inner {
  background: rgba(2,16,44,0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 12px;
  box-shadow: 0 26px 60px rgba(0,0,0,0.6);
  padding: 10px;
}
.dropdown-wrap:hover .mega-menu,
.dropdown-wrap.open .mega-menu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

.mega-menu-items { display: flex; flex-direction: column; gap: 2px; }

.mega-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}
.mega-item:hover { background: rgba(105,159,255,0.10); }
.mega-item.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

.mega-icon {
  width: 36px; height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(105,159,255,0.10);
  border: 1px solid rgba(105,159,255,0.25);
  border-radius: 8px;
  color: #699FFF;
}
.mega-icon svg { width: 18px; height: 18px; }

.mega-item-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mega-item-name {
  font-family: "Montserrat", sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #fff;
}
.mega-item-strap {
  font-family: "Montserrat", sans-serif;
  font-size: 11px;
  font-weight: 300;
  color: rgba(255,255,255,0.55);
  line-height: 1.4;
}
.mega-item-badge {
  display: inline-block;
  margin-left: 8px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 999px;
  padding: 2px 7px;
  vertical-align: 1px;
}

.mega-menu-footer {
  margin-top: 8px;
  padding: 10px 12px 8px;
  border-top: 1px solid rgba(255,255,255,0.08);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.mega-menu-footer-text {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
}
.mega-cta {
  font-family: "Montserrat", sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #699FFF;
  text-decoration: none;
  padding: 4px 10px;
  border-radius: 4px;
  border: 1px solid rgba(105,159,255,0.35);
  transition: all 0.15s ease;
}
.mega-cta:hover {
  background: rgba(105,159,255,0.14);
  color: #fff;
}

/* ─── Hamburger ─────────────────────────────────────────────────── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 36px; height: 36px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 6px;
  cursor: pointer;
  padding: 8px;
  flex-shrink: 0;
  z-index: 1200;
}
.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background: rgba(255,255,255,0.8);
  border-radius: 2px;
  transition: all 0.25s ease;
  transform-origin: center;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── Mobile: flatten dropdowns into the menu ───────────────────── */
@media (max-width: 900px) {
  .hamburger { display: flex; }
  .top-bar { padding: 12px 20px; }
  .logo-img { height: 46px; }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: rgba(2,16,44,0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    flex-direction: column;
    align-items: stretch;
    padding: 12px 16px 18px;
    gap: 0;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    z-index: 99;
    max-height: calc(100vh - 70px);
    overflow-y: auto;
  }
  .nav-links.open { display: flex; }

  .nav-btn {
    width: 100%;
    text-align: left;
    padding: 11px 14px;
    border-radius: 6px;
    font-size: 12px;
    justify-content: space-between;
  }

  .dropdown-wrap { width: 100%; }

  /* On mobile, dropdown becomes a static, indented list under its trigger */
  .mega-menu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    display: none;
    padding: 0;
    margin: 0;
    min-width: 0;
    width: 100%;
  }
  .mega-menu-inner {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 4px 0 8px 12px;
  }
  .dropdown-wrap.open .mega-menu { display: block; }
  .dropdown-wrap:hover .mega-menu { display: none; }
  .dropdown-wrap.open:hover .mega-menu { display: block; }

  .mega-item { padding: 8px 10px; }
  .mega-icon { width: 30px; height: 30px; }
  .mega-icon svg { width: 16px; height: 16px; }
  .mega-menu-footer { display: none; }
}
