/* GoetheCoach editorial layer for the static content pages (articles, level pages;
   the blog index only uses its motion). Injected last in <head> by scripts/article-conversion.mjs, so it
   sits on top of each page's own inline theme. Follows the app's variant C rules:
   navy + yellow stay, yellow only for actions, upright serif titles, hairlines and
   whitespace instead of cards, sentence-case labels, no pills, no glow.
   `:root` prefixes lift specificity above the inline per-page styles. */

:root {
  /* Same tokens as the landing page (src/index.css, tailwind.config.ts). */
  --ed-bg: hsl(222 47% 7%);
  --ed-ink: hsl(210 40% 98%);
  --ed-text: hsl(224 16% 76%);
  --ed-muted: hsl(224 13% 61%);
  --ed-line: hsl(0 0% 100% / 0.07);
  --ed-line-strong: hsl(0 0% 100% / 0.12);
  --ed-action: hsl(45 100% 60%);
  --ed-kicker: #DC9335;
  --ed-measure: 680px;
  --ed-ease: cubic-bezier(.2, .8, .2, 1);
  --ed-display: 'Sora', 'Manrope', sans-serif;
  --ed-sans: 'Manrope', system-ui, -apple-system, sans-serif;
  /* Page themes use --serif for every title; the landing sets titles in Sora. */
  --serif: var(--ed-display);
  --sans: var(--ed-sans);
  --bg: var(--ed-bg);
}
:root, :root body { background: var(--ed-bg); }
:root body { font-family: var(--ed-sans); color: var(--ed-ink); }
:root .nav { background: hsl(222 47% 7% / 0.85); border-bottom-color: var(--ed-line-strong); min-height: 64px; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
:root body { text-rendering: optimizeLegibility; font-feature-settings: "kern", "liga"; }

/* ---------- Reading column ---------- */
:root .hero, :root .content, :root .exam-snapshot, :root .level-nav { max-width: calc(var(--ed-measure) + 48px); }
:root .content { padding-bottom: 96px; }

:root .content p, :root .section p, :root .content li, :root .tips-list li, :root .faq-a {
  font-size: 17px; line-height: 1.7; color: var(--ed-text);
}
:root .content p, :root .section p { margin-bottom: 18px; }
:root .content strong, :root .section strong { color: var(--ed-ink); font-weight: 650; }
:root .content p em, :root .content li em, :root .section em { color: inherit; font-style: italic; }

:root .content h2, :root .section h2 {
  font-family: var(--ed-display); font-size: clamp(24px, 3vw, 30px);
  font-weight: 600; line-height: 1.2; letter-spacing: -0.025em; color: var(--ed-ink);
  margin: 72px 0 16px; text-wrap: balance;
}
:root .section:first-child h2, :root .content > h2:first-child { margin-top: 24px; }
:root .content h3, :root .section h3 {
  font-family: var(--ed-display); font-size: 19px; font-weight: 600; letter-spacing: -0.01em;
  line-height: 1.35; color: var(--ed-ink); margin: 40px 0 10px; text-wrap: balance;
}
:root .section { margin-bottom: 0; }
:root h2[id], :root h3[id], :root .content h2, :root .section h2 { scroll-margin-top: 88px; }

/* Links inside running text: action colour, thin underline that thickens on hover. */
:root .content a:not([class]), :root .section a:not([class]) {
  color: var(--ed-ink); font-weight: 600; text-decoration: underline; text-decoration-thickness: 1px;
  text-underline-offset: 4px; text-decoration-color: hsl(45 100% 60% / 0.6); border-bottom: 0;
  transition: text-decoration-color .2s ease, text-decoration-thickness .2s ease;
}
:root .content a:not([class]):hover, :root .section a:not([class]):hover {
  text-decoration-color: var(--ed-action); text-decoration-thickness: 2px;
}

/* ---------- Hero ---------- */
:root .hero { padding-top: 56px; padding-bottom: 40px; }
:root .hero h1, :root main > h1 {
  font-family: var(--ed-display); font-weight: 600;
  font-size: clamp(34px, 4.6vw, 54px); line-height: 1.06; letter-spacing: -0.02em; text-wrap: balance;
}
:root .hero h1 em { color: inherit; font-style: normal; }
:root .hero-desc, :root .lead {
  font-size: 18px; line-height: 1.6; color: var(--ed-text); font-style: normal;
  border: 0; padding: 0; max-width: 620px; text-wrap: pretty;
}
:root .lead em { color: var(--ed-ink); font-style: normal; font-weight: 600; }
:root .lead, :root .hero-desc { color: var(--ed-text); }
:root .lead strong { color: var(--ed-ink); }

/* Level badge and meta line → a plain kicker, no pill. */
:root .level-badge, :root .badge {
  background: none; border: 0; border-radius: 0; padding: 0; margin-bottom: 18px;
  color: var(--ed-kicker); font-size: 14px; font-weight: 500; letter-spacing: 0.01em; text-transform: none;
}
/* Category kicker (scripts/article-conversion.mjs): main category · two subcategories, all links. */
:root .gc-kicker {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: 0 0 18px;
  font-size: 14px; font-weight: 500; line-height: 1.5; color: var(--ed-muted);
}
:root .gc-kicker a, :root .gc-kicker a:not([class]) {
  color: var(--ed-kicker); font-weight: 500; text-decoration: none; transition: color .2s ease;
}
:root .gc-kicker a:first-child { font-weight: 600; }
:root .gc-kicker a:hover, :root .gc-kicker a:not([class]):hover {
  color: var(--ed-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px;
}
:root .gc-kicker span { opacity: .5; }
:root .meta-row {
  font-size: 13.5px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ed-muted);
}
:root .gc-breadcrumb { font-size: 13.5px; margin-bottom: 20px; }
:root .gc-breadcrumb .sep { opacity: .35; }
:root .gc-breadcrumb, :root .gc-breadcrumb a { color: var(--ed-muted); }
:root .gc-breadcrumb a:hover { color: var(--ed-ink); text-decoration: none; }
:root .gc-breadcrumb [aria-current] { color: var(--ed-text); }

/* Buttons: yellow is the action, nothing glows or jumps. */
:root .btn-primary, :root .nav-cta, :root .tool-cta {
  box-shadow: none; transition: filter .2s ease, background-color .2s ease;
}
:root .btn-primary, :root .btn-secondary {
  display: inline-flex; align-items: center; min-height: 48px; padding: 0 28px; border-radius: 8px; font-size: 15px; font-weight: 700;
}
:root .nav-cta { border-radius: 8px; font-weight: 700; }
:root .btn-primary:hover { transform: none; filter: brightness(1.06); }
:root .btn-secondary { border-color: var(--ed-line-strong); }
:root .btn-secondary:hover { border-color: var(--ed-ink); color: var(--ed-ink); }

/* Phones: the breadcrumb and the logo already lead back, so the header keeps
   only the logo and one CTA on a single line. */
:root .nav-cta { white-space: nowrap; }
@media (max-width: 560px) {
  :root .nav-links > a:not(.nav-cta), :root .nav > a[href*="/blog"]:not(.brand):not(.nav-cta) { display: none; }
  :root .nav { padding-inline: 16px; }
}

/* ---------- Media ---------- */
:root .cover { border: 0; border-radius: 10px; max-width: calc(var(--ed-measure) + 120px); }
:root .gc-infographic img, :root .gc-infographic video,
:root .gc-yt-facade, :root .gc-yt iframe { border-radius: 10px; border-color: var(--ed-line); }
:root .gc-infographic figcaption, :root .gc-yt figcaption { color: var(--ed-muted); font-size: 14px; }
:root .gc-transcript summary { color: var(--ed-text); font-weight: 600; transition: color .2s ease; }
:root .gc-transcript summary:hover { color: var(--ed-ink); }

/* ---------- Exam snapshot: a definition row between hairlines, not a card ---------- */
:root .exam-snapshot {
  background: none; border: 0; border-radius: 0; box-shadow: none;
  border-top: 1px solid var(--ed-line-strong); border-bottom: 1px solid var(--ed-line);
  padding: 24px 0 26px; width: calc(100% - 48px); max-width: var(--ed-measure); margin: 0 auto 40px;
}
:root .exam-snapshot h2 { font-size: 15px; font-family: var(--sans, 'Manrope', sans-serif); font-weight: 600; color: var(--ed-muted); margin-bottom: 16px; }
:root .snapshot-item { border: 0; padding: 0; }
:root .snapshot-label { font-size: 13px; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--ed-muted); }
:root .snapshot-val { font-size: 16px; color: var(--ed-ink); font-variant-numeric: tabular-nums; }

