/* A display equation (docs/plans/physics-page.md M3): a fenced block with the info string "equation", which Markdown renders
   as <div class="c-equation"> holding the lines as written, plain Unicode. Set in the text font, not monospace, lining
   figures; the block is centred on the text block and its lines are set flush left within it, so that a group of equations
   stands as one. A line too long for a phone scrolls sideways rather than breaking. In c-markdown it is a break in the
   running text, with a line of space around it (_markdown.css). */

.c-equation { width: fit-content; max-width: 100%; overflow-x: auto; font-variant-numeric: lining-nums; line-height: 1.6; text-align: left; white-space: pre; hyphens: none; }

/* Below --bp-small-phone (24rem) the text block is too narrow for the longest lines (310 px at 1.2rem on /fysik, where a phone
   320 px wide leaves 272): the equation is set at 0.94em, and in a book page (c-book, 1.5rem side padding) it takes 0.75rem of
   each side margin, which together fit every equation on /physics and /fysik at 320 px. To stay centred while it spills into the
   margins it is a flex container: its text is one anonymous flex item, centred while it fits and set from the left edge when it
   does not (safe center), so that a line still too long scrolls sideways from its start. */
@media (width < 24rem) {
  .c-equation { font-size: 0.94em; }
  .c-book .c-markdown > .c-equation { display: flex; justify-content: safe center; width: auto; max-width: none; margin-inline: calc(-1 * var(--space-3)); }
}
