/* Direct and Limit Comparison Tests: 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:
     \our  pink    our series: its terms, its first terms, its sum, "our term";
     \cmp  blue    the series we compare with, and any multiple of it, "comparison term";
     \lvl  green   a finite number a total or a ratio can't pass: a convergent total, a positive limit, the band's ends;
     \fac  orange  a factor that stays between two numbers (sin²n, 2 + cos n, 3 + sin n);
     \fast violet  the fastest-growing terms, read off our term to choose the comparison series.
   Verdicts, routine arithmetic and simplified ratios stay ink; practice statements and hints stay ink. */

/* A row of displayed pieces that wrap whole at the arrow where the argument moves on, never inside a piece: a long
   "premise -> verdict" row read as one line on a wide screen and was cut after a + on a phone. */
:root[data-alive-ui] body main.col .ct-flow{display:flex;flex-wrap:wrap;align-items:baseline;gap:4px 14px}
/* pieces of a row sit on one baseline, so a tall sum beside a short verdict doesn't float its relation signs */
:root[data-alive-ui] body main.col :is(.look-card,.look-case,.look-krows,.sol) .math-chain{align-items:baseline}
:root[data-alive-ui] body main.col .ct-flow>.math-chain{margin:0}
:root[data-alive-ui] body main.col .sol .ct-flow{margin:12px 0}

/* One chain, two breaks: one line (or the chain's own wrap) on a wide screen, one "=" to a line on a phone. */
:root[data-alive-ui] body main.col .ct-narrow{display:none}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .ct-wide{display:none}
  :root[data-alive-ui] body main.col .ct-narrow{display:block}
}

/* The question each problem starts from: the series and "converges or diverges?", one line on a wide screen and stacked
   on a phone, large and quiet (one equation, so the lamp passes over it like any goal). Section 5's goal keeps section
   1's row just above it at text size, since the + becomes a − in place. */
:root[data-alive-ui] body main.col .ct-recall{margin:18px 0 -10px}
:root[data-alive-ui] body main.col .ct-recall .katex{font-size:1em}
/* on a phone the goal is the size of the cards' maths (the shared look sets them to 1em there), not larger */
@media (max-width:640px){:root[data-alive-ui] body main.col .look-goal .katex{font-size:1em}}

/* Two cases and the picture of both, one block: the two series under (or over) the same comparison series, then their
   running totals on one panel. The figure is drawn at its own size. */
:root[data-alive-ui] body main.col .ct-two{display:grid;grid-template-columns:1fr 1fr;gap:12px 28px}
:root[data-alive-ui] body main.col .ct-two>.ct-case .row+.row{margin-top:8px}
:root[data-alive-ui] body main.col .ct-cases>figure.diagram{display:block;width:auto;max-width:none;margin:18px 0 0;padding:0;text-align:center}
:root[data-alive-ui] body main.col .ct-cases>figure.diagram>svg:not(.katex svg){width:auto;max-width:100%;height:auto;display:block;margin:0 auto}
@media (max-width:640px){:root[data-alive-ui] body main.col .ct-two{grid-template-columns:1fr;gap:26px}}

/* The four comparisons: the two that prove something, a space, the two that prove nothing. */
:root[data-alive-ui] body main.col .ct-table .row.ct-gap{margin-top:20px}

/* A single line of maths a sentence restates: displayed, not a card, so it isn't mistaken for a block of its own. */
:root[data-alive-ui] body main.col .ct-line{margin:16px 0 20px}
:root[data-alive-ui] body main.col .ct-line .math-chain{margin:0;justify-content:center}
:root[data-alive-ui] body main.col .ct-line .katex{font-size:1.1em}
@media (max-width:640px){:root[data-alive-ui] body main.col .ct-line .katex{font-size:1em}}

/* Key concepts: each row's name above its maths, so the maths has the card's full width (beside a 120 px label it was
   clipped); the name in sentence case, since an uppercased "1/n" read as "1/N". */
:root[data-alive-ui] body main.col .look-krows .kr{display:block;padding:0;border-top:0}
:root[data-alive-ui] body main.col .look-krows .kr+.kr{margin-top:14px}
:root[data-alive-ui] body main.col .look-krows .kh{display:block;font:500 15px/1.4 var(--lf-label);letter-spacing:0;text-transform:none;color:var(--ink);margin:0 0 2px}
:root[data-alive-ui] body main.col .look-krows .kv{overflow:visible}
:root[data-alive-ui] body main.col .look-krows .math-chain{margin:0}

/* Practice: "converges" and "diverges" side by side, the two answers a series can have. */
:root[data-alive-ui] body main.col .prob .choices.ct-verdict{display:flex;flex-wrap:wrap;gap:0 10px}
:root[data-alive-ui] body main.col .prob .choices.ct-verdict label{min-width:140px}

/* A figure standing in a section takes the card's phone padding too (the shared figure card keeps 24 px a side, which
   drew the charts at 83% on a 390 px phone and their 15 px labels at 12.5 px). */
@media (max-width:640px){:root[data-alive-ui] body main.col>section>figure.diagram{padding:14px 8px}}

/* Bounding a trig factor: the two directions side by side, convergence and divergence */
:root[data-alive-ui] body main.col .look-krows.ct-krows-two{display:grid;grid-template-columns:1fr 1fr;gap:14px 24px}
:root[data-alive-ui] body main.col .look-krows.ct-krows-two .kr+.kr{margin-top:0}
@media (max-width:640px){:root[data-alive-ui] body main.col .look-krows.ct-krows-two{grid-template-columns:1fr}}

/* Practice 4: the three series on a line of their own after the question, each kept whole */
:root[data-alive-ui] body main.col .prob .ct-item{display:inline-block;margin:8px 28px 0 0;white-space:nowrap}
@media (max-width:640px){:root[data-alive-ui] body main.col .prob .choices.ct-verdict label{min-width:0;flex:1 1 0}}
