/* ============================================================
   understand-veganism.com — Phase 1 visual refinements
   Verified against the live page (real class names & tokens).
   Load AFTER the main stylesheet so it wins the cascade.
   Add to <head>:
   <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500&display=swap" rel="stylesheet">
   ============================================================ */

:root{
  --font-read:"Inter",system-ui,-apple-system,"Segoe UI",sans-serif;
  --font-mono:"IBM Plex Mono",monospace;
  --ink-soft:#4a4642;
}

/* 1 + 2. Body copy -> proportional, constrained line length.
   Verified: paragraphs are bare <p> in .principle/.container/section. */
section p, section li,
.container p, .container li,
.principle p, .principle li{
  font-family:var(--font-read);
  font-size:1.0625rem;
  line-height:1.75;
  letter-spacing:0;
}
.container, .principle, section .container{
  max-width:760px;
  margin-left:auto;
  margin-right:auto;
}
/* keep mono where it looks good */
.mini-toc-label, .mini-toc-current,
.eyebrow, .subtitle, .label,
blockquote, .pull-quote, .quote,
code, kbd{ font-family:var(--font-mono); }

/* 3. Rein in the red. */
h2, h3{ color:var(--black) !important; }
.stat-number, .stat .number{ color:var(--ink-soft); }
.stat-number.is-key, .stat.is-key .number{ color:var(--red); }
footer a{ color:var(--ink-soft); text-decoration:underline; text-underline-offset:3px; }
footer a:hover{ color:var(--red); }

/* 4. Nav: lighten + anchor (verified .nav-tabs, fixed, flex-end). */
.nav-tabs{
  justify-content:center;
  flex-wrap:wrap;
  gap:4px 10px;
  background:rgba(30,28,26,0.92);
  backdrop-filter:saturate(140%) blur(6px);
  padding:8px 16px;
  width:100%;
  box-sizing:border-box;
}
.nav-tabs a{
  background:transparent;
  border:0;
  color:var(--white);
  font-size:0.72rem;
  padding:6px 8px;
  opacity:0.82;
  border-bottom:2px solid transparent;
  transition:opacity .15s, border-color .15s;
}
.nav-tabs a:hover,
.nav-tabs a[aria-current="page"]{ opacity:1; border-bottom-color:var(--red); }

/* 5. Language selector: small + quiet (was a full-width red bar). */
select{
  background:transparent !important;
  color:var(--white) !important;
  border:1px solid rgba(247,243,238,0.35) !important;
  max-width:200px;
  margin:0 auto;
  font-family:var(--font-mono);
  font-size:0.8rem;
  padding:6px 12px;
  border-radius:4px;
}

/* 6. CTA hierarchy. Add class="cta-secondary" to the
   "Leslie Cross Archive" and "SIC" buttons in the markup;
   leave "Take the Quiz" as the primary red button.
   Also relabel "SIC" -> "Single-issue campaigns". */
.cta-button{ display:inline-block; padding:16px 40px; }
.cta-button.cta-secondary{
  background:transparent;
  color:var(--white);
  border:2px solid rgba(247,243,238,0.4);
}
.cta-button.cta-secondary:hover{ border-color:var(--red); color:var(--red); }

/* 7. Reading-progress indicator: stop nav overlap + clipping. */
.mini-toc-current{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  max-width:40vw;
}
.mini-toc-label{ white-space:nowrap; }

/* 8. Remove doubled bullet+numeral on the big-numeral lists.
   Real class is .key-points; <ol> children already get list-style:none,
   but <ul> children don't, so both the disc bullet and the ::before
   numeral were showing. */
.key-points ul{ list-style:none; padding-left:0; }
.key-points ul > li{ padding-left:4rem; }
@media (max-width:768px){ .key-points ul > li{ padding-left:2.75rem; } }

/* 9. Mobile. */
@media (max-width:640px){
  .container, .principle, section .container{ max-width:100%; }
  .nav-tabs{ gap:2px 6px; padding:6px 8px; }
  .nav-tabs a{ font-size:0.68rem; padding:5px 6px; }
  .cta-button{ display:block; width:100%; box-sizing:border-box; }
}

