/* ══════════════════════════════════════════════════════════════════════════
   content-system.css — the canonical editorial block vocabulary (cs-*)

   Loaded AFTER _shared/wiki.css and _shared/wiki-translated.css, on editorial
   pages only. Three jobs:

     1. Define the canonical blocks (cs-masthead … cs-next).
     2. Fix the measured light-surface defects no other file fixes.
     3. Suppress the ad LABELS that must never reappear.

   ── WHAT THIS FILE DELIBERATELY DOES NOT DO (v119) ────────────────────────
   It does NOT re-assert a property on a selector that already ships in
   wiki.css / wiki-translated.css. The first draft aliased `.quick-summary`,
   `.t-summary`, `.wiki-toc`, `.wiki-callout`, `.wiki-article h2`,
   `.wiki-art-header-inner` and `.wiki-table` onto the cs-* rules. Linking that
   draft sitewide would have restyled all ~600 legacy pages at once from a file
   never measured against them — a redesign of 600 pages dressed up as a bug
   fix, against the §1 visual/SEO freeze.

   Consequence, stated plainly: linking this file sitewide changes only the
   four defects below, plus any page that has adopted a cs-* class. Legacy
   pages keep the appearance their own stylesheet gives them until P4 migrates
   their markup — which is the plan's own ordering (§7: P4 improves markup, it
   never has to rescue the look).

   HARD RULE — this file contains NO promotional component.
   No cs-partner, no cs-cta, no cs-promo, no sponsored variant. A money link is
   a link inside prose, styled by the article's own `.wiki-article a` rule. Do
   not add a boxed money unit here: a box is an ad, and an ad gets skipped
   (plan §6.5). A related-links block is cs-next, internal links only.

   Tokens come from wiki.css :root. We only ADD tokens (--cs-*), never redefine
   --accent, so nothing already shipping can change colour.
   ══════════════════════════════════════════════════════════════════════════ */

:root {
  /* Single source of truth for editorial surfaces (plan §6.2). */
  --cs-ink:     #0f172a;
  --cs-body:    #334155;
  --cs-muted:   #64748b;
  --cs-meta:    #64748b;   /* deliberately NOT #94a3b8 — that was a 3.0:1 label */
  --cs-line:    #e2e8f0;
  --cs-line-2:  #cbd5e1;
  --cs-surface: #f8fafc;
  --cs-brand:       #0284c7;
  --cs-brand-hover: #0369a1;
  --cs-info: #0284c7;
  --cs-warn: #b45309;
  --cs-risk: #b91c1c;
  --cs-gain: #15803d;
  --cs-radius:      10px;
  --cs-radius-ctrl: 8px;
  --cs-measure: 68ch;
  --cs-max: 720px;
}

/* ─────────────────────────────────────────────────────────────────────────
   1. MEASURE — one left edge for H1 and body text (F-01)
   Applies to an adopted masthead only; the legacy `.wiki-art-header-inner`
   keeps its shipped 760px until that page migrates in P4.
   ───────────────────────────────────────────────────────────────────────── */

.cs-masthead {
  max-width: var(--cs-max);
  margin-inline: auto;
  padding-inline: 0;      /* the grid already supplies the gutter */
}

.cs-lede,
.cs-section > p,
.cs-keypoints,
.cs-callout,
.cs-formula,
.cs-faq { max-width: var(--cs-measure); }

/* ─────────────────────────────────────────────────────────────────────────
   2. TYPE SCALE — one, clamped (plan §6.3)
   ───────────────────────────────────────────────────────────────────────── */

.cs-masthead h1 {
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  font-weight: 800;
}

.cs-masthead .cs-eyebrow {
  font-size: clamp(11px, 1.4vw, 12px);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
  color: var(--cs-meta);
}

.cs-section > h2 {
  font-size: clamp(20px, 2.6vw, 26px);
  line-height: 1.3;
  font-weight: 750;
  margin-block: 40px 14px;
  letter-spacing: -0.015em;
  color: var(--cs-ink);
}

.cs-section > h3 {
  font-size: 18px;
  line-height: 1.4;
  font-weight: 700;
  margin-block: 28px 10px;
  color: var(--cs-ink);
}

.cs-lede {
  font-size: 18px;
  line-height: 1.7;
  font-weight: 450;
  color: var(--cs-body);
  margin-block: 14px 22px;
}

