/*
 * Accessibility corrections to the approved design.
 *
 * WHY THIS FILE EXISTS SEPARATELY, AND WHY IT LOADS LAST
 *
 * The design's own tokens are served exactly as delivered and are loaded after the application's
 * stylesheet, so for every token name the two share, the DESIGN's value is the live one. That is
 * deliberate and correct — the design is the reference implementation. It also means a correction
 * cannot be made from the application's stylesheet, because its value is overridden before it is
 * ever used. This file is therefore linked last, and contains only what accessibility requires.
 *
 * WHAT IT CORRECTS, AND HOW IT WAS FOUND
 *
 * Every colour pair the design actually uses was measured against WCAG 2.1 AA. Twenty-one pairs were
 * checked across the paper, raised and sunk grounds, the four chip washes, and the night palette.
 * **One failed:**
 *
 *   --ink-faint #8d8577 on --paper #f7f1e3 = 3.24:1   (AA needs 4.5:1 for normal text)
 *
 * It is not a marginal call and it is not only for disabled controls, which WCAG exempts. The design
 * uses it for real text in three places, all of them in main.css:
 *
 *   .search input::placeholder   -> placeholder text
 *   .rail .count                 -> a count beside a filter
 *   the empty-state line         -> the sentence a reader sees when a filter matches nothing
 *
 * An empty state a reader cannot read is the worst of the three, because it is the only thing on the
 * screen at that moment.
 *
 * THE VALUE CHOSEN
 *
 * #655d51. Measured on every ground the design puts faint text on:
 *
 *   paper #f7f1e3        5.76:1
 *   paper-raised #fffdf8 6.38:1
 *   paper-sunk #efe6d2   5.23:1
 *   accent-wash #e2efe8  5.48:1
 *
 * The design's own --ink-muted (#6b6358) would also pass, but using it would make faint and muted
 * identical and lose a distinction the design draws on purpose. #655d51 keeps that distinction and
 * still clears 4.5:1 on the darkest ground with room to spare.
 *
 * This is the only change made to the delivered design's appearance, it is recorded here, and it
 * should be folded back into the design rather than carried as an override forever.
 */
:root {
  --ink-faint: #655d51;

  /*
   * --focus, CORRECTED FOR THE NIGHT GROUND — THE SECOND MEASURED FAILURE, AND IT IS THE SAME KIND.
   *
   * The design declares `--focus: #1b4f8a`, "never the accent, must be seen". It is excellent on paper
   * (7.36:1) and it fails on the night chrome: measured against `--night` #0f0d0b it is **2.34:1**, where
   * WCAG 2.2 SC 1.4.11 asks 3:1 of a focus indicator. `main.css` draws the ring as
   * `:focus-visible { outline: 3px solid var(--focus) }`, and the night grounds are not incidental — the
   * platform bar, the sticky masthead, the hero, the archive visual, the story doors and the citation band
   * are all night, and the masthead holds the whole main navigation. **A keyboard user's focus ring was
   * fading into the ground on the most-used control on the site.**
   *
   * WHY THIS IS ONE GLOBAL VALUE RATHER THAN A NIGHT-SCOPED RULE
   *
   * A rule scoped to the night containers would leave the light grounds on #1b4f8a and would be the smaller
   * change. It is not the correct one, for a reason that is about honesty rather than taste:
   * `/admin/design/` measures every pair from THE VALUES IN FORCE, and it reads this file to do it
   * (`parseDesignTokens(a11yCss)` merged over the design's own declarations, keyed by token NAME). A scoped
   * re-declaration would have been reported as the value on every ground, so the audit would have shown a
   * passing ratio for a ring the page does not paint. **A measurement that describes a different page is
   * worse than no measurement.**
   *
   * THE VALUE CHOSEN, #5f6ad6. It stays in the design's blue-indigo family and away from the emerald accent
   * and the gold brand, and it clears 3:1 on both grounds with margin to spare:
   *
   *   night  #0f0d0b   4.17:1
   *   paper  #f7f1e3   4.13:1
   *
   * #1b4f8a's 7.36:1 on paper is given up for it. That is the trade: the design's ring was tuned for the
   * light ground, and this site's navigation is on the dark one. **Like the --ink-faint correction above,
   * this belongs in the deliverable rather than in a served override forever.**
   */
  --focus: #5f6ad6;
}

/*
 * THE MARQUEE STOPS FOR THE KEYBOARD TOO.
 *
 * The design pauses its rotating name on hover only:
 *
 *   .sx-marquee:hover ul { animation-play-state: paused; }
 *
 * **`:hover` is not the keyboard's event.** A reader tabbing into one of the marquee's links focuses an
 * anchor that is still sliding, so the focus ring moves out from under the reader and the next Tab starts
 * from somewhere they did not leave. `:focus-within` is the keyboard's half of the same rule and it is the
 * whole fix — the design's own declaration is untouched and this is added beside it rather than replacing
 * it, so a pointer user sees exactly what the design drew.
 *
 * `prefers-reduced-motion` already switches the animation off in the design, so a reader who asks for no
 * motion never reaches this rule. This is for the reader who has motion on and a keyboard.
 */
.sx-marquee:focus-within ul {
  animation-play-state: paused;
}

/*
 * REFLOW — WCAG 2.2 SC 1.4.10. THE THIRD AND FOURTH MEASURED FAILURES, AND THEY ARE THE SAME DEFECT TWICE.
 *
 * The requirement is that content reflows to a 320 CSS-pixel viewport without two-dimensional scrolling. It
 * is measured, not argued: `scripts/sweep-overflow.mjs` drives real Chrome over every reachable page at 390,
 * 768 and 1440 px and reads `documentElement.scrollWidth` against `clientWidth`. Of 414 page-widths, **three
 * scrolled sideways and all three were at 390 px:**
 *
 *   /documents/                                                  +86 px
 *   /folklore-reader/                                           +150 px
 *   /the-rise-decline-and-potential-revival-of-akwa-blacksmithing-a-centuries-old-igbo-craft/   +242 px
 *
 * At 768 and 1440 px nothing scrolled sideways. The cause in both cases is the same shape, and it is a shape
 * the design had already guarded against in its WIDE rule and then dropped in its narrow one:
 *
 *   .sx-pdf-grid       base      grid-template-columns: repeat(3, minmax(0, 1fr))   <- guarded
 *                      <=60rem   grid-template-columns: repeat(2, 1fr)               <- guard dropped
 *                      <=40rem   grid-template-columns: 1fr                         <- guard dropped
 *
 *   .sx-reading-columns  base    grid-template-columns: 14rem minmax(0, 1fr)        <- guarded
 *                        <=60rem grid-template-columns: 1fr                          <- guard dropped
 *
 * `1fr` is `minmax(auto, 1fr)`, and that `auto` minimum is the item's **min-content** width — so a track
 * whose plain `1fr` was meant to mean "the column" silently becomes "whatever the widest unbreakable thing
 * in this item measures". `minmax(0, 1fr)` is the design saying what it meant.
 *
 * WHAT WAS ACTUALLY IN THE COLUMNS, WHICH IS THE HALF THE DESIGN COULD NOT HAVE KNOWN
 *
 * These are migrated WordPress records, and their content is not the design's example content. Three
 * different things were measured sitting in those tracks, and each needs its own answer:
 *
 *   /documents/       one record's title IS its filename — `capacity_building_for_traditional`, thirty-two
 *                     characters with no space in them, set at 1.35rem in the card's `<h3>`. The outer
 *                     track grew to 459 px inside a 358 px column; with the track corrected the title still
 *                     overflowed its own 245 px cell by 82 px.
 *   the article page  the body carries **raw URLs** as link text:
 *                     `https://independent.ng/anambra-community-seeks-revival-of-aw…` measures 658 px at
 *                     16.8 px. The track grew to 616 px inside a 358 px column.
 *   /folklore-reader/ a WordPress `[caption]` figure, and this one is a FIXED WIDTH rather than a long
 *                     token: the shortcode emits `<figure class="wp-caption alignnone" style="width:540px">`,
 *                     an inline width copied from the uploaded image. `img { max-width: 100% }` is already
 *                     in `main.css` and cannot help, because the image's containing block is the 540 px
 *                     figure. **A fixed width wider than its parent is the one cause here that no
 *                     `overflow-wrap` can touch**, and it is why the figure needs its own cap.
 *
 * **A URL is not a word and a filename used as a title is not a word either**, so breaking them is the
 * correct answer rather than a concession — and the design already agrees: `.cite-block` in `main.css` sets
 * `overflow-wrap: anywhere` for exactly this reason. `overflow-wrap: anywhere` rather than `break-word` is
 * deliberate: it is the value that also shrinks the element's min-content contribution, which is what stops
 * the track growing in the first place. It is applied to the containers migrated record text lands in rather
 * than to one measured element, because **the next record with a filename for a title has not been imported
 * yet**; on ordinary prose the declaration does nothing, since it only breaks a word that cannot fit a line
 * by itself. `word-break: break-all` would break ordinary prose mid-word and is not used anywhere here.
 *
 * THE GRID TRACK IS ALSO CORRECTED, AND IT HAS TO BE, because `overflow-wrap` cannot help a REPLACED
 * element or a fixed width, and only `minmax(0, 1fr)` tells the track it is allowed to be narrower than what
 * it holds. With the track at the column width the figure's own `max-width: 100%` scales the image, which is
 * what that declaration was always for.
 *
 * Nothing here changes a single design file, and none of these four screens is altered at 768 px or wider,
 * where the design's own guarded wide rules apply and were measured clean.
 */
