/* ============================================================================
   typography.css — the type scale, applied.

   WHY THIS FILE EXISTS. The application had no type system. Headings came
   from Bootstrap 4.6.2 (h1 40px, h2 32px, h3 28px, h4 24px) — web-page sizes
   on an app screen — with `layouts/eduqueue.html`'s inline block adding a
   weight and a margin on top, and every dashboard and report class picking
   its own size out of sixteen values between .7rem and 2rem. A page title
   was 40px on one screen, 24px on the next and 30px on a third, and none of
   those numbers was chosen.

   The scale itself is in `dashboard-common.css`'s :root block, with a job
   named beside every step. This file is only the application of it.

   ── THE ONE THING TO UNDERSTAND BEFORE EDITING ──────────────────────────

   Every element rule here is wrapped in `:where(.main-content)`. That does
   two separate jobs, and both of them are load-bearing.

   1. SCOPE. `.main-content` exists in exactly one template,
      `layouts/eduqueue.html` — the authenticated application shell. The
      marketing site and the five `bulkmode` screens extend `layouts/base.html`
      directly and have no such element, so not one rule in this file can
      match them. Marketing keeps its own identity by construction rather
      than by an exclusion list, and the student scan screen — 36,389 posts
      in 30 days — cannot be reached from here at all.

   2. SPECIFICITY. `:where()` contributes ZERO, so `:where(.main-content) h1`
      weighs (0,0,1): exactly what a bare `h1` weighs. It therefore beats
      Bootstrap and the shell's inline block (both (0,0,1), both earlier in
      the cascade) and loses to every page-local class, which is the correct
      outcome — a page that already decided its own heading size keeps it,
      and nothing this file does can silently resize a screen nobody looked
      at. Written as `.main-content h1` it would weigh (0,1,1) and quietly
      outrank `.dq-title`, `.page-header h1` and ~40 page-local rules.

   Utility classes (`.eq-h1`, `.eq-caption`, …) are NOT scoped and are NOT
   `:where()`-wrapped: asking for one is explicit, so it should win.

   NO COLOURS BEYOND THE INK TOKENS and no width media query: the two largest
   steps are `clamp()`, which is why the four-breakpoint rule
   (tests/cssguard/test_breakpoints.py) is untouched by a responsive type
   scale.
   ========================================================================== */

/* ---- The document ---------------------------------------------------------
   `font-family` repeats what app-shell.css sets on <body>; it is here as
   well because this file is the one that defines what type in this
   application is, and a reader who deletes the rule there should not silently
   lose the stack. Same token, same value, no conflict.

   THE INHERITED LINE HEIGHT IS --eq-leading-NORMAL, NOT --eq-leading-relaxed,
   and the difference is 203 table rows. Line height inherits, so whatever is
   set here lands on every cell, chip, label and nav item that does not set
   its own. Relaxed (1.6) is a PARAGRAPH value: measured against origin/main
   it made 203 elements on the visitor list and 275 on the today's-check-ins
   report 1.4px taller each, for no gain — none of them is a paragraph.
   Paragraphs get the relaxed value below, where it belongs. */
:where(.main-content) {
  font-size: var(--eq-text-body);
  line-height: var(--eq-leading-normal);
}

/* Kerning and ligatures are off by default in Chrome below 20px, which is
   most of this application. `optimizeLegibility` turns them on; the usual
   objection to it (a layout-shift bug on huge bodies of text) applies to
   documents, not to a front-desk table. */
