/* 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);
}
.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);
}

/* ---- 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; }
}