@media (max-width: 60rem) {
  .sx-reading-columns,
  .sx-folk-reader-book .sx-reading-columns {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* The design's own two-column step, with the guard it dropped. */
@media (min-width: 40.0625rem) and (max-width: 60rem) {
  .sx-year-grid,
  .sx-pdf-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* The design's own one-column step, with the guard it dropped. */
@media (max-width: 40rem) {
  .sx-year-grid,
  .sx-pdf-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* A migrated record's own words: a raw URL, or a title that is a filename. */
.sx-reading-columns .prose,
.sx-reading-columns .sx-page,
.sx-reading-columns aside,
.sx-pdf-grid article,
.sx-publication-list article {
  overflow-wrap: anywhere;
}

/* A WordPress caption figure carries the uploaded image's width inline; cap it rather than obey it. */
.sx-reading-columns .prose figure,
.sx-pdf-grid figure {
  max-width: 100%;
}

.sx-reading-columns .prose figure img {
  height: auto;
}

/*
 * ── THE MASTHEAD LOGO WAS BEING SQUEEZED, AND THE CAUSE IS TWO RULES THAT ARE EACH CORRECT ALONE ────────
 *
 *   main.css:11      img { max-width: 100%; display: block }
 *   main.css:98      .wordmark { display: inline-flex; align-items: baseline; gap: var(--s-2) }
 *   showcase.css:19  .wordmark { align-items: center }
 *   showcase.css:20  .wordmark img { width: 34px; height: 34px; border-radius: 50% }
 *
 * ⚠️ **AN `img` INSIDE A FLEX CONTAINER IS A FLEX ITEM, AND A FLEX ITEM SHRINKS BY DEFAULT**
 * (`flex-shrink: 1`). **`max-width: 100%` then resolves against whatever space the flex line has left**,
 * rather than against the 34 px the design asked for — so as the masthead's own content grew (the nav, the
 * date, and on a narrow viewport the whole wrapped row), **the logo was compressed below its own size.**
 *
 * ⚠️ **AND THE DESIGN NEVER INTENDED A VARIABLE LOGO.** *It sets 34 px by 34 px and a circle, and the archive
 * serves a 512 × 512 square PNG through it, so the file is not the problem and never was* — measured: the
 * served image is **512 × 512, ratio 1.000**, 15,175 bytes. **The size was being decided by the layout rather
 * than by the design.**
 *
 * SO THE SIZE IS PINNED WHERE THE APPLICATION CONTROLS IT. *`apps/ozikoro/public/design/` is inviolable — it
 * is byte-identical to the deliverable and must stay so — and this sheet already loads **after** both of the
 * design's, which is where a rule that **corrects** the design rather than contradicting it belongs.*
 *
 * `max-width: none` is needed as well as `flex: 0 0 auto`, and neither alone is enough: **`flex` stops the
 * flex algorithm shrinking the box, and `max-width` stops the global `img` cap re-capping it once the box
 * has been sized.** *The 34 px itself is not repeated here — it is the design's, and duplicating a value
 * is how the two copies drift.*
 */
.wordmark img {
  flex: 0 0 auto;
  max-width: none;
}

/*
 * ── THE BACK-OFFICE LINK ON A DASHBOARD RAIL WAS THE SAME COLOUR AS THE RAIL ─────────────────────────
 *
 * The owner: *"the dashboard where it was written 'The administration — the archive's back office' was
 * invisible unless my cursor goes there"*.
 *
 * WHAT WAS PAINTED, MEASURED FROM THE VALUES IN FORCE
 *
 * The control is the rail's one back-office anchor, and the rail is night — `showcase.css:276` sets
 *
 *     aside.sx-dash-side { background: var(--night); color: var(--on-night) }
 *
 * while the anchor is dressed in `main.css`'s quiet-button class, which is written for paper:
 *
 *     main.css:130   .btn-quiet        { background: transparent; color: var(--ink); border-color: var(--rule-firm) }
 *     main.css:131   .btn-quiet:hover  { background: var(--paper-sunk); color: var(--ink-strong) }
 *
 * So on that rail the pair was
 *
 *     resting   --ink        #1d1a16 text on --night      #0f0d0b ground   1.12:1
 *     hover     --ink-strong #0f0d0b text on --paper-sunk #efe6d2 fill    15.63:1
 *
 * **The link was legible in exactly one state, and it is the state a keyboard user has to reach it to
 * cause and a touch-screen reader can never cause.** 1.12:1 is not dim text; it is text the same colour
 * as what is behind it.
 *
 * THE CORRECTION IS THE DESIGN'S OWN, NOT A NEW COLOUR
 *
 * `showcase.css` already corrects this class on the two other night grounds it lands on —
 * `.sx-reg-search .btn-quiet { color: var(--on-night); … }` (line 671) and `.sx-viewer-page
 * .btn-quiet { color: var(--cream); … }` (line 708). This is the third night ground and the one that was
 * missed, so the rule is written the same way: the resting colour becomes the rail's own foreground
 * (--on-night, **16.21:1** on --night) and the border the design's stronger-rule tone (--rule-firm,
 * **9.59:1** on --night). No new value is introduced.
 *
 * THE HOVER IS THE DESIGN'S OWN, AND IT HAS TO BE WRITTEN OUT, WHICH WAS NOT OBVIOUS.
 *
 * `main.css:131` already gives this class a hover — `--paper-sunk` fill, `--ink-strong` text, 15.63:1 — and
 * the intention was to leave it exactly as the design wrote it. **It does not survive the rule above**: the
 * resting rule is `.sx-dash-side .sx-mode-admin .btn-quiet` (three classes) and the design's hover is
 * `.btn-quiet:hover` (two), so the resting colour went on winning while the design's fill came through —
 * **cream text on a cream pill, measured 1.05:1, which is the original fault one interaction later.**
 *
 * Forcing the pseudo-state in Chrome and reading what it painted is what found this; nothing in the markup
 * or the diff shows it. So the hover is stated in the design's own values.
 *
 * ⚠️ SCOPED TO THE RAIL, BECAUSE THE SAME PARAGRAPH IS ALSO PUT ON PAPER. `fillModeSwitcher` places it
 * either inside `aside.sx-dash-side` (the nine rail dashboards — night) or at the head of
 * `<main class="wrap sx-section">` (the five rail-less dashboards — paper). On paper `--ink` is correct
 * and must not be touched, which is why this is a descendant selector and not a rule on `.sx-mode-admin`.
 */
.sx-dash-side .sx-mode-admin .btn-quiet {
  color: var(--on-night);
  border-color: var(--rule-firm);
}

.sx-dash-side .sx-mode-admin .btn-quiet:hover {
  color: var(--ink-strong);
}

/*
 * ── THE SIGNED-IN ITEM IN THE MASTHEAD, WHICH WAS A DARK PANEL SITTING IN THE MENU ──────────────────
 *
 * The owner: *"when i signed in and went to the front page, it scattered the menu."*
 *
 * WHAT WAS PAINTED
 *
 * `renderModeSwitcher` reuses the deliverable's own `details.sx-role-switch`, and `showcase.css:280`
 * draws that control as a card, because it was drawn for a dashboard SIDEBAR:
 *
 *     showcase.css:280  .sx-role-switch      { margin-top: var(--s-5); border: 1px solid rgba(201,168,76,.4);
 *                                              border-radius: var(--r-md); background: var(--night-2) }
 *     showcase.css:281  .sx-role-switch summary { padding: var(--s-3); color: var(--on-night); font-weight: 700 }
 *     showcase.css:283  .sx-role-switch a    { display: block; padding: var(--s-2); font-size: var(--t-sm) }
 *
 * **In `nav.nav` that is a 1.5rem top margin, a 0.75rem-padded bold summary, a gold border and a
 * night-2 fill — a box in a row of links.** `main.css:101` lets the row wrap, so a control several
 * hundred pixels wide pushed `About` and the account item onto a second line. The measurement that
 * matters is in the report; the cause is that one control was styled for the place it came from and not
 * the place it was put.
 *
 * THE CORRECTION MAKES IT AN ITEM IN THE NAV, WHICH IS WHAT IT IS
 *
 * The summary is given `main.css`'s own `.nav a` metrics (1rem, --on-night, 2px transparent underline,
 * --s-1 block padding) so it measures like the links beside it, and the panel is taken **out of flow**
 * and anchored under the item. **An open menu must not reflow the bar it opened from** — that is the
 * same fault one hover later, and it is why `position: absolute` rather than a taller `<li>`.
 *
 * The disclosure marker is redrawn rather than left as the platform's own triangle, because
 * `::marker` is not styled consistently and the design's vocabulary is a chevron.
 *
 * ⚠️ ONLY `.nav-modes-item`. `.sx-role-switch` is also the rail control and the rail-less screens'
 * control, where the design's own card styling is right — both are scoped separately below and neither
 * is touched.
 */
.nav-modes-item {
  position: relative;
  display: flex;
  align-items: center;
}

.nav-modes-item .sx-role-switch {
  margin-top: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.nav-modes-item .sx-role-switch > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: var(--s-1) 0;
  color: var(--on-night);
  font-size: 1rem;
  font-weight: 500;
  line-height: inherit;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  list-style: none;
  cursor: pointer;
}

/* Safari and Chrome both draw their own marker on a summary; the design's is a chevron. */
.nav-modes-item .sx-role-switch > summary::-webkit-details-marker {
  display: none;
}

.nav-modes-item .sx-role-switch > summary::after {
  content: '';
  width: 0.4em;
  height: 0.4em;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-0.15em) rotate(45deg);
}

/* The design's own hover for a nav link, so this item behaves like the ones beside it. */
.nav-modes-item .sx-role-switch > summary:hover,
.nav-modes-item .sx-role-switch[open] > summary {
  color: var(--gold-bright);
  border-bottom-color: var(--gold);
}

.nav-modes-item .sx-role-switch[open] > summary::after {
  transform: translateY(0.1em) rotate(-135deg);
}

/*
 * THE PANEL, ANCHORED. `right: 0` rather than `left: 0` because the item is the last thing in the row
 * apart from nothing — a panel that grew to the right would leave the viewport on the archive's own
 * 1440px bar, and one that grows left stays under the control it came from.
 */
.nav-modes-item .sx-role-switch > div {
  position: absolute;
  top: calc(100% + var(--s-3));
  right: 0;
  z-index: 60;
  min-width: 16rem;
  max-height: min(70vh, 30rem);
  overflow: auto;
  padding: var(--s-2);
  border: 1px solid rgba(201, 168, 76, 0.4);
  border-radius: var(--r-md);
  background: var(--night-2);
  box-shadow: var(--shadow-lift);
}

/*
 * AT 40REM THE DESIGN TURNS THE MASTHEAD INTO A DISCLOSURE ITSELF — `showcase.css:658` hides `nav.nav`
 * and shows it only on `.masthead.menu-open`, as a two-column grid of full-width rows. **A floating
 * panel inside a grid cell is two panels fighting for the same pixels**, so at that width the panel goes
 * back into flow and the summary takes the same row metrics as every other item in that menu.
 */
@media (max-width: 40rem) {
  .nav-modes-item .sx-role-switch > summary {
    display: block;
    padding: 0.85rem 0.35rem;
    font-size: 1rem;
    border-bottom: 0;
  }

  .nav-modes-item .sx-role-switch > div {
    position: static;
    min-width: 0;
    max-height: none;
    margin: 0;
    padding: var(--s-2) 0.35rem var(--s-3);
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
}

/*
 * ── THE ACCOUNT CONTROL: OUTSIDE THE MENU ON A WIDE SCREEN, THE MENU'S LAST ROW ON A PHONE ─────────
 *
 * The owner, three times. Twice about the wide screen: *"when i signed in and went to the front page, it
 * scattered the menu."* and then *"again, you have not fixed the menu to be exactly as it should fixed.
 * again, go to the original github design, see the original menu, and fix this shit"*. **He was right both
 * times, and the second report is the evidence that the first fix was the wrong shape.** And once about a
 * phone: *"on the mobile, sign and my account shows despite the mobile having the three lines that leads you
 * to the menu, why not also add the sign in and sign up there?"* — the same control reported from the other
 * end, and answered in rule 4 below.
 *
 * WHAT WAS PAINTED, MEASURED
 *
 * The design's menu is seven items and the served masthead carried eight, because the account control was
 * written `<li class="nav-account">` and spliced in after the About `<li>` — inside the design's own `<ul>`.
 * Then the design's own rules laid that `<ul>` out:
 *
 *   main.css:101   .nav ul { display: flex; gap: var(--s-5); flex-wrap: wrap }
 *   main.css:405   .nav ul { gap: var(--s-4); font-size: var(--t-sm) }        /* narrower breakpoint */
 *   showcase.css:658
 *                  .masthead .nav ul { display: grid !important; grid-template-columns: 1fr 1fr; gap: 0 }
 *                  .masthead .nav li { border-bottom: 1px solid color-mix(in oklab, var(--gold) 18%, transparent) }
 *
 * **Seven items fit that wrapping flex row and the eighth wrapped to a second line** — which is what "it
 * scattered the menu" describes — and at 40rem **every `<li>` in the two-column grid is given a bottom
 * border**, so the account control was drawn as a menu item. **And `nav-account` had no rule anywhere**, so
 * nothing distinguished it: it *was* one more menu item, because that is exactly what it was emitted as.
 *
 * WHAT IS DIFFERENT NOW, AND WHY NEITHER FAULT CAN HAPPEN AGAIN
 *
 * `fillMasthead` writes the control **once**, as a `div.masthead-account`: a sibling of the `<nav>` inside the
 * header's own `.wrap`, which `main.css:97` already sets to
 * `display: flex; align-items: center; justify-content: space-between` for the `.wordmark` and the `<nav>`, so
 * the row can hold a third child. Rules 1–4 above dress it for a wide screen, where it is where it has been
 * since the second report — **outside the `<ul>`, so `.nav ul`'s flex row holds seven items and has no eighth
 * item to wrap**, and not a `.nav li`, so `showcase.css:658`'s border cannot reach it. **That is a structural
 * guarantee rather than a width that happens to fit**, which is what the earlier "My Account is narrower than
 * Sign in / Sign up" mitigation relied on and why the complaint survived it.
 *
 * ⚠️ **ON A PHONE THAT SAME SINGLE CONTROL IS THE MENU'S LAST ROW, AND IT IS STILL OUTSIDE THE `<ul>`.** The
 * owner's third report asks for it *in the menu*, and the disclosure the design already draws —
 * `showcase.css:658` hides `nav.nav` and shows it on `.masthead.menu-open` — is what "in the menu" is made of.
 * So below 40rem the control is hidden while the menu is shut and laid out as the menu's own last row when it
 * is open: rule 4 below. **The `<ul>` still comes out of `fillMasthead` item for item identical**, which is
 * what the two tests named for his second report assert against all 52 design files — an `<li>` put back into
 * it is precisely the fault they exist to catch, so it is not the fix for this one.
 *
 * ⚠️ **AND THE ROLE SWITCH DOES NOT GO INTO THE MENU WITH IT.** `fillModeSwitcher` writes the workspace switch
 * into this same box, and a switch a phone cannot reach without opening a menu is a control a person cannot
 * use. Rule 4 hides `.nav-account` alone; **the switch keeps the bar at every width**, and the account link is
 * the thing the menu carries.
 *
 * Three things this has to do, and where each is done:
 *
 *   1. it does not wrap the menu, at any width          rules 1–2 — it is not in the `<ul>` at wide widths,
 *                                                       and below 40rem it is a row of the menu rather than
 *                                                       a cell of its grid
 *   2. it does not take the menu item's border on a      by construction: it is not a `.nav li`. Below 40rem
 *      wide screen                                       it takes that border deliberately, because there
 *                                                       it is the menu's last row
 *   3. it still reads as the way into the account       the label carries the design's own `.nav a` type and
 *                                                       colour at every width — and its phone row repeats
 *                                                       `showcase.css:658`'s own `1rem` / `.85rem .35rem`
 *
 * ⚠️ THIS SHEET IS THE ONLY ONE EDITED. `apps/ozikoro/public/design/` is inviolable and byte-compared against
 * the deliverable, and this sheet loads after both of the design's — which is where a rule that corrects the
 * design rather than contradicting it belongs. It is the same placement `main.css:97` already gives a third
 * child of `.wrap`.
 */

/*
 * 1. THE FLEX ROW, AT DESKTOP WIDTHS.
 *
 * The box is the third child of `.masthead > .wrap`, beside the `.wordmark` and the `<nav>`. `align-items`
 * is inherited as `center` from `main.css:97`; `flex-wrap` comes from there too, so if a narrow desktop ever
 * runs out of room **the account control wraps onto a line of its own and the seven-item menu keeps its
 * own** — the failure mode is the control moving, never the menu scattering.
 */
.masthead-account {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: var(--s-2) var(--s-4);
}

/*
 * 2. THE LABEL READS AS THE DESIGN'S OWN NAV ITEM, BECAUSE IT IS THE SAME KIND OF THING.
 *
 * The metrics are `.nav a`'s from `main.css:102` — 500 weight, `--s-1` block padding, a 2px transparent
 * underline — with `--on-night` in place of `--ink`, for the reason the masthead note above already gives:
 * `showcase.css:27` sets the masthead's own nav links to the night bar's foreground, and this control is in
 * that bar. Hover and focus use the design's `--gold-bright` / `--gold`, which is `showcase.css:28`'s own
 * treatment of a masthead link rather than a new colour.
 */
.masthead-account > .nav-account {
  display: inline-flex;
  align-items: center;
  padding-block: var(--s-1);
  color: var(--on-night);
  font-size: 1rem;
  font-weight: 500;
  line-height: inherit;
  white-space: nowrap;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.masthead-account > .nav-account:hover,
.masthead-account > .nav-account:focus-visible {
  color: var(--gold-bright);
  border-bottom-color: var(--gold);
}

/*
 * 3. THE WORKSPACE SWITCH, WHEN THE VIEWER HAS ONE, SITS BESIDE THE ACCOUNT LINK IN THE SAME BOX.
 *
 * It is a `<details>` carrying the existing `.nav-modes-item` rule above, which was written for `nav.nav`
 * and now finds it here instead. The summary takes the metrics of the link beside it; `--on-night` is right
 * for this bar for the same reason. **`padding` is repeated rather than inherited because `line-height:
 * inherit` on `a` and on `summary` resolves against different parents.**
 */
.masthead .nav .nav-modes-item .sx-role-switch > summary,
.masthead-account .nav-modes-item .sx-role-switch > summary {
  padding: var(--s-1) 0;
  color: var(--on-night);
  font-size: 1rem;
  font-weight: 500;
}

/*
 * 4. THE 40REM BREAKPOINT, WHERE THE DESIGN TURNS THE MASTHEAD'S `.wrap` INTO A TWO-COLUMN GRID.
 *
 *   showcase.css:656  .masthead>.wrap, .sx-reader-header>.wrap {
 *                       display: grid !important;
 *                       grid-template-columns: minmax(0,1fr) auto;
 *                       gap: .75rem; align-items: center; padding-block: .75rem }
 *
 * `mobile-nav.js:26` injects the hamburger as a child of that `.wrap`, immediately before `nav.nav`, and
 * `showcase.css:658` hides the real menu behind it — so the row's second column is the menu button's, and
 * the account control must not take it. **It therefore takes the grid's own first row**, in that second
 * column beside the wordmark, and the button follows it in the natural flow rather than being pushed onto a
 * line of its own: measured at 390 px, the header stays two rows and the menu button stays in the top-right
 * corner where a reader looks for it.
 *
 * `display: contents` is what lets the injected button take part in this grid **without touching
 * `mobile-nav.js`, which is part of the deliverable`**. This application has no reason to edit the design's
 * script, and a control the web platform already understands should not be hidden by a wrapper this round
 * introduced. It is set for the reader header too, whose `.wrap` is the same grid — `showcase.css:656` names
 * both — so that the account control is a grid item on either header rather than a flex row inside a cell.
 *
 * AND IT TAKES A CHIP INSTEAD OF THE MENU ITEM'S BORDER. `showcase.css:658` gives every `.nav li` a bottom
 * border; this box is not a `.nav li` and cannot receive it, and the rule below is what makes that visible
 * rather than merely true — a filled gold button, in the design's own `--gold` and `--ink-strong`, which
 * reads as the way into the account and as nothing else in that row.
 *
 * ⚠️ **AND ON A PHONE THE CHIP IS NOW ONLY THE FALLBACK, BECAUSE THE OWNER ASKED FOR THE CONTROL IN THE
 * MENU.** His third report, from the phone: *"on the mobile, sign and my account shows despite the mobile
 * having the three lines that leads you to the menu, why not also add the sign in and sign up there?"*
 * **Measured at 390 px, he was looking at exactly this chip** — `44 × 44` of hamburger at the top right and a
 * `123 × 36` gold "Sign in / Sign up" on its own row beneath it, beside a menu that was closed. So where the
 * header has a menu button and the menu is shut, the chip is not displayed; where the menu is OPEN the same
 * single control is laid out as the menu's last row, in the design's own type and with the same 18%-gold rule
 * under it. **It is the menu's row rather than an eighth `<li>`**, which is why the design's `<ul>` still
 * comes out of `fillMasthead` item for item identical — the two tests named for his second report assert
 * that against all 52 design files, and putting an `<li>` back is the fault they exist to catch.
 *
 * ⚠️ THE STAND-DOWN IS GATED ON THE MENU BUTTON EXISTING, WHICH `:has()` IS HOW CSS ASKS. Without JavaScript
 * `mobile-nav.js` injects no `.mobile-menu-button`, and `showcase.css:658` then hides `nav.nav` with nothing
 * able to open it. Hiding the chip as well would leave a phone **no way into an account at all** — the
 * design's own dead menu, plus a fault this round added. `:has()` makes the two facts one: where there is no
 * button there is no menu, so the chip stays. A browser without `:has()` drops that rule and the chip shows —
 * **the failure is the arrangement that shipped, never an unreachable control.**
 *
 * ⚠️ AND THE WORKSPACE SWITCH DOES NOT STAND DOWN WITH IT. `fillModeSwitcher` writes the switch into this
 * same box, and a switch a phone cannot reach without opening a menu is a control a person cannot use. Only
 * `.nav-account` is hidden, so a reader holding a second workspace keeps that chip in the bar at every width
 * and the account LINK is the control the menu carries.
 */
@media (max-width: 40rem) {
  .masthead > .wrap > .masthead-account,
  .sx-reader-header > .wrap > .masthead-account {
    display: contents;
  }

  /*
   * THE CONTROL IS IN THE MENU, SO IT IS HIDDEN WHILE THE MENU IS SHUT. `:not(.menu-open)` rather than a
   * second selector with the same weight: this rule has to lose to the one below it when the menu opens, and
   * an explicit state is a smaller thing to reason about than a specificity that happens to be one class
   * lighter.
   */
  .masthead:has(> .wrap > .mobile-menu-button):not(.menu-open)
    > .wrap > .masthead-account > .nav-account,
  .sx-reader-header:has(> .wrap > .mobile-menu-button):not(.menu-open)
    > .wrap > .masthead-account > .nav-account {
    display: none;
  }

  /*
   * THE MENU'S LAST ROW. `grid-column: 1/-1` puts it under the seven menu rows that `nav.nav` already spans
   * with its own `1/-1`, and the metrics are the design's own from `showcase.css:658` — `.masthead .nav a`
   * is `padding: .85rem .35rem` at `1rem`, and every `.nav li` carries the same 18%-gold rule underneath.
   * **The rule under it is what makes it read as a menu row rather than a control parked under a menu**, and
   * the colour is `--on-night`, the bar's own foreground, because this row is in the menu the bar draws.
   */
  .masthead.menu-open > .wrap > .masthead-account > .nav-account,
  .sx-reader-header.menu-open > .wrap > .masthead-account > .nav-account {
    display: block;
    grid-column: 1 / -1;
    justify-self: stretch;
    align-self: center;
    padding: 0.85rem 0.35rem;
    border: 0;
    border-bottom: 1px solid color-mix(in oklab, var(--gold) 18%, transparent);
    border-radius: 0;
    background: transparent;
    color: var(--on-night);
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    white-space: normal;
  }

  /* The hover stays the design's own masthead treatment rather than a new colour. */
  .masthead.menu-open > .wrap > .masthead-account > .nav-account:hover,
  .masthead.menu-open > .wrap > .masthead-account > .nav-account:focus-visible,
  .sx-reader-header.menu-open > .wrap > .masthead-account > .nav-account:hover,
  .sx-reader-header.menu-open > .wrap > .masthead-account > .nav-account:focus-visible {
    color: var(--gold-bright);
    background: color-mix(in oklab, var(--gold) 14%, transparent);
  }

  /*
   * THE CHIP IS THE FALLBACK, AND IT IS STILL A CHIP RATHER THAN NOTHING.
   *
   * `grid-column: 2` is beside the wordmark, which `showcase.css:656` puts in column 1; the mobile datebar and
   * the menu button keep the rows they had, and `nav.nav` keeps its own `grid-column: 1/-1`. This is what the
   * page shows when there is no menu button to put the control inside — **the no-JavaScript case, and a
   * browser without `:has()`** — so it is kept rather than deleted: the arrangement that shipped is a working
   * arrangement, and the stand-down above is a preference about where the control belongs, not a repair.
   *
   * ⚠️ IT IS NO LONGER WHAT A PHONE WITH A WORKING MENU SHOWS, AND THE OLD NOTE HERE IS WORTH CORRECTING
   * RATHER THAN KEEPING. It read: *"It takes its own row on a phone, and that is accepted rather than hidden —
   * three rows and a visible control is the honest arrangement."* **Measured at 390 px, that row is exactly
   * what the owner reported**: the wordmark and the hamburger on the first row, a `123 × 36` gold
   * "Sign in / Sign up" on the second, beside a menu that is closed. A control parked under a disclosure is
   * not the way into an account; **it is the fault**, and where a menu exists the control is that menu's last
   * row instead.
   *
   * The chip is drawn rather than filled, which is both quieter than a gold block beside a gold hamburger and
   * smaller: `--gold-bright` on the masthead's near-black is 9.8:1, and the border is the design's own
   * `--gold`, the same tone the menu button beside it uses for its own outline (`showcase.css:657`).
   */
  .masthead-account > .nav-account {
    grid-column: 2;
    justify-self: end;
    align-self: center;
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--gold);
    border-radius: var(--r-sm);
    background: transparent;
    color: var(--gold-bright);
    font-size: var(--t-sm);
    font-weight: 600;
  }

  /*
   * The hover is the design's own inversion of the same pair, so the control is visibly the one thing in the
   * bar that answers a pointer.
   */
  .masthead-account > .nav-account:hover,
  .masthead-account > .nav-account:focus-visible {
    background: var(--gold);
    color: var(--ink-strong);
    border-color: var(--gold-bright);
  }

  /*
   * The switch, when there is one, takes the same cell. It is `display: contents`'s other child, so it is a
   * grid item here — **and it is the one child of the box that does not stand down when the menu does.** A
   * reader holding a second workspace keeps the chip in the bar whether the menu is open or shut, which is the
   * whole reason the stand-down above names `.nav-account` and not the box: a switch that needs a menu opened
   * first is a control a phone cannot use, and the account LINK is what the menu is carrying.
   */
  .masthead-account .nav-modes-item {
    grid-column: 2;
    justify-self: end;
    align-self: center;
  }

  .masthead-account .nav-modes-item .sx-role-switch > summary {
    display: inline-flex;
    padding: 0.5rem 0.7rem;
    color: var(--gold-bright);
    font-size: var(--t-sm);
    font-weight: 600;
  }
}

/*
 * ══ THE BRAND WAS GREEN ON THE READING PAGES, AND IT WAS THE ONE ELEMENT THE DESIGN FORGOT TO COLOUR ══
 *
 * The owner: *"when one is reading article, especially like folklores, and others on mobile, the ozikoro
 * shows green and not even the logo. please make sure every single page, the logo is showing no green
 * text"*. **He is describing the record and folklore reading pages exactly, and the cause is a gap in the
 * design's markup rather than a rule of the design being overridden.**
 *
 * WHAT WAS PAINTED, MEASURED IN CHROME FROM THE VALUES IN FORCE
 *
 * On `/why-a-hawk-kills-chickens/` and `/folklore/`, at both 390 px and 1280 px, `Emulation.setDeviceMetrics`
 * override and `CSS.forcePseudoState` driving real states:
 *
 *   `.sx-reader-header .wordmark`   default  rgb(13, 92, 69)   `#0d5c45`
 *                                   hover    rgb(8, 64, 47)    `#08402f`
 *                                   focus    rgb(13, 92, 69)   `#0d5c45`
 *   the winning rule                `main.css:52  a { color: var(--link) }`, specificity (0,0,1),
 *                                   `--link: var(--accent)` = `#0d5c45` (tokens.css:19,43)
 *   the ground it is read on        `.sx-reader-header` = `var(--night)` `#0f0d0b` (showcase.css:287)
 *
 * **AND IT IS NOT ONLY THE WRONG BRAND, IT FAILS CONTRAST, AND ITS HOVER IS WORSE THAN ITS RESTING STATE:**
 *
 *   `#0d5c45` on `#0f0d0b`   2.43:1   (WCAG 2.1 AA needs 4.5:1 for normal text, 3:1 even for large text)
 *   `#08402f` on `#0f0d0b`   1.65:1   ← the hover, i.e. the state a pointer user reaches *to confirm a link*
 *
 * WHY THE READING HEADER IS THE ODD ONE OUT, AND WHY NOTHING IS CONTRADICTED HERE
 *
 * The design colours its brand name through a `<b>`:
 *
 *   showcase.css:21   .wordmark b         { color: transparent; background: var(--gradient-gold);
 *                                           background-clip: text }              ← the gold wordmark
 *   showcase.css:289  .sx-reader-header .wordmark b { color: var(--gold-bright, #e8c766) }
 *   main.css:99       .wordmark b         { color: var(--ink-strong) }             (the paper-ground base)
 *
 * **So the design's intent for this exact element is gold, and it says so in its own sheet.** But the
 * markup has to carry the `<b>` for any of that to match, and **on two of the fifty-three screens it does
 * not**:
 *
 *   design/screens/article.html   `<a class="wordmark" href="home.html">OZI IKORO <span>Archive</span></a>`
 *   design/screens/folklore.html  `<a class="wordmark" href="home.html">OZI IKORO <span>Archive</span></a>`
 *
 * — where `home.html`, `folklore-reader.html`, `cultural-event.html` and every masthead screen write
 * `<b>Ozikoro</b>` or `<b>OZI IKORO</b>` instead. **`OZI IKORO` is therefore a bare text node, and a bare
 * text node takes its colour from the anchor** — which is `a { color: var(--link) }`, the green. The
 * `<span>Archive</span>` beside it is fine (`showcase.css:290` colours it `--on-night-muted`, 8.74:1), which
 * is why only the name read green and why the fault looks like a half-finished rule.
 *
 * **`article.html` is the record route's template and `folklore.html` is `/folklore/`, so these two design
 * files are the whole of the fault** — measured: of fifty-three served pages, the brand is green on exactly
 * those two and gold everywhere else. Every masthead page and `/watch/`, `/listen/`,
 * `/folklore-reader/` and `/cultural-event/` were already correct at both widths.
 *
 * ⚠️ **THE FILL IS FAITHFUL AND IS NOT THE THING TO CHANGE.** It reproduces the design's markup character
 * for character, and the markup it reproduces is the design's. Editing the fill to inject a `<b>` would put
 * the application's markup and the deliverable's markup out of step on a screen the design drew
 * deliberately, and it would fix only the two screens that exist today.
 *
 * SO THE GAP IS CLOSED FROM THIS SHEET, WITH THE DESIGN'S OWN COLOUR AND NO NEW ONE. This rule gives the
 * anchor the colour the design already gives its `<b>`, so a bare wordmark is painted the same gold as a
 * wrapped one and the two markups become visually identical. `--gold-bright` is not a value invented here:
 * it is `showcase.css:289`'s own reader-header brand colour and the 45% stop of `--gradient-gold`.
 *
 *   `#e8c766` on `#0f0d0b`   11.82:1   ← replaces a 2.43:1 default and a 1.65:1 hover
 *
 * ⚠️ IT CHANGES NOTHING WHERE `<b>` IS ALREADY PRESENT, WHICH IS THE TEST THAT IT IS A CORRECTION AND NOT A
 * REDESIGN. `.wordmark b` and `.wordmark span` both carry their own `color`, so they never inherit from the
 * anchor; on the fifty-one screens that write `<b>` this rule is invisible. Measured after the change: the
 * `<b>` is still gold at every width and on every page.
 *
 * ⚠️ AND HOVER AND `:focus-visible` WERE MEASURED RATHER THAN ASSUMED — the lesson `cfcf015` recorded, that a
 * fix which repairs the default and breaks the focus ring is a new fault.
 *
 *   · HOVER DOES NOT MOVE THE COLOUR, AND THAT IS THE DESIGN'S OWN BEHAVIOUR. `a:hover` sets
 *     `color: var(--link-hover)`, and **at (0,1,1) it is lighter than this rule at (0,2,0), so this rule
 *     wins and the hover stays gold.** That is what a `<b>` wordmark already does — the `<b>` has its own
 *     colour, so hovering it has never changed anything — and matching it is the point. It is also the only
 *     defensible direction: the design's hover *was* the darker green at 1.65:1, i.e. hovering the brand made
 *     it less legible than leaving it alone.
 *   · THE FOCUS RING IS UNTOUCHED, BECAUSE IT IS AN OUTLINE AND NOT A COLOUR. `main.css:29`
 *     `:focus-visible { outline: 3px solid var(--focus) }`, and `--focus` is this sheet's own `#5f6ad6`
 *     (4.17:1 on `--night`) — the value the note at the top of this file measured for exactly these night
 *     bars. **This rule changes `color` and nothing else, so the ring cannot be affected by it**, and it is
 *     verified in the browser at both widths rather than argued from the declaration.
 *
 * The two selectors are given because both of the archive's headers are night bars with a gold brand —
 * `.masthead` is `rgba(15,13,11,.92)` (showcase.css:12) and `.sx-reader-header` is `var(--night)` — and a
 * bare wordmark in either would take the same green. **Today only the reader header has one; the masthead
 * half is here so that the next bare wordmark is not a recurrence of this report.**
 */
.sx-reader-header .wordmark,
.masthead .wordmark {
  color: var(--gold-bright);
}

/*
 * ═══════════════════════════════════════════════════════════════════════════════════════════════════════
 * THE THIRTEEN MONTHS (ỌNWA) TABLE AT PHONE WIDTH — `/igbo-calendar/`, WCAG 2.1 AA 1.4.10 (Reflow).
 *
 * ▸ THIS BLOCK IS ONE CHANGE AND NOTHING ELSE IN THIS FILE IS ITS. The reader-header wordmark block
 *   directly above is a different change by a different hand; if you are looking for that one, stop at
 *   line 822. Nothing here re-declares a colour, a token or a header rule.
 * ═══════════════════════════════════════════════════════════════════════════════════════════════════════
 *
 * WHAT WAS ACTUALLY WRONG, MEASURED IN CHROME AT 390 px BEFORE THIS BLOCK EXISTED:
 *
 *   document.scrollingElement   scrollWidth 390  ==  clientWidth 390   ← THE PAGE NEVER SCROLLED SIDEWAYS
 *   div.sx-cal-table-wrap       scrollWidth 480  >   clientWidth 356   ← the only element over its box
 *   table.sx-cal-months         width 480px   (showcase.css:725 `min-width:30rem`)
 *   caption                     width 480px   → clipped mid-word at the scrollport's edge
 *   td widths                   65 / 166 / 250  →  124px of "Gregorian equivalent" off-screen
 *
 * So the thing the owner saw was the TABLE, not the page. The wrapper is not missing its rule:
 * `showcase.css:724` gives `.sx-cal-table-wrap { overflow-x: auto }`, that rule IS applied (measured
 * `overflow-x: auto`, and it is the single reason `document.scrollingElement` never exceeded 390), and
 * the wrapper really did scroll. What it did not do was let anything be READ without scrolling: 480px
 * of table sat in a 356px scrollport, so the third column and — the part he named — the caption were cut
 * off mid-word, and on iOS and Android the overlay scrollbar is invisible, so nothing on screen said the
 * table could be moved at all.
 *
 * WHY THIS SHAPE, AND WHY IT IS THE DESIGN'S OWN TREATMENT RATHER THAN A NEW IDEA.
 * The design already draws a mobile treatment for the calendar's tables, and it skipped exactly one:
 * `showcase.css:764` `@media(max-width:40rem)` shrinks `.sx-cal-sample`'s padding and type and keeps its
 * wrapper scrolling — `.sx-cal-sample-wrap{padding:1rem;overflow-x:auto}`, `.sx-cal-sample td{padding:.45rem;
 * font-size:.8rem}` — but that block names `.sx-cal-months` nowhere, so the thirteen-month table kept its
 * desktop `min-width:30rem` floor and its 1.2rem cell padding on a phone. This block is that same drawn
 * treatment extended to the one table the design forgot, at the design's own 40rem breakpoint.
 *
 * RELEASING `min-width` IS THE PART THAT ACTUALLY FIXES IT, and it is why the fix is not merely "smaller
 * type". The floor, not the glyph size, is what put 480px of table into a 356px phone. The table's own
 * min-content at this scale is far narrower than the viewport, so with the floor released and the padding
 * brought to the design's own mobile scale the three columns fit inside the scrollport and wrap within it:
 * measured after, the wrapper's `scrollWidth` equals its `clientWidth` (356/356) and the columns are
 * 41 / 123 / 192 = 356.
 *
 * ⚠️ THE TABLE'S SEMANTICS ARE UNTOUCHED, WHICH IS WHY THIS IS NOT A STACK-AND-LABEL REWRITE.
 * No `display` is changed on `<table>`, `<caption>`, `<tr>`, `<th>` or `<td>`, so the table role, its
 * three `<th scope="col">` headers and its caption all survive at every width. A stacking fix that turned
 * these into blocks with `::before` labels would have dropped the table role in the accessibility tree —
 * trading a visual fault for an accessibility one, in the accessibility sheet. Measured after the change:
 * one `<table class="sx-cal-months">`, 3 `th[scope="col"]`, 13 `tbody tr`, caption present and read.
 *
 * ⚠️ IT CANNOT REACH THE DESKTOP, AND THAT WAS VERIFIED RATHER THAN ASSUMED. It is inside
 * `@media(max-width:40rem)`, so at 1280px not one declaration matches, and the table measures exactly as
 * it did before: wrapper 1166/1166, table 1166px, columns 157 / 402 / 607, caption 1166px, 0 overflowing.
 *
 * The wrapper keeps the design's `overflow-x:auto` as the safety net for the case this block cannot
 * predict — a reader at 400% text zoom, or a viewport narrower than the table's min-content — so the
 * fallback is still the wrapper scrolling, never the page.
 */
/*
 * ═══════════════════════════════════════════════════════════════════════════════════════════════════════
 * A RECORD'S OWN HEADINGS ON THE SERVED ARTICLE. THE OWNER'S SECOND REPORT.
 *
 * ▸ THIS BLOCK IS ONE CHANGE AND NOTHING ELSE IN THIS FILE IS ITS. If you are looking for the calendar
 *   table's phone treatment, that is the block directly below this one; the reader-header wordmark is
 *   further up. Nothing here re-declares a colour and nothing here touches a layout property.
 * ═══════════════════════════════════════════════════════════════════════════════════════════════════════
 *
 * The owner: *"also, the title h1, h2, etc should be showing exactly like that on the main article when
 * one is reading it. most of it appear very small, instead of its right size"*.
 *
 * ── WHAT THE ARCHIVE'S WRITING ACTUALLY CONTAINS, COUNTED RATHER THAN ASSUMED ─────────────────────────
 *
 * Every published record was fetched from the served sitemaps and its headings counted inside the record's
 * own `<div class="prose">` — the element `fillArticleProse` puts the record's words into, with the
 * frame's own `sr-only` headings separated out. **1,063 records (1,051 histories and 12 pages); 695 of them
 * carry at least one authored heading.** The headings they carry:
 *
 *     h1      0        h2    883        h3    442        h4  2,309        h5    441        h6      8
 *
 * ⚠️ **`h4` IS THE ARCHIVE'S HEADING — 2,309 of 4,083, 57% of every heading in the corpus** — and 408
 * records use `h4` as their SHALLOWEST heading, so for those it is the top-level section marker in the
 * record. `h5` is next at 441. `h1` is zero on the served page: the sanitiser used to DROP an authored
 * `<h1>` (see below), so there was nothing to size.
 *
 * ── ⚠️ EVERY NUMBER AND ONE SENTENCE ABOVE IS THE **BEFORE** PICTURE, AND THE SERVED LEVELS MOVED ─────
 *
 * The owner's next report — *"some articles sources is not in order"* — was the outline this block's own
 * census had already described from the other end: **516 of the 1,051 served article pages skipped a heading
 * level** (every page fetched and its headings read, live, before the change; 28 after), because the archive
 * splices its own two `h2`s (`#record` *"The written record"* and `#context` *"Historical context"*) between
 * headings the author wrote at `h4`. `fillArticle` now runs `normaliseHeadingLevels(…, 3)`, so a record's own
 * top level sits directly beneath the archive's `h2` container, and an authored `<h1>` is demoted to `h2` by
 * the sanitiser instead of being dropped. Measured through the served pipeline over the same 1,051 histories,
 * before and after:
 *
 *     before   h1 0   h2 927   h3 453   h4 2,602   h5 441   h6  8     shallowest h4 in 411 records
 *     after    h1 0   h2   0   h3 4,093 h4   262   h5  64   h6 12     shallowest h3 in all 720
 *
 * **So the archive's dominant heading now paints at the `h3` step — 1.35em (24.4px), `margin-top: 2rem` —
 * where the same heading painted at the `h4` step, 1.18em (21.3px), before.** That is a visible change to
 * every article's section headings, and it is a CONSEQUENCE of the level fix rather than a decision of its
 * own: these rules are level-based and the level is what was wrong. **1.35em stays inside the scale set out
 * below** (1.6em is the ceiling, `h4` is 1.18em), so the scale still steps as designed and the declarations
 * themselves are unchanged. The 28 pages that still skip are the records whose own levels are non-contiguous
 * or whose shallower heading stands later in the document than a deeper one — six authored `h5`s followed by
 * one `h4`, on `umueri-the-ancestral-homeland-of-eri-the-children-of-eri` — and the offset rule preserves the
 * author's own structure rather than inventing a level they did not write.
 *
 * ── WHAT WAS PAINTED, MEASURED IN CHROME AT 1280 px BEFORE THIS BLOCK EXISTED ──────────────────────────
 *
 *   body paragraph      18.08px      `.sx-page .prose { font-size: 1.13rem }`   showcase.css:310
 *   h2                  24.00px      `.sx-page .prose h2 { font-size: 1.5rem }` showcase.css:311
 *   h3                  26.00px      `.prose h3 { font-size: var(--t-xl) }`     main.css:223
 *   h4                  15.00px      `h4 { font-size: var(--t-base) }`          main.css:50
 *   h5                  15.01px      no rule at all — the browser's 0.83em      (× 18.08px)
 *   h6                  12.11px      no rule at all — the browser's 0.67em
 *
 * Three separate faults, and all three are in those six numbers:
 *
 *   1. **`h4`, the archive's dominant heading, is SMALLER than the paragraph text under it** — 15px against
 *      18.08px. `main.css:50` sizes every `h4` on the site at the UI base size (`--t-base`, 0.9375rem),
 *      which is right for a footer column heading and wrong for a section heading inside a reading column.
 *      This is "most of it appear very small", and it is 57% of the corpus.
 *   2. **`h5` and `h6` are smaller still**, for the opposite reason: no rule reaches them, so they keep the
 *      browser's own `0.83em` and `0.67em` defaults, which the `.prose` reading size then scales down.
 *   3. **`h3` DRAWS LARGER THAN `h2`** — 26px against 24px — because `showcase.css:311` overrides the
 *      article's `h2` down to 1.5rem while `main.css:223` leaves the same article's `h3` at `--t-xl`
 *      (1.625rem). *The outline is inverted on the page: a reader is shown a sub-section bigger than the
 *      section above it.* On the sample article measured, that is visible directly — its eleven body `<h3>`s
 *      at 26px sit under the frame's `<h2>`s at 24px.
 *
 * ── THE SCALE, AND WHY IT IS IN `em` ───────────────────────────────────────────────────────────────────
 *
 * The values are multiples of the reading size, not absolute rems, because the design sets that size three
 * times and each one is deliberate: `1.13rem` on the article, `1.05rem` at the 40rem breakpoint
 * (`showcase.css:450`) and `10.5pt` in print (`showcase.css:459`). A scale in `em` follows all three, and
 * an absolute one would be wrong in two of them without anybody noticing.
 *
 * Nothing here makes a heading huge, and the ceiling is deliberate: the largest body heading is **1.6em
 * (28.9px)**, comfortably under the page's own `<h1>` title at 42px. *A section heading in a record is not
 * competing with the record's title, and the design's article frame draws that title itself.* `h4`, the one
 * the corpus actually uses, is 1.18em (21.3px) — a real step above the 18.08px it sits in, and small enough
 * that four levels of nesting still fit the reading column.
 *
 * ⚠️ AND `h5`/`h6` ARE GIVEN A FAMILY AND A WEIGHT, NOT ONLY A SIZE. `main.css:40` puts `h1, h2, h3, h4` in
 * the serif and leaves `h5`/`h6` in the body sans, so the two rarest levels were also the only ones not set
 * in the record's own typeface. A heading that changes typeface at the fifth level is the same fault in a
 * different property.
 *
 * WHY THIS IS IN `/a11y.css` AND NOT IN THE DESIGN. `apps/ozikoro/public/design/` is the approved
 * deliverable and is byte-identical to `design/calm-comfort-construct/public/design`; it must stay so. This
 * sheet is the archive's own, it loads after both of the design's (`layout.tsx:193`), and the whole reason
 * it exists is to correct what the design's values paint — which is what these six declarations are.
 *
 * ⚠️ THE SELECTORS CARRY TWO ARMS ON PURPOSE AND THE SECOND ONE IS THE ONE THAT WINS.
 * `showcase.css:311` is `.sx-page .prose h2` — specificity (0,2,1) — and a bare `.prose h2` (0,1,1) loses to
 * it however late this sheet loads. So each level is written both as the general `.prose h*` (which covers
 * every other reading column the archive draws: clan, town, researcher, publication) **and** as
 * `.sx-page .prose h*`, which ties the design's own selector and wins on order.
 *
 * ⚠️ AND `:not(.sr-only)` IS WHAT MAKES THE RULE MATCH THE POPULATION THAT WAS COUNTED. The article frame
 * draws two headings of its own inside `.prose` — *"The written record"* and *"Historical context"* — and
 * marks them `class="sr-only"`, because they exist for a screen reader's outline and are not the record's
 * writing. The census above excludes them by that class, and so do these rules; without it this block would
 * quietly restyle two of the design's own elements as a side effect of sizing the archive's.
 */
.prose h2:not(.sr-only),
.sx-page .prose h2:not(.sr-only) {
  font-size: 1.6em;
}

.prose h3:not(.sr-only),
.sx-page .prose h3:not(.sr-only) {
  font-size: 1.35em;
  margin-top: 2rem;
}

/* 2,309 of the archive's 4,083 body headings are this one. */
.prose h4:not(.sr-only),
.sx-page .prose h4:not(.sr-only) {
  font-size: 1.18em;
  margin-top: 1.7rem;
  font-family: var(--font-serif);
}

.prose h5:not(.sr-only),
.sx-page .prose h5:not(.sr-only) {
  font-size: 1.06em;
  margin-top: 1.5rem;
  font-family: var(--font-serif);
}

.prose h6:not(.sr-only),
.sx-page .prose h6:not(.sr-only) {
  font-size: 1em;
  margin-top: 1.4rem;
  font-family: var(--font-serif);
  /* At the reading size the level needs something other than size to read as a heading. */
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

@media (max-width: 40rem) {
  /* The design's own scroll container, made to move smoothly on iOS. */
  .sx-cal-table-wrap {
    -webkit-overflow-scrolling: touch;
  }

  /* The desktop floor (showcase.css:725) is what makes the table wider than the phone. */
  .sx-cal-months {
    min-width: 0;
  }

  /* The design's own mobile scale, from its `.sx-cal-sample` rules at showcase.css:764. */
  .sx-cal-months caption {
    padding: 0.8rem 0.9rem;
    font-size: 0.7rem;
  }

  .sx-cal-months th {
    padding: 0.5rem 0.6rem;
    font-size: 0.68rem;
  }

  .sx-cal-months td {
    padding: 0.5rem 0.6rem;
    font-size: 0.85rem;
  }
}

