/* ═══════════════════════════════════════════════════════════════
   NAVBAR  —  dropdown style, light + dark mode
   Append to common.css or load as <link rel="stylesheet" href="/navbar.css">
   ═══════════════════════════════════════════════════════════════ */

/* ── Shell ── */
.site-nav {
  background: #1a1610;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  display: flex;
  align-items: center;
  padding: 0 .75rem;
  position: sticky;
  top: 0;
  z-index: 200;           /* above header (z:20) and page content */
  gap: .5rem;
  min-height: 44px;
}

/* ── Brand label ── */
.nav-brand {
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #9a9188;
  white-space: nowrap;
  user-select: none;
  margin-right: .25rem;
}

/* ── Hamburger button ── */
.nav-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 5px;
  cursor: pointer;
  padding: 0 8px;
  flex-shrink: 0;
  transition: border-color .15s, background .15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.nav-hamburger:hover {
  border-color: rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.04);
}
.nav-hamburger[aria-expanded="true"] {
  border-color: #4db87a;
  background: rgba(77,184,122,0.10);
}
.nav-hamburger span {
  display: block;
  height: 2px;
  background: #9a9188;
  border-radius: 1px;
  transition: all .22s ease;
  width: 100%;
}
.nav-hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ── Dropdown panel ── */
.nav-dropdown {
  display: none;                /* hidden by default */
  position: fixed;              /* fixed so it escapes any overflow:hidden ancestors */
  top: 44px;                    /* matches .site-nav min-height */
  left: 0;
  min-width: 680px;
  max-width: 98vw;
  background: #1e1c16;
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: 0 0 10px 10px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.55), 0 2px 8px rgba(0,0,0,0.30);
  padding: 1rem 1.2rem 1.1rem;
  flex-direction: row;
  gap: 0;
  z-index: 300;
  animation: navFadeIn .18s ease;
}
@keyframes navFadeIn {
  from { opacity:0; transform:translateY(-6px); }
  to   { opacity:1; transform:translateY(0); }
}

/* Open state — toggled by JS */
.nav-dropdown.open {
  display: flex;
}

/* ── Column inside dropdown ── */
.nav-col {
  display: flex;
  flex-direction: column;
  gap: 1px;
  flex: 1;
  min-width: 120px;
}

.nav-col-label {
  font-family: 'DM Mono', monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #4db87a;
  padding: 0 8px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  margin-bottom: 4px;
  user-select: none;
}

/* ── Links inside dropdown ── */
.nav-dropdown a {
  font-family: 'DM Mono', monospace;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: .03em;
  color: #a8a098;
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 4px;
  transition: background .12s, color .12s;
  display: block;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.nav-dropdown a:hover {
  background: rgba(255,255,255,0.06);
  color: #e8e4dc;
}
.nav-dropdown a.active {
  background: rgba(77,184,122,0.14);
  color: #8ecfa8;
  font-weight: 600;
}

/* ── Divider between columns ── */
.nav-divider {
  width: 1px;
  background: rgba(255,255,255,0.06);
  margin: 0 .85rem;
  align-self: stretch;
  flex-shrink: 0;
}

/* ── Overlay (closes menu on outside click) ── */
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 299;
  background: transparent;
}
.nav-overlay.open {
  display: block;
}

/* ── Light mode overrides ── */
@media (prefers-color-scheme: light) {
  .site-nav {
    background: #1a1610;   /* keep dark — site header is always dark */
  }
  .nav-dropdown {
    background: #ffffff;
    border-color: rgba(22,19,15,0.12);
    box-shadow: 0 12px 40px rgba(0,0,0,0.18), 0 2px 8px rgba(0,0,0,0.08);
  }
  .nav-col-label {
    color: #2d7d52;
    border-bottom-color: rgba(22,19,15,0.08);
  }
  .nav-dropdown a {
    color: #36312c;
  }
  .nav-dropdown a:hover {
    background: #f0faf5;
    color: #16130f;
  }
  .nav-dropdown a.active {
    background: #e8f5ee;
    color: #1e5e3b;
  }
  .nav-divider {
    background: rgba(22,19,15,0.08);
  }
}

/* ── Mobile: full-width stacked dropdown ── */
@media (max-width: 640px) {
  .nav-dropdown {
    min-width: calc(100vw - 0px);
    left: -.75rem;
    flex-direction: column;
    gap: .5rem;
    padding: .85rem 1rem 1rem;
    border-radius: 0 0 8px 8px;
  }
  .nav-divider {
    width: auto;
    height: 1px;
    margin: .25rem 0;
  }
  .nav-col {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 2px;
  }
  .nav-col-label {
    width: 100%;
    border-bottom: none;
    margin-bottom: 2px;
    padding-bottom: 2px;
  }
  .nav-dropdown a {
    font-size: 13px;
    padding: 8px 10px;
  }
}