/* Never let body copy fall below a readable floor on a phone. */
@media (max-width: 560px) {
  .cs-section > p,
  .cs-lede,
  .cs-keypoints li,
  .cs-callout { font-size: max(15px, 1em); }
  .cs-masthead .cs-eyebrow,
  .cs-meta { font-size: 11px; }
}

/* ─────────────────────────────────────────────────────────────────────────
   3. BLOCK 3 — cs-keypoints
   Replaces .quick-summary (EN) and .t-summary / .t-summary-box (locale) once
   a page adopts it. The legacy classes are NOT restyled from here: `.quick-
   summary li` ships as a flex label+value row on 47 EN articles and reshaping
   it is a P4 markup decision, not a stylesheet decision.
   ───────────────────────────────────────────────────────────────────────── */

.cs-keypoints {
  background: var(--cs-surface);
  border: 1px solid var(--cs-line);
  border-left: 3px solid var(--cs-brand);
  border-radius: 0 var(--cs-radius) var(--cs-radius) 0;
  padding: 16px 20px;
  margin-block: 22px 28px;
}

.cs-keypoints > :first-child { margin-top: 0; }

.cs-keypoints-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
  color: var(--cs-meta);
  margin: 0 0 10px;
}

.cs-keypoints ul { margin: 0; padding: 0; list-style: none; }

.cs-keypoints li {
  position: relative;
  padding: 6px 0 6px 16px;
  font-size: 14.5px;
  line-height: 1.65;
  color: var(--cs-body);
  border-bottom: 1px solid var(--cs-line);
}

.cs-keypoints li::before {
  content: "\2022";
  position: absolute;
  left: 0;
  color: var(--cs-brand);
  font-weight: 700;
}

.cs-keypoints li:last-child { border-bottom: none; padding-bottom: 0; }

/* RTL: mirror the accent bar and the bullet gutter (plan §5). */
[dir="rtl"] .cs-keypoints {
  border-left: 1px solid var(--cs-line);
  border-right: 3px solid var(--cs-brand);
  border-radius: var(--cs-radius) 0 0 var(--cs-radius);
}
[dir="rtl"] .cs-keypoints li::before { left: auto; right: 0; }
[dir="rtl"] .cs-keypoints li { padding-inline: 16px 0; }

/* ─────────────────────────────────────────────────────────────────────────
   4. BLOCK 4 — cs-toc
   Navigation, so it keeps its frame: a TOC is not an ad.
   ───────────────────────────────────────────────────────────────────────── */

.cs-toc {
  background: var(--cs-surface);
  border: 1px solid var(--cs-line);
  border-radius: var(--cs-radius);
  padding: 18px 20px;
}

.cs-toc-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
  color: var(--cs-meta);
  margin: 0 0 12px;
}

.cs-toc a {
  display: block;
  font-size: 13px;
  line-height: 1.45;
  color: var(--cs-muted);
  padding: 6px 0;
  border-bottom: 1px solid var(--cs-line);
  text-decoration: none;
}

.cs-toc a:last-child { border-bottom: none; }
.cs-toc a:hover { color: var(--cs-brand-hover); text-decoration: underline; }

/* Tap targets: a TOC row must be >=44px on a phone (plan §8). */
@media (max-width: 560px) { .cs-toc a { padding-block: 11px; } }

/* ─────────────────────────────────────────────────────────────────────────
   5. BLOCK 6 — cs-callout
   Four tones. Kept quiet: a tinted left edge, a near-white surface, never a
   saturated panel.
   ───────────────────────────────────────────────────────────────────────── */

.cs-callout {
  border-left: 3px solid var(--cs-line-2);
  border-radius: 0 var(--cs-radius-ctrl) var(--cs-radius-ctrl) 0;
  background: var(--cs-surface);
  padding: 16px 20px;
  margin-block: 26px;
  font-size: 15px;
  line-height: 1.75;
  color: var(--cs-body);
}

.cs-callout-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
  color: var(--cs-info);
  margin: 0 0 8px;
}

.cs-callout strong { color: var(--cs-ink); }

