/*
 * AquaFromAir — Nav Dropdown Styles
 * Enqueue globally via functions.php (css/nav-dropdown.css)
 */

/* ─── DESKTOP: parent li needs relative positioning ─── */
.nav-links li {
  position: relative;
  list-style: none;
  display: flex;
  align-items: center;
}

/* ─── CHEVRON on parent trigger ─────────────────────── */
.nav-links .menu-item-has-children > a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* Kill the ::after underline on parent — chevron is separate */
.nav-links .menu-item-has-children > a::after {
  display: none !important;
}

/* Active underline */
.nav-links .menu-item-has-children.current-menu-item > a,
.nav-links .menu-item-has-children.current-menu-ancestor > a {
  color: var(--teal);
  text-decoration: underline;
  text-decoration-color: var(--teal);
  text-underline-offset: 6px;
  text-decoration-thickness: 1.5px;
}

/* Chevron span */
.nav-links .menu-item-has-children > a .nav-chevron {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 1.8px solid var(--text);
  border-bottom: 1.8px solid var(--text);
  transform: rotate(45deg) translateY(-2px);
  transition: border-color 0.2s, transform 0.2s;
  flex-shrink: 0;
}
.nav-links .menu-item-has-children:hover > a .nav-chevron {
  border-color: var(--teal);
  transform: rotate(225deg) translateY(2px);
}

/* ─── GAP FIX ────────────────────────────────────────
   Invisible bridge between the nav link and the panel
   so the hover state survives the cursor traveling down.
──────────────────────────────────────────────────────── */
.nav-links .sub-menu::before {
  content: '';
  position: absolute;
  top: -20px;
  left: 0;
  right: 0;
  height: 20px;
  background: transparent;
}

/* ─── DROPDOWN PANEL ─────────────────────────────────── */
.nav-links .sub-menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(-4px);
  min-width: 210px;
  background: var(--abyss);
  border: 1px solid rgba(134, 204, 224, 0.12);
  border-radius: 3px;
  box-shadow: 0 12px 40px rgba(26, 43, 44, 0.22), 0 2px 8px rgba(26, 43, 44, 0.12);
  list-style: none;
  padding: 8px 0;
  margin: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
  z-index: 200;
}

/* Arrow notch */
.nav-links .sub-menu::after {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%) rotate(45deg);
  width: 9px;
  height: 9px;
  background: var(--abyss);
  border-left: 1px solid rgba(134, 204, 224, 0.12);
  border-top: 1px solid rgba(134, 204, 224, 0.12);
}

/* Reveal on hover — on the li so cursor entering the panel keeps it alive */
.nav-links .menu-item-has-children:hover > .sub-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0);
}

/* ─── DROPDOWN ITEMS ─────────────────────────────────── */
.nav-links .sub-menu li {
  position: static;
}

.nav-links .sub-menu a {
  display: flex;
  align-items: center;
  padding: 7px 20px;
  font-family: 'Jost', sans-serif;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, padding-left 0.15s;
  position: relative;
}

/* Kill any inherited underline pseudo on sub-menu links */
.nav-links .sub-menu a::after,
.nav-links .sub-menu a::before {
  display: none !important;
}

.nav-links .sub-menu a:hover {
  background: rgba(134, 204, 224, 0.08);
  color: var(--aqua);
  padding-left: 26px;
}

/* Hairline divider between items */
.nav-links .sub-menu li + li {
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ─── MOBILE DRAWER ──────────────────────────────────── */
.nav-drawer .menu-item-has-children {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
}
.nav-drawer .menu-item-has-children > a {
  flex: 1;
  min-width: 0;
}
.drawer-toggle-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0 24px;
  color: var(--text);
  border-bottom: 1px solid rgba(61, 122, 128, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: color 0.2s, background 0.2s;
}
.drawer-toggle-btn:hover { color: var(--teal); }
.drawer-toggle-btn svg { transition: transform 0.25s ease; display: block; }

.nav-drawer .sub-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 100%;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
  background: rgba(61, 122, 128, 0.05);
  border-top: 1px solid rgba(61, 122, 128, 0.08);
}
.nav-drawer .menu-item-has-children.drawer-open > .sub-menu {
  max-height: 600px;
}

.nav-drawer .sub-menu li a {
  display: block;
  padding: 11px 28px 11px 44px;
  font-family: 'Jost', sans-serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--teal);
  text-decoration: none;
  border-bottom: 1px solid rgba(61, 122, 128, 0.06);
  transition: background 0.15s, color 0.15s;
}

.nav-drawer .sub-menu li a:hover {
  background: rgba(61, 122, 128, 0.08);
  color: var(--teal-deep);
}
