/* ============================================================
   H Heuristics — Editorial Print Design System
   "Consulting/Economist meets British America" × Magazine Print

   Anti-Claude strategy: print design rules, not web conventions.
   Multi-column, drop caps, pull quotes that break grids, hairlines,
   paper texture, dramatic scale, asymmetric tension.

   Requires: hheuristics-tokens.css
   ============================================================ */

/* ============================================================
   1. PAPER TEXTURE — The Foundation
   Subtle noise grain on the background. Everything feels printed.
   ============================================================ */
@layer base {
  body {
    position: relative;
  }

  /* Subtle paper grain overlay */
  body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
    background-size: 256px 256px;
  }
}

/* ============================================================
   2. HAIRLINE RULES — Print-Quality Dividers
   Not the chunky CSS border. 0.5px hairline rules like a magazine.
   ============================================================ */
.hairline {
  width: 100%;
  height: 0.5px;
  background: var(--border-default);
  margin: var(--space-16) 0;
}

.hairline--gold {
  background: var(--color-accent);
  opacity: 0.6;
}

.hairline--short {
  width: 80px;
  height: 1px;
  background: var(--color-accent);
  margin: var(--space-8) 0;
}

.hairline--fade {
  background: linear-gradient(
    to right,
    transparent 0%,
    var(--border-default) 20%,
    var(--border-default) 80%,
    transparent 100%
  );
}

/* ============================================================
   3. MAGAZINE HERO — Cover-Style Opening
   Not a dark banner. A print cover: oversized type, negative space,
   tiny metadata. The headline IS the visual.
   ============================================================ */
.magazine-hero {
  padding: var(--space-32) 0 var(--space-24);
  position: relative;
}

.magazine-hero__kicker {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: var(--tracking-mono);
  margin-bottom: var(--space-6);
}

.magazine-hero__headline {
  font-family: var(--font-display);
  font-size: clamp(3rem, 6vw, 5.5rem);
  font-weight: var(--weight-bold);
  color: var(--color-brand);
  line-height: 0.95;
  letter-spacing: -0.025em;
  max-width: 14ch;
}

.magazine-hero__dek {
  font-family: var(--font-body);
  font-size: var(--text-xl);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  max-width: 28rem;
  margin-top: var(--space-8);
}

.magazine-hero__meta {
  display: flex;
  align-items: center;
  gap: var(--space-6);
  margin-top: var(--space-10);
  padding-top: var(--space-6);
  border-top: 0.5px solid var(--border-default);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
}

.magazine-hero__meta span {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.magazine-hero__meta span + span::before {
  content: '·';
  margin-right: var(--space-4);
  color: var(--border-strong);
}

/* ── Hero with a large folio number ── */
.magazine-hero--numbered {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: var(--space-10);
  align-items: start;
}

.magazine-hero__folio {
  font-family: var(--font-display);
  font-size: 8rem;
  font-weight: var(--weight-bold);
  color: var(--color-accent);
  line-height: 0.75;
  opacity: 0.25;
  user-select: none;
  pointer-events: none;
}

/* ============================================================
   4. MULTI-COLUMN BODY TEXT — Magazine Layout
   2-column body text for wider screens. This alone kills the
   Claude look — AI never does multi-column.
   ============================================================ */
.prose-columns {
  column-count: 1;
  column-gap: var(--space-10);
  column-rule: 0.5px solid var(--border-subtle);
}

@media (min-width: 720px) {
  .prose-columns {
    column-count: 2;
  }
}

@media (min-width: 1024px) {
  .prose-columns--3 {
    column-count: 3;
  }
}

.prose-columns p {
  break-inside: avoid;
  margin-bottom: var(--space-4);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-loose);
  color: var(--text-secondary);
  text-wrap: pretty;
}

.prose-columns p:first-child {
  margin-top: 0;
}

/* ============================================================
   5. DROP CAP — The Ultimate Print Tell
   Oversized first letter that drops 3-4 lines into the text.
   AI virtually never does this.
   ============================================================ */
.drop-cap::first-letter {
  float: left;
  font-family: var(--font-display);
  font-size: 4.5em;
  font-weight: var(--weight-bold);
  color: var(--color-brand);
  line-height: 0.75;
  padding-right: 0.12em;
  padding-top: 0.04em;
  margin-bottom: -0.12em;
}

.drop-cap--gold::first-letter {
  color: var(--color-accent);
}

/* ============================================================
   6. PULL QUOTE — Breaks the Column Grid
   Not a card. A dramatic quote that spans columns, with hairlines
   above and below. Magazine designers use these for rhythm.
   ============================================================ */
