/* ============================================================
 OxerLine site nav: shared by every oxerline.com page.
 Markup lives in each page's <header class="nav"> (copy it from
 index.html); styles live here; the mobile menu is nav.js.
 ============================================================ */

.nav {
  line-height: 1.5;  /* fixed here so the nav looks the same whatever the page's body line-height */
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--graphite);
  color: var(--ivory);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}
.nav.nav--hidden { transform: translateY(-100%); }
.nav-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 12px 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  position: relative;
}
.nav-toggle { display: none; }
.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--ivory);
  flex-shrink: 0;
}
.brand-mark { width: 52px; height: auto; flex-shrink: 0; display: block; }
.brand-wordmark {
  font-family: var(--sans);
  font-size: 17px;
  letter-spacing: 0.01em;
  line-height: 1;
  white-space: nowrap;
  opacity: 0.92;
}
.brand-wordmark .wm-oxer { font-weight: 700; }
.brand-wordmark .wm-adv  { font-weight: 300; letter-spacing: 0.04em; opacity: 0.75; margin-left: 7px; }

.nav-links { display: flex; align-items: center; gap: 36px; }
.nav-item { position: relative; display: flex; align-items: center; }
.nav-link {
  font-family: var(--sans);
  font-weight: 300;
  font-size: 13px;
  color: var(--ivory);
  text-decoration: none;
  letter-spacing: 0.005em;
  opacity: 0.75;
  transition: opacity 0.18s ease;
  white-space: nowrap;
}
.nav-link:hover { opacity: 1; }
.nav-link--publication em {
  font-style: italic;
  font-weight: inherit;
}
.nav-link--publication .nav-external {
  font-style: normal;
  font-size: 0.92em;
  margin-left: 0.35em;
  opacity: 0.6;
  vertical-align: 0.05em;
}
.nav-link--publication:hover .nav-external { opacity: 0.9; }
.nav-item-has-menu > .nav-link::after {
  content: " \2193";
  margin-left: 5px;
  opacity: 0.55;
  font-size: 11px;
}
/* dropdown */
.nav-menu {
  position: absolute;
  top: calc(100% + 14px);
  left: -20px;
  background: var(--graphite);
  border-top: 1px solid rgba(248,246,241,0.1);
  padding: 10px 0;
  min-width: 240px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s linear 0.18s;
  z-index: 60;
  box-shadow: 0 24px 40px -16px rgba(0,0,0,0.45);
}
/* hover-buffer so the dropdown stays open when mouse crosses gap */
.nav-menu::before {
  content: "";
  position: absolute;
  top: -16px; left: 0; right: 0; height: 16px;
}
.nav-item-has-menu:hover .nav-menu,
.nav-item-has-menu:focus-within .nav-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0s;
}
.nav-menu-link {
  display: block;
  padding: 12px 26px;
  font-family: var(--sans);
  font-weight: 300;
  font-size: 13px;
  color: var(--ivory);
  text-decoration: none;
  opacity: 0.78;
  letter-spacing: 0.005em;
  transition: opacity 0.18s, background 0.18s;
  white-space: nowrap;
}
.nav-menu-link:hover { opacity: 1; background: rgba(248,246,241,0.05); }


/* the page you're on (set aria-current="page" and this class on its link) */
.nav-link--current { opacity: 1; text-decoration: underline; text-decoration-color: rgba(248,246,241,0.5); text-decoration-thickness: 1px; text-underline-offset: 6px; }

@media (max-width: 760px) {
    /* hamburger button */
    .nav-toggle {
      display: inline-flex;
      flex-direction: column;
      justify-content: center;
      gap: 5px;
      width: 44px;
      height: 44px;
      padding: 0;
      background: none;
      border: none;
      cursor: pointer;
      -webkit-tap-highlight-color: transparent;
    }
    .nav-toggle span {
      display: block;
      width: 24px;
      height: 2px;
      margin: 0 auto;
      background: var(--ivory);
      border-radius: 1px;
      transition: transform 0.22s var(--ease), opacity 0.18s var(--ease);
    }
    .nav.nav-open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .nav.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
    .nav.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    /* slide-down panel */
    .nav-links {
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      flex-direction: column;
      align-items: stretch;
      gap: 0;
      background: var(--graphite);
      border-top: 1px solid rgba(248,246,241,0.1);
      box-shadow: 0 24px 40px -16px rgba(0,0,0,0.5);
      padding: 0 24px;
      max-height: 0;
      overflow: hidden;
      opacity: 0;
      visibility: hidden;
      transition: max-height 0.28s var(--ease), opacity 0.2s var(--ease), padding 0.28s var(--ease), visibility 0s linear 0.28s;
    }
    .nav.nav-open .nav-links {
      max-height: calc(100vh - 64px);
      opacity: 1;
      visibility: visible;
      padding: 8px 24px 22px;
      overflow-y: auto;
      transition: max-height 0.28s var(--ease), opacity 0.2s var(--ease), padding 0.28s var(--ease), visibility 0s;
    }
    .nav-item { display: block; }
    .nav-link {
      display: block;
      font-size: 17px;
      opacity: 0.92;
      padding: 16px 0;
      border-bottom: 1px solid rgba(248,246,241,0.08);
    }
    .nav-item-has-menu > .nav-link::after { content: ""; }
    /* sub-menu always visible inline on mobile */
    .nav-menu {
      position: static;
      opacity: 1;
      visibility: visible;
      transform: none;
      box-shadow: none;
      border-top: none;
      min-width: 0;
      padding: 0 0 8px;
      transition: none;
    }
    .nav-menu::before { content: none; }
    .nav-menu-link {
      padding: 13px 0 13px 18px;
      font-size: 15px;
      opacity: 0.7;
      border-left: 2px solid rgba(31,107,90,0.5);
    }
    .nav-links .btn {
      margin-top: 18px;
      padding: 18px 22px;
      font-size: 16px;
      width: 100%;
    }
}
