/* ============================================================================
   EvalQA — assets/learn.css
   The Learn section's stylesheet. It lived inline inside learn/_header.php,
   which meant ~150 lesson pages each re-downloaded the same 15 KB and nothing
   could cache or lint it. It is one file now, included by every lesson page
   through that same header.

   Tokens: Learn keeps its own NAMES (--bg2..--bg5, --text2/3, --l1..--l5)
   because the lesson pages reference them everywhere; the VALUES are the light
   palette and match assets/theme.css.
   ========================================================================== */

/* ============================================================
   eval.qa Learn - Shared Styles (inlined via _header.php)
   ============================================================ */

/* ---- Design Tokens ---- */
/* Light palette, matching assets/theme.css. Learn keeps its own token NAMES
   (--bg2..--bg5, --text2/3, --l1..--l5) because ~60 lesson pages reference
   them; only the VALUES moved. Every accent below was darkened until it clears
   4.5:1 on white — the dark-theme values (#4ade80, #d4a843, #a78bfa …) do not. */
:root {
  --bg:   #faf8fd;
  --bg2:  #ffffff;
  --bg3:  #f2eefa;
  --bg4:  #e8e0f6;
  --bg5:  #f6f2fd;
  --text:  #1a1723;
  --text2: #4a4458;
  --text3: #615a70;
  --gold:     #8a6212;
  --gold-dim: rgba(138,98,18,0.10);
  --blue:   #2b58c9;
  --green:  #0f6b32;
  --red:    #b42318;
  --orange: #9a4a06;
  --purple: #6d28d9;
  --cyan:   #0e6f80;
  --border:  rgba(88,28,135,0.13);
  --border2: rgba(88,28,135,0.22);
  --l1: #0f6b32;
  --l2: #2b58c9;
  --l3: #6d28d9;
  --l4: #9a4a06;
  --l5: #8a6212;
  --max-width: 860px;
}

/* ---- Reset ---- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
}

/* ---- Site Header ---- */
.site-header {
  background: rgba(250,248,253,0.90);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0 24px;
}
.site-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.site-logo {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: -0.5px;
}
.site-logo span { color: var(--text3); }
.site-logo { display: inline-flex; align-items: center; gap: 8px; }
.site-logo .logo-mark { width: 26px; height: 26px; border-radius: 6px; display: block; flex: 0 0 auto; }
@media (max-width: 520px) { .site-logo .logo-mark { width: 22px; height: 22px; } }
.nav-links { display: flex; gap: 24px; list-style: none; }
.nav-links a {
  color: var(--text3);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--text); }

/* ---- Article Wrap ---- */
.article-wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 24px 100px;
}

/* ---- Breadcrumb ---- */
/* The breadcrumb is a direct child of <body>, not of .article-wrap, so without
   the same max-width and padding it started hard against the viewport edge
   while the article below it sat in a centred column. It now shares the
   article's gutter, so the two line up. */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9375rem;
  color: var(--text3);
  font-family: var(--mono, 'JetBrains Mono', monospace);
  max-width: var(--max-width);
  margin: 0 auto 32px;
  padding: 20px 24px 0;
  background: none;      /* Bootstrap-ish resets elsewhere give .breadcrumb a fill */
  border-radius: 0;
}
.breadcrumb a { color: var(--text3); text-decoration: none; }
.breadcrumb a:hover { color: var(--gold); }
.breadcrumb .sep { opacity: 0.4; }

/* ---- Level Badges ---- */
.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border-radius: 20px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.level-badge.l1 { background: rgba(74,222,128,0.12);  color: var(--l1); border: 1px solid rgba(74,222,128,0.25); }
.level-badge.l2 { background: rgba(91,138,245,0.12);  color: var(--l2); border: 1px solid rgba(91,138,245,0.25); }
.level-badge.l3 { background: rgba(167,139,250,0.12); color: var(--l3); border: 1px solid rgba(167,139,250,0.25); }
.level-badge.l4 { background: rgba(251,146,60,0.12);  color: var(--l4); border: 1px solid rgba(251,146,60,0.25); }
.level-badge.l5 { background: rgba(212,168,67,0.12);  color: var(--l5); border: 1px solid rgba(212,168,67,0.25); }

