/* ==========================================================================
   STAY FREE ENTERPRISE — nav component
   Two-path grouping (Financial Freedom / Business Freedom, Ruling 4) +
   single coral CTA. Progressive enhancement: markup works with zero JS
   (groups render as static link lists); nav.js upgrades the groups into
   dropdowns and adds the mobile toggle. Consumes tokens.css only.
   ========================================================================== */

.sf-nav--component {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sf-space-4);
  padding: var(--sf-space-3) var(--sf-space-4);
  background: rgba(250, 247, 242, 0.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(14, 74, 60, 0.12);
}
.sf-nav--component.sf-nav--scrolled {
  box-shadow: var(--sf-elevation-1);
}

.sf-nav__mark {
  font-family: var(--sf-font-display);
  font-size: var(--sf-text-md);
  font-weight: 560;
  white-space: nowrap;
  color: var(--sf-teal); /* 2026-07-11: WHOLE wordmark in Emerald Empire, uniform (Anthony: no two-tone) */
}
/* a11y: gold (#C6A45C) on ivory measures ~1.9:1 — fails WCAG AA (4.5:1) for
   text at any weight this small. Per plan §2, teal is the palette's own
   "contrast anchor" color; swapping the wordmark accent to it keeps the
   mark fully in-palette (zero new hex) while making it legible. Gold stays
   reserved for material/foil treatments (cards, dividers, icons) where it
   was always meant to read as metal, not as body text. */
.sf-nav__mark-accent { color: inherit; } /* uniform with the rest of the wordmark */

/* ---- mobile toggle (hidden on desktop) ---- */
.sf-nav__toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: var(--sf-space-2);
}
.sf-nav__toggle span {
  width: 22px;
  height: 2px;
  background: var(--sf-teal);
  border-radius: 2px;
  transition: transform var(--sf-dur-fast) var(--sf-ease-out), opacity var(--sf-dur-fast) var(--sf-ease-out);
}
.sf-nav--component[data-nav-open="true"] .sf-nav__toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.sf-nav--component[data-nav-open="true"] .sf-nav__toggle span:nth-child(2) { opacity: 0; }
.sf-nav--component[data-nav-open="true"] .sf-nav__toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---- links row ---- */
.sf-nav__links {
  display: flex;
  align-items: center;
  gap: var(--sf-space-5);
}

/* ---- dropdown group ---- */
.sf-nav__group { position: relative; }
.sf-nav__group-trigger {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: var(--sf-space-1) 0;
}
.sf-nav__group-label {
  color: var(--sf-teal);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-size: 0.68rem;
  display: flex;
  align-items: center;
  gap: 5px;
}
.sf-nav__group-label::after {
  content: "";
  width: 6px; height: 6px;
  border-right: 1.5px solid var(--sf-teal);
  border-bottom: 1.5px solid var(--sf-teal);
  transform: rotate(45deg) translateY(-2px);
  transition: transform var(--sf-dur-fast) var(--sf-ease-out);
}
.sf-nav__group[data-open="true"] .sf-nav__group-label::after { transform: rotate(225deg) translateY(2px); }

.sf-nav__group-sub {
  font-size: var(--sf-text-sm);
  color: var(--sf-text-secondary);
}

.sf-nav__group-panel {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translate(-50%, -6px);
  min-width: 220px;
  background: var(--sf-ivory);
  border: 1px solid rgba(14, 74, 60, 0.14);
  border-radius: var(--sf-radius-md);
  box-shadow: var(--sf-elevation-3);
  padding: var(--sf-space-2);
  display: flex;
  flex-direction: column;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--sf-dur-fast) var(--sf-ease-out),
              transform var(--sf-dur-fast) var(--sf-ease-out),
              visibility var(--sf-dur-fast);
}
.sf-nav__group[data-open="true"] .sf-nav__group-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, 0);
}
.sf-nav__group-panel a {
  padding: var(--sf-space-2) var(--sf-space-3);
  border-radius: var(--sf-radius-sm);
  font-size: var(--sf-text-sm);
  color: var(--sf-text-primary);
  transition: background var(--sf-dur-fast) var(--sf-ease-out);
}
.sf-nav__group-panel a:hover,
.sf-nav__group-panel a:focus-visible { background: var(--sf-sand); }

/* ---- no-JS fallback: groups render as static inline lists ---- */
.sf-nav--component:not([data-nav-enhanced]) .sf-nav__group-panel {
  position: static;
  opacity: 1; visibility: visible; pointer-events: auto;
  transform: none;
  flex-direction: row;
  flex-wrap: wrap;
  box-shadow: none;
  border: none;
  padding: 0;
  background: none;
  gap: var(--sf-space-2);
}
.sf-nav--component:not([data-nav-enhanced]) .sf-nav__group-label::after { display: none; }

/* ---- mobile ---- */
@media (max-width: 860px) {
  .sf-nav__toggle { display: flex; }
  .sf-nav__links {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--sf-ivory);
    border-bottom: 1px solid rgba(14, 74, 60, 0.14);
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: var(--sf-space-3) var(--sf-space-4) var(--sf-space-4);
    box-shadow: var(--sf-elevation-2);
    display: none;
  }
  .sf-nav--component[data-nav-open="true"] .sf-nav__links { display: flex; }
  .sf-nav__group-panel {
    position: static; transform: none; opacity: 1; visibility: visible; pointer-events: auto;
    box-shadow: none; border: none; padding-left: var(--sf-space-3);
  }
  .sf-nav__group { border-bottom: 1px solid rgba(14, 74, 60,.08); padding-block: var(--sf-space-2); }
  .sf-nav__links .sf-cta { margin-top: var(--sf-space-3); align-self: flex-start; }
}

/* real logo pin in the nav mark (added 2026-07-10 logo swap) */
.sf-nav__mark { display: inline-flex; align-items: center; gap: 10px; }
.sf-nav__mark-pin { height: 32px; width: auto; display: block; }

/* hover bridge (2026-07-10): invisible strip covering the trigger→panel gap so
   the pointer never technically leaves the group while traveling down. */
.sf-nav__group-panel::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: -16px; height: 16px;
}

/* wordmark spacing fix (2026-07-11): text is ONE flex item so "Free"/"Enterprise"
   get a normal word space; the 10px gap now only separates pin from text. */
.sf-nav__mark-text { white-space: nowrap; }
/* (removed 2026-07-11: the natural word space is correct on its own; the extra margin read as a gap) */

/* plain (no-dropdown) nav links: Results, About — same voice as the group
   labels, vertically centered against the two-line groups */
.sf-nav__plain {
  align-self: center;
  color: var(--sf-teal);
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  font-size: 0.68rem;
  padding: var(--sf-space-2) 0;
}
.sf-nav__plain:hover, .sf-nav__plain:focus-visible { color: var(--sf-coral-hover); }
