/* Applications of Taylor Series: page layout. No colours here: every colour is the course palette's (../lib/lesson-colors.css).
   Colour meanings (planning/colour.md), one macro each in katex-macros.json:
     \bx    blue    what goes in the box, or in place of x: the box itself, x², −x², a number read as x (2, π/3, −3)
     \off   pink    the first terms of a known series that are taken off, and the subtraction they cancel against
     \anti  green   a term and the antiderivative it becomes, one pair at a time
     \tot   violet  a running total: the series stopped after a term
     \nxt   orange  the first term left out: its size bounds the error, its sign gives the side
     \gone  mute    the terms that go to 0 in a limit (spent pieces)
   The function itself, answers and routine arithmetic stay ink. Every rule is scoped to main.col because the sheet styles
   outrank a plain page selector. */

/* one chain, two breaks: the wide one on a screen, a narrower break of the same maths on a phone */
:root[data-alive-ui] body main.col .sa-narrow{display:none}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .sa-wide{display:none}
  :root[data-alive-ui] body main.col .sa-narrow{display:block}
}

/* a step's lead-in above its row, in a card: the row gets the card's whole width at every size */
:root[data-alive-ui] body main.col .sa-cap{font:500 16.5px/1.45 'STIX Two Text',Georgia,serif;color:var(--ink);margin:0 0 6px}
:root[data-alive-ui] body main.col .sa-cap .katex{font-size:1.04em}
:root[data-alive-ui] body main.col .look-card .row+.sa-cap{margin-top:20px}

/* a single relation on its own line: centred, like the goal rows, and not a lamp block (one equation isn't a block) */
:root[data-alive-ui] body main.col .sa-eq{margin:20px auto 24px;width:fit-content;max-width:100%}
:root[data-alive-ui] body main.col .sa-eq .math-chain{margin:0;justify-content:center}
:root[data-alive-ui] body main.col .sa-eq .katex{font-size:1.1em}

/* a figure beside its rows, drawn at its own width (360 px); the rows take what is left. Stacks on a phone. */
:root[data-alive-ui] body main.col .look-pair.sa-pair{grid-template-columns:360px minmax(0,1fr);column-gap:28px}
:root[data-alive-ui] body main.col .sa-pair .look-rows{display:flex;flex-direction:column;align-items:center}
:root[data-alive-ui] body main.col .sa-pair .look-rows .math-chain{justify-content:center}
:root[data-alive-ui] body main.col .sa-pair .sa-goal .katex{font-size:1.3em}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .look-pair.sa-pair{grid-template-columns:1fr}
}

/* columns: a known series with a number series set term under term below it */
:root[data-alive-ui] body main.col .look-card .sa-cols{overflow-x:visible}
:root[data-alive-ui] body main.col .look-card .row.sa-cols+.row{margin-top:18px}

/* the common Maclaurin series: the pattern to look for, then the series it belongs to; the pattern goes above on a phone */
:root[data-alive-ui] body main.col .sa-kt{font:600 18px/1.3 'STIX Two Text',Georgia,serif;color:var(--ink);margin:0 0 14px}
:root[data-alive-ui] body main.col .sa-kr{display:grid;grid-template-columns:minmax(0,15.5em) minmax(0,1fr);gap:2px 26px;align-items:center}
:root[data-alive-ui] body main.col .sa-kr+.sa-kr{margin-top:12px}
:root[data-alive-ui] body main.col .sa-kp{font:400 17px/1.45 'STIX Two Text',Georgia,serif;color:var(--ink)}
:root[data-alive-ui] body main.col .sa-kr .math-chain{margin:0}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .sa-kr{grid-template-columns:1fr}
  :root[data-alive-ui] body main.col .sa-kr+.sa-kr{margin-top:16px}
}

/* Key concepts: rows of displayed maths on the quiet sheet (no row heads on this page) */
:root[data-alive-ui] body main.col .look-krows .row+.row{margin-top:8px}
:root[data-alive-ui] body main.col .look-krows .math-chain{margin:0}
:root[data-alive-ui] body main.col .look-krows+.knote{margin-top:14px}
/* the six known series in two columns on a wide card; the sum that drops eˣ's first term spans both */
:root[data-alive-ui] body main.col .look-krows.sa-k2{display:grid;grid-template-columns:1fr 1fr;gap:10px 28px}
:root[data-alive-ui] body main.col .look-krows.sa-k2 .row+.row{margin-top:0}
:root[data-alive-ui] body main.col .look-krows.sa-k2 .sa-span{grid-column:1/-1;margin-top:6px}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .look-krows.sa-k2{grid-template-columns:1fr}
}
