/* Article-specific stylesheet
 * Inherits design tokens from quintace-ds.css.
 * Use for long-form coach-authored articles spawned from books.
 */

body {
  background: var(--bg-dark);
  color: var(--text);
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.7;
  margin: 0;
}

a:focus-visible { outline: 2px solid var(--text-accent); outline-offset: 3px; border-radius: 3px; }

/* ---- Hero ---- */
.article-hero {
  text-align: center;
  padding: 72px 24px 48px;
  background: radial-gradient(ellipse at 50% 30%, var(--bg-accent) 0%, var(--bg-dark) 70%);
  border-bottom: 1px solid var(--border);
}
.hub-backlink {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-muted); text-decoration: none;
  margin-bottom: 20px; opacity: 0.75; transition: opacity 0.15s;
}
.hub-backlink:hover { opacity: 1; color: var(--text); }
.hub-backlink::before { content: "←"; font-size: 13px; }
.article-hero .logo { display: inline-block; margin-bottom: 28px; opacity: 0.88; }
.article-hero .logo img { height: 28px; width: auto; display: block; }
.article-eyebrow {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.14em; color: var(--text-accent); margin-bottom: 16px;
}
.article-title {
  font-size: clamp(28px, 4.2vw, 44px); font-weight: 700; color: #fff;
  line-height: 1.15; letter-spacing: -0.5px;
  max-width: 880px; margin: 0 auto 14px;
}
.article-subtitle {
  font-size: clamp(15px, 2vw, 19px);
  color: var(--text-muted);
  max-width: 640px; margin: 0 auto 24px;
  font-style: italic;
}
.article-byline {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  margin-top: 24px;
}
.byline-main {
  font-size: 14px; font-weight: 600; color: var(--text);
}
.byline-sub {
  font-size: 12px; color: var(--text-muted);
}

/* ---- Main body ---- */
.article-body {
  max-width: 720px;
  margin: 0 auto;
  padding: 56px 28px 72px;
  font-size: 17px;
  color: var(--text-dim);
}

.article-body h2 {
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  margin: 56px 0 20px;
  line-height: 1.25;
}
.article-body h2:first-child { margin-top: 0; }

.article-body h3 {
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  margin: 40px 0 14px;
  line-height: 1.3;
}

.article-body p {
  margin: 0 0 18px;
}

.article-body p strong,
.article-body li strong {
  color: var(--text);
  font-weight: 600;
}

.article-body em { font-style: italic; }

.article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 48px 0;
}

/* ---- Lists ---- */
.article-body ul,
.article-body ol {
  margin: 0 0 22px;
  padding-left: 24px;
}
.article-body li {
  margin-bottom: 10px;
}

/* ---- Tables ---- */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0 28px;
  font-size: 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.article-body th {
  text-align: left;
  padding: 12px 16px;
  background: var(--bg-accent);
  color: var(--text);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}
.article-body td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-dim);
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.article-body th { word-wrap: break-word; overflow-wrap: break-word; }
.article-body td[align="right"],
.article-body th[align="right"] { text-align: right; }
.article-body tr:last-child td { border-bottom: none; }
.article-body tr:hover td {
  background: rgba(81, 162, 255, 0.04);
}
/* Mobile: allow wide tables to scroll horizontally rather than push the page. */
@media (max-width: 560px) {
  .article-body table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    white-space: nowrap;
  }
  .article-body table th,
  .article-body table td {
    white-space: normal;
    min-width: 90px;
    padding: 10px 12px;
  }
}

/* ---- Blockquotes ---- */
.article-body blockquote {
  border-left: 3px solid var(--text-accent);
  padding: 4px 0 4px 20px;
  margin: 24px 0;
  color: var(--text);
  font-size: 18px;
  font-style: italic;
}
.article-body blockquote p { margin-bottom: 12px; }
.article-body blockquote p:last-child { margin-bottom: 0; }

