/* ============================================================
   article.css - NewsArticle.html (single-story reading page)
   ============================================================ */

/* ---------- HERO ---------- */
/* Back-link override: role.css defaults to white@62% for dark heroes, but
   all the light-hero news templates (article, release, white paper, thought)
   sit on var(--tap-bg-warm). Restate against the warm bg. */
.article-hero .back-link,
.release-hero .back-link,
.wp-hero .back-link,
.thought-hero .back-link {
  color: var(--tap-ink-3);
}
.article-hero .back-link:hover,
.release-hero .back-link:hover,
.wp-hero .back-link:hover,
.thought-hero .back-link:hover {
  color: var(--tap-orange-deep);
}

.article-hero {
  background: var(--tap-bg-warm);
  border-bottom: 1px solid var(--tap-line);
  padding: 64px 28px 56px;
}
.article-hero-inner {
  max-width: 880px; margin: 0 auto;
}
.article-meta-row {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
  margin: 24px 0 22px;
}
.article-source {
  font-size: 13px; font-weight: 600;
  color: var(--tap-ink-3);
  letter-spacing: 0.02em;
}
.article-h1 {
  font-size: clamp(40px, 5.8vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 700;
  margin: 0 0 22px;
  color: var(--tap-ink);
  text-wrap: balance;
}
.article-h1-em {
  color: var(--tap-orange);
  font-style: italic;
}
.article-deck {
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.5;
  color: var(--tap-ink-2);
  max-width: 700px;
  margin: 0 0 36px;
  font-weight: 350;
}
.article-byline {
  display: grid;
  grid-template-columns: 44px auto 1fr;
  align-items: center;
  gap: 14px;
  padding-top: 24px;
  border-top: 1px solid var(--tap-line);
}
.article-byline-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--tap-grad-hank);
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 14px; letter-spacing: 0.01em;
}
.article-byline-text {}
.article-byline-name { font-size: 14px; font-weight: 700; color: var(--tap-ink); }
.article-byline-role { font-size: 12.5px; color: var(--tap-ink-2); }
.article-byline-meta {
  justify-self: end; text-align: right;
  font-size: 12.5px; color: var(--tap-ink-3); line-height: 1.5;
}

/* ---------- BODY + RAIL ---------- */
.article-section {
  background: var(--tap-bg);
  padding: 56px 28px 96px;
}
.article-section-inner {
  max-width: calc(var(--maxw) - 2 * var(--pad-x)); margin: 0 auto;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 56px;
  align-items: start;
}

.article-rail {
  position: sticky;
  top: 88px;
  align-self: start;
}
.article-rail-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--tap-ink-3);
  padding-bottom: 12px;
  border-bottom: 1px solid var(--tap-line);
  margin-bottom: 12px;
}
.article-toc {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 2px;
  counter-reset: toc;
}
.article-toc li { counter-increment: toc; }
.article-toc a {
  display: flex; align-items: baseline; gap: 10px;
  padding: 7px 10px;
  border-radius: 6px;
  font-size: 13px; font-weight: 500;
  color: var(--tap-ink-2);
  line-height: 1.4;
  border-left: 2px solid transparent;
  transition: background 120ms, color 120ms, border-color 120ms;
}
.article-toc a::before {
  content: counter(toc, decimal-leading-zero);
  font-variant-numeric: tabular-nums;
  font-size: 10.5px; font-weight: 700;
  color: var(--tap-ink-3);
  letter-spacing: 0.04em;
  flex: none;
}
.article-toc a:hover { color: var(--tap-ink); background: var(--tap-bg-warm); }
.article-toc a.active {
  color: var(--tap-orange-deep);
  background: var(--tap-orange-light);
  border-left-color: var(--tap-orange);
}
.article-toc a.active::before { color: var(--tap-orange-deep); }

.article-share { margin-top: 28px; padding-top: 22px; border-top: 1px solid var(--tap-line); }
.article-share-row { display: flex; gap: 6px; }
.article-share-btn {
  width: 32px; height: 32px; border-radius: 8px;
  display: grid; place-items: center;
  background: var(--tap-card);
  border: 1px solid var(--tap-line-strong);
  color: var(--tap-ink-2);
  transition: color 120ms, background 120ms, border-color 120ms;
}
.article-share-btn:hover {
  color: var(--tap-orange-deep);
  background: var(--tap-orange-light);
  border-color: color-mix(in oklab, var(--tap-orange) 25%, transparent);
}
.article-share-btn svg { width: 14px; height: 14px; }

/* ---------- ARTICLE BODY ---------- */
.article-body {
  max-width: 720px;
}

