/* Display and inline maths, every page. A plain stylesheet listed under `css:` in
   _quarto.yml, deliberately outside the Sass theme: an edit here never recompiles
   docs/site_libs/. Colours are theme tokens (theme/*.scss), so both halves of the
   light/dark pair repaint without a reload.

   MathJax 4 is pinned in _quarto.yml and configured in theme/mathjax.html: the
   STIX Two maths font, whose x-height and stroke weight sit level with the Inter
   body face at the sizes below, and a display wider than the column scaled down to
   fit instead of running off a phone screen. These rules set the size of the maths
   and the space around it.

   Size goes on Quarto's span.math wrappers, never as an !important font-size on
   mjx-container: MathJax scales an over-wide display through that element's inline
   font-size, and an !important rule cancels the scaling (theme/mathjax.html).

   Theorem and definition blocks are styled per post, not here: other posts use
   callout-important for real warnings. A post whose callouts are mathematical
   statements restyles them in its own post.css. */

/* A display is its own block, a little larger than body text, with air above and
   below. Anything MathJax still cannot fit scrolls inside its own box and the page
   does not; the bottom padding keeps descenders and the scrollbar from clipping
   the last row. */
span.math.display {
  display: block;
  overflow-x: auto;
  overflow-y: hidden;
  max-width: 100%;
  padding: 0.15em 0 0.35em;
  font-size: 114%;
}
mjx-container[display="true"] {
  margin: 1.1em 0 !important;
}

/* Inline maths at 110%, so STIX Two's lowercase stands nearly as tall as Inter's and
   a formula in a sentence reads at the size of the words around it. (New Computer
   Modern needed about 118% for the same height, and at that size its tall
   delimiters pushed lines apart.) */
span.math.inline {
  font-size: 110%;
}

/* Equation numbers: quieter than the maths they label. */
mjx-container[display="true"] mjx-mtd[id] mjx-mtext,
mjx-container[display="true"] mjx-labels {
  color: var(--w-muted);
}

/* A short reason beside a derivation step, set in TeX as
   \class{eq-note}{\text{(Fubini)}}: quieter than the step it justifies. */
.eq-note {
  color: var(--w-muted);
}

/* A table header's text-transform must not reach the maths inside it. */
main table th mjx-container {
  text-transform: none;
}