/* ---- Review callout (remove before publish) ---- */
.article-body blockquote:has(.review-callout),
.article-body blockquote.review-callout {
  background: rgba(255, 210, 104, 0.12);
  border-left: 3px solid var(--yellow);
  padding: 16px 22px;
  margin: 32px 0;
  color: var(--text);
  font-size: 15px;
  font-style: normal;
  border-radius: 4px;
}
.article-body blockquote .review-callout,
.article-body blockquote.review-callout {
  font-style: normal;
  font-size: 15px;
  color: var(--text);
  margin: 0;
}
.article-body blockquote .review-callout strong,
.article-body blockquote.review-callout strong {
  color: var(--yellow);
}

/* ---- Editor's open question (draft-only, strip pre-publish) — METHODOLOGY §10b ---- */
.article-body blockquote:has(.editor-question),
.article-body blockquote.editor-question {
  background: rgba(255, 159, 64, 0.10);
  border-left: 3px solid #ff9f40;
  padding: 16px 22px;
  margin: 28px 0;
  color: var(--text);
  font-size: 15px;
  font-style: normal;
  border-radius: 4px;
}
.article-body blockquote.editor-question p {
  margin: 0 0 8px;
}
.article-body blockquote.editor-question p:last-child {
  margin-bottom: 0;
}
.article-body blockquote.editor-question strong {
  color: #ff9f40;
}

/* ---- Inline emphasis (links) ---- */
.article-body a {
  color: var(--text-accent);
  text-decoration: none;
  border-bottom: 1px dotted var(--text-accent);
  transition: border-color 0.15s, color 0.15s;
}
.article-body a:hover {
  border-bottom: 1px solid var(--text-accent);
}

/* ---- Source + footnote style ---- */
.article-body p em:only-child,
.article-body p em:first-child:last-child {
  color: var(--text-muted);
  font-size: 13px;
}

/* ---- Footer ---- */
.article-footer {
  text-align: center;
  padding: 48px 24px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 13px;
}
.logo-footer { display: inline-block; margin-bottom: 16px; opacity: 0.6; }
.logo-footer img { height: 22px; width: auto; }
.article-footer p { margin: 6px 0; }
.article-footer a {
  color: var(--text-accent);
  text-decoration: none;
}
.article-footer a:hover { text-decoration: underline; }

/* ---- Chart figures ---- */
.chart-figure {
  margin: 32px 0;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.chart-figure figcaption {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 16px;
  text-align: center;
}
.chart-container {
  position: relative;
  width: 100%;
  height: 320px;
}

/* ---- Article table of contents (markdown [TOC]) ---- */
.article-body .toc {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px 28px;
  margin: 32px 0 40px;
}
.article-body .toc::before {
  content: "In this article";
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-accent);
  margin-bottom: 14px;
}
.article-body .toc > ul,
.article-body .toc ul ul {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: toc-item;
}
.article-body .toc > ul > li {
  counter-increment: toc-item;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 6px 0;
  border-top: 1px solid var(--border-subtle);
}
.article-body .toc > ul > li:first-child { border-top: none; padding-top: 0; }
.article-body .toc > ul > li::before {
  content: counter(toc-item) ".";
  min-width: 22px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
}
.article-body .toc a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 15px;
  line-height: 1.45;
  border-bottom: none;
  transition: color 0.12s;
}
.article-body .toc a:hover,
.article-body .toc a:focus-visible {
  color: var(--text-accent);
  border-bottom: none;
}
/* Hide nested H3s in the TOC for now — keep it a clean H2-only list.
   Remove this rule if we want to expose sub-sections. */
.article-body .toc ul ul { display: none; }

/* ---- EV-by-class table (small-multiples) ---- */
.ev-class-figure {
  margin: 32px 0;
  padding: 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.ev-class-figure figcaption {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 16px;
  text-align: center;
}
.ev-class-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: transparent;
  border: none;
  border-radius: 0;
}
.ev-class-table th {
  padding: 10px 12px;
  font-size: 11px;
}
.ev-class-table td {
  padding: 8px 12px;
  font-size: 13px;
  border-bottom: 1px solid var(--border-subtle);
}
.ev-class-note {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin: 12px 0 0;
  font-style: italic;
}

