/* design/typography.css — the design layer, type. Loaded after the theme
   stylesheets, so it wins without !important.
   Source: Figma "Hyperallergic 2026 — Design System" (I4wEr3rpoOWSpmeVtuubTC),
   frame 7:328 "Type". Two binding errors in that file are read past here —
   see .claude/FIGMA-INVENTORY.md.
   GENERATED FROM FIGMA — DO NOT HAND-TUNE. If a value doesn't match, fix
   Figma or the extraction (.claude/FIGMA.md). Every value notes its source.
   Conversions: px ÷ 16 → rem; Figma tracking is percent, ÷ 100 → em. */

:root {
  /* Families — declared in partials/fonts.hbs; this assigns roles. */

  /* Body copy, description text, links, small caps. */
  --font-body: "Spectator Text", Georgia, "Times New Roman", serif;

  /* Headlines, interface voice (h1–h6, section headers, News titles). Stays
     the sans at :root; see THE EDITORIAL VOICE below. */
  --font-heading: "Hyperallergic TwoOneFive", system-ui, -apple-system, sans-serif;

  /* Headlines, editorial voice (post titles outside News). One weight only. */
  --font-heading-alt: "Spectator Head", Georgia, "Times New Roman", serif;
  --weight-heading-alt: 400;

  /* Section headers, bylines, tags, metadata, captions, navigation. */
  --font-ui: "Hyperallergic TwoOneFive", system-ui, -apple-system, sans-serif;

  /* The dropcap is set in the display serif rather than the body face it sits
     inside. Figma: Dropcaps — Spectator Head 68/110/-1. */
  --dropcap-font: "Spectator Head", Georgia, serif;
  --dropcap-size: calc(4.25rem * var(--text-scale)); /* 68px */

  /* Size scale — only the steps the structural CSS references. Each is
     multiplied by --text-scale (01-tokens.css) so the reader's larger-type
     choice reaches it; keep the calc() when retuning a value. */
  --text-sm:   calc(0.875rem * var(--text-scale)); /* 14px — Figma: Card Bylines, Caption */
  --text-base: calc(1rem * var(--text-scale));     /* 16px — Figma: Small Text, Article Tags, Nav Items */
  --text-lg:   calc(1.125rem * var(--text-scale)); /* 18px — Figma: Description Text, Small Headline */
  --text-xl:   calc(1.25rem * var(--text-scale));  /* 20px — Figma: Body Text */
  --text-2xl:  calc(1.5rem * var(--text-scale));   /* 24px — Figma: Medium Headline */
  --text-3xl:  calc(2rem * var(--text-scale));     /* 32px — Figma: Header/General, both sans and serif cuts [was 30px] */
  --text-4xl:  calc(3rem * var(--text-scale));     /* 48px — Figma: Headline/XL, both cuts  [was 36px] */

  /* Off-scale role sizes, each exposed by its component as a knob. */
  --post-tag-size: calc(1.0625rem * var(--text-scale)); /* 17px */

  /* Figma "Membership Page" 1570:29776 (file ANnCC7l2WszcizAuitqUjU). */
  --membership-title-size: calc(2.625rem * var(--text-scale)); /* 42px — Figma: hero headline */
  --membership-price-size: calc(2.25rem * var(--text-scale));  /* 36px — Figma: tier price, Spectator Text */

  /* Newsletter box headline, measured off the design PNG. */
  --newsletter-signup-title-size: calc(2.25rem * var(--text-scale)); /* 36px */

  /* Author archive name, measured off the author-page mock. */
  --archive-author-title-size: calc(2.25rem * var(--text-scale)); /* 36px */

  /* Post headline on a phone, per design review. */
  --post-title-mobile-size: calc(2.375rem * var(--text-scale)); /* 38px */

  /* Homepage lead headline on a phone, per design review. */
  --lead-title-mobile-size: calc(2.25rem * var(--text-scale)); /* 36px */

  /* Line height (Figma ratios) */
  --leading-tight:  1.1; /* Figma: all headline styles */
  --leading-snug:   1.3; /* Figma: Medium/Small Headline, bylines, tags, metadata */
  --leading-normal: 1.5; /* Figma: Body Text */

  /* Article prose runs looser than Figma's 1.5, which measures tight at length. */
  --leading-body:   1.6;

  /* Weight — all real cuts, nothing synthesised. */
  --weight-normal:   400;
  --weight-medium:   500;
  --weight-semibold: 600; /* Figma: Body Text (Semibold) */
  --weight-bold:     600; /* Figma's General Header (Bold) is 700; set lighter on purpose. */

  /* Spectator Head is 400 only: set this to 400 if --font-heading becomes it. */
  --weight-heading: 500;

  /* Tracking (Figma percent ÷ 100 → em) */
  --tracking-tight:   -0.04em; /*  -4% — Figma: Extra Large / Large Headline (sans) */
  --tracking-snug:    -0.02em; /*  -2% — Figma: Medium Headline, Section Headers */
  --tracking-slight:  -0.01em; /*  -1% — Figma: bylines, metadata, nav items */
  --tracking-normal:   0;      /*   0% — Figma: all Spectator Text styles */
  --tracking-wide:     0.1em;  /* +10% — Figma: Small Caps */

  /* The design's -3% has no step; it rounds to --tracking-snug. */
}

