/* Learn cluster — hub (7 locales) + 12 English guides.
   Tokens only; no colours are hardcoded. Light-only, WCAG AA. */

/* ============================================================ HUB */

.learn-hub-head { max-width: 44rem; margin-bottom: 40px; }
.learn-hub-head h1 { margin-bottom: .3em; }
.learn-lead { font-size: 1.0625rem; color: var(--ink); }

.en-note {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--leaf);
  border-radius: var(--r-m);
  padding: 16px 20px;
  margin-bottom: 40px;
  max-width: 44rem;
}
.en-note p { margin: 0; font-size: .9375rem; color: var(--text); }
.en-note-title { font-weight: 600; color: var(--ink); margin-bottom: .25em !important; }

.guide-group { margin-bottom: 48px; }
.guide-group h2 {
  font-size: .8125rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); margin: 0 0 16px; padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.lang-ja .guide-group h2, .lang-ko .guide-group h2, .lang-zh .guide-group h2 { letter-spacing: 0; }

.guide-grid {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.guide-grid-lead { grid-template-columns: 1fr; }

.guide-card {
  display: flex; flex-direction: column; gap: 8px; height: 100%;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-m); box-shadow: var(--shadow-s);
  padding: 20px 22px; text-decoration: none;
  transition: box-shadow 150ms var(--ease), transform 150ms var(--ease);
}
.guide-card:hover { box-shadow: var(--shadow-m); transform: translateY(-2px); }
.guide-stat {
  font-size: .75rem; letter-spacing: .04em; color: var(--text-muted);
  font-weight: 600; text-transform: uppercase;
}
.guide-title { font-size: 1.0625rem; font-weight: 600; color: var(--ink); line-height: 1.3; }
.guide-grid-lead .guide-title { font-size: 1.25rem; }
.guide-blurb { font-size: .9375rem; color: var(--text); line-height: 1.6; flex: 1; }
.guide-more { font-size: .875rem; font-weight: 600; color: var(--accent); margin-top: 4px; }
.guide-card:hover .guide-more { color: var(--accent-deep); text-decoration: underline; }
.guide-lang-badge {
  display: inline-block; margin-left: 6px; padding: 1px 8px;
  border: 1px solid var(--line); border-radius: var(--r-round);
  background: var(--surface-alt); color: var(--text-muted);
  font-size: .6875rem; font-weight: 500; letter-spacing: .02em; text-transform: none;
}

.learn-next { margin-top: 8px; }
.next-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
.next-list a {
  display: flex; flex-direction: column; gap: 2px;
  background: var(--surface-alt); border: 1px solid var(--line);
  border-radius: var(--r-m); padding: 14px 18px; text-decoration: none;
}
.next-list a:hover { background: var(--surface); }
.next-list strong { color: var(--ink); font-size: 1rem; }
.next-list span { color: var(--text-muted); font-size: .875rem; }

/* ======================================================== ARTICLE */

.learn-article { max-width: 44rem; margin: 0 auto; }
.learn-article > * { max-width: 100%; }

.learn-meta {
  font-size: .75rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--leaf-text); margin: 0 0 .6em;
}
.learn-article h1 { margin-bottom: .4em; }

/* --- the answer-first block (first screenful, AI-Overview bait) --- */
.answer-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--leaf);
  border-radius: var(--r-m);
  box-shadow: var(--shadow-s);
  padding: 22px 24px;
  margin: 0 0 32px;
}
.answer-lead {
  font-size: 1.1875rem; line-height: 1.5; font-weight: 500;
  color: var(--ink); margin: 0 0 18px; max-width: none;
}
.answer-card table { margin: 0; }
.answer-source {
  margin: 14px 0 0; font-size: .75rem; color: var(--text-muted);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.answer-source a { color: var(--text-muted); }

/* --- body rhythm --- */
.learn-body h2 { margin-top: 2em; }
.learn-body h3 { margin-top: 1.6em; color: var(--ink); }
.learn-body p, .learn-body li { color: var(--text); }
.learn-body li { margin-bottom: .35em; }
.learn-body ul, .learn-body ol { max-width: 65ch; }
.learn-body strong { color: var(--ink); font-weight: 600; }
.learn-body a { font-weight: 500; }
.learn-body hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }

/* --- data tables (markdown-authored) --- */
.learn-body table, .answer-card table {
  width: 100%; border-collapse: collapse; font-size: .9375rem;
  margin: 20px 0; font-variant-numeric: tabular-nums;
}
/* Markdown tables are wrapped in .table-wrap by eleventy.config.mjs, so the
   table keeps table layout and the WRAPPER scrolls — a min-width here produces
   a real scroll instead of cells squeezed to min-content. */