.pull-quote {
  column-span: all;
  padding: var(--space-8) 0;
  margin: var(--space-10) 0;
  border-top: 0.5px solid var(--border-default);
  border-bottom: 0.5px solid var(--border-default);
  text-align: center;
}

.pull-quote__text {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-medium);
  font-style: italic;
  color: var(--color-brand);
  line-height: var(--leading-snug);
  max-width: 24ch;
  margin: 0 auto;
}

.pull-quote__attribution {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-mono);
  margin-top: var(--space-4);
}

/* ── Side pull quote (in margin, not spanning) ── */
.pull-quote--side {
  float: right;
  width: 220px;
  margin: var(--space-4) 0 var(--space-6) var(--space-10);
  padding: var(--space-4) 0;
  border-top: 0.5px solid var(--color-accent);
  border-bottom: 0.5px solid var(--color-accent);
  text-align: left;
  column-span: none;
}

.pull-quote--side .pull-quote__text {
  font-size: var(--text-xl);
  max-width: none;
}

/* ============================================================
   7. FOLIO NUMBERS — Section Markers
   Oversized numbers that mark sections like magazine page numbers.
   Used as decorative background elements, not functional UI.
   ============================================================ */
.folio {
  font-family: var(--font-display);
  font-weight: var(--weight-bold);
  color: var(--color-accent);
  opacity: 0.12;
  line-height: 0.75;
  user-select: none;
  pointer-events: none;
}

.folio--lg  { font-size: 12rem; }
.folio--md  { font-size: 8rem;  }
.folio--sm  { font-size: 5rem;  }

/* ── Section with folio number ── */
.section-folio {
  position: relative;
  padding-top: var(--space-16);
}

.section-folio__number {
  position: absolute;
  top: 0;
  left: 0;
  font-family: var(--font-display);
  font-size: 10rem;
  font-weight: var(--weight-bold);
  color: var(--color-accent);
  opacity: 0.08;
  line-height: 0.7;
  user-select: none;
  pointer-events: none;
}

/* ============================================================
   8. RUNNING HEAD / MARGINALIA — Print Navigation
   Small text in the margin or at section tops that labels content.
   Like magazine section headers or running feet.
   ============================================================ */
.running-head {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-mono);
  position: relative;
  padding-bottom: var(--space-3);
  margin-bottom: var(--space-8);
}

.running-head::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 40px;
  height: 0.5px;
  background: var(--color-accent);
}

/* ── Side marginalia ── */
.marginalia {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-style: italic;
  line-height: var(--leading-relaxed);
}

@media (min-width: 900px) {
  .with-marginalia {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: var(--space-10);
  }
}

/* ============================================================
   9. ASYMMETRIC LAYOUT — Intentional Tension
   Not the standard image-left/text-right. Deliberate imbalance.
   ============================================================ */
.asymmetric-2col {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-10);
}

@media (min-width: 768px) {
  .asymmetric-2col {
    grid-template-columns: 1fr 1fr;
  }

  .asymmetric-2col--wide-left  { grid-template-columns: 1.5fr 1fr; }
  .asymmetric-2col--wide-right { grid-template-columns: 1fr 1.5fr; }
  .asymmetric-2col--extreme    { grid-template-columns: 2fr 1fr; }
}

/* ============================================================
   10. STAT BLOCK — Editorial Data Presentation
   Not cards-in-a-grid. Numbers presented like a magazine
   sidebar — compact, dense, with hairline separators.
   ============================================================ */
.stat-block {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 0;
  border-top: 0.5px solid var(--border-default);
  border-bottom: 0.5px solid var(--border-default);
}

.stat-block__item {
  padding: var(--space-5) var(--space-6);
  border-right: 0.5px solid var(--border-subtle);
}

.stat-block__item:last-child {
  border-right: none;
}

.stat-block__value {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  color: var(--color-brand);
  line-height: 1;
  margin-bottom: var(--space-1);
}

.stat-block__label {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
}

.stat-block__trend {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  margin-top: var(--space-2);
  color: var(--hh-success);
}

.stat-block__trend--down { color: var(--hh-danger); }
.stat-block__trend--flat { color: var(--text-muted); }

/* ============================================================
   11. EDITORIAL CARD — Restrained, Not Rounded
   Thin border, minimal shadow, left accent line. No 8px radius.
   Print doesn't do rounded corners.
   ============================================================ */
.editorial-card {
  background: var(--surface-card);
  border: 0.5px solid var(--border-subtle);
  padding: var(--space-6);
  transition: border-color var(--duration-fast) var(--ease-out);
}