/* THE EDITORIAL VOICE — post titles in the serif, News included, wherever
   News is mixed in with other sections, so a News card matches its
   neighbours. Where only News is on show (the homepage News section, the
   News archive, a News article) titles keep the sans, and every other tag
   archive but Reviews follows the News archive. Done as token overrides on
   a scope ([data-section] = primary tag slug, or the tag archive), not by
   restyling selectors. :root stays sans so h1–h6 site-wide don't turn
   serif. */

/* Every post scope → serif (untagged posts included). */
:is(
  [data-section],
  body.tag-template
) {
  --font-heading: var(--font-heading-alt);
  --weight-heading: var(--weight-heading-alt);
  /* Serif tracks looser than the sans. */
  --tracking-tight: -0.01em;
  --tracking-snug: -0.01em;
}

/* Only News on show, and the tag archives → sans, for every post in them
   whatever its primary tag. Reviews (tag-reviews.hbs) keeps the serif. The
   archives are scoped to .site-main so the navigation menu's trending cards
   (a mixed list) stay serif. Cards carry .post too ({{post_class}}), hence
   the :not(). The *-default tokens are pinned in 01-tokens.css. */
.news [data-section],
body.tag-template:not(.tag-reviews),
body.tag-template:not(.tag-reviews) .site-main [data-section],
.post:not(.post-card)[data-section="news"],
.site-header__post-title[data-section="news"] {
  --font-heading: var(--font-heading-default);
  --weight-heading: var(--weight-heading-default);
  --tracking-tight: var(--tracking-tight-default);
  --tracking-snug: var(--tracking-snug-default);
}

/* ARCHIVE HEADERS → sans on Reviews too, as on every other tag archive.
   Wins by inheritance over body.tag-template; its cards stay serif. */
.archive-header {
  --font-heading: var(--font-heading-default);
  --weight-heading: var(--weight-heading-default);
  --tracking-tight: var(--tracking-tight-default);
  --tracking-snug: var(--tracking-snug-default);
}

/* LARGE and WIDE IMAGE → serif title, except on News posts, which keep the
   sans on every layout. Wins by inheritance (set on a descendant), so source
   order doesn't matter. Scoped to .post__top-text so article subheads keep
   their voice. */
.post[data-layout="large-image"]:not([data-section="news"]) .post__top-text,
.post[data-layout="wide-image"]:not([data-section="news"]) .post__top-text {
  --font-heading: var(--font-heading-alt);
  --weight-heading: var(--weight-heading-alt);
  --tracking-tight: -0.01em;
  --tracking-snug: -0.01em;
}

/* FEATURES & NEWS right column → serif, even for News posts. Its compact
   cards set --font-ui, so the family is restated here too. The [data-variant]
   outranks those post-card.css rules. */
.featured-1-2-5__list .post-card[data-variant] .post-card__title {
  --font-heading: var(--font-heading-alt);
  --weight-heading: var(--weight-heading-alt);
  --tracking-tight: -0.01em;
  --tracking-snug: -0.01em;

  font-family: var(--font-heading);
  font-weight: var(--weight-heading);
}

/* PODCASTS → serif (podcast cards emit no data-section). */
.podcast-card__title {
  --font-heading: var(--font-heading-alt);
  --weight-heading: var(--weight-heading-alt);
  --tracking-tight: -0.01em;
  --tracking-snug: -0.01em;
}

/* Not yet expressible: the 42px Headline/Lg step has no token (it's wired
   per component, e.g. --membership-title-size). --text-5xl–7xl are left
   neutral; --text-4xl equalling --text-5xl is expected. */