/* ---- Range grid visualizations ---- */
.range-grid-figure {
  margin: 36px 0;
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
}
.range-grid-figure figcaption {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 20px;
  text-align: center;
}
.range-grids-side-by-side {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 20px;
}
.range-grid-wrap { display: flex; flex-direction: column; }
.range-grid-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  text-align: center;
  margin-bottom: 4px;
}
.range-grid-meta {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 12px;
}
.range-grid {
  display: grid;
  grid-template-columns: repeat(13, 1fr);
  gap: 2px;
  aspect-ratio: 1;
}
.grid-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  line-height: 1;
  border-radius: 2px;
  color: rgba(255,255,255,0.85);
  cursor: default;
  transition: outline 0.1s;
}
.grid-cell:hover { outline: 1px solid #fff; z-index: 1; }
.grid-cell .hand-name { font-weight: 600; }
.grid-cell .hand-pct { font-size: 7px; opacity: 0.65; margin-top: 1px; }

/* Range-grid action palette — hue-separated for max distinguishability:
 *   open   → deep blue         (strong play, full confidence)
 *   mostly → lighter blue      (open most of the time)
 *   mixed  → amber/gold        (split action — neither pure open nor fold)
 *   rare   → muted orange/rust (occasional play, mostly folding)
 *   fold   → dark slate        (don't play)
 */
.grid-cell.play-full, .sw.play-full { background: #1e4fb3; color: #fff; }
.grid-cell.play-strong, .sw.play-strong { background: #5aa2e8; color: #0c1220; }
.grid-cell.play-mixed, .sw.play-mixed { background: #f5b947; color: #0c1220; }
.grid-cell.play-rare, .sw.play-rare { background: #d17a4a; color: #fff; }
.grid-cell.play-fold, .sw.play-fold { background: #2a2f3a; color: rgba(255,255,255,0.35); }
.grid-cell.play-jam, .sw.play-jam { background: #c23c3c; color: #fff; }
.grid-cell.play-na, .sw.play-na { background: #1a1f28; color: rgba(255,255,255,0.2); }
.grid-cell.jrb-hand { outline: 2px solid var(--text-accent); outline-offset: -2px; font-weight: 700; z-index: 1; }

/* Action-palette (for jam/limp/raise/fold decomposition grids) */
.grid-cell.action-jam, .sw.action-jam { background: #c23c3c; color: #fff; }
.grid-cell.action-limp, .sw.action-limp { background: #2e7bb3; color: #fff; }
.grid-cell.action-raise, .sw.action-raise { background: #5aa2e8; color: #0c1220; }
.grid-cell.action-fold, .sw.action-fold { background: #2a2f3a; color: rgba(255,255,255,0.35); }

.range-grid-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  justify-content: center;
  margin: 18px 0 12px;
  font-size: 11px;
  color: var(--text-muted);
}
.legend-item { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; }
.legend-item .sw {
  width: 18px; height: 18px; border-radius: 3px;
  display: inline-block;
  border: 1px solid rgba(255,255,255,0.15);
}
.range-grid-caption-note {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin: 8px 0 0;
  font-style: italic;
}

/* ---- Mobile ---- */
@media (max-width: 640px) {
  .article-hero { padding: 48px 20px 36px; }
  .article-body {
    padding: 36px 20px 48px;
    font-size: 16px;
  }
  .article-body h2 { font-size: 22px; margin: 40px 0 16px; }
  .article-body h3 { font-size: 18px; margin: 28px 0 12px; }
  .article-body table { font-size: 13px; }
  .article-body th, .article-body td { padding: 8px 12px; }
  .range-grids-side-by-side { grid-template-columns: 1fr; gap: 28px; }
  .grid-cell { font-size: 8px; }
  .grid-cell .hand-pct { display: none; }
}


/* ============================================================
 * Spot card — canonical widget for any specific hand reference
 * (methodology §5.7). Vertical-band architecture: four stacked
 * bands, each owning full width. Robust across 0-5 board cards,
 * short/long scenarios, solver-verified or commentary outcomes,
 * any viewport 320px+.
 *
 * Usage: <figure class="spot-card"> with .sc-meta, .sc-body
 * (containing .sc-cards, .sc-scenario, .sc-outcome).
 * See articles/patrik-5-questions/q1_spot_card.html for the
 * canonical example markup.
 * ============================================================ */

.spot-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  margin: 24px 0;
}

/* BAND 1 — meta strip (hand id / venue / verdict pill on right) */
.spot-card .sc-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border-subtle);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}
.spot-card .sc-hand { color: var(--text-accent); }
.spot-card .sc-context { color: var(--text-muted); }
.spot-card .sc-pill {
  margin-left: auto;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  letter-spacing: 0.06em;
  border: 1px solid rgba(255, 255, 255, 0.18);
  white-space: nowrap;
}
.spot-card .sc-pill.miss    { background: rgba(194, 60, 60, 0.16); color: #f1a0a0; border-color: rgba(194, 60, 60, 0.45); }
.spot-card .sc-pill.hit     { background: rgba(92, 194, 138, 0.18); color: #9ae0b4; border-color: rgba(92, 194, 138, 0.45); }
.spot-card .sc-pill.variance{ background: rgba(255, 255, 255, 0.07); color: var(--text-dim); border-color: rgba(255, 255, 255, 0.22); }
.spot-card .sc-pill.leak    { background: rgba(255, 180, 80, 0.14); color: #f5c97b; border-color: rgba(255, 180, 80, 0.4); }
.spot-card .sc-pill.info    { background: rgba(81, 162, 255, 0.12); color: #9ecbff; border-color: rgba(81, 162, 255, 0.35); }

/* Body: three vertical bands stacked (cards, scenario, outcome) */
.spot-card .sc-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* BAND 2 — cards (hero / villain / board rows, flex-wrap safe) */
.spot-card .sc-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.spot-card .sc-cards-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.spot-card .sc-cards-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  font-weight: 600;
  min-width: 52px;
}

/* BAND 3 — scenario (narrative prose, full width) */
.spot-card .sc-scenario {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.55;
}
.spot-card .sc-scenario strong { color: var(--text); }

/* BAND 4 — outcome (styled callout; stacked label/value/detail) */
.spot-card .sc-outcome {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  background: linear-gradient(90deg, rgba(81, 162, 255, 0.09) 0%, rgba(81, 162, 255, 0.03) 100%);
  border: 1px solid rgba(81, 162, 255, 0.22);
  border-radius: 6px;
  min-width: 0;
}
.spot-card .sc-outcome-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}
.spot-card .sc-outcome-val {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.spot-card .sc-outcome-val.loss { color: #e87070; }
.spot-card .sc-outcome-val.win  { color: #78d9a0; }
.spot-card .sc-outcome-val.chop { color: var(--text); }
.spot-card .sc-outcome-detail {
  font-size: 12px;
  color: var(--text-accent);
}

/* Playing-card tiles (shared with .pc elsewhere if present) */
.spot-card .pc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 36px;
  padding: 2px 5px;
  background: #fafafa;
  color: #111;
  border-radius: 4px;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0,0,0,0.3);
  letter-spacing: -0.5px;
}
.spot-card .pc-red { color: #d62828; }
.spot-card .pc-blk { color: #111; }

@media (max-width: 480px) {
  .spot-card { padding: 14px 14px; }
  .spot-card .sc-cards-label { min-width: 48px; }
  .spot-card .sc-pill { margin-left: 0; }
}


/* Inline code — let long URLs / paths break on narrow viewports instead of
 * forcing horizontal overflow. (§5.4 mobile 0-overflow gate.) */
.article-body code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  font-size: 0.92em;
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 3px;
  word-break: break-word;
  overflow-wrap: anywhere;
}
