/* math.css -- styles for mathematical display pages
   (Dirac.html, Euler.html, GR.html, Hessian.html, Houseboat.html,
    Integral.html)
   Link this in addition to site.css on pages containing MathML.
   Header list corrected 2026-08-27: it named spoilers.html, which
   doesn't link this file, and omitted Houseboat.html, which does.
*/

/* ===== Default math display ===== */

math {
  display: block;
  /* width: fit-content is load-bearing, not decorative -- without
   * it, "margin: auto" below does nothing. A block-level <math>'s
   * root <mrow> gets its own MathML-internal block box that fills
   * the full container width by default; CSS text-align does not
   * reach inside MathML's own layout algorithm to center the
   * formula glyphs within that box, and "margin: auto" only centers
   * a block that's narrower than its container to begin with. Fixed
   * 2026-08-27: confirmed via direct measurement in a live browser
   * (Euler.html's formula was flush left despite text-align:center
   * being correctly computed and inherited) that adding this
   * shrink-to-fit width is what actually centers the content -- not
   * a text-align or margin change, which were already present and
   * already ineffective. (An early test of this fix seemed to show
   * the plain declaration being silently dropped and only an
   * !important version taking effect -- that was a false alarm from
   * a stale cached copy of this file in the test browser tab, not a
   * real engine quirk; a fresh load confirms the plain declaration
   * below works fine on its own.) */
  width: fit-content;
  font-size: 4em;
  margin: auto;
  text-align: center;
}

/* ===== Default text style for math pages ===== */

p {
  font-size: 4em;
  font-weight: bold;
  text-align: center;
}

/* ===== Large math variant (Integral.html) ===== */
/* Apply class="math-large" to the <math> element */

math.math-large {
  font-size: 10em;
}

/* ===== Hessian matrix -- prevent line wrapping ===== */
/* Apply class="math-nowrap" to the <math> element */

math.math-nowrap {
  white-space: nowrap;
  overflow-x: auto;
}

