/* ─────────────────────────────────────────────────────────────
   NORDAM — Slide-out Drawer Navigation Styles
   Add to main.css or enqueue as a separate partial.
   Uses Barlow + Barlow Condensed + JetBrains Mono.
   Enqueue fonts in functions.php if not already loaded.
───────────────────────────────────────────────────────────────*/

/* ── Variables ────────────────────────────────────────────── */
:root {
  --nd-navy: #0d1a4a;
  --nd-navy-mid: #13216a;
  --nd-gold: #c8940a;
  --nd-gold-bright: #e8ab12;
  --nd-surface: #fff;
  --nd-surface-2: #dee0ea;
  --nd-surface-3: #242f42;
  --nd-line: rgba(255, 255, 255, 0.07);
  --nd-line-gold: rgba(200, 148, 10, 0.35);
  --nd-text-1: #c8940a;
  --nd-text-2: #13216a;
  --nd-text-3: #13216a;
  --nd-drawer-w: 710px;
  --nd-nav-w: 220px;
  --nd-head-h: 64px;
  --nd-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Body lock when menu open ─────────────────────────────── */
body.nd-menu-open {
  overflow: hidden;
}

/* ── Hide the old mobile menu area entirely ───────────────── */
/* The new drawer (#nd-drawer) replaces it completely.        */
.mobile-menu-area {
  display: none !important;
}

/* ── Overlay ──────────────────────────────────────────────── */
.nd-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(5, 8, 20, 0.72);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s var(--nd-ease);
}
.nd-overlay.is-visible {
  opacity: 1;
  pointer-events: all;
}

/* ── Drawer ───────────────────────────────────────────────── */
.nd-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--nd-drawer-w);
  background: var(--nd-surface);
  z-index: 300;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.42s var(--nd-ease);
  will-change: transform;
  border-left: 1px solid var(--nd-line);
}
.nd-drawer.is-open {
  transform: translateX(0);
}

/* Drawer head */
.nd-drawer__head {
  height: var(--nd-head-h);
  background: var(--nd-navy);
  display: flex;
  align-items: center;
  padding: 0 0 0 24px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--nd-line-gold);
  position: relative;
}
.nd-drawer__head::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 48px;
  height: 2px;
  background: var(--nd-gold);
}
.nd-drawer__logo {
  display: flex;
  align-items: center;
  flex: 1;
  text-decoration: none;
}
.nd-drawer__logo-img {
  height: 28px;
  display: block;
}

.nd-drawer__close {
  width: var(--nd-head-h);
  height: var(--nd-head-h);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: none;
  border: none;
  border-left: 1px solid var(--nd-line);
  color: var(--nd-text-3);
  transition:
    color 0.15s,
    background 0.15s;
  flex-shrink: 0;
}
.nd-drawer__close:hover {
  color: var(--nd-gold);
  background: rgba(200, 148, 10, 0.08);
}
.nd-drawer__close svg {
  width: 16px;
  height: 16px;
}

/* Drawer body */
.nd-drawer__body {
  display: flex;
  flex: 1;
  overflow: hidden;
}

/* ── Left nav column ──────────────────────────────────────── */
.nd-nav {
  width: var(--nd-nav-w);
  background: var(--nd-surface-2);
  border-right: 1px solid var(--nd-line);
  overflow-y: auto;
  flex-shrink: 0;
  padding: 0;
}

.nd-nav__item {
  position: relative;
  display: flex;
  align-items: stretch;
  border-left: 2px solid transparent;
  transition:
    border-color 0.15s,
    background 0.15s;
  cursor: pointer;
}
.nd-nav__item:hover {
  background: rgba(255, 255, 255, 0.04);
}
.nd-nav__item.is-active {
  background: var(--nd-surface-3);
  border-left-color: var(--nd-gold);
}

.nd-nav__link {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 13px 0 13px 18px;
  font-family: "Barlow", sans-serif;
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: var(--nd-text-2);
  text-decoration: none;
  transition: color 0.15s;
  position: relative;
  z-index: 1;
}
.nd-nav__item:hover .nd-nav__link,
.nd-nav__item.is-active .nd-nav__link {
  color: var(--nd-text-1);
}

/* Chevron — the panel-switch button */
.nd-nav__chevron {
  width: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 6px 8px 6px 0;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  transition:
    background 0.15s,
    border-color 0.15s;
  cursor: pointer;
  position: relative;
  z-index: 1;
}
.nd-nav__chevron:hover {
  background: rgba(200, 148, 10, 0.18);
  border-color: var(--nd-gold);
}
.nd-nav__chevron svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: var(--nd-text-2);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition:
    stroke 0.15s,
    transform 0.2s;
}
.nd-nav__chevron:hover svg {
  stroke: var(--nd-gold-bright);
  transform: translateX(2px);
}
.nd-nav__item.is-active .nd-nav__chevron {
  background: rgba(200, 148, 10, 0.2);
  border-color: var(--nd-gold);
}
.nd-nav__item.is-active .nd-nav__chevron svg {
  stroke: var(--nd-gold);
  transform: translateX(2px);
}

