/* ============================================================
   Page-body vocabulary  ·  canonical surface file
   Body content vocabulary for Layer 2 surfaces (and any future
   content-led page): page shell, display header, sections, prose,
   rule / clause lists, definition cards, measure index, spec table,
   aside. Loaded after components.css and layer2.css.

   Canonical, consumed not forked. Built on the locked design system
   tokens only — no new tokens.

   General-purpose classes kept for future supporting surfaces, even
   though the first two Batch 2 surfaces do not all use them:
     .tf-twocol    — two-column body layout (rail + content)
     .tf-clauses   — numbered clause list (contract-document feel)
     .tf-measures  — two-up numbered measure index
     .tf-spectable — key / value / ref spec table
     .tf-aside     — margin note / callout
   ============================================================ */

/* ─── Page shell ────────────────────────────────────────────── */
.tf-page {
  background: var(--tf-offwhite);
  color: var(--tf-offblack);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  padding: 64px 72px 72px;
  width: 100%;
  /* Set --measure to override prose measure per page if needed */
  --measure: 64ch;
}
.tf-page--paper { background: var(--tf-paper); }
.tf-page--bone  { background: var(--tf-offwhite); }

.tf-page--compact { padding: 48px 56px 56px; }
.tf-page--airy    { padding: 88px 96px 96px; }

/* ─── Page chrome: rule + small section locator + page number ── */
.tf-page__chrome {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--tf-border);
  margin-bottom: 56px;
  font-family: var(--font-ui);
  font-size: var(--text-2xs); font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-eyebrow); text-transform: uppercase;
  color: var(--tf-muted);
}
.tf-page__chrome-left  { display: inline-flex; gap: 14px; align-items: baseline; }
.tf-page__chrome-right { display: inline-flex; gap: 14px; align-items: baseline; }
.tf-page__chrome-sep   { color: var(--tf-grey-03); }
.tf-page__chrome-folio { font-family: var(--font-mono); letter-spacing: 0; text-transform: none; }

/* ─── Display header ───────────────────────────────────────── */
.tf-display-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 380px);
  gap: 56px;
  align-items: end;
  padding-bottom: 40px;
  border-bottom: 2px solid var(--tf-offblack);
  margin-bottom: 48px;
}
.tf-display-head--single {
  grid-template-columns: 1fr;
}
.tf-display-head__eyebrow {
  font-family: var(--font-ui); font-size: var(--text-xs); font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-eyebrow); text-transform: uppercase;
  color: var(--tf-muted);
  display: block;
  margin-bottom: 18px;
}
.tf-display-head__title {
  font-family: var(--font-display);
  font-size: clamp(48px, 5.6vw, 80px);
  font-weight: var(--fw-regular);
  letter-spacing: -0.03em;
  line-height: 0.94;
  margin: 0;
  color: var(--tf-offblack);
  text-wrap: balance;
}
.tf-display-head__lede {
  font-family: var(--font-display);
  font-size: clamp(18px, 1.5vw, 22px);
  letter-spacing: -0.005em;
  line-height: 1.35;
  color: var(--tf-offblack);
  margin: 0;
  text-wrap: pretty;
}
.tf-display-head__lede em {
  font-style: normal;
  background: var(--tf-fixed);
  padding: 0 4px;
}

/* Minimal header alt */
.tf-display-head--minimal {
  border-bottom: 1px solid var(--tf-border);
  padding-bottom: 24px;
  margin-bottom: 32px;
}
.tf-display-head--minimal .tf-display-head__title {
  font-size: clamp(32px, 3.5vw, 44px);
}

/* Pill header alt */
.tf-display-head--pill .tf-display-head__eyebrow {
  display: inline-flex;
  background: var(--tf-fixed);
  color: var(--tf-offblack);
  padding: 5px 9px;
  border-radius: var(--r-xs);
  margin-bottom: 24px;
}

/* ─── Section heading inside a page ────────────────────────── */
.tf-section {
  margin-top: 56px;
}
.tf-section:first-child { margin-top: 0; }

.tf-section__head {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 48px;
  align-items: baseline;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--tf-border);
  margin-bottom: 28px;
}
.tf-section__num {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  color: var(--tf-muted);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.tf-section__title {
  font-family: var(--font-display);
  font-size: clamp(22px, 2vw, 28px);
  font-weight: var(--fw-regular);
  letter-spacing: var(--tracking-heading);
  line-height: 1.15;
  margin: 0;
}

/* Compact section head — eyebrow + title inline */
.tf-section--compact .tf-section__head {
  grid-template-columns: 1fr;
  gap: 6px;
  padding-bottom: 14px;
}
.tf-section--compact .tf-section__num { font-size: var(--text-xs); }

/* ─── Body prose ───────────────────────────────────────────── */
.tf-prose {
  max-width: var(--measure);
  font-family: var(--font-ui);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--tf-offblack);
}
.tf-prose p { margin: 0 0 1em; text-wrap: pretty; }
.tf-prose p:last-child { margin-bottom: 0; }
.tf-prose strong { font-weight: var(--fw-semibold); }
.tf-prose a { color: var(--tf-offblack); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

.tf-lede {
  font-family: var(--font-display);
  font-size: clamp(var(--text-2xl), 1.7vw, var(--text-3xl));
  line-height: 1.35;
  letter-spacing: -0.005em;
  color: var(--tf-offblack);
  max-width: 36ch;
  margin: 0;
  text-wrap: pretty;
}

/* ─── Two-column body layout ───────────────────────────────── */
.tf-twocol {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 48px;
  align-items: start;
}
.tf-twocol__rail {
  font-family: var(--font-ui);
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--tf-muted);
}
.tf-twocol__rail-meta {
  margin-top: 12px;
  font-family: var(--font-ui);
  font-size: var(--text-sm);
  font-weight: var(--fw-regular);
  letter-spacing: 0;
  text-transform: none;
  color: var(--tf-muted);
  line-height: 1.5;
}