/* COVER ART (placeholder for a magazine image) */
.article-cover {
  margin: 0 0 36px;
}
.article-cover-art {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #1A1410;
}
.article-cover-grid {
  position: absolute; inset: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(2, 1fr);
  gap: 6px;
  padding: 12px;
}
.cover-tile { border-radius: 6px; }
.cover-tile.r { background: linear-gradient(135deg, #F27A2E, #E8601A); }
.cover-tile.b { background: linear-gradient(135deg, #0E73BB, #0A5894); }
.cover-tile.g { background: linear-gradient(135deg, #059669, #047857); }
.cover-tile.p { background: linear-gradient(135deg, #C33C8E, #9F2D72); }
.cover-tile.c { background: linear-gradient(135deg, #23B0E7, #0795A0); }
.cover-tile.o { background: linear-gradient(135deg, #ED7725, #B8470F); }
.cover-tile.y { background: linear-gradient(135deg, #A9B313, #6B8E1F); }
.cover-tile.t { background: linear-gradient(135deg, #5A3B8F, #6E4FB8); }
.article-cover-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 28px;
  background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,0.55) 100%);
  color: #fff;
}
.article-cover-eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
  margin-bottom: 6px;
}
.article-cover-title {
  font-size: clamp(28px, 4vw, 52px);
  font-weight: 700; letter-spacing: -0.025em;
  font-style: italic;
  color: #fff;
  line-height: 1;
}
.article-cover figcaption {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--tap-ink-3);
  font-style: italic;
}

/* PROSE */
.article-body p {
  font-size: 17.5px;
  line-height: 1.72;
  color: var(--tap-ink);
  margin: 0 0 18px;
  font-weight: 350;
}
.article-body p.article-lede {
  font-size: 21px;
  line-height: 1.55;
  color: var(--tap-ink);
  font-weight: 400;
  margin-bottom: 28px;
}
.article-body p.article-lede em {
  font-style: italic; color: var(--tap-orange-deep);
}
.article-body p strong { font-weight: 700; color: var(--tap-ink); }
.article-body p em { font-style: italic; }

.article-body h2 {
  font-size: clamp(26px, 3.2vw, 36px);
  font-weight: 700; letter-spacing: -0.02em; line-height: 1.15;
  margin: 48px 0 14px;
  text-wrap: balance;
  scroll-margin-top: 88px;
}
.article-body h3 {
  font-size: 20px; font-weight: 700; letter-spacing: -0.015em;
  margin: 32px 0 10px;
  color: var(--tap-ink);
}

.article-pullquote {
  margin: 36px -32px;
  padding: 28px 32px;
  border-left: 4px solid var(--tap-orange);
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.3;
  font-style: italic;
  color: var(--tap-ink);
  font-weight: 350;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.article-list {
  margin: 0 0 22px;
  padding-left: 22px;
  display: flex; flex-direction: column; gap: 10px;
}
.article-list li {
  font-size: 16.5px; line-height: 1.65; color: var(--tap-ink);
  padding-left: 4px;
}
.article-list strong { font-weight: 700; }

/* AUTHOR CARD */
.article-author-card {
  margin-top: 48px;
  padding: 28px 28px;
  background: var(--tap-card);
  border: 1px solid var(--tap-line);
  border-radius: 16px;
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 20px;
}
.article-author-avatar {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--tap-grad-hank);
  display: grid; place-items: center;
  color: #fff; font-weight: 800; font-size: 20px; letter-spacing: 0.01em;
}
.article-author-eyebrow {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--tap-ink-3);
}
.article-author-card h3 {
  font-size: 20px; font-weight: 700; letter-spacing: -0.015em;
  margin: 4px 0 6px;
}
.article-author-card p {
  font-size: 14.5px; color: var(--tap-ink-2); line-height: 1.6;
  margin: 0 0 12px;
}
.article-author-links { display: flex; gap: 16px; flex-wrap: wrap; }
.article-author-links a {
  font-size: 13px; font-weight: 700;
  color: var(--tap-orange-deep);
  border-bottom: 1px solid color-mix(in oklab, var(--tap-orange) 30%, transparent);
}
.article-author-links a:hover { border-bottom-color: var(--tap-orange); }

/* ---------- FIGURES (for image-heavy long-form essays) ---------- */
/* Used by the thesis pages. Each figure either renders a real image
   from /assets/thesis/ - or, if the image hasn't been uploaded yet,
   degrades to a clean coloured panel with the caption underneath. */
.article-figure {
  margin: 36px 0;
}
.article-figure-frame {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: var(--tap-bg-warm);
  border: 1px solid var(--tap-line);
  aspect-ratio: 16 / 10;
  display: grid; place-items: center;
}
.article-figure-frame img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}
/* Inline SVG diagrams - frame adapts to the SVG's own aspect ratio,
   no cropping, padding for breathing room. */
.article-figure-frame:has(> svg) {
  aspect-ratio: auto;
  background: var(--tap-bg);
  padding: 0;
}
.article-figure-frame > svg {
  width: 100%;
  height: auto;
  display: block;
}
.article-figure-frame[data-tone="dark"] {
  background:
    radial-gradient(600px 320px at 80% 0%, color-mix(in oklab, var(--tap-orange) 28%, transparent) 0%, transparent 60%),
    linear-gradient(135deg, #1A1410 0%, #14100C 100%);
  border-color: transparent;
}
.article-figure-frame[data-tone="orange"] {
  background:
    radial-gradient(500px 300px at 20% 0%, rgba(255,255,255,0.18) 0%, transparent 60%),
    linear-gradient(135deg, var(--tap-orange) 0%, var(--tap-orange-deep) 100%);
  border-color: transparent;
}
.article-figure-placeholder {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; gap: 10px;
  align-items: center; justify-content: center;
  text-align: center;
  padding: 24px;
}
.article-figure-placeholder .label {
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}
.article-figure-frame[data-tone="light"] .article-figure-placeholder .label {
  color: var(--tap-ink-3);
}
.article-figure-placeholder .title {
  font-size: 18px; font-weight: 700; letter-spacing: -0.015em;
  color: #fff;
  max-width: 420px;
  text-wrap: balance;
}
.article-figure-frame[data-tone="light"] .article-figure-placeholder .title {
  color: var(--tap-ink);
}
.article-figure figcaption {
  margin-top: 12px;
  font-size: 13px;
  color: var(--tap-ink-3);
  font-style: italic;
  line-height: 1.5;
  max-width: 600px;
}

/* Big stat / pull-number block - used for "Trust =" style equations */
.article-equation {
  margin: 36px -16px;
  padding: 28px 32px;
  border-radius: 14px;
  background: var(--tap-orange-light);
  border: 1px solid color-mix(in oklab, var(--tap-orange) 22%, transparent);
  font-size: clamp(20px, 2.4vw, 26px);
  font-weight: 700;
  letter-spacing: -0.015em;
  line-height: 1.35;
  color: var(--tap-orange-deep);
  text-wrap: balance;
}
.article-equation em { font-style: italic; font-weight: 500; }

/* Series nav - "you're reading Part I" rail at the top of long essays */
.article-series-rail {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 16px;
  background: rgba(242,122,46,0.08);
  border: 1px solid color-mix(in oklab, var(--tap-orange) 22%, transparent);
  border-radius: 10px;
  font-size: 12.5px;
  margin: 0 0 24px;
  flex-wrap: wrap;
}
.article-series-rail .label {
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--tap-orange-deep);
}
.article-series-rail .step {
  color: var(--tap-ink-2);
  font-weight: 600;
}
.article-series-rail .step.is-current {
  color: var(--tap-ink);
  background: #fff;
  padding: 3px 8px;
  border-radius: 5px;
  border: 1px solid color-mix(in oklab, var(--tap-orange) 22%, transparent);
}
.article-series-rail .step a { color: var(--tap-orange-deep); font-weight: 700; }
.article-series-rail .sep {
  color: var(--tap-ink-4, rgba(0,0,0,0.25));
  font-weight: 400;
}

/* MANIFESTO — a dark editorial slab for numbered first-principles
   beliefs. Used by the thesis pages for the "author's point of view"
   block. Visually echoes the thesis banner on News.html (dark warm
   off-black + soft orange radial + ornamental italic numerals) so
   the two pages read as one continuous editorial set. */
.article-manifesto {
  margin: 32px -20px 44px;
  padding: 40px 40px 36px;
  border-radius: 18px;
  color: #fff;
  background:
    radial-gradient(720px 380px at 92% -10%, color-mix(in oklab, var(--tap-orange) 22%, transparent) 0%, transparent 60%),
    radial-gradient(500px 320px at -5% 110%, color-mix(in oklab, var(--tap-orange) 10%, transparent) 0%, transparent 55%),
    linear-gradient(180deg, #19130F 0%, #14100C 100%);
  border: 1px solid rgba(255,255,255,0.08);
  position: relative;
  overflow: hidden;
}
.article-manifesto-eyebrow {
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tap-orange);
  margin-bottom: 6px;
}
.article-manifesto-lede,
.article-body p.article-manifesto-lede {
  font-size: clamp(20px, 2.2vw, 26px);
  line-height: 1.3;
  font-weight: 400;
  color: #fff;
  margin: 0 0 28px;
  text-wrap: balance;
  max-width: 640px;
}
.article-manifesto-lede em {
  font-style: italic; color: var(--tap-orange); font-weight: 400;
}
.article-manifesto-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px 36px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: pov;
}
.article-manifesto-grid li {
  counter-increment: pov;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 14px;
  align-items: start;
  padding: 0;
  font-size: 14.5px;
  line-height: 1.55;
  color: rgba(255,255,255,0.72);
}
.article-manifesto-grid li::before {
  content: counter(pov, decimal-leading-zero);
  font-variant-numeric: tabular-nums;
  font-style: italic;
  font-weight: 200;
  font-size: 34px;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--tap-orange);
  padding-top: 2px;
}
.article-manifesto-grid li strong {
  display: block;
  font-size: 15.5px;
  font-weight: 700;
  letter-spacing: -0.005em;
  color: #fff;
  margin: 0 0 4px;
}
@media (max-width: 760px) {
  .article-manifesto { margin: 28px 0 36px; padding: 28px 24px; }
  .article-manifesto-grid { grid-template-columns: 1fr; gap: 22px; }
}

/* Update banner — small ribbon at the end of an article explaining
   that figures were revised. Tonally quiet; sits with the byline meta. */
.article-update-note {
  margin: 32px 0 0;
  padding: 16px 20px;
  border-radius: 10px;
  background: var(--tap-bg-warm);
  border: 1px solid var(--tap-line);
  border-left: 3px solid var(--tap-orange);
  font-size: 13px;
  color: var(--tap-ink-2);
  line-height: 1.55;
}
.article-update-note .label {
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--tap-orange-deep);
  display: block; margin-bottom: 4px;
}
.article-update-note a {
  color: var(--tap-orange-deep); font-weight: 700;
  border-bottom: 1px solid color-mix(in oklab, var(--tap-orange) 30%, transparent);
}

/* Quote with attribution (used for retailer / brand testimonials) */
.article-quote-card {
  margin: 36px 0;
  padding: 28px 32px;
  background: var(--tap-bg-warm);
  border: 1px solid var(--tap-line);
  border-left: 4px solid var(--tap-orange);
  border-radius: 12px;
}
.article-quote-card blockquote {
  margin: 0 0 14px;
  font-size: 19px; font-style: italic; font-weight: 350;
  color: var(--tap-ink);
  line-height: 1.45;
  text-wrap: balance;
}
.article-quote-card .attribution {
  font-size: 13px;
  color: var(--tap-ink-2);
  font-weight: 600;
  letter-spacing: 0.005em;
}
.article-quote-card .attribution .who { color: var(--tap-ink); font-weight: 700; }

/* Mini "next in series" card at the foot of Part I */
.article-next-in-series {
  margin: 56px 0 0;
  padding: 32px 32px;
  border-radius: 18px;
  background:
    radial-gradient(600px 320px at 100% 0%, color-mix(in oklab, var(--tap-orange) 22%, transparent) 0%, transparent 60%),
    linear-gradient(135deg, #1A1410 0%, #14100C 100%);
  color: #fff;
  display: block;
  border: 1px solid rgba(255,255,255,0.10);
  transition: transform 220ms var(--ease);
}
.article-next-in-series:hover { transform: translateY(-3px); }
.article-next-in-series .label {
  font-size: 10.5px; font-weight: 800; letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tap-orange);
}
.article-next-in-series h3 {
  font-size: clamp(22px, 2.6vw, 28px);
  font-weight: 700; letter-spacing: -0.02em; line-height: 1.15;
  margin: 10px 0 6px;
  color: #fff;
  text-wrap: balance;
}
.article-next-in-series .sub {
  font-size: 15px; color: rgba(255,255,255,0.65);
  font-style: italic;
  margin: 0 0 18px;
}
.article-next-in-series .cta {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--tap-orange);
}
.article-next-in-series .cta svg { width: 12px; height: 12px; transition: transform 220ms var(--ease); }
.article-next-in-series:hover .cta svg { transform: translateX(3px); }

/* ---------- RELATED ---------- */
.article-related {
  background: var(--tap-bg-warm);
  border-top: 1px solid var(--tap-line);
  padding: var(--pad-y) 28px;
}
.article-related-inner {
  max-width: calc(var(--maxw) - 2 * var(--pad-x)); margin: 0 auto;
  display: flex; flex-direction: column; gap: 36px;
}
.article-related-head { max-width: 720px; }
.article-related-head h2 {
  font-size: clamp(32px, 4vw, 48px);
  font-weight: 700; letter-spacing: -0.025em; line-height: 1.1;
  margin: 12px 0 0;
  text-wrap: balance;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1000px) {
  .article-section-inner { grid-template-columns: 1fr; gap: 32px; }
  .article-rail { position: static; }
  .article-toc { flex-direction: row; flex-wrap: wrap; }
  .article-share { display: none; }
  .article-byline { grid-template-columns: 44px 1fr; }
  .article-byline-meta { display: none; }
  .article-pullquote { margin-left: 0; margin-right: 0; }
}
@media (max-width: 640px) {
  .article-hero, .article-section, .article-related { padding-left: 20px; padding-right: 20px; }
  .article-author-card { grid-template-columns: 1fr; gap: 12px; }
}