.nd-nav__sep {
  height: 1px;
  background: var(--nd-line);
  margin: 6px 16px;
}

/* ── Right content panels ─────────────────────────────────── */
.nd-content {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--nd-surface);
}

.nd-panel {
  display: none;
  padding: 28px 28px 24px;
}
.nd-panel.is-active {
  display: block;
  animation: nd-panel-in 0.22s var(--nd-ease) both;
}
@keyframes nd-panel-in {
  from {
    opacity: 0;
    transform: translateX(8px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Panel header */
.nd-panel__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--nd-line);
}
.nd-panel__eyebrow {
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  color: var(--nd-gold);
}
.nd-panel__viewall {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: "Barlow", sans-serif;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--nd-text-3);
  text-decoration: none;
  transition: color 0.15s;
}
.nd-panel__viewall:hover {
  color: var(--nd-gold);
}
.nd-panel__viewall svg {
  width: 10px;
  height: 10px;
  transition: transform 0.2s;
}
.nd-panel__viewall:hover svg {
  transform: translateX(3px);
}

/* Panel grid */
.nd-panel__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 32px;
}
.nd-panel__grid--solo {
  grid-template-columns: 1fr;
}

/* Link groups */
.nd-group {
  margin-bottom: 24px;
  animation: nd-group-in 0.3s var(--nd-ease) both;
}
.nd-panel.is-active .nd-group:nth-child(1) {
  animation-delay: 0.04s;
}
.nd-panel.is-active .nd-group:nth-child(2) {
  animation-delay: 0.08s;
}
.nd-panel.is-active .nd-group:nth-child(3) {
  animation-delay: 0.12s;
}
.nd-panel.is-active .nd-group:nth-child(4) {
  animation-delay: 0.16s;
}
@keyframes nd-group-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.nd-group__label {
  font-family: "JetBrains Mono", monospace;
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--nd-text-3);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.nd-group__label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--nd-line);
}
.nd-group__label-link {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s;
}
.nd-group__label-link:hover {
  color: var(--nd-gold);
}

.nd-link {
  display: flex;
  align-items: center;
  gap: 0;
  padding: 8px 0;
  font-family: "Barlow", sans-serif;
  font-size: 13px;
  font-weight: 400;
  color: var(--nd-text-2);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition:
    color 0.15s,
    padding-left 0.18s var(--nd-ease);
}
.nd-link::before {
  content: "";
  display: inline-block;
  width: 0;
  height: 1px;
  background: var(--nd-gold);
  flex-shrink: 0;
  transition:
    width 0.2s var(--nd-ease),
    margin-right 0.2s var(--nd-ease);
  vertical-align: middle;
}
.nd-link:hover {
  color: var(--nd-text-1);
}
.nd-link:hover::before {
  width: 12px;
  margin-right: 8px;
}

/* ── Search panel ─────────────────────────────────────────── */
.nd-search-panel {
  padding-top: 4px;
}
.nd-search-panel__field {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--nd-surface-3);
  border: 1px solid var(--nd-line);
  border-radius: 3px;
  padding: 0 16px;
  height: 44px;
  transition: border-color 0.15s;
}
.nd-search-panel__field:focus-within {
  border-color: var(--nd-gold);
}
.nd-search-panel__field svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--nd-text-3);
}
.nd-search-panel__field input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-family: "Barlow", sans-serif;
  font-size: 13px;
  color: #c8940a !important;
}
.nd-search-panel__field input::placeholder {
  color: #c8940a !important;
}

/* ── Drawer footer ────────────────────────────────────────── */
.nd-drawer__foot {
  height: 56px;
  background: var(--nd-surface-2);
  border-top: 1px solid var(--nd-line);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 10px;
  flex-shrink: 0;
}

.nd-foot-pill {
  font-family: "Barlow Condensed", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  padding: 7px 16px;
  border-radius: 2px;
  white-space: nowrap;
  transition:
    background 0.15s,
    color 0.15s,
    border-color 0.15s;
}
.nd-foot-pill--primary {
  background: var(--nd-gold);
  color: #0a0f1e;
  border: 1px solid transparent;
}
.nd-foot-pill--primary:hover {
  background: var(--nd-gold-bright);
}
.nd-foot-pill--ghost {
  background: transparent;
  color: var(--nd-text-2);
  border: 1px solid var(--nd-line);
}
.nd-foot-pill--ghost:hover {
  border-color: rgba(255, 255, 255, 0.25);
  color: var(--nd-text-1);
}

