/* ============================================================
   SECTION SUB-NAV — sticky anchor band (cream + navy + gold)
   ASI design system; pairs with /section-subnav.js
   v0.7.1 — 2026-04-25
   ============================================================ */

/* Invisible anchor span used when the section already has an ID
   reserved for another purpose (e.g., the methodology section
   carries id="methodology" but the sub-nav links to #domains). */
.subnav-anchor {
  display: block;
  position: relative;
  top: -120px;          /* offset for sticky top-nav (64) + subnav (~48) */
  height: 0;
  width: 0;
  overflow: hidden;
  pointer-events: none;
}

.section-subnav {
  position: sticky;
  top: 64px;            /* sits flush below the floating glass nav */
  z-index: 90;
  background: var(--color-bg);
  border-top: 1px solid rgba(15, 27, 45, 0.06);
  border-bottom: 1px solid rgba(15, 27, 45, 0.06);
  transition:
    background 0.25s ease,
    box-shadow 0.25s ease,
    backdrop-filter 0.25s ease,
    border-color 0.25s ease;
}

/* "Stuck" state — applied via JS once the band actually reaches the
   top boundary. Adds a frosted glass treatment that kisses the
   floating top-nav language without competing with it. */
.section-subnav.is-stuck {
  background: rgba(247, 244, 236, 0.92); /* cream @ 92% */
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 24px rgba(15, 27, 45, 0.06);
  border-top-color: transparent;
}

.section-subnav-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 0 var(--space-8);
  position: relative;
}

.section-subnav-list {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.section-subnav-list::-webkit-scrollbar { display: none; }

.section-subnav-list a {
  display: inline-flex;
  align-items: center;
  padding: 14px 0;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-navy-text-muted, var(--color-text-muted));
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.section-subnav-list a:hover {
  color: var(--color-gold);
}
.section-subnav-list a.is-active {
  color: var(--color-navy);
  border-bottom-color: var(--color-gold);
}

/* Right-edge fade hint when the bar is horizontally scrollable
   (mobile and narrow viewports). Hidden by default; shown on small. */
.section-subnav-inner::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 32px;
  pointer-events: none;
  background: linear-gradient(to right, transparent, var(--color-bg));
  opacity: 0;
  transition: opacity 0.2s ease, background 0.25s ease;
}

@media (max-width: 720px) {
  .section-subnav-inner { padding: 0 var(--space-4); }
  .section-subnav-list { gap: var(--space-5); }
  .section-subnav-inner::after { opacity: 1; }
  .section-subnav.is-stuck .section-subnav-inner::after {
    background: linear-gradient(to right, transparent, rgba(247, 244, 236, 0.92));
  }
}

/* Honor the user's reduced-motion preference. */
@media (prefers-reduced-motion: reduce) {
  .section-subnav,
  .section-subnav-list a,
  .section-subnav-inner::after {
    transition: none;
  }
  html { scroll-behavior: auto; }
}