.editorial-card:hover {
  border-color: var(--border-accent);
}

.editorial-card--accent {
  border-left: 2px solid var(--color-accent);
}

.editorial-card__kicker {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  margin-bottom: var(--space-3);
}

.editorial-card__heading {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  color: var(--color-brand);
  line-height: var(--leading-snug);
  margin-bottom: var(--space-2);
}

.editorial-card__body {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
}

/* ============================================================
   12. MAGAZINE SECTION OPENER
   Full-spread section opening with oversized type and minimal
   chrome. Like the start of a magazine feature.
   ============================================================ */
.section-opener {
  padding: var(--space-24) 0 var(--space-16);
  position: relative;
}

.section-opener__number {
  font-family: var(--font-display);
  font-size: clamp(4rem, 8vw, 7rem);
  font-weight: var(--weight-bold);
  color: var(--color-accent);
  opacity: 0.15;
  line-height: 0.8;
  margin-bottom: var(--space-4);
}

.section-opener__heading {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: var(--weight-semibold);
  color: var(--color-brand);
  line-height: var(--leading-tight);
  max-width: 16ch;
}

.section-opener__subtitle {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: var(--text-secondary);
  line-height: var(--leading-relaxed);
  max-width: 32rem;
  margin-top: var(--space-6);
}

/* ============================================================
   13. ARTICLE BODY — The Core Reading Experience
   Comfortable measure, generous leading, serif body for long reads.
   ============================================================ */
.article-body {
  max-width: 34rem;
  margin: 0 auto;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-loose);
  color: var(--text-secondary);
}

.article-body p {
  margin-bottom: var(--space-5);
  text-wrap: pretty;
}

.article-body p.lede {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-medium);
  font-style: italic;
  color: var(--text-primary);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-6);
}

.article-body h3 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--weight-semibold);
  color: var(--color-brand);
  margin-top: var(--space-10);
  margin-bottom: var(--space-4);
}

.article-body hr {
  border: none;
  border-top: 0.5px solid var(--border-default);
  width: 60px;
  margin: var(--space-10) auto;
}

/* ============================================================
   14. MAGAZINE TABLE — Editorial Data Tables
   Thin rules, small type, monospace numbers. Like a table in
   The Economist or the Financial Times.
   ============================================================ */
.magazine-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: var(--text-sm);
}

.magazine-table thead th {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--text-muted);
  border-bottom: 0.5px solid var(--color-brand);
  padding: var(--space-2) var(--space-3);
  text-align: left;
  white-space: nowrap;
}

.magazine-table tbody td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 0.5px solid var(--border-subtle);
  color: var(--text-primary);
}

.magazine-table tbody tr:hover td {
  background-color: oklch(0.92 0.03 82 / 0.3);
}

.magazine-table .num {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.magazine-table .rank {
  font-weight: var(--weight-bold);
  color: var(--color-accent);
  text-align: center;
}

.magazine-table .name {
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
}

/* ============================================================
   15. KICKER + HEADLINE — The Editorial Pairing
   Small uppercase label + large serif heading. Used everywhere.
   ============================================================ */
.kicker-headline {
  margin-bottom: var(--space-10);
}

.kicker-headline__kicker {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  color: var(--color-accent);
  text-transform: uppercase;
  letter-spacing: var(--tracking-mono);
  margin-bottom: var(--space-2);
}

.kicker-headline__heading {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: var(--weight-semibold);
  color: var(--color-brand);
  line-height: var(--leading-tight);
}

.kicker-headline__sub {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: var(--text-secondary);
  margin-top: var(--space-4);
  max-width: 30rem;
}

/* ============================================================
   16. BYLINE / METADATA — Print Crediting
   ============================================================ */
.byline {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.byline__name {
  font-weight: var(--weight-semibold);
  color: var(--text-primary);
}

.byline__dot {
  color: var(--border-strong);
  font-size: var(--text-xs);
}

/* ============================================================
   17. DARK SPREAD — For Dramatic Contrast
   A full-width dark section that feels like a magazine photo spread.
   Not a "hero section" — a visual break in the editorial rhythm.
   ============================================================ */
.dark-spread {
  background: var(--surface-dark);
  color: var(--text-inverse);
  padding: var(--space-24) 0;
  position: relative;
}

.dark-spread__heading {
  font-family: var(--font-display);
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  color: var(--text-inverse);
  line-height: var(--leading-tight);
  max-width: 16ch;
}

.dark-spread__body {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  color: var(--hh-navy-100);
  line-height: var(--leading-relaxed);
  max-width: 28rem;
  margin-top: var(--space-6);
}

.dark-spread__accent {
  color: var(--color-accent);
}

/* ============================================================
   18. CHAPTER INDICATOR — Running Navigation
   Like a magazine showing which section you're in at the top
   of each page.
   ============================================================ */
.chapter-indicator {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: var(--tracking-mono);
}

.chapter-indicator__rule {
  flex: 1;
  height: 0.5px;
  background: var(--border-subtle);
}

/* ============================================================
   19. COMPACT NAV — Magazine Header Style
   Minimal header. Not a fat nav bar. Like a magazine masthead —
   just the brand mark and a thin rule.
   ============================================================ */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-5) 0;
  border-bottom: 0.5px solid var(--border-default);
  margin-bottom: var(--space-10);
}

