/* Ratio and Root 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:
     \tm   pink    the term a_n and its sizes |a_n|, its values and bars, and the reciprocal of a_n in a ratio;
     \nx   blue    the next term a_{n+1}, written by replacing every n by n + 1, until it splits or cancels;
     \mul  green   the multiplier: the value of a_{n+1}/a_n (or the root test's nth root), its limit L, and the pieces
                   that set L (a number to the nth power, a factorial) with the factors they bring;
     \geo  violet  the geometric series laid over the terms: its fixed ratio r, its terms and its sum;
     \pw   orange  a power of n and the factor it brings, which approaches 1 and never decides L.
   The name a_{n+1}/a_n is always blue over pink, so the direction of the division shows before any algebra.
   Verdicts, routine arithmetic, the comparison series after L = 1, and practice statements and hints stay ink. */

/* A row of displayed pieces that wrap whole, never inside a piece: a row of two or three short facts read as one line
   on a wide screen and was cut after a + on a phone (the chapter's Comparison Tests page does the same). */
:root[data-alive-ui] body main.col .rr-flow{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px 30px}
:root[data-alive-ui] body main.col .rr-flow>.math-chain{margin:0}
:root[data-alive-ui] body main.col :is(.look-card,.look-krows,.sol) .math-chain{align-items:baseline}
:root[data-alive-ui] body main.col .sol .rr-flow{margin:12px 0}

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

/* A single line of maths a sentence restates: displayed, not a card, so it isn't read as a block of its own and the
   lamp passes over it, like a goal. */
:root[data-alive-ui] body main.col .rr-line{margin:16px 0 20px}
:root[data-alive-ui] body main.col .rr-line .math-chain{margin:0;justify-content:center}
:root[data-alive-ui] body main.col .rr-line.rr-flow{justify-content:center}
:root[data-alive-ui] body main.col .rr-line .katex{font-size:1.1em}

/* The three outcomes of a test, under the limit that decides them: a short table aligned on the colon, centred. */
:root[data-alive-ui] body main.col .look-card .row.rr-out{margin-top:16px}
:root[data-alive-ui] body main.col .look-card .row.rr-out .math-chain,:root[data-alive-ui] body main.col .look-card .row.rr-def .math-chain{justify-content:center}

/* The bars of section 1 with the rows they give, one block: the figure at its own size on top, its three rows under it
   (beside a 360 px figure the rows had under 300 px and broke inside the geometric sum). */
:root[data-alive-ui] body main.col .rr-figcard>figure.diagram{display:block;width:auto;max-width:none;margin:0 0 18px;padding:0;text-align:center}
:root[data-alive-ui] body main.col .rr-figcard>figure.diagram>svg:not(.katex svg){width:auto;max-width:100%;height:auto;display:block;margin:0 auto}

/* on a phone the goal and the single lines are the size of the cards' maths (the shared look sets them to 1em there) */
@media (max-width:640px){
  :root[data-alive-ui] body main.col .look-goal .katex,:root[data-alive-ui] body main.col .rr-line .katex{font-size:1em}
  :root[data-alive-ui] body main.col .rr-flow{column-gap:22px}
}

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

/* the figure card's rows sit as one block centred under the figure, so the picture and its numbers read as one piece */
:root[data-alive-ui] body main.col .rr-figcard .rr-figrows{width:fit-content;max-width:100%;margin:0 auto}
:root[data-alive-ui] body main.col .rr-figcard .rr-figrows .row+.row{margin-top:12px}
/* a test's definition row of two pieces centres like the single ones above the outcomes */
:root[data-alive-ui] body main.col .look-card .row.rr-def.rr-flow{justify-content:center}
/* Key concepts: maths in an entry's title at the title's size, inside the title rather than a column of its own */
:root[data-alive-ui] body main.col .look-kgrid .kn .katex{font-size:1em}
/* on a narrow phone a Key idea's inline chain may break after its "=" rather than run past the card's edge */
@media (max-width:400px){:root[data-alive-ui] body main.col .key-idea span.nb,:root[data-alive-ui] body main.col .key-idea span.nb .katex,:root[data-alive-ui] body main.col .key-idea span.nb .katex-html{white-space:normal}}
:root[data-alive-ui] body main.col .look-kgrid .kn .katex{white-space:nowrap}
