/* tick-760: readable code everywhere - long lines wrap instead of
   rendering as horizontal scroll strips. ASCII diagrams (```text boxes),
   long JSON strings and shell one-liners keep their newlines and
   indentation (pre-wrap) but break at the container edge instead of
   overflowing; inline code wraps inside table cells too. Purely visual:
   no content files, no fence line numbers touched. */
.md-typeset pre > code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.md-typeset code {
  overflow-wrap: break-word;
}

/* Table cells on narrow screens: Material scrolls tables, but long
   unbreakable inline code made the scroll far wider than the content
   required. */
.md-typeset table code {
  overflow-wrap: anywhere;
}

/* tick-779: a single over-long token in prose (a deep file path, a long
   URL) forced whole pages horizontally scrollable on narrow screens.
   break-word only engages when the token alone exceeds the line, so
   normal prose is untouched. ASCII box-art blocks are excluded from the
   pre-wrap above by stylesheets/ascii-fit.js (they fit or scroll with
   their frame intact instead of wrapping mid-character). */
.md-typeset {
  overflow-wrap: break-word;
}

/* tick-917: the header palette toggle's keyboard-focus indicator must be
   VISIBLE (WCAG 2.4.7). Upstream Material draws the focus ring on the
   focus-visible radio's NEXT SIBLING, but the form is cross-structured
   (input0, label1, input1, label0) and the bundle never syncs the radio
   checked state with the active theme (both radios stay unchecked), so a
   real Tab always lands on the first radio and the ring lands on the
   OTHER theme's icon - the one display:none'd in the active theme. Net
   effect: in slate the outline (auto/3px/accent, verified live) is drawn
   on an invisible label while the visible toggle shows nothing; default
   theme happens to work. Drawing the ring on BOTH sibling labels fixes
   it theme-agnostically: the hidden one stays invisible anyway. */
.md-header__option:has(.md-option.focus-visible) label.md-header__button {
  outline: 3px auto var(--md-accent-fg-color);
}

/* tick-935: links in prose are differentiated from surrounding text by
   COLOR ALONE (WCAG 1.4.1, technique G183) - the base anchor rule sets
   only --md-typeset-a-color and the hover rule swaps to the accent, with
   no text-decoration at rest or on hover, so the "this is a link" signal
   is lost on a color-blind reader. A matching underline adds the second
   visual channel and follows the link color automatically (currentColor).
   Permalinks (.headerlink) are chrome glyphs revealed on heading hover and
   the icon-only edit/share buttons (.md-content__button) carry their own
   affordance, so both stay unlined. */
.md-typeset a:not(.headerlink):not(.md-content__button) {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* tick-936: keyboard-focused elements must not hide under the sticky
   header (WCAG 2.4.11, Minimum). The header is ~96px tall and overlaps
   the scrolling article, but the built CSS ships no scroll-padding-top
   and its only scroll-margin rules are for :target fragment jumps - so
   a Shift+Tab target that is already "in" the viewport (top edge a few
   px down) triggers NO native focus-scroll and lands fully covered by
   the header; live-verified: a mid-page link focused at y=29 rendered
   entirely behind the header. scroll-margin-top on content focusables
   makes the focus-scroll algorithm keep a clear band below the header
   (6.5rem > 96px header). Headings are deliberately excluded: they are
   the :target elements and keep upstream's fragment landing (116px)
   byte-identical. */
.md-content a,
.md-content button {
  scroll-margin-top: 6.5rem;
}

/* tick-1918: the lede-meta strip (hooks.py on_page_content) - one
   reading-time + last-updated face under every page h1, computed at
   build time from the page's own content/front matter (nothing corpus-
   embedded to rot). Muted secondary text tucked against the h1:
   metadata, not content. The 20 pages with an authored face keep it;
   the hook never injects a twin. */
.md-lede-meta {
  color: var(--md-default-fg-color--light);
  font-size: 0.75em;
  margin: -0.6em 0 1.5em;
}

.md-lede-meta .md-lede-meta-sep {
  margin: 0 0.45em;
}

/* tick-1949: Lighthouse color-contrast FAIL on the inactive nav tabs -
   measured computed style: white at opacity 0.7 over the indigo primary
   (rgb(64,81,181)) blends to ~4.30:1, just under the 4.5:1 AA bar for
   the tab labels. 0.8 blends to ~4.94:1 - passes with margin, and the
   active tab (opacity 1) keeps its emphasis. */
.md-tabs__link:not(.md-tabs__link--active) {
  opacity: 0.8;
}

/* tick-1949b: Lighthouse color-contrast FAIL on two pygments token classes
   in SLATE mode - measured computed styles over the real code background
   rgb(39,42,53): .nb rgb(147,131,226) = 4.48:1 and .m rgb(230,105,91) =
   4.45:1, both a hair under 4.5:1 (light mode passes: 4.71 / 4.59 on
   rgb(245,245,245), so the override is slate-scoped only). The values
   lightened hue-preservingly and live-verified in the browser:
   .nb rgb(160,146,232) = 5.29:1, .m rgb(238,120,106) = 5.13:1. */
[data-md-color-scheme="slate"] .md-typeset .highlight .nb {
  color: rgb(160, 146, 232);
}

[data-md-color-scheme="slate"] .md-typeset .highlight .m {
  color: rgb(238, 120, 106);
}
