/* The structure of a page: the console's headings, the flow that spaces a page's sections, and the two kinds of plain text a page has besides its sections (a sentence that says what the
   page is for, and a note at its foot). design-direction.md section 4 gives the page recipes; this is what makes each of them a page and not a pile.

   WHY THIS FILE. The base stylesheet (10-globals.css) sets every h2 at the light shell's display size, 2rem, and gives every heading no margin. That is right for a student's page, where the
   title and a section are both editorial; on the console it made a section heading as large as the page's own title, with nothing between it and what it headed, and a page of three
   of them looked thrown together (break-glass, the queues, the consultation agenda, 8 Oct 2026). The console is a working surface: its page title is about 1.9rem, its sections 1.25rem,
   and what is under a section is a step of the space scale (`--space-*`, 10-globals.css) away from it.

   THE RULES ARE LOW-SPECIFICITY ON PURPOSE. `:where(...)` adds nothing to a selector, so each rule here is as strong as the bare `h2` it replaces and wins only by coming later; any heading that a
   component or a page gives a class (`.person-page-heading`, `.source-map-heading`, a panel's title) keeps its own look. What the console changes is the heading nobody styled.

   Tokens only and logical properties only, both enforced (test/styles/tokens_test.rb, test/styles/components_test.rb), so it reads on the light shell and the console, in light and in dark, and
   mirrors in a right-to-left language. Nothing pinned to an edge, no height in vh, and everything that holds words may shrink and wrap (WCAG 1.4.10). */

/* ── The console's headings ──────────────────────────────────────────────
   h1 is the page header's (35-components.css). A section is h2, set in the display face; what is under a section is h3 and h4, set in the working face, so a page reads title, section,
   subsection by the face and the size and not by the size alone. */
:where([data-surface="console"]) h2 {
  font-size: var(--text-lg);
  line-height: 1.2;
  letter-spacing: -0.015em;
}
:where([data-surface="console"]) h3 {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: 0;
}
:where([data-surface="console"]) h4 {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 650;
  line-height: 1.3;
  letter-spacing: 0;
}

/* ── The flow ────────────────────────────────────────────────────────────
   What a page puts after its header: its sections, cards and lists, each `--section-gap` from the next. One column that may shrink, so a long word never widens the page.
   `data-gap="tight"` is for a page of small parts (a short list of links) that would be loose at a section's distance. */
.page-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--section-gap);
  min-inline-size: 0;
}
.page-flow[data-gap="tight"] {
  gap: var(--space-4);
}
/* A flow that holds a sheet (what stands above a form, the form, the person search before it) is held to the form's own cap, 60rem (36-form-fields.css), so the notice above the card, the card and
   the search share a right edge; a callout runs the flow's width, as the card does, and is not held to its own 66ch. Five tracks of the UI pass each wrote this rule under a name of their own. */
.page-flow[data-measure="sheet"] {
  max-inline-size: 60rem;
}
.page-flow[data-measure="sheet"] > .callout {
  max-inline-size: none;
}

/* ── Plain text ──────────────────────────────────────────────────────────
   The sentence that says what a page is for, under its header; and a note at its foot ("You never see your own request here"). Held to a readable measure and set in the quiet color,
   `--fg2`, which is on every surface a text pair the contrast check measures (config/contrast_pairs.yml). */
.page-intro,
.page-note {
  max-inline-size: 66ch;
  margin: 0;
  color: var(--fg2);
  line-height: 1.55;
  overflow-wrap: anywhere;
}
.page-note {
  font-size: var(--text-sm);
  line-height: 1.5;
}

/* Tabs over the sections of a page (TabsComponent, tabs_controller.js). Without the script the row is a wrapping list of links over sections drawn one under the other; with it (`.tabs--scripted`) the
   row is a strip of tabs on a rule, the chosen one marked by its weight and a bar under it as well as by its color (color is never the only sign), and one section shows at a time. Tabs wrap on a phone
   rather than scroll sideways, and each is at least --target-min tall to touch (44px; WCAG 2.5.8 asks 24). Tokens and logical properties only. */
.tabs {
  display: grid;
  gap: var(--density-block, var(--space-4));
  min-inline-size: 0;
}
.tabs__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
  border-block-end: 1px solid var(--rule);
}
.tabs__item {
  min-inline-size: 0;
  max-inline-size: 100%;
}
.tabs__tab {
  display: inline-flex;
  align-items: center;
  min-block-size: var(--target-min);
  overflow-wrap: anywhere;
  padding-inline: var(--space-1);
  border-block-end: 3px solid transparent;
  margin-block-end: -1px;
  color: var(--fg2);
  font-weight: 600;
  text-decoration: none;
}
.tabs__tab:hover {
  color: var(--fg1);
}
.tabs--scripted .tabs__tab[aria-selected="true"] {
  border-block-end-color: var(--accent);
  color: var(--fg1);
  font-weight: 700;
}
.tabs__tab:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.tabs__panel {
  display: grid;
  gap: var(--density-block, var(--space-4));
  min-inline-size: 0;
}
.tabs__panel:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}
