/* ============================================================
   LONGIPATH — Shared Navigation Styles
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,700;0,900;1,700&family=DM+Sans:wght@300;400;500;600;700&display=swap');

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --teal:         #1DA8A0;
  --teal-light:   #5EC4BD;
  --dark:         #0D3D3D;
  --dark-deep:    #13384A;
  --surface:      #EEF6F5;
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'DM Sans', system-ui, sans-serif;
  --nav-h:        64px;
}

/* ── Top accent stripe ── */
#top-stripe {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--teal), var(--teal-light));
  z-index: 1000;
}

/* ── Frosted nav bar ── */
#site-header {
  position: fixed;
  top: 4px; left: 0; right: 0;
  height: var(--nav-h);
  background: rgba(238, 246, 245, 0.92);
  backdrop-filter: blur(18px) saturate(160%);
  -webkit-backdrop-filter: blur(18px) saturate(160%);
  border-bottom: 1px solid rgba(29, 168, 160, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1.5rem, 4vw, 4rem);
  z-index: 999;
  /* No overflow:hidden — dropdown must be able to escape */
}

/* ── Wordmark ── */
.site-wordmark {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(1.5rem, 1.9vw, 1.75rem);
  color: var(--dark-deep);
  letter-spacing: -0.025em;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  line-height: 1;
}

.site-wordmark .wm-dot {
  width: 11px;
  height: 11px;
  background: var(--teal);
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(29, 168, 160, 0.18);
}

/* ── Nav container ── */
#site-nav {
  position: static; /* intentionally static so dropdown uses fixed positioning */
  display: flex;
  align-items: center;
}

/* ── Hamburger button ── */
#nav-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 1.5px solid rgba(29, 168, 160, 0.3);
  border-radius: 8px;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}

#nav-hamburger:hover {
  background: rgba(29, 168, 160, 0.08);
  border-color: rgba(29, 168, 160, 0.55);
}

.ham-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: #2D5A6A;
  border-radius: 2px;
  transform-origin: center;
  transition: transform 0.22s ease, opacity 0.18s ease, background 0.18s;
}

#nav-hamburger.open .ham-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
  background: var(--teal);
}
#nav-hamburger.open .ham-bar:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
#nav-hamburger.open .ham-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
  background: var(--teal);
}

/* ── Dropdown panel ──
   Uses position:fixed (not absolute) so it escapes the
   backdrop-filter stacking context of #site-header.
   nav.js sets top/right via JS on open.
── */
#nav-dropdown {
  position: fixed;
  top: calc(var(--nav-h) + 4px + 8px); /* stripe + nav height + gap */
  right: clamp(1rem, 4vw, 4rem);
  min-width: 220px;
  background: rgba(242, 250, 249, 0.98);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(29, 168, 160, 0.2);
  border-radius: 14px;
  box-shadow:
    0 4px 8px rgba(13, 61, 61, 0.07),
    0 16px 40px rgba(13, 61, 61, 0.14);
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 2000; /* above everything */

  /* Hidden state */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.97);
  transform-origin: top right;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0s linear 0.2s;
  pointer-events: none;
}

#nav-dropdown.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: all;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    visibility 0s linear 0s;
}

/* ── Nav links ── */
.nav-link {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #2D5A6A;
  text-decoration: none;
  padding: 0.6rem 1rem;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--teal);
  background: rgba(29, 168, 160, 0.08);
}

.nav-link.active {
  color: var(--teal);
  background: rgba(29, 168, 160, 0.1);
}

.nav-link.active::before {
  content: '';
  width: 5px;
  height: 5px;
  background: var(--teal);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── Divider between nav groups ── */
.nav-divider-rule {
  height: 1px;
  background: rgba(29, 168, 160, 0.14);
  margin: 4px 8px;
}

/* ── Member Portal link ── */
.nav-link.nav-link-portal {
  color: var(--teal);
  font-weight: 700;
  margin-top: 1px;
}

.nav-link.nav-link-portal:hover {
  background: rgba(29, 168, 160, 0.12);
  color: var(--teal);
}

.nav-link.nav-link-portal.active {
  background: rgba(29, 168, 160, 0.15);
}

.nav-link.nav-link-portal.active::before {
  background: var(--teal);
}

.nav-portal-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: rgba(29, 168, 160, 0.12);
  border-radius: 6px;
  flex-shrink: 0;
  color: var(--teal);
}

/* ── Badge pill ── */
.nav-badge-pill {
  font-size: 0.57rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--teal);
  color: #fff;
  padding: 0.1rem 0.42rem;
  border-radius: 4px;
  vertical-align: middle;
  margin-left: 0.25rem;
  line-height: 1.6;
}

/* ── Mobile full-width ── */
@media (max-width: 480px) {
  #nav-dropdown {
    right: 1rem;
    left: 1rem;
    min-width: unset;
  }
}

/* ── Page body offset for fixed nav ── */
.page-body {
  padding-top: calc(var(--nav-h) + 4px);
  font-family: var(--font-body);
  background: var(--surface);
  min-height: 100vh;
}

/* ── Editorial kicker — applied to eyebrows site-wide ──
   Page-level styles set font/color/tracking; nav.css owns the
   layout (inline-flex + leading hairline). The ::before mark
   pulls its colour from currentColor so it inherits whatever
   the page sets on .hero-eyebrow / .section-eyebrow. ── */
.hero-eyebrow,
.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
}
.hero-eyebrow::before,
.section-eyebrow::before {
  content: '';
  width: 28px;
  height: 1.5px;
  background: currentColor;
  opacity: 0.85;
  flex-shrink: 0;
}

/* ── Shared footer legal links ──
   Pages opt in by including <nav class="site-footer-links"> inside
   their existing <footer> element. Colour is inherited from the
   parent footer; spacing and hover state are standardized here. ── */
.site-footer-links {
  display: flex;
  gap: 1.25rem;
  align-items: center;
  flex-wrap: wrap;
}
.site-footer-links a {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: inherit;
  opacity: 0.85;
  transition: opacity 0.15s, color 0.15s;
}
.site-footer-links a:hover {
  opacity: 1;
  color: var(--teal-light);
}