/* ---------- Lists ---------- */
:root .tips-list li { gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--ed-line); }
:root .tips-list li:last-child { border-bottom: 0; }
:root .tips-list li::before {
  width: 6px; height: 6px; margin-top: .75em; border-radius: 50%;
  background: var(--ed-muted); box-shadow: none; flex-shrink: 0;
}
:root .tips-list li::after { display: none; }
:root .content ul:not([class]) li::marker, :root .content ol li::marker { color: var(--ed-muted); }
:root .content ol li::marker { font-variant-numeric: tabular-nums; font-weight: 600; }

/* ---------- Quotes, callouts, rules ---------- */
:root .content blockquote, :root .callout {
  background: none; border: 0; border-radius: 0; font-style: normal;
  font-family: var(--ed-sans); font-size: 19px; font-weight: 500; line-height: 1.55; color: var(--ed-ink);
  padding: 4px 0 4px 24px; margin: 32px 0; box-shadow: inset 1px 0 0 var(--ed-line-strong);
}
[dir="rtl"] .content blockquote, [dir="rtl"] .callout { padding: 4px 24px 4px 0; box-shadow: inset -1px 0 0 var(--ed-line-strong); }
:root hr.section-divider, :root .content hr { border: 0; border-top: 1px solid var(--ed-line); margin: 56px 0; }
:root hr.section-divider::after { display: none; }

