/* Formula rendering styles for Temml MathML output */

/* Subset of STIX Two Math (SIL OFL, see fonts/STIX-Two-Math-OFL.txt) that keeps
   the OpenType MATH table. iOS ships no math font; without that table Safari
   draws accents such as \bar{x} detached from the letter. */
@font-face {
  font-family: 'STIX Two Math';
  src: local('STIX Two Math'), local('STIXTwoMath-Regular'), url("/assets/stix-two-math-2d972669.woff2") format('woff2');
  font-display: swap;
}

.formula-container {
  display: inline-block;
  font-size: 0.875rem; /* 14px - appropriate for table cells */
  line-height: 1.5;
}

/* One formula per line, for formulas set apart from prose */
.formula-container.formula-block {
  display: block;
  margin-left: 1rem;
}

/* Browsers center display math; shrink it so it starts at the indent */
.formula-container.formula-block math {
  width: fit-content;
  margin: 0;
  text-align: left;
}

/* MathML elements styling */
.formula-rendered math {
  font-family: 'STIX Two Math', 'Latin Modern Math', 'Cambria Math', math, serif;
  font-size: 1em; /* Match container size */
}

/* Ensure fractions are readable in table cells */
.formula-rendered mfrac {
  font-size: 0.95em;
}

/* Style function names in text mode */
.formula-rendered mtext {
  font-family: monospace;
  font-size: 0.9em; /* Slightly smaller to balance with math */
}