.cs-callout a {
  color: var(--cs-brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cs-callout--info { border-left-color: var(--cs-info); }
.cs-callout--warn { border-left-color: var(--cs-warn); }
.cs-callout--risk { border-left-color: var(--cs-risk); }
.cs-callout--gain { border-left-color: var(--cs-gain); }

/* Tone text must stay dark enough to read on the near-white surface.
   Measured failure: #94a3b8 on #f8fafc is 3.0:1. #78350f is legible. */
.cs-callout--warn { color: #78350f; }
.cs-callout--warn strong { color: #92400e; }
.cs-callout--gain { color: #14532d; }
.cs-callout--risk { color: #7f1d1d; }

[dir="rtl"] .cs-callout {
  border-left: 1px solid var(--cs-line);
  border-right: 3px solid var(--cs-line-2);
  border-radius: var(--cs-radius-ctrl) 0 0 var(--cs-radius-ctrl);
}

/* ─────────────────────────────────────────────────────────────────────────
   6. BLOCK 7 — cs-table

   A table is the one element that legitimately overflows on a phone, so it
   scrolls inside its own box and never widens the page. `overflow-x:auto`
   plus `max-width:100%` is deliberate; the outer page must never scroll
   sideways (a measured README v114 defect), and forcing `display:table` back
   would kill the phone scroll wiki.css §12 ships.
   ───────────────────────────────────────────────────────────────────────── */

.cs-table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-collapse: collapse;
  margin-block: 24px;
}

.cs-table > table {
  width: 100%;
  border-collapse: collapse;
  margin: 0;
  font-size: 14px;
}

.cs-table th {
  background: var(--cs-surface);
  padding: 10px 14px;
  text-align: start;
  font-size: 12px;
  font-weight: 600;
  color: var(--cs-muted);
  border-bottom: 2px solid var(--cs-line);
  white-space: nowrap;
}

.cs-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--cs-line);
  color: var(--cs-body);
  vertical-align: top;
}

.cs-table tr:last-child td { border-bottom: none; }
.cs-table tbody tr:hover td { background: var(--cs-surface); }

/* Numeric cells line up when the column is about comparison. */
.cs-table .num { text-align: end; font-variant-numeric: tabular-nums; }
.cs-table .pos { color: var(--cs-gain); }
.cs-table .neg { color: var(--cs-risk); }
.cs-table .mid { color: #92400e; }

/* Swipe hint, only where a table actually overflows on a phone. */
@media (max-width: 700px) {
  .cs-table {
    position: relative;
    background:
      linear-gradient(to left, rgba(248,250,252,.9), rgba(248,250,252,0)) right / 24px 100% no-repeat;
  }
  .cs-table::after {
    content: "swipe \2192";
    display: block;
    position: sticky;
    left: 0;
    font-size: 10.5px;
    letter-spacing: .04em;
    color: var(--cs-meta);
    padding: 4px 2px 0;
  }
  [dir="rtl"] .cs-table::after { content: "\2190 swipe"; }
}

/* ─────────────────────────────────────────────────────────────────────────
   7. BLOCK 8 — cs-formula

   F-03 (.formula-block #79c0ff-on-white) is fixed in wiki.css itself, because
   that is the file every one of the 102 wiki/learn/kalshi pages already loads.
   Not duplicated here — one source of truth per defect.
   ───────────────────────────────────────────────────────────────────────── */

.cs-formula {
  background: var(--cs-surface);
  border: 1px solid var(--cs-line);
  border-left: 3px solid var(--cs-brand);
  border-radius: var(--cs-radius-ctrl);
  padding: 16px 20px;
  margin-block: 22px;
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  font-size: 0.9rem;
  line-height: 1.75;
  color: var(--cs-ink);
  overflow-x: auto;      /* a long formula scrolls, the page does not */
}

.cs-formula strong { color: #075985; }
.cs-formula code { color: var(--cs-ink); }

.cs-formula ul { margin: 10px 0 0 18px; padding: 0; }
.cs-formula li { font-size: .88rem; color: var(--cs-muted); margin-bottom: 3px; }

/* ─────────────────────────────────────────────────────────────────────────
   8. BLOCK 9 — cs-figure
   For an infographic, chart or inline SVG the copy actually refers to. A
   caption and a source line are mandatory: plan §9 forbids fabricated data in
   a figure, so the source line is where the number is attributable.
   ───────────────────────────────────────────────────────────────────────── */

.cs-figure { margin-block: 28px; max-width: 100%; }

.cs-figure > img,
.cs-figure > svg,
.cs-figure > picture > img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--cs-line);
  border-radius: var(--cs-radius);
  background: #fff;
}

.cs-figure figcaption {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--cs-muted);
}

.cs-figure .cs-source {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--cs-meta);
  font-family: 'JetBrains Mono', monospace;
}

/* ─────────────────────────────────────────────────────────────────────────
   9. BLOCK 10 — cs-tool
   An embedded calculator or live widget. Functional, never promotional: no
   money link inside it (plan §6.4 #10).
   ───────────────────────────────────────────────────────────────────────── */

.cs-tool {
  border: 1px solid var(--cs-line);
  border-radius: var(--cs-radius);
  background: #fff;
  padding: 18px 20px;
  margin-block: 28px;
}

.cs-tool-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
  color: var(--cs-meta);
  margin: 0 0 12px;
}