body {
  font-family: var(--eq-font);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Headings -------------------------------------------------------------
   Five steps, not six: h5 and h6 share a size and differ by case, because a
   sixth distinguishable heading size is a size nobody can place. Tracking
   tightens from 22px up — type set at a display size with default tracking
   is the single most reliable tell of an interface nobody typeset. */
:where(.main-content) h1 {
  font-size: var(--eq-text-2xl);
  line-height: var(--eq-leading-snug);
  font-weight: var(--eq-weight-bold);
  letter-spacing: var(--eq-tracking-tight);
  color: var(--eq-ink);
  margin: 0 0 var(--eq-space-4);
}
:where(.main-content) h2 {
  font-size: var(--eq-text-xl);
  line-height: var(--eq-leading-snug);
  font-weight: var(--eq-weight-bold);
  letter-spacing: var(--eq-tracking-tight);
  color: var(--eq-ink);
  margin: 0 0 var(--eq-space-3);
}
:where(.main-content) h3 {
  font-size: var(--eq-text-lg);
  line-height: var(--eq-leading-snug);
  font-weight: var(--eq-weight-semibold);
  letter-spacing: var(--eq-tracking-normal);
  color: var(--eq-ink);
  margin: 0 0 var(--eq-space-3);
}
:where(.main-content) h4 {
  font-size: var(--eq-text-body);
  line-height: var(--eq-leading-snug);
  font-weight: var(--eq-weight-semibold);
  color: var(--eq-ink);
  margin: 0 0 var(--eq-space-2);
}
:where(.main-content) h5,
:where(.main-content) h6 {
  font-size: var(--eq-text-base);
  line-height: var(--eq-leading-normal);
  font-weight: var(--eq-weight-semibold);
  color: var(--eq-ink);
  margin: 0 0 var(--eq-space-2);
}
/* h6 is the overline: small, upper, tracked out. It is the one heading level
   nothing in the application was using for a heading. */
:where(.main-content) h6 {
  font-size: var(--eq-text-caption);
  letter-spacing: var(--eq-tracking-wide);
  text-transform: uppercase;
  color: var(--eq-muted);
}

/* ---- Body copy ------------------------------------------------------------
   A paragraph gets relaxed leading and a measure; everything else in a UI is
   a label or a cell and gets neither. 68ch is about 85 characters at this
   size, the upper end of what stays comfortable in a single column. */
:where(.main-content) p {
  font-size: var(--eq-text-body);
  line-height: var(--eq-leading-relaxed);
  margin: 0 0 var(--eq-space-4);
}
:where(.main-content) p:last-child { margin-bottom: 0; }
:where(.main-content) ul,
:where(.main-content) ol { margin: 0 0 var(--eq-space-4); padding-left: var(--eq-space-5); }
:where(.main-content) li { line-height: var(--eq-leading-normal); margin-bottom: var(--eq-space-1); }
:where(.main-content) small { font-size: var(--eq-text-xs); line-height: var(--eq-leading-normal); }
:where(.main-content) strong, :where(.main-content) b { font-weight: var(--eq-weight-semibold); }
:where(.main-content) code, :where(.main-content) kbd, :where(.main-content) pre, :where(.main-content) samp {
  font-family: var(--eq-font-mono);
  font-size: var(--eq-text-sm);
}
:where(.main-content) dt { font-weight: var(--eq-weight-semibold); color: var(--eq-ink); }
:where(.main-content) dd { margin: 0 0 var(--eq-space-3); color: var(--eq-text); }

/* `.lead` is Bootstrap's and is 1.25rem/300 — a light weight the system
   stack has no cut of on Windows, so it synthesises one and the line looks
   smeared. Same size as the body copy at a medium weight reads as a lead-in
   without asking the font for anything it does not have. */
:where(.main-content) .lead {
  font-size: var(--eq-text-lg);
  line-height: var(--eq-leading-normal);
  font-weight: var(--eq-weight-regular);
  color: var(--eq-text);
}

/* ---- Utilities, for markup that wants a step by name ----------------------
   Unscoped and not :where()-wrapped: these are opt-in, so they win. */
.eq-display { font-size: var(--eq-text-display); line-height: var(--eq-leading-tight);
  font-weight: var(--eq-weight-bold); letter-spacing: var(--eq-tracking-tight); color: var(--eq-ink); }
.eq-h1 { font-size: var(--eq-text-2xl); line-height: var(--eq-leading-snug);
  font-weight: var(--eq-weight-bold); letter-spacing: var(--eq-tracking-tight); color: var(--eq-ink); }
.eq-h2 { font-size: var(--eq-text-xl); line-height: var(--eq-leading-snug);
  font-weight: var(--eq-weight-bold); letter-spacing: var(--eq-tracking-tight); color: var(--eq-ink); }
.eq-h3 { font-size: var(--eq-text-lg); line-height: var(--eq-leading-snug);
  font-weight: var(--eq-weight-semibold); color: var(--eq-ink); }
.eq-h4 { font-size: var(--eq-text-body); line-height: var(--eq-leading-snug);
  font-weight: var(--eq-weight-semibold); color: var(--eq-ink); }
.eq-body { font-size: var(--eq-text-body); line-height: var(--eq-leading-relaxed); color: var(--eq-text); }
.eq-ui { font-size: var(--eq-text-base); line-height: var(--eq-leading-normal); color: var(--eq-text); }
.eq-small { font-size: var(--eq-text-xs); line-height: var(--eq-leading-normal); color: var(--eq-muted); }
.eq-caption { font-size: var(--eq-text-caption); line-height: var(--eq-leading-normal); color: var(--eq-muted); }

/* The small-caps label above a value. One definition, instead of the nine
   copies of `font-size:.72rem; letter-spacing:.06em; text-transform:uppercase`
   the audit counted across the dashboards and reports. */
.eq-overline {
  display: block;
  font-size: var(--eq-text-caption);
  font-weight: var(--eq-weight-semibold);
  letter-spacing: var(--eq-tracking-wide);
  text-transform: uppercase;
  line-height: var(--eq-leading-normal);
  color: var(--eq-muted);
}

/* Lining, fixed-width digits. A column of check-in times with proportional
   figures does not line up, and a count that changes every minute reflows
   the cell it sits in. */
.eq-nums { font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1; }
.eq-measure { max-width: var(--eq-measure); }
.eq-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Two lines then an ellipsis, for a notes cell. `-webkit-` prefixed and
   unprefixed both: the unprefixed form is still not shipped anywhere. */
.eq-clamp-2 {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden;
}

/* ---- Print ----------------------------------------------------------------
   Paper is not a screen: a 28px heading wastes a third of the first page of
   a district report, and the clamped steps resolve against the PAGE width,
   which is not what they were authored against. Fixed points, and a serif-free
   stack the printer certainly has. */
@media print {
  :where(.main-content) h1 { font-size: 18pt; margin-bottom: 8pt; }
  :where(.main-content) h2 { font-size: 15pt; margin-bottom: 6pt; }
  :where(.main-content) h3 { font-size: 13pt; margin-bottom: 6pt; }
  :where(.main-content) h4,
  :where(.main-content) h5 { font-size: 11pt; margin-bottom: 4pt; }
  :where(.main-content) p,
  :where(.main-content) li { font-size: 10pt; line-height: 1.4; }
  .eq-display { font-size: 22pt; }
  .eq-caption, .eq-overline, :where(.main-content) small { font-size: 8pt; }
}
