/* ============================================================
   HarmoniQ — Article Page Styles
   Supplements main.css for long-form editorial content.
   ============================================================ */

/* ── Article Hero ─────────────────────────────────────────── */
.article-hero {
  padding: calc(var(--nav-height) + 80px) 0 56px;
  background: var(--dark-bg);
  color: var(--dark-text);
  position: relative;
}
.article-hero::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,200,122,0.3), transparent);
}
.article-hero-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 40px;
}
.article-hero-tag {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2.5px;
  color: var(--accent-light);
  margin-bottom: 28px;
}
.article-hero h1 {
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 800;
  color: var(--dark-text);
  line-height: 1.12;
  letter-spacing: -0.04em;
  margin-bottom: 28px;
}
.article-hero-sub {
  font-size: 1.125rem;
  font-weight: 400;
  color: var(--dark-muted);
  line-height: 1.7;
  max-width: 580px;
}
.article-hero-meta {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--dark-border);
  display: flex;
  gap: 28px;
  font-size: 0.75rem;
  font-weight: 500;
  color: rgba(255,255,255,0.35);
  letter-spacing: 0.3px;
}

/* ── Article Body ─────────────────────────────────────────── */
.article-body {
  max-width: 680px;
  margin: 0 auto;
  padding: 56px 40px 100px;
}

.article-body p {
  font-size: 1.0625rem;
  line-height: 1.82;
  margin-bottom: 28px;
  font-weight: 400;
  color: var(--text-secondary);
}

.article-body h2 {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin: 72px 0 0;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--text-primary);
  scroll-margin-top: calc(var(--nav-height) + 24px);
}
.article-body h2 + .section-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin: 20px 0 24px;
}

.article-body h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 44px 0 16px;
  letter-spacing: -0.3px;
  scroll-margin-top: calc(var(--nav-height) + 24px);
}

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

.article-body ol, .article-body ul {
  margin: 0 0 28px 0;
  padding-left: 24px;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-secondary);
}
.article-body li {
  margin-bottom: 12px;
  padding-left: 4px;
}

.article-body a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.article-body a:hover {
  color: var(--accent-light);
}

/* ── Exhibit (data tables) ────────────────────────────────── */
.exhibit {
  margin: 40px 0 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.exhibit-label {
  padding: 14px 24px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.exhibit-label .num {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
}
.exhibit-label .desc {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
}
.exhibit table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  line-height: 1.6;
}
.exhibit th {
  text-align: left;
  padding: 12px 20px;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  background: var(--bg-primary);
}
.exhibit td {
  padding: 13px 20px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: top;
  color: var(--text-secondary);
}
.exhibit tr:last-child td { border-bottom: none; }
.exhibit .row-highlight td {
  background: var(--accent-dim);
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Key Stat Block ───────────────────────────────────────── */
.key-stat {
  margin: 56px 0;
  padding: 56px 40px;
  background: var(--dark-bg);
  border-radius: var(--radius-md);
  text-align: center;
  color: var(--dark-text);
}
.key-stat .number {
  font-size: 5rem;
  font-weight: 800;
  letter-spacing: -4px;
  line-height: 1;
  color: var(--accent-light);
}
.key-stat .number span { font-size: 2.5rem; letter-spacing: -1px; }
.key-stat .caption {
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--dark-muted);
  margin-top: 16px;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.65;
}

/* ── Insight Box ──────────────────────────────────────────── */
.insight-box {
  margin: 40px 0 44px;
  padding: 32px 36px;
  background: var(--bg-secondary);
  border-left: 3px solid var(--text-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.insight-box .label {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.insight-box p {
  font-size: 0.9375rem;
  line-height: 1.75;
  margin-bottom: 12px;
  color: var(--text-secondary);
}
.insight-box p:last-child { margin-bottom: 0; }
.insight-box strong { color: var(--text-primary); }

/* ── Pull Quote ───────────────────────────────────────────── */
.pull-quote {
  margin: 52px 0;
  padding: 0 0 0 32px;
  border-left: 3px solid var(--accent);
}
.pull-quote p {
  font-size: 1.375rem;
  font-weight: 300;
  color: var(--text-primary);
  line-height: 1.55;
  letter-spacing: -0.3px;
  margin: 0;
}

/* ── Callout Block ────────────────────────────────────────── */
.callout-block {
  margin: 52px 0;
  padding: 40px;
  background: var(--accent-dim);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.callout-block .label {
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--accent);
  margin-bottom: 12px;
}
.callout-block p {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin: 0;
}
.callout-block strong { color: var(--text-primary); }

/* ── Steps ────────────────────────────────────────────────── */
.art-steps { margin: 36px 0 44px; }
.art-step {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 0 20px;
  margin-bottom: 32px;
  align-items: start;
}
.art-step-num {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--text-primary);
  color: var(--bg-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem;
  font-weight: 700;
  flex-shrink: 0;
}
.art-step-body h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  padding-top: 4px;
}
.art-step-body p {
  font-size: 0.9375rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin: 0;
}

/* ── Article CTA ──────────────────────────────────────────── */
.article-cta {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 40px 80px;
}
.article-cta-card {
  padding: 48px;
  background: var(--dark-bg);
  border-radius: var(--radius-md);
  text-align: center;
}
.article-cta-card h3 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--dark-text);
  letter-spacing: -0.5px;
  margin-bottom: 12px;
}
.article-cta-card p {
  font-size: 0.9375rem;
  color: var(--dark-muted);
  line-height: 1.7;
  margin-bottom: 32px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}
.article-cta-card a.btn {
  display: inline-block;
}

/* ── Back to Insights link ────────────────────────────────── */
.article-back {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 40px;
}
.article-back a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition);
}
.article-back a:hover {
  color: var(--accent);
}