.cs-tool input,
.cs-tool select {
  min-height: 44px;              /* tap target floor */
  border: 1px solid var(--cs-line-2);
  border-radius: var(--cs-radius-ctrl);
  padding: 8px 10px;
  font-size: 15px;
  color: var(--cs-ink);
  background: #fff;
}

/* ─────────────────────────────────────────────────────────────────────────
   10. BLOCK 11 — cs-faq

   The second light-on-light defect (`.wiki-faq` borders at
   rgba(255,255,255,.07) on white) is likewise fixed in wiki.css, so the 16
   pages that ship that accordion get it without loading this file at all.
   ───────────────────────────────────────────────────────────────────────── */

.cs-faq { margin-top: 40px; }

.cs-faq details { border-top: 1px solid var(--cs-line); padding: 0; }
.cs-faq details:last-child { border-bottom: 1px solid var(--cs-line); }

.cs-faq summary {
  cursor: pointer;
  padding: 14px 4px;
  min-height: 44px;               /* tap target floor */
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--cs-ink);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  user-select: none;
}

.cs-faq summary::-webkit-details-marker { display: none; }

.cs-faq summary::after {
  content: "+";
  font-size: 1.1rem;
  font-weight: 400;
  color: var(--cs-muted);
  flex-shrink: 0;
}

.cs-faq details[open] > summary::after { content: "\2212"; }

.cs-faq details > *:not(summary) {
  color: var(--cs-body);
  font-size: 15px;
  line-height: 1.75;
}

/* ─────────────────────────────────────────────────────────────────────────
   11. BLOCK 12 — cs-next
   End-of-article read-more. INTERNAL LINKS ONLY. Deliberately carries no
   money link: the last thing a reader sees should be the next thing to read,
   not an ask.
   ───────────────────────────────────────────────────────────────────────── */

.cs-next {
  margin-top: 40px;
  padding-top: 22px;
  border-top: 1px solid var(--cs-line);
}

.cs-next-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
  color: var(--cs-meta);
  margin: 0 0 12px;
}

.cs-next ul { margin: 0; padding: 0; list-style: none; }
.cs-next li { padding: 7px 0; border-bottom: 1px solid var(--cs-line); }
.cs-next li:last-child { border-bottom: none; }

