/* ===========================================================================
   Dropdown navigation for the eight-section menu.

   Opens on click rather than hover: hover menus are unreachable on a phone, and
   most of this audience is on one.
   =========================================================================== */

.nav-links { position: relative; }

.nav-group { position: relative; }

.nav-group-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: 0;
  font: inherit;
  cursor: pointer;
  color: inherit;
}

.nav-caret {
  font-size: 10px;
  opacity: .6;
  transition: transform .18s ease;
}
.nav-group.open .nav-caret { transform: rotate(180deg); }

.nav-panel {
  display: none;
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 250px;
  max-width: min(320px, 92vw);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 14px 40px rgb(0 0 0 / 0.16);
  padding: 8px;
  z-index: 60;
}
.nav-group.open .nav-panel { display: block; }

/* A little arrow, so the panel reads as attached to its button. */
.nav-panel::before {
  content: '';
  position: absolute;
  top: -6px; left: 50%;
  width: 11px; height: 11px;
  transform: translateX(-50%) rotate(45deg);
  background: var(--surface);
  border-left: 1px solid var(--line);
  border-top: 1px solid var(--line);
}

.nav-panel-head {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding: 8px 12px 6px;
}

.nav-panel-link {
  display: block;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--ink-soft);
  font-size: 14.5px;
  text-decoration: none;
  transition: background .12s ease, color .12s ease;
}
.nav-panel-link:hover {
  background: color-mix(in srgb, var(--indigo) 9%, transparent);
  color: var(--indigo);
}

/* --- phone --------------------------------------------------------------
   Nine top-level sections cannot sit in a row on a 390px screen, so the whole
   bar becomes a stacked drawer and each panel opens inline beneath its heading
   rather than floating over the page. */
@media (max-width: 1024px) {
  .nav-group { width: 100%; }

  .nav-group-btn {
    width: 100%;
    justify-content: space-between;
    padding: 11px 2px;
  }

  .nav-panel {
    position: static;
    transform: none;
    min-width: 0;
    max-width: none;
    box-shadow: none;
    border: 0;
    border-left: 2px solid var(--line);
    border-radius: 0;
    margin: 0 0 8px 6px;
    padding: 2px 0 2px 8px;
  }
  .nav-panel::before { display: none; }
  .nav-panel-head { display: none; }
  .nav-panel-link { padding: 8px 6px; font-size: 14px; }
}