/* ─── Clause list (contract-document feel) ─────────────────── */
.tf-clauses {
  list-style: none;
  margin: 0;
  padding: 0;
}
.tf-clauses > li {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--tf-border);
  align-items: baseline;
}
.tf-clauses > li:first-child { padding-top: 0; }
.tf-clauses > li:last-child  { border-bottom: 0; }
.tf-clauses__num {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  color: var(--tf-muted);
  letter-spacing: 0.02em;
}
.tf-clauses__body p { margin: 0 0 0.5em; line-height: var(--leading-relaxed); }
.tf-clauses__body p:last-child { margin-bottom: 0; }
.tf-clauses__heading {
  display: block;
  font-family: var(--font-ui);
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
  margin-bottom: 8px;
  color: var(--tf-offblack);
}

/* ─── Bullet list (operational rules) ──────────────────────── */
.tf-rules {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}
.tf-rules > li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--tf-border);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}
.tf-rules > li:last-child { border-bottom: 0; }
.tf-rules__marker {
  color: var(--tf-muted);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.5;
  padding-top: 1px;
}

/* Inline rules without numbered marker (just a hairline list) */
.tf-rules--plain > li { grid-template-columns: 1fr; }

/* ─── Definition card grid ─────────────────────────────────── */
.tf-defs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.tf-defs--three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tf-defs--one   { grid-template-columns: 1fr; }

.tf-def {
  background: var(--tf-white);
  border: 1px solid var(--tf-border);
  border-radius: var(--r-lg);
  padding: 24px 24px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tf-def--paper { background: var(--tf-paper); }
.tf-def__eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: var(--fw-regular);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--tf-muted);
}
.tf-def__title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: var(--fw-regular);
  letter-spacing: var(--tracking-heading);
  line-height: 1.15;
  margin: 0;
}
.tf-def__body {
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  color: var(--tf-offblack);
  margin: 0;
  text-wrap: pretty;
}
.tf-def__body p { margin: 0 0 0.7em; }
.tf-def__body p:last-child { margin-bottom: 0; }

/* ─── Aside (margin note) ──────────────────────────────────── */
.tf-aside {
  background: var(--tf-paper);
  border-left: 2px solid var(--tf-offblack);
  padding: 16px 18px;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--tf-offblack);
}
.tf-aside__eyebrow {
  display: block;
  font-family: var(--font-ui);
  font-size: var(--text-2xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--tf-muted);
  margin-bottom: 6px;
}
.tf-aside__body { margin: 0; }
.tf-aside--accent {
  background: var(--tf-fixed);
  border-left-color: var(--tf-offblack);
}
.tf-aside--accent .tf-aside__eyebrow { color: var(--tf-offblack); }

/* ─── Inline measure index strip (two-up numbered measures) ── */
.tf-measures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 56px;
}
.tf-measures > li {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 16px;
  align-items: baseline;
  padding: 18px 0;
  border-bottom: 1px solid var(--tf-border);
}
.tf-measures__num {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  color: var(--tf-muted);
}
.tf-measures__heading {
  display: block;
  font-family: var(--font-ui);
  font-size: var(--text-base);
  font-weight: var(--fw-semibold);
  margin-bottom: 4px;
  color: var(--tf-offblack);
}
.tf-measures__body {
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
  color: var(--tf-muted);
  text-wrap: pretty;
}

/* ─── Spec table (key/value pairs) ─────────────────────────── */
.tf-spectable {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}
.tf-spectable > li {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) auto;
  gap: 24px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--tf-border);
}
.tf-spectable > li:first-child { padding-top: 0; }
.tf-spectable > li:last-child  { border-bottom: 0; }
.tf-spectable__label {
  font-size: var(--text-sm);
  color: var(--tf-muted);
}
.tf-spectable__value {
  font-size: var(--text-base);
  color: var(--tf-offblack);
}
.tf-spectable__ref {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--tf-muted);
  text-align: right;
}

/* ─── Page footer ──────────────────────────────────────────── */
.tf-page__foot {
  margin-top: 64px;
  padding-top: 18px;
  border-top: 1px solid var(--tf-border);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  font-family: var(--font-ui);
  font-size: var(--text-2xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  color: var(--tf-muted);
}
.tf-page__foot-folio {
  font-family: var(--font-mono);
  letter-spacing: 0;
  text-transform: none;
}

/* ─── Density controls ─────────────────────────────────────── */
.tf-page[data-density="compact"] {
  --measure: 60ch;
}
.tf-page[data-density="compact"] .tf-section { margin-top: 40px; }
.tf-page[data-density="compact"] .tf-display-head { padding-bottom: 28px; margin-bottom: 36px; }
.tf-page[data-density="airy"] {
  --measure: 70ch;
}
.tf-page[data-density="airy"] .tf-section { margin-top: 72px; }
.tf-page[data-density="airy"] .tf-display-head { padding-bottom: 48px; margin-bottom: 64px; }