.cs-next a {
  font-size: 14.5px;
  color: var(--cs-brand);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cs-next a:hover { color: var(--cs-brand-hover); }

@media (max-width: 560px) { .cs-next li { padding-block: 11px; } }

/* ─────────────────────────────────────────────────────────────────────────
   12. SUPPRESSION LAYER — the ad shapes that must never reappear

   wiki.css §42 and wiki-translated.css §28 already unbox the nine legacy CTA
   containers. These are the belt to that braces: if a future page or a stale
   cached stylesheet reintroduces a visible ad marker, it is hidden here
   regardless of load order. They target LABELS, not layout, so they cannot
   hide a legitimate heading.
   ───────────────────────────────────────────────────────────────────────── */

/* Ad LABELS only — never layout, never content.
   Deliberately NOT listed: .kx-eyebrow ("Run the Numbers", "Step 4 of 5"),
   .winner-badge ("Editor's Pick") and .winner-note ("Educational guide -
   no affiliate link."). Those carry real editorial words; hiding them would
   delete content and break the SEO freeze (plan §1). */
.kx-panel .kx-partner-label,
.ps-wiki-cta__eyebrow,
.ps-wiki-cta__disc { display: none !important; }

/* Any element that literally announces itself as an ad. */
[data-sponsored],
[class*="sponsored-chip"] { display: none !important; }

/* ─────────────────────────────────────────────────────────────────────────
   13. TRENDING MARKETS HUB (tm-*)

   Components for /trending-markets.html only. Built on the same --cs-*
   tokens as every other editorial block, so the page inherits the site's
   one visual language instead of forking a second one (plan §6.2).

   HARD RULE holds here too: there is NO boxed money unit in this file.
   A market name is rendered as a normal in-prose link, styled by the
   article's own `.wiki-article a` rule. `.tm-row` is a list row, not an
   ad card — it carries no border, no fill, no button and no label.
   ───────────────────────────────────────────────────────────────────────── */

/* ── cluster jump nav ───────────────────────────────────────────────────── */

.tm-jump {
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 0 30px;
  padding: 10px 0;
  background: #fff;
  border-bottom: 1px solid var(--cs-line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.tm-jump::-webkit-scrollbar { display: none; }

.tm-jump ul {
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  white-space: nowrap;
}

.tm-jump a {
  display: inline-block;
  padding: 6px 11px;
  border-radius: var(--cs-radius-ctrl);
  font-size: 13px;
  font-weight: 600;
  color: var(--cs-body);
  text-decoration: none;
  background: var(--cs-surface);
  border: 1px solid transparent;
}
.tm-jump a:hover { color: var(--cs-brand); background: #eff6ff; }
.tm-jump a:focus-visible { outline: 2px solid var(--cs-brand); outline-offset: 2px; }

/* ── one cluster ────────────────────────────────────────────────────────── */

.tm-cluster { scroll-margin-top: 64px; }
.tm-cluster + .tm-cluster { margin-top: 8px; }

.tm-cluster-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 12px;
  margin-bottom: 4px;
}

.tm-cluster-head h2 { margin-block: 34px 0; }

.tm-count {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cs-meta);
  font-family: 'JetBrains Mono', monospace;
}

.tm-lede {
  max-width: var(--cs-measure);
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--cs-body);
  margin-block: 10px 8px;
}

/* ── market list ────────────────────────────────────────────────────────── */

.tm-list { margin: 16px 0 6px; }
.tm-list > * + * { border-top: 1px solid var(--cs-line); }

.tm-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px 78px;
  gap: 8px 16px;
  align-items: center;
  padding: 13px 0;
}

.tm-q {
  min-width: 0;
  font-size: 14.5px;
  line-height: 1.45;
  font-weight: 600;
  color: var(--cs-ink);
  text-align: left;
  text-decoration: none;
  display: block;
}
a.tm-q:hover { color: var(--cs-brand); text-decoration: underline; text-underline-offset: 2px; }

.tm-sub {
  display: block;
  margin-top: 3px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--cs-meta);
}

/* probability: number + rule bar. The bar is a data mark, not decoration. */
.tm-p { min-width: 0; }

.tm-p-num {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--cs-ink);
  line-height: 1.2;
}
.tm-p-bar {
  display: block;
  height: 4px;
  margin-top: 5px;
  border-radius: 2px;
  background: var(--cs-line);
  overflow: hidden;
}
.tm-p-bar > i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--cs-brand);
}
.tm-p-bar > i[data-dir="up"]   { background: var(--cs-gain); }
.tm-p-bar > i[data-dir="down"] { background: var(--cs-risk); }

.tm-p-num[data-dir="up"]   { color: var(--cs-gain); }
.tm-p-num[data-dir="down"] { color: var(--cs-risk); }

.tm-vol {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--cs-meta);
  text-align: right;
  white-space: nowrap;
}

.tm-vol small {
  display: block;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--cs-meta);
  margin-top: 2px;
}

/* ── status line (loading / error / empty). Never styled as an alert box. ── */

.tm-status {
  margin: 14px 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--cs-meta);
}
.tm-status[data-state="error"] { color: var(--cs-warn); }

/* ── phone: stack the row so the question never truncates ───────────────── */

@media (max-width: 620px) {
  .tm-row {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "q q"
      "p v";
    gap: 6px 12px;
    padding: 15px 0;
  }
  .tm-q   { grid-area: q; font-size: 15px; }
  .tm-p   { grid-area: p; }
  .tm-vol { grid-area: v; align-self: end; }

  .tm-jump { margin-bottom: 22px; }
  .tm-jump a { padding: 8px 12px; font-size: 13.5px; }
  .tm-cluster-head h2 { margin-block: 28px 0; }
  .tm-cluster { scroll-margin-top: 58px; }
}

/* ── the shared "how to read this" note ─────────────────────────────────── */

.tm-method {
  max-width: var(--cs-measure);
  margin: 20px 0 0;
  font-size: 13px;
  line-height: 1.65;
  color: var(--cs-meta);
}