/* ---------- Tables: horizontal hairlines only ---------- */
:root .table-wrap { margin: 28px 0 36px; }
:root .content table, :root .section table { font-size: 15px; font-variant-numeric: tabular-nums; }
:root .content th, :root .content td, :root .section th, :root .section td {
  border: 0; border-bottom: 1px solid var(--ed-line); padding: 12px 16px 12px 0; vertical-align: top;
}
:root .content th, :root .section th {
  background: none; color: var(--ed-muted); font-size: 13.5px; font-weight: 600;
  border-bottom-color: var(--ed-line-strong); text-transform: none; letter-spacing: 0;
}
:root .content code { background: hsla(0, 0%, 100%, .05); border: 0; }

/* ---------- FAQ ---------- */
:root .faq-item { padding: 20px 0; border-bottom: 1px solid var(--ed-line); }
:root .faq-q, :root .content .faq-q, :root .section .faq-q { font-family: var(--ed-sans); font-size: 17px; font-weight: 600; letter-spacing: 0; color: var(--ed-ink); margin: 0 0 8px; }

/* ---------- Closing CTA: a section, not a gradient slab ---------- */
:root .cta-block {
  background: none; color: var(--ed-ink); border: 0; border-top: 1px solid var(--ed-line-strong);
  border-radius: 0; box-shadow: none; padding: 56px 0 8px; margin-top: 72px; text-align: center;
}
:root .cta-block::before { width: 32px; height: 32px; color: var(--ed-kicker); margin-bottom: 18px; }
:root .cta-block h2 { color: var(--ed-ink); font-size: clamp(26px, 3.4vw, 36px); font-weight: 600; letter-spacing: -0.025em; margin: 0 0 12px; }
:root .cta-block p { color: var(--ed-text); opacity: 1; max-width: 520px; margin: 0 auto 26px; }
:root .cta-block a, :root .cta-block a:not([class]) {
  display: inline-block; text-decoration: none; color: hsl(222 47% 7%);
  background: var(--ed-action); color: hsl(222 47% 7%); border-radius: 8px; padding: 14px 32px; font-size: 16px;
  font-weight: 700; box-shadow: none; transition: filter .2s ease;
}
:root .cta-block a:hover, :root .cta-block a:not([class]):hover { background: var(--ed-action); filter: brightness(1.06); }
:root .inline-cta a { text-decoration-thickness: 1px; }