/* ---- Article Header ---- */
.article-header { margin-bottom: 40px; }
.article-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.875rem, 4vw, 2.6rem);
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 16px;
  color: var(--text);
}
.article-title span { color: var(--gold); }
.article-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.9375rem;
  color: var(--text3);
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.article-meta .dot { opacity: 0.4; }

/* ---- Content Tags ---- */
.content-tags { display: flex; gap: 8px; flex-wrap: wrap; margin: 20px 0; }
.ctag {
  font-size: 0.9375rem;
  padding: 3px 10px;
  border-radius: 4px;
  font-weight: 600;
  font-family: 'JetBrains Mono', monospace;
}
.ctag.guide   { background: rgba(74,222,128,0.1);  color: var(--green);  border: 1px solid rgba(74,222,128,0.2); }
.ctag.exam    { background: rgba(91,138,245,0.1);  color: var(--blue);   border: 1px solid rgba(91,138,245,0.2); }
.ctag.blog    { background: rgba(167,139,250,0.1); color: var(--purple); border: 1px solid rgba(167,139,250,0.2); }
.ctag.lab     { background: rgba(251,146,60,0.1);  color: var(--orange); border: 1px solid rgba(251,146,60,0.2); }
.ctag.ref     { background: rgba(212,168,67,0.1);  color: var(--gold);   border: 1px solid rgba(212,168,67,0.2); }
.ctag.new     { background: rgba(34,211,238,0.1);  color: var(--cyan);   border: 1px solid rgba(34,211,238,0.2); }

/* ---- Table of Contents ---- */
.toc {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  padding: 20px 24px;
  margin: 32px 0;
}
.toc-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 12px;
}
.toc ol { margin-left: 16px; color: var(--text2); font-size: 0.9375rem; line-height: 1.8; }
.toc ol li a { color: var(--text2); text-decoration: none; transition: color 0.2s; }
.toc ol li a:hover { color: var(--gold); }

/* ---- Article Body ---- */
.article-body { font-size: 1rem; line-height: 1.8; color: var(--text2); }
.article-body h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.625rem;
  font-weight: 700;
  color: var(--text);
  margin: 48px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.article-body h3 {
  font-family: 'Inter', sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text);
  margin: 32px 0 12px;
}
.article-body h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 24px 0 8px;
  font-family: 'JetBrains Mono', monospace;
}
.article-body p { margin-bottom: 18px; }
.article-body ul,
.article-body ol { margin: 0 0 18px 24px; color: var(--text2); }
.article-body li { margin-bottom: 8px; }
.article-body strong { color: var(--text); font-weight: 600; }
.article-body em { color: var(--gold); font-style: normal; }
.article-body a {
  color: var(--blue);
  text-decoration: none;
  border-bottom: 1px solid rgba(91,138,245,0.3);
  transition: color 0.2s, border-color 0.2s;
}
.article-body a:hover { color: var(--cyan); border-bottom-color: var(--cyan); }
.article-body code {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.92em;   /* inline code sits inside body text; 0.85em dropped it under 15px */
  background: var(--bg3);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--cyan);
  border: 1px solid var(--border);
}
.article-body blockquote {
  border-left: 3px solid var(--gold);
  padding: 16px 20px;
  margin: 28px 0;
  background: var(--gold-dim);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text);
  font-size: 1.0625rem;
}

/* ---- Callouts ---- */
.callout { border-radius: 10px; padding: 18px 22px; margin: 28px 0; font-size: 0.9375rem; }
.callout.info    { background: rgba(91,138,245,0.08);  border: 1px solid rgba(91,138,245,0.2); }
.callout.warning { background: rgba(251,146,60,0.08);  border: 1px solid rgba(251,146,60,0.2); }
.callout.success { background: rgba(74,222,128,0.08);  border: 1px solid rgba(74,222,128,0.2); }
.callout.tip     { background: rgba(212,168,67,0.08);  border: 1px solid rgba(212,168,67,0.2); }
.callout-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}
.callout.info    .callout-title { color: var(--blue); }
.callout.warning .callout-title { color: var(--orange); }
.callout.success .callout-title { color: var(--green); }
.callout.tip     .callout-title { color: var(--gold); }