/* ── Table of Contents ────────────────────────────────────── */
.article-toc-wrapper {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
}
.article-toc {
  position: fixed;
  top: calc(var(--nav-height) + 32px);
  left: max(16px, calc(50% - 540px));
  width: 180px;
  max-height: calc(100vh - var(--nav-height) - 64px);
  overflow-y: auto;
  z-index: 50;
  opacity: 0;
  transform: translateX(-8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
.article-toc.visible {
  opacity: 1;
  transform: translateX(0);
}
.article-toc-label {
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.article-toc ol {
  list-style: none;
  padding: 0;
  margin: 0;
  border-left: 1px solid var(--border);
}
.article-toc li {
  margin: 0;
}
.article-toc a {
  display: block;
  padding: 6px 0 6px 16px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  line-height: 1.4;
  border-left: 2px solid transparent;
  margin-left: -1px;
  transition: color 0.2s, border-color 0.2s;
}
.article-toc a:hover {
  color: var(--text-primary);
}
.article-toc a.active {
  color: var(--accent);
  border-left-color: var(--accent);
  font-weight: 600;
}

/* ── Inline colour helpers (green/red for table cells) ────── */
.g { color: var(--accent); }
.r { color: #dc2626; }

/* ── Comparison Cards (replaces Yes/No matrix tables) ─────── */
.comparison-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 28px 0; }
.comparison-card { border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.comparison-card-title { padding: 14px 16px; font-size: 0.875rem; font-weight: 700; color: var(--text-primary); background: var(--bg-secondary); border-bottom: 1px solid var(--border); }
.comparison-card-row { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; font-size: 0.8125rem; border-bottom: 1px solid var(--border-subtle); }
.comparison-card-row:last-child { border-bottom: none; }
.comparison-card-row span:first-child { color: var(--text-secondary); }
.comparison-card-row span:last-child { font-weight: 700; }
.comparison-card-row .g { color: var(--accent); }
.comparison-card-row .r { color: #dc2626; }
@media (max-width: 640px) { .comparison-cards { grid-template-columns: 1fr; } }

/* ── Table scroll wrapper (desktop fallback) ──────────────── */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 24px 0; }
.table-scroll table { margin: 0; }
.article-body table { max-width: 100%; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 1100px) {
  .article-toc { display: none; }
}
@media (max-width: 768px) {
  .article-hero { padding: calc(var(--nav-height) + 48px) 0 40px; }
  .article-hero-inner { padding: 0 24px; }
  .article-hero h1 { font-size: 2rem; }
  .article-body { padding: 40px 24px 60px; overflow-x: hidden; word-break: break-word; }
  .article-body p, .article-body li { overflow-wrap: break-word; }
  .article-cta { padding: 0 24px 60px; }
  .article-cta-card { padding: 32px 24px; }
  .article-back { padding: 0 24px; }
  .key-stat { margin: 40px -24px; border-radius: 0; padding: 40px 24px; }
  .key-stat .number { font-size: 2.5rem; letter-spacing: -2px; }
  .key-stat .caption { font-size: 0.8125rem; }
  .art-step { grid-template-columns: 44px 1fr; }
  .art-step-num { width: 44px; height: 44px; font-size: 0.9375rem; }
  .exhibit { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .exhibit table { font-size: 0.75rem; min-width: 480px; }
  .exhibit th { font-size: 0.6rem; padding: 10px 12px; }
  .exhibit td { padding: 10px 12px; }
  .exhibit-label { flex-direction: column; gap: 4px; padding: 12px 16px; }
  .article-hero-meta { flex-wrap: wrap; gap: 16px; }
  .insight-box { padding: 24px 20px; }
  .callout-block { padding: 28px 20px; }
  .pull-quote { padding-left: 20px; }
  .pull-quote p { font-size: 1.125rem; }

  /* Convert inline tables to stacked cards (not .exhibit tables) */
  .article-body > table,
  .article-body > .table-scroll table {
    display: block; width: 100% !important; min-width: 0 !important; margin: 24px 0;
    border-collapse: collapse; font-size: 0.9rem;
  }
  .article-body > table tr:first-child,
  .article-body > .table-scroll table tr:first-child {
    display: none; /* hide header row */
  }
  .article-body > table tr,
  .article-body > .table-scroll table tr {
    display: block; padding: 16px 0; border-bottom: 1px solid var(--border);
  }
  .article-body > table tr:last-child,
  .article-body > .table-scroll table tr:last-child {
    border-bottom: none;
  }
  .article-body > table td,
  .article-body > .table-scroll table td {
    display: block; padding: 2px 0; border: none; line-height: 1.7;
    color: var(--text-secondary); font-size: 0.9rem;
  }
  .article-body > table td:first-child,
  .article-body > .table-scroll table td:first-child {
    font-size: 0.95rem; color: var(--text-primary); margin-bottom: 6px;
  }
  .article-body > table td:last-child,
  .article-body > .table-scroll table td:last-child {
    font-size: 0.8rem; color: var(--text-muted); font-style: italic; margin-top: 4px;
  }
  .article-body > .table-scroll { overflow-x: visible; }
}

/* ── Print ────────────────────────────────────────────────── */
@media print {
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .nav, .footer, .article-cta, .article-back { display: none; }
  .article-hero { padding-top: 40px; }
  .key-stat, .exhibit { break-inside: avoid; }
}