.learn-body .table-wrap, .answer-card .table-wrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin;
  background:
    linear-gradient(to right, var(--surface) 30%, rgba(254,252,250,0)) left / 24px 100% no-repeat local,
    linear-gradient(to left, var(--surface) 30%, rgba(254,252,250,0)) right / 24px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(45,36,22,.15), rgba(45,36,22,0)) left / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(45,36,22,.15), rgba(45,36,22,0)) right / 12px 100% no-repeat scroll;
}
/* Reference values are read as units ("96–100 °C / 205–212 °F"), not prose:
   wrapping them across five lines destroys the comparison the table exists for.
   The same rule already governs .data-table on the tool pages. */
.learn-body :is(td, th), .answer-card :is(td, th) { white-space: nowrap; }
@media (min-width: 640px) { .learn-body table, .answer-card table { min-width: 0; } }
.learn-body th, .learn-body td,
.answer-card th, .answer-card td {
  text-align: left; padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top;
}
.learn-body thead th, .answer-card thead th {
  font-size: .6875rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); font-weight: 600; white-space: nowrap;
}
.learn-body tbody tr:nth-child(even), .answer-card tbody tr:nth-child(even) { background: var(--surface-alt); }
.learn-body tbody td:first-child, .answer-card tbody td:first-child { color: var(--ink); font-weight: 600; }
.learn-body tbody tr:last-child :is(th, td),
.answer-card tbody tr:last-child :is(th, td) { border-bottom: none; }

/* --- sidenotes (the app's insight themes, rewritten) --- */
.sidenote {
  background: var(--leaf-tint);
  border-radius: var(--r-m);
  padding: 18px 22px;
  margin: 28px 0;
}
.sidenote h3 {
  margin: 0 0 .4em; font-size: .75rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--accent-deep);
}
.sidenote p { margin: 0; font-size: .9375rem; line-height: 1.65; color: var(--ink); max-width: none; }
.sidenote p + p { margin-top: .7em; }

/* --- infusion ladders reuse .pill from main.css --- */
.ladder-block { margin: 20px 0; }
.ladder-block .ladder-label {
  display: block; font-size: .75rem; font-weight: 600; letter-spacing: .06em;
  text-transform: uppercase; color: var(--text-muted); margin-bottom: 8px;
}

/* --- FAQ --- */
.faq-block { margin-top: 48px; }
.faq-item {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-m); padding: 14px 20px; margin-bottom: 10px;
}
.faq-item summary {
  cursor: pointer; font-weight: 600; color: var(--ink);
  list-style: none; padding-right: 24px; position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+"; position: absolute; right: 0; top: -2px;
  color: var(--leaf-text); font-size: 1.25rem; font-weight: 600; line-height: 1;
}
.faq-item[open] summary::after { content: "–"; }
.faq-item p { margin: .8em 0 .2em; font-size: .9375rem; }

/* --- sources --- */
.source-block { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--line); }
.source-block h2 {
  font-size: .8125rem; text-transform: uppercase; letter-spacing: .08em;
  color: var(--text-muted); margin: 0 0 12px; font-weight: 600;
}
.source-list { margin: 0; padding-left: 1.2em; font-size: .875rem; color: var(--text-muted); }
.source-list li { margin-bottom: .5em; }
.source-list cite { font-style: normal; color: var(--text); }

/* --- related strip (pillar ↔ spoke linking) --- */
.related-strip { margin-top: 40px; }
.related-strip h2 { font-size: 1.125rem; margin-bottom: 12px; }
.related-list {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.related-list a {
  display: block; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-s); padding: 12px 16px; text-decoration: none;
  font-size: .9375rem; font-weight: 500; color: var(--text);
}
.related-list a:hover { border-color: var(--leaf); color: var(--accent-deep); }

/* --- pillar index --- */
.pillar-index { margin: 28px 0 8px; }
.pillar-index ol { list-style: none; padding: 0; margin: 0; counter-reset: pillar; }
.pillar-index li { counter-increment: pillar; margin-bottom: 8px; }
.pillar-index a {
  display: flex; gap: 12px; align-items: baseline;
  background: var(--surface-alt); border: 1px solid var(--line);
  border-radius: var(--r-s); padding: 12px 16px; text-decoration: none;
}
.pillar-index a:hover { background: var(--surface); border-color: var(--leaf); }
.pillar-index a::before {
  content: counter(pillar); font-variant-numeric: tabular-nums;
  color: var(--leaf-text); font-weight: 600; font-size: .875rem; min-width: 1.4em;
}
.pillar-index .pi-title { font-weight: 600; color: var(--ink); }
.pillar-index .pi-note { color: var(--text-muted); font-size: .875rem; }

@media print {
  .en-note, .related-strip, .learn-next { display: none !important; }
  .answer-card, .faq-item, .sidenote { break-inside: avoid; border: 1px solid #ccc; }
  .learn-article { max-width: none; }
}

/* Guide prose cites DOIs and journal URLs — unbreakable strings that overflow
   a 320px column. */
.learn-body, .source-list { overflow-wrap: anywhere; }