/* ============================================================
   Phase 3 #13 — Nav grouping (dropdowns).
   Replaces the 9-flat-tab nav with: Home / What is veganism ▾ /
   Common confusions ▾ / History ▾ / Ask a question / Take the quiz.
   CSS-only on hover/focus-within; small JS handles click toggle.
   ============================================================ */
.nav-tabs{
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 4px 18px;
}
.nav-tabs .nav-link,
.nav-tabs .nav-trigger{
  background: transparent;
  border: 0;
  color: var(--white);
  font-family: 'Archivo Black', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 6px 8px;
  opacity: 0.82;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: opacity .15s, border-color .15s;
}
.nav-tabs .nav-link:hover,
.nav-tabs .nav-trigger:hover,
.nav-group:focus-within > .nav-trigger,
.nav-group:hover > .nav-trigger{ opacity: 1; border-bottom-color: var(--red); }
.nav-group{ position: relative; }
.nav-dropdown{
  display: none;
  position: absolute;
  top: 100%; left: 50%;
  transform: translateX(-50%);
  min-width: 220px;
  background: rgba(30,28,26,0.98);
  border: 1px solid rgba(247,243,238,0.12);
  border-top: 3px solid var(--red);
  padding: 4px 0;
  z-index: 1100;
  box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}
.nav-group:hover .nav-dropdown,
.nav-group:focus-within .nav-dropdown,
.nav-trigger[aria-expanded="true"] + .nav-dropdown{ display: block; }
.nav-dropdown a{
  display: block;
  padding: 10px 16px;
  font-family: 'Archivo Black', sans-serif;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--white);
  opacity: 0.85;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.nav-dropdown a:hover{ opacity: 1; background: rgba(192,57,43,0.18); color: var(--red); }
.caret{ display: inline-block; margin-left: 4px; font-size: 0.55em; transform: translateY(-1px); }

/* Active page indicators (set aria-current="page" on the matching link). */
.nav-tabs .nav-link[aria-current="page"]{ opacity: 1; border-bottom-color: var(--red); }
.nav-dropdown a[aria-current="page"]{ opacity: 1; background: rgba(192,57,43,0.18); color: var(--red); }
.nav-group:has([aria-current="page"]) > .nav-trigger{ opacity: 1; border-bottom-color: var(--red); }

/* Mobile: dropdowns stack inline rather than overlay (no hover on touch). */
@media (max-width: 640px){
  .nav-tabs{ position: static; padding: 8px 6px; }
  .nav-group{ width: auto; }
  .nav-group:hover .nav-dropdown{ display: none; } /* disable hover-open on touch */
  .nav-trigger[aria-expanded="true"] + .nav-dropdown{
    display: block;
    position: static;
    transform: none;
    width: 100%;
    min-width: 0;
    margin-top: 4px;
  }
}

/* ============================================================
   Ask-a-question modal (iframe vegan-qa.vercel.app).
   Added so the Q&A chatbot opens in-place across all pages
   rather than navigating away to the external site.
   ============================================================ */
body.qa-open { overflow: hidden; }
.qa-modal { position: fixed; inset: 0; z-index: 2000; background: rgba(30,28,26,0.96); display: flex; flex-direction: column; padding: 64px 24px 24px; backdrop-filter: blur(4px); }
.qa-modal[hidden] { display: none; }
.qa-modal-close { position: absolute; top: 16px; right: 20px; background: var(--white); color: var(--black); border: 3px solid var(--black); width: 44px; height: 44px; font-size: 24px; line-height: 1; cursor: pointer; z-index: 2; font-family: 'Archivo Black', sans-serif; transition: background 0.15s, color 0.15s; padding: 0; }
.qa-modal-close:hover { background: var(--red); color: var(--white); border-color: var(--red); }
.qa-modal-frame-wrap { flex: 1; max-width: 960px; width: 100%; margin: 0 auto; background: var(--white); border: 4px solid var(--red); overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.6); }
#qa-modal-iframe { width: 100%; height: 100%; border: 0; display: block; }
@media (max-width: 640px) { .qa-modal { padding: 56px 8px 8px; } .qa-modal-close { top: 8px; right: 8px; width: 40px; height: 40px; } }