/* ---- Stat Grid ---- */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px,1fr)); gap: 16px; margin: 28px 0; }
.stat-box {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
}
.stat-box .stat-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 1.875rem;
  font-weight: 800;
  color: var(--gold);
  line-height: 1;
  margin-bottom: 6px;
}
.stat-box .stat-label { font-size: 0.9375rem; color: var(--text3); line-height: 1.4; }

/* ---- Comparison Table ---- */
.comparison-table { width: 100%; border-collapse: collapse; margin: 28px 0; font-size: 0.9375rem; }
.comparison-table th {
  background: var(--bg3);
  color: var(--text2);
  font-weight: 600;
  text-align: left;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border2);
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.comparison-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text2);
  vertical-align: top;
}
.comparison-table tr:hover td { background: rgba(88,28,135,0.03); }
.comparison-table .yes     { color: var(--green);  font-weight: 600; }
.comparison-table .no      { color: var(--red); }
.comparison-table .partial { color: var(--orange); }

/* ---- Summary Box ---- */
.summary-box {
  background: linear-gradient(135deg, var(--bg2), var(--bg3));
  border: 1px solid var(--border2);
  border-radius: 14px;
  padding: 28px;
  margin: 48px 0 32px;
}
.summary-box h3 {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 14px;
}
.summary-box ul { margin-left: 18px; }
.summary-box li { color: var(--text2); font-size: 0.9375rem; margin-bottom: 7px; }
.summary-box li strong { color: var(--text); }

/* ---- CTA Block ---- */
.cta-block {
  background: linear-gradient(135deg, rgba(212,168,67,0.08), rgba(91,138,245,0.08));
  border: 1px solid rgba(212,168,67,0.2);
  border-radius: 16px;
  padding: 36px;
  text-align: center;
  margin: 56px 0;
}
.cta-block h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4375rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
}
.cta-block p { color: var(--text2); font-size: 1rem; margin-bottom: 24px; }
/* a.cta-btn, not just .cta-btn: the lesson pages define `.article-body a`,
   which is more specific and was repainting this button's label link-blue on
   its gold fill (1.15:1). Matching on the tag too puts the label back. */
.cta-btn,
.article-body a.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--gold);
  color: #ffffff;   /* --gold is now a dark amber, so the label goes white */
  font-weight: 700;
  font-size: 0.9375rem;
  padding: 12px 28px;
  border-radius: 8px;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.15s;
  border: none;
  cursor: pointer;
}
.cta-btn:hover { opacity: 0.9; transform: translateY(-1px); }

/* ---- Site Footer ---- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 40px 24px;
  text-align: center;
  color: var(--text3);
  font-size: 0.9375rem;
}
.site-footer a { color: var(--text3); text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.footer-nav { display: flex; justify-content: center; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.footer-nav .sep { opacity: 0.3; }
.footer-copy { font-size: 0.9375rem; opacity: 0.6; }

/* ---- Mobile nav toggle ---- */
.nav-menu-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text3);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px 8px;
}
@media (max-width: 640px) {
  .nav-menu-btn { display: block; }
  .nav-links { display: none; flex-direction: column; position: absolute; top: 56px; left: 0; right: 0; background: var(--bg2); border-bottom: 1px solid var(--border); padding: 16px 24px; z-index: 99; }
  .nav-links.open { display: flex; }
}

/* ---- Related Lessons ---- */
.related-lessons-section {
  max-width: var(--max-width);
  margin: 64px auto 0;
  padding: 0 24px;
}
.related-lessons-inner {
  background: var(--bg2);
  border: 1px solid var(--border2);
  border-radius: 16px;
  padding: 40px;
  margin-bottom: 48px;
}
.related-lessons-inner h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.625rem;
  color: var(--gold);
  margin-bottom: 8px;
  margin-top: 0;
}
.related-lessons-inner > p {
  color: var(--text2);
  font-size: 0.9375rem;
  margin-bottom: 28px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}
