/* math.css — how mathematics is displayed on appendix and essay pages.
   Linked AFTER each page's inline <style>. Pages do not all link tokens.css,
   so every token carries a literal fallback. Selectors are prefixed with
   `html` so they still beat MathJax's own runtime stylesheet
   (mjx-container[jax="SVG"][display="true"]) when it is appended later. */

/* A display equation wider than its column scrolls inside its own box
   instead of being clipped by body{overflow-x:hidden}. */
html mjx-container[jax="SVG"][display="true"] {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

/* Wide tables: static wrapper, added in the HTML by hand. */
html .table-scroll {
  max-width: 100%;
  overflow-x: auto;
  margin: 1.25rem 0;
  -webkit-overflow-scrolling: touch;
}
html body .table-scroll > table {
  margin: 0;
}
html .table-scroll:focus-visible {
  outline: 2px solid var(--gold, #c9a84c);
  outline-offset: 2px;
}

/* The assistive MathML stays in the accessibility tree, but its natural width
   (MathML text laid out at full size) can poke past the right edge of the page
   when an inline formula sits at the end of a line. Keep it one pixel wide,
   as visually-hidden text is usually done. */
html mjx-container[jax="SVG"] > mjx-assistive-mml {
  width: 1px !important;
  max-width: 1px !important;
}

/* A paragraph holding one inline formula that is wider than the column
   (static class, added by hand where measured). */
html .math-scroll {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
}

/* Figures whose labels would fall below 11 CSS px on a phone: keep the figure
   at a size where the smallest label (9 units) renders at 11px or more and let
   the reader pan it, rather than shrinking the labels. Static wrapper. */
@media (max-width: 600px) {
  html .figure-scroll {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
  }
  html .figure-scroll > svg {
    min-width: 700px;
  }
}
html .figure-scroll:focus-visible {
  outline: 2px solid var(--gold, #c9a84c);
  outline-offset: 2px;
}