/* ---------- Level navigation: text links, active = stronger ink ---------- */
:root .level-nav { border-top: 1px solid var(--ed-line); }
:root .level-nav p { font-size: 13.5px; font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--ed-muted); }
:root .level-pills { gap: 4px 22px; }
:root .level-pill {
  background: none; border: 0; border-radius: 0; padding: 4px 0; font-size: 15px; font-weight: 500;
  color: var(--ed-muted); transition: color .2s ease;
}
:root .level-pill:hover { color: var(--ed-ink); border: 0; }
:root .level-pill.active { background: none; color: var(--ed-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1.5px; }

/* ---------- Share + follow: quiet, no brand-colour flashes ---------- */
:root .gc-share-label { font-size: 13.5px; font-weight: 500; color: var(--ed-muted); }
:root .gc-share-btn {
  width: 34px; height: 34px; background: none; border-color: var(--ed-line); color: var(--ed-muted);
}
:root .gc-share-btn svg { width: 16px; height: 16px; }
:root .gc-share-btn:hover, :root .gc-share-facebook:hover, :root .gc-share-x:hover {
  transform: none; background: none; border-color: var(--ed-line-strong); color: var(--ed-ink);
}
:root .gc-share--top { margin-top: 24px; }
:root .gc-share--bottom { border-top-color: var(--ed-line); }
:root .gc-follow-btn { background: none; border-color: var(--ed-line); color: var(--ed-text); font-weight: 500; }
:root .gc-follow-btn:hover, :root .gc-follow-btn.gc-share-instagram:hover, :root .gc-follow-btn.gc-share-x:hover,
:root .gc-follow-btn.gc-share-tiktok:hover, :root .gc-follow-btn.gc-share-youtube:hover {
  transform: none; background: none; box-shadow: none; border-color: var(--ed-line-strong); color: var(--ed-ink);
}

/* ---------- Related articles: image + words, no card surface ---------- */
:root .related-articles { text-align: start; font-size: 16px; }
:root .related-articles h2 { font-family: var(--ed-display); font-size: clamp(24px, 3vw, 30px); font-weight: 600; letter-spacing: -0.025em; margin-bottom: 28px; }
:root .related-grid { gap: 40px 28px; }
:root .related-card { background: none; border: 0; border-radius: 0; box-shadow: none; }
:root .related-card:hover { transform: none; box-shadow: none; border: 0; }
:root .related-cover { border-radius: 8px; background: hsl(222 37% 13%); }
:root .related-cover-overlay { display: none; }
:root .related-cover img { transition: transform .9s var(--ed-ease), opacity .4s ease; }
:root .related-card:hover .related-cover img { transform: scale(1.025); }
:root .related-cover .related-level { display: none; }
:root .related-body { padding: 14px 0 0; gap: 6px; }
:root .related-body .related-level {
  position: static; display: block; background: none; border: 0; padding: 0; border-radius: 0;
  backdrop-filter: none; -webkit-backdrop-filter: none; color: var(--ed-kicker); font-size: 13px; font-weight: 600; letter-spacing: 0;
}
:root .related-title { font-family: var(--ed-display); font-size: 17px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; }
:root .related-card:hover .related-title { color: var(--ed-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
:root .related-desc { font-size: 14.5px; color: var(--ed-muted); }

/* The blog index has its own landing-style layout in scripts/build-blog-index.mjs. */

/* ---------- Motion (set up by editorial.js; nothing is hidden without JS) ---------- */
.ed-progress {
  position: fixed; inset-inline: 0; top: 0; height: 2px; z-index: 200; pointer-events: none;
  background: var(--ed-action); transform-origin: 0 50%; transform: scaleX(0);
}
[dir="rtl"] .ed-progress { transform-origin: 100% 50%; }

.ed-reveal { opacity: 0; transform: translateY(8px); }
.ed-reveal.ed-in {
  opacity: 1; transform: none;
  transition: opacity .5s var(--ed-ease), transform .5s var(--ed-ease);
  transition-delay: var(--ed-delay, 0ms);
}

/* Table of contents in the left margin on wide screens. */
.ed-toc { display: none; }
@media (min-width: 1240px) {
  .ed-toc {
    display: block; position: fixed; top: 112px; width: 200px;
    inset-inline-start: max(24px, calc(50% - (var(--ed-measure) / 2) - 280px));
    max-height: calc(100vh - 160px); overflow: auto; font-size: 13.5px; line-height: 1.45;
    opacity: 0; transform: translateY(6px); pointer-events: none;
    transition: opacity .4s ease, transform .4s var(--ed-ease);
  }
  .ed-toc.ed-show { opacity: 1; transform: none; pointer-events: auto; }
  .ed-toc-title { color: var(--ed-muted); font-weight: 600; margin: 0 0 12px; }
  .ed-toc ol { list-style: none; margin: 0; padding: 0; }
  .ed-toc li { margin: 0; }
  .ed-toc a {
    display: block; padding: 6px 0; color: var(--ed-muted); text-decoration: none;
    transition: color .25s ease;
  }
  .ed-toc a:hover { color: var(--ed-text); }
  .ed-toc a[aria-current="true"] { color: var(--ed-ink); font-weight: 650; }
}

@media (prefers-reduced-motion: reduce) {
  .ed-reveal { opacity: 1; transform: none; }
  .ed-toc { transition: none; }
}