.related-card {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, transform 0.15s, background 0.2s;
  display: block;
}
.related-card:hover {
  border-color: var(--border2);
  background: var(--bg4);
  transform: translateY(-2px);
}
.related-card .rc-level {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
  display: block;
}
.related-card .rc-title {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--text);
  line-height: 1.4;
  display: block;
}

/* ---- Hero Image ---- */
#auto-hero-image {
  margin: 0 0 28px 0;
  display: block;
}
#auto-hero-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 12px;
  aspect-ratio: 1200/630;
  object-fit: cover;
}

/* ---- Responsive ---- */
@media (max-width: 860px) {
  .related-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .article-wrap { padding: 32px 16px 80px; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
  .related-grid { grid-template-columns: 1fr 1fr; }
  .related-lessons-inner { padding: 24px 20px; }
  .article-title { font-size: clamp(1.625rem, 5vw, 2.2rem); }
}
@media (max-width: 420px) {
  .related-grid { grid-template-columns: 1fr; }
}

/* ── Utilities replacing what used to be inline style attributes ─────────────
   973 of them across ~150 lesson pages, but only 38 distinct declarations —
   so they are 38 classes here rather than 973 attributes there. */
.t-purple { color: var(--purple); }
.t-blue   { color: var(--blue); }
.t-gold   { color: var(--gold); }
.t-green  { color: var(--green); }
.t-orange { color: var(--orange); }
.t-red    { color: var(--red); }

.code-l1, .code-l2, .code-l3, .code-l4, .code-l5 {
  font-family: var(--mono, 'JetBrains Mono', monospace); font-size: 0.9375rem;
}
.code-l1 { color: var(--l1); }
.code-l2 { color: var(--l2); }
.code-l3 { color: var(--l3); }
.code-l4 { color: var(--l4); }
.code-l5 { color: var(--l5); }

.is-hidden { display: none; }
.row-wrap  { display: flex; gap: 12px; flex-wrap: wrap; }
.mb-12 { margin-bottom: 12px; }
.mb-24 { margin: 0 0 24px 0; }
.mt-12 { margin-top: 12px; }
.mt-32 { margin-top: 32px; }
.my-32 { margin: 32px 0; }
.p-flat { margin: 0; line-height: 1.7; }
.h-sm { font-size: 1rem; margin: 0 0 8px 0; }
.lead-sm { font-size: 1.125rem; margin-bottom: 12px; }
.btn-sm { font-size: 0.9375rem; padding: 10px 22px; }
.center-block { text-align: center; padding: 60px 0; }
.w-0  { width: 0%; }
.w-25 { width: 25%; }
.img-fluid-round { width: 100%; height: auto; display: block; border-radius: 12px; }

.kicker {
  font-family: var(--mono, 'JetBrains Mono', monospace);
  font-size: 0.8125rem; font-weight: 700; color: var(--gold);
  text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 14px;
}
.kicker-tight { letter-spacing: 1px; margin-bottom: 12px; }

.meta-mono { font-family: var(--mono, 'JetBrains Mono', monospace); font-size: 0.9375rem; color: var(--text3); }

.caption { color: var(--text3); font-style: italic; margin-bottom: 4px; }

.h-serif-rule {
  font-family: 'Playfair Display', serif; font-size: 1.4375rem; color: var(--text);
  margin: 48px 0 20px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}

.callout {
  border-left: 3px solid var(--purple);
  background: rgba(var(--accent-rgb), .06);
  padding: 14px 18px; margin: 0 0 24px;
  border-radius: 0 8px 8px 0; font-size: 0.9375rem; line-height: 1.6;
}

.panel {
  margin: 64px 0 32px; padding: 28px;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 14px;
}
.panel-gold {
  margin: 56px 0 40px; padding: 24px;
  background: var(--bg2); border-radius: 12px; border-left: 3px solid var(--gold);
}
.note-box {
  max-width: 860px; margin: 40px auto 0; padding: 16px 20px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--tint-1);
}