.masthead__brand {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  color: var(--color-brand);
  text-decoration: none;
  letter-spacing: -0.01em;
}

.masthead__nav {
  display: flex;
  gap: var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
}

.masthead__nav a {
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--duration-fast) var(--ease-out);
}

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

/* ============================================================
   20. COLOPHON — Magazine Footer
   Not a fat footer. A refined colophon like the back of a
   magazine — small type, minimal, elegant.
   ============================================================ */
.colophon {
  border-top: 0.5px solid var(--border-default);
  margin-top: var(--space-24);
  padding: var(--space-8) 0 var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-xs);
  color: var(--text-muted);
  line-height: var(--leading-relaxed);
}

.colophon__grid {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-8);
}

.colophon__brand {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--color-brand);
  margin-bottom: var(--space-2);
}

.colophon__heading {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--text-primary);
  margin-bottom: var(--space-3);
}

.colophon__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.colophon__list a {
  color: var(--text-muted);
  text-decoration: none;
}

.colophon__list a:hover {
  color: var(--color-accent);
}

.colophon__rule {
  border: none;
  border-top: 0.5px solid var(--border-subtle);
  margin: var(--space-6) 0 var(--space-4);
}

/* ============================================================
   21. BUTTONS — Print-Appropriate
   Understated. Not pill-shaped. Like a text link with a border.
   ============================================================ */
.btn-print {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  padding: var(--space-3) var(--space-6);
  cursor: pointer;
  text-decoration: none;
  transition: all var(--duration-fast) var(--ease-out);
  border: 0.5px solid var(--border-default);
  background: transparent;
  color: var(--color-brand);
}

.btn-print:hover {
  border-color: var(--color-brand);
  color: var(--color-brand);
}

.btn-print--filled {
  background: var(--color-brand);
  color: var(--text-inverse);
  border-color: var(--color-brand);
}

.btn-print--filled:hover {
  background: var(--color-brand-light);
  border-color: var(--color-brand-light);
}

.btn-print--gold {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.btn-print--gold:hover {
  background: var(--color-accent);
  color: var(--color-brand-dark);
}

.btn-print--lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
}

.btn-print--sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-xs);
}

/* ============================================================
   22. TAGS — Editorial Badges
   ============================================================ */
.tag-print {
  display: inline-block;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  padding: 1px 8px;
  border: 0.5px solid var(--border-default);
  color: var(--text-muted);
}

.tag-print--brand {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.tag-print--navy {
  border-color: var(--color-brand);
  color: var(--color-brand);
}

/* ============================================================
   23. ANIMATIONS — Subtle, Print-Quality
   No bouncy springs. Just a quiet fade. Ink settling on paper.
   ============================================================ */
@keyframes ink-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes ink-rise {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.animate-ink-fade {
  animation: ink-fade 0.5s ease-out forwards;
}

.animate-ink-rise {
  animation: ink-rise 0.6s ease-out forwards;
}

.stagger-ink > * {
  opacity: 0;
  animation: ink-rise 0.5s ease-out forwards;
}

.stagger-ink > *:nth-child(1)  { animation-delay: 0.05s; }
.stagger-ink > *:nth-child(2)  { animation-delay: 0.12s; }
.stagger-ink > *:nth-child(3)  { animation-delay: 0.19s; }
.stagger-ink > *:nth-child(4)  { animation-delay: 0.26s; }
.stagger-ink > *:nth-child(5)  { animation-delay: 0.33s; }
.stagger-ink > *:nth-child(6)  { animation-delay: 0.40s; }

/* ============================================================
   24. REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ============================================================
   25. PRINT STYLESHEET
   ============================================================ */
@media print {
  body::before { display: none; }
  body { background: #fff; color: #000; }
  .dark-spread {
    background: #fff !important;
    color: #000 !important;
  }
  .dark-spread__heading,
  .dark-spread__body { color: #000 !important; }
}
