/* Area and Surface Area of Parametric Curves: page layout. No colours here: every colour is the course palette's (../lib/lesson-colors.css).
   Colour meanings (planning/colour.md), as KaTeX macros in katex-macros.json:
     \hgt  green   the height y(t) in an area integral, and the radius r (y(t) about the x-axis, x(t) about the y-axis);
     \wid  blue    the area width (dx/dt) dt in every form, minus sign included;
     \dsw  pink    ds, the distance along the curve: the root whole, its inside while it is itself, and what it becomes;
     \cneg orange  counted negative, \cpos violet counted positive: section 3's x-form row only, as in its figure.
   A row reads its own structure: ∫ green · blue is an area, ∫ 2π green · pink is a surface. */

/* a chain written twice: a wide break (two moves to a line) and a narrow one (one move to a line), one shown per width */
:root[data-alive-ui] body main.col .psa-narrow{display:none}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .psa-wide{display:none}
  :root[data-alive-ui] body main.col .psa-narrow{display:block}
}

/* a single formula the eye comes back to (the area integral before and after it's written in t, a root rule): set on its
   own line, large and quiet like a goal row, and not a lamp block (one equation isn't a block) */
:root[data-alive-ui] body main.col .psa-eq{width:fit-content;max-width:100%;margin:20px auto 24px}
:root[data-alive-ui] body main.col .psa-eq .math-chain{margin:0;justify-content:center}
:root[data-alive-ui] body main.col .psa-eq .katex{font-size:1.1em}

/* a wide figure with the rows it explains under it, in one card: the figure at its own size (a 382 px drawing beside its
   rows would shrink to three quarters with its labels) */
:root[data-alive-ui] body main.col .psa-figcard>figure.diagram{margin:0;max-width:none}
:root[data-alive-ui] body main.col .psa-figcard>figure.diagram>svg:not(.katex svg){width:auto;max-width:100%;height:auto;display:block;margin:0 auto}
:root[data-alive-ui] body main.col .psa-figcard>figure.diagram>figcaption{margin-top:10px}
:root[data-alive-ui] body main.col .psa-figrows{display:flex;flex-wrap:wrap;justify-content:center;align-items:baseline;gap:10px 44px;margin-top:16px}
:root[data-alive-ui] body main.col .psa-figrows>.row{margin:0}
:root[data-alive-ui] body main.col .psa-figrows .math-chain{justify-content:center}

/* a live 3D figure sits centred in its card, like the flat ones */
:root[data-alive-ui] body main.col figure.diagram>.fig3d>svg{display:block;margin:0 auto}

/* an identity a chain uses, centred between the rows it joins; a contrast row set a little apart */
:root[data-alive-ui] body main.col .look-card .row.psa-id{margin:14px 0}
:root[data-alive-ui] body main.col .look-card .row.psa-id .math-chain{justify-content:center}
:root[data-alive-ui] body main.col .look-card .row.psa-gap{margin-top:22px}

/* labelled formulas side by side in a column: area against surface area. The label is set beside its formula on a wide
   screen and above it on a phone, so the formula never drops under a label it doesn't fit beside. */
:root[data-alive-ui] body main.col .psa-vs{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:16px 26px;align-items:center}
:root[data-alive-ui] body main.col .psa-lab{font:500 17px/1.4 'STIX Two Text',Georgia,serif;color:var(--ink);letter-spacing:0;text-transform:none}
:root[data-alive-ui] body main.col .psa-vs .math-chain,:root[data-alive-ui] body main.col .psa-vs .katex-display{margin:0}
:root[data-alive-ui] body main.col .look-krows.psa-vs{gap:12px 22px}
:root[data-alive-ui] body main.col .look-krows .row+.row{margin-top:8px}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .psa-vs{grid-template-columns:minmax(0,1fr);gap:2px}
  :root[data-alive-ui] body main.col .psa-vs>.psa-f{margin-bottom:12px}
  :root[data-alive-ui] body main.col .psa-vs>.psa-f:last-child{margin-bottom:0}
  /* a figure standing in a section keeps more of the narrow width for its drawing */
  :root[data-alive-ui] body main.col>section>figure.diagram,:root[data-alive-ui] body main.col .psa-figcard{padding-left:10px;padding-right:10px}
}
