/* Volume by Cross Sections: page layout. No colours here: every colour is the course palette's (../lib/lesson-colors.css),
   reached through the macros in katex-macros.json, one per meaning (planning/colour.md):
     \side  pink    the side: the segment across the base at one x (or y), its length, and s;
     \area  green   the cross section: the shape on the side, its area, and that area inside the integral;
     \thk   blue    the thickness, dx or dy;
     \eone  violet  the base's first edge (the curve, both halves, and x = y² as the same curve);
     \etwo  orange  the base's second edge (x = 4, y = 2x, …).
   A piece and what it becomes share a colour: two edges subtract to a pink side, the pink side sits inside a green area,
   and a blue dx turns the face into a slice. Answers, bounds and routine arithmetic stay ink.
   Every rule is scoped :root[data-alive-ui] body main.col, because the sheet styles outrank a plain page selector. */

/* a single displayed equation in the flow of the text: centred, at the cards' maths size, not a card and not lit */
:root[data-alive-ui] body main.col .cs-eq{width:fit-content;max-width:100%;margin:20px auto 24px}
:root[data-alive-ui] body main.col .cs-eq .math-chain{margin:0;justify-content:center}
:root[data-alive-ui] body main.col .cs-eq .katex{font-size:1.1em}
/* the lesson's formula, V = ∫ (area of the cross section at x) dx: the eye comes back to it, so a little larger */
:root[data-alive-ui] body main.col .cs-eq.cs-formula .katex{font-size:1.2em}

/* a figure beside its rows, each at its own width, the pair centred in its card (a small cross section beside two rows
   left the card's right half empty) */
:root[data-alive-ui] body main.col .look-pair.cs-fit{grid-template-columns:auto auto;justify-content:center;column-gap:48px}
:root[data-alive-ui] body main.col .look-pair.cs-fit .look-rows{min-width:0}
:root[data-alive-ui] body main.col .look-pair.cs-fit .look-rows .math-chain{justify-content:flex-start}

/* a name over the maths it names (the name is the page's words), so two integrals start at one left edge and read
   one above the other: section 1's area and volume, section 5's two directions */
:root[data-alive-ui] body main.col .cs-h{margin:0 0 6px;font:500 16px/1.35 'STIX Two Text',Georgia,serif;color:var(--ink)}
:root[data-alive-ui] body main.col .look-card>.row+.cs-h{margin-top:20px}
:root[data-alive-ui] body main.col .cs-tab .row-label{display:block;min-width:0;margin:0;font:500 16px/1.35 'STIX Two Text',Georgia,serif;letter-spacing:0;text-transform:none;font-style:normal;color:var(--ink)}
/* a short table: name, then its maths, on one line each */
:root[data-alive-ui] body main.col .cs-tab{display:grid;grid-template-columns:auto minmax(0,1fr);gap:12px 22px;align-items:center}
:root[data-alive-ui] body main.col .cs-tab>.row{display:contents}
:root[data-alive-ui] body main.col .cs-tab>.row>.row-label{margin:0}
:root[data-alive-ui] body main.col .cs-tab>.row.cs-span{display:block;grid-column:1/-1;margin:0 0 4px}
:root[data-alive-ui] body main.col .cs-tab .math-chain{justify-content:flex-start}
/* a case of the two-case comparison: its name, then its two integrals */
:root[data-alive-ui] body main.col .look-case .look-a+.look-a{margin-top:10px}
:root[data-alive-ui] body main.col .look-compare.cs-tall .look-case{display:flex;flex-direction:column;justify-content:flex-start}

/* results that follow one line as items: each wraps as a whole */
:root[data-alive-ui] body main.col .cs-chips{display:flex;flex-wrap:wrap;gap:6px 40px;align-items:baseline}
:root[data-alive-ui] body main.col .cs-chips .math-chain{margin:0}

/* a chain read one move per "=": two moves to a line on a wide screen, one on a phone */
:root[data-alive-ui] body main.col .cs-narrow{display:none}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .cs-wide{display:none}
  :root[data-alive-ui] body main.col .cs-narrow{display:block}
  :root[data-alive-ui] body main.col .look-pair.cs-fit{grid-template-columns:1fr}
  :root[data-alive-ui] body main.col .look-pair.cs-fit .look-rows .math-chain{justify-content:center}
  :root[data-alive-ui] body main.col .look-pair.cs-fit .cs-tab{justify-content:center}
}

/* Key concepts: the row names in the page's heading face rather than capitals, so "Semicircle with diameter s" keeps its s */
:root[data-alive-ui] body main.col .look-kgrid .kr .kh{font:500 16.5px/1.35 'STIX Two Text',Georgia,serif;letter-spacing:0;text-transform:none;color:var(--ink)}
:root[data-alive-ui] body main.col .look-kgrid .kr{grid-template-columns:minmax(150px,auto) minmax(0,1fr)}
:root[data-alive-ui] body main.col .look-kgrid .kv .math-chain{margin:0;justify-content:flex-start}
:root[data-alive-ui] body main.col .look-kgrid .kv .math-chain+.math-chain{margin-top:4px}
@media (max-width:640px){:root[data-alive-ui] body main.col .look-kgrid .kr{grid-template-columns:1fr}}
/* Key concepts 1 and 3: the figure over its maths, at its own size (beside it, the shared .8fr column drew the slice and
   the shapes at 74%, and the formula split from its "V ="); the shapes table keeps name and area on one line on a
   phone too, since every area is short */
:root[data-alive-ui] body main.col .look-kpair.cs-kstack{grid-template-columns:1fr;gap:14px}
:root[data-alive-ui] body main.col .cs-kformula .math-chain{justify-content:center}
:root[data-alive-ui] body main.col .look-kgrid .cs-kshapes .kr{grid-template-columns:240px minmax(0,1fr);gap:0 16px}
:root[data-alive-ui] body main.col .look-kgrid .kn>span{display:inline}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .look-kgrid .cs-kshapes .kr{grid-template-columns:minmax(0,1fr) auto}
}

/* practice 8's table: on its own line under the sentence that names it; on a phone, the same table turned on its side,
   under the statement, so it never runs past the card */
:root[data-alive-ui] body main.col .cs-table-wide{display:block;margin:10px 0}
:root[data-alive-ui] body main.col .cs-table-narrow{display:none;margin:4px 0 0 44px}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .cs-table-wide{display:none}
  :root[data-alive-ui] body main.col .cs-table-narrow{display:block;margin:10px 0}
}