.nd-foot-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--nd-surface-3);
  border: 1px solid var(--nd-line);
  border-radius: 2px;
  padding: 0 12px;
  height: 34px;
  transition: border-color 0.15s;
}
.nd-foot-search:focus-within {
  border-color: var(--nd-gold);
}
.nd-foot-search svg {
  width: 12px;
  height: 12px;
  color: var(--nd-text-3);
  flex-shrink: 0;
}
.nd-foot-search input {
  background: none;
  border: none;
  outline: none;
  font-family: "Barlow", sans-serif;
  font-size: 12px;
  color: var(--nd-text-1);
  width: 140px;
}
.nd-foot-search input::placeholder {
  color: var(--nd-text-1);
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE — Mobile (≤ 982px)
   Collapses the two-column drawer into a single-pane
   vertical accordion. The left nav becomes a full-width
   list of tappable parent rows; tapping a row expands its
   children inline below it.
═══════════════════════════════════════════════════════════ */
@media screen and (max-width: 982px) {
  /* Full-width drawer — slides up from bottom edge of header */
  .nd-drawer {
    width: 100%;
    top: 0;
    border-left: none;
    border-top: 3px solid var(--nd-gold);
  }

  /* ── Drawer head ──────────────────────────────────────── */
  .nd-drawer__head {
    padding: 0 16px;
  }
  .nd-drawer__logo-img {
    height: 24px;
  }
  .nd-drawer__close {
    width: 56px;
  }

  /* ── Body: stack columns vertically ──────────────────── */
  .nd-drawer__body {
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
  }

  /* ── Left nav: full-width accordion trigger list ──────── */
  .nd-nav {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--nd-line);
    padding: 0;
    /* Don't scroll independently — body scrolls */
    overflow: visible;
  }

  .nd-nav__item {
    border-left: none;
    border-bottom: 1px solid var(--nd-line);
    flex-wrap: wrap; /* allow panel to expand below */
  }
  .nd-nav__item:last-child {
    border-bottom: none;
  }

  /* Remove left-border active indicator; use background instead */
  .nd-nav__item.is-active {
    background: var(--nd-surface-3);
    border-left: none;
  }

  .nd-nav__link {
    padding: 15px 16px;
    font-size: 14px;
  }

  /* Chevron rotates to point down when active */
  .nd-nav__chevron {
    margin: 8px 12px 8px 0;
    width: 40px;
    height: 40px;
  }
  .nd-nav__chevron svg {
    width: 13px;
    height: 13px;
  }
  .nd-nav__item.is-active .nd-nav__chevron svg {
    transform: rotate(90deg);
  }

  .nd-nav__sep {
    display: none;
  }

  /* ── Panels: inline below each nav item ───────────────── */
  .nd-content {
    /* remove as a separate pane — panels live inside .nd-nav now */
    display: none;
  }

  /* On mobile the panels are moved inside each .nd-nav__item
       via JS (see menu.js mobile logic).
       We style .nd-mobile-panel for this inline expansion. */
  .nd-mobile-panel {
    display: none;
    width: 100%;
    background: var(--nd-surface);
    border-top: 1px solid var(--nd-line);
    padding: 20px 20px 16px;
    animation: nd-mobile-panel-in 0.22s var(--nd-ease) both;
  }
  .nd-mobile-panel.is-open {
    display: block;
  }
  @keyframes nd-mobile-panel-in {
    from {
      opacity: 0;
      transform: translateY(-6px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  /* Panels stack single column on mobile */
  .nd-mobile-panel .nd-panel__grid,
  .nd-mobile-panel .nd-panel__grid--solo {
    grid-template-columns: 1fr;
    gap: 0;
  }

  /* Tighter group spacing on mobile */
  .nd-mobile-panel .nd-group {
    margin-bottom: 16px;
  }

  .nd-mobile-panel .nd-panel__header {
    margin-bottom: 16px;
    padding-bottom: 12px;
  }

  /* Slightly larger tap targets for links */
  .nd-mobile-panel .nd-link {
    padding: 10px 0;
    font-size: 14px;
  }

  /* ── Footer: wrap on very small screens ──────────────── */
  .nd-drawer__foot {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 16px;
    gap: 8px;
  }
  .nd-foot-search {
    width: 100%;
    margin-left: 0;
  }
  .nd-foot-search input {
    width: 100%;
  }
}
