/* Rolle's Theorem and the Mean Value Theorem: page layout. No colours here: every colour is the course palette's (../lib/lesson-colors.css). */

/* The two theorems: their conditions side by side as separate pieces (they stack on a phone, each whole), and the conclusion
   under them, centred and a little larger, since it's the line the whole page keeps coming back to. Rolle's card and the Mean
   Value Theorem's have the same shape, so the student sees that only f(a) = f(b) and the right-hand side change. */
:root[data-alive-ui] body main.col .mvt-thm{padding:20px 24px 22px}
:root[data-alive-ui] body main.col .mvt-if{display:flex;flex-wrap:wrap;justify-content:center;gap:6px 34px}
:root[data-alive-ui] body main.col .mvt-if .katex{font-size:1.06em}
:root[data-alive-ui] body main.col .mvt-then{margin-top:16px;display:flex;flex-wrap:wrap;justify-content:center;align-items:baseline;gap:4px 18px}
:root[data-alive-ui] body main.col .mvt-then .math-chain{justify-content:center}
:root[data-alive-ui] body main.col .mvt-thm .mvt-then>:first-child .katex{font-size:1.3em}
:root[data-alive-ui] body main.col .mvt-thm .mvt-then .katex{font-size:1.1em}

/* A figure beside its rows takes its own width, and the rows the rest: the shared .9fr/1.1fr split drew these graphs at about
   three quarters of their size. */
:root[data-alive-ui] body main.col .look-pair.mvt-pair{grid-template-columns:auto minmax(0,1fr)}

/* Under a figure and its rows, the steps that use both, across the card's full width */
:root[data-alive-ui] body main.col .look-pair .mvt-span{grid-column:1/-1;padding-top:4px}
:root[data-alive-ui] body main.col .mvt-span .row+.row{margin-top:12px}
:root[data-alive-ui] body main.col .mvt-span .math-chain{justify-content:center}
:root[data-alive-ui] body main.col .mvt-span .katex{font-size:1.1em}
/* the value set aside and the value kept, side by side */
:root[data-alive-ui] body main.col .row.mvt-split{display:flex;flex-wrap:wrap;justify-content:center;align-items:baseline;gap:6px 40px}
/* a theorem's name after the conclusion it gives, kept whole: it moves under the row on a phone rather than splitting it */
:root[data-alive-ui] body main.col .row.mvt-by{display:flex;flex-wrap:wrap;align-items:baseline;gap:2px 18px}
:root[data-alive-ui] body main.col .mvt-span .row.mvt-by{justify-content:center}

/* Flex pieces keep their own width (a shrunk piece wrapped its maths at its "="), and wrap whole instead */
:root[data-alive-ui] body main.col :is(.mvt-then,.mvt-split,.mvt-by,.mvt-q,.mvt-if)>*{flex:0 0 auto;max-width:100%}

/* A chain that reads on one line on a wide page takes one step per line on a phone, so nothing breaks mid-step */
:root[data-alive-ui] body main.col .mvt-narrow{display:none}
:root[data-alive-ui] body main.col :is(.look-card,.look-rows,.mvt-span) :is(.mvt-wide,.mvt-narrow):not(:first-child){margin-top:12px}
:root[data-alive-ui] body main.col :is(.mvt-wide,.mvt-narrow)+.row{margin-top:12px}
/* §6's last row is the bound in general, the line the section leaves the student with: a little apart from the example */
:root[data-alive-ui] body main.col .look-card .row.mvt-gen{margin-top:18px}

/* A row that draws its conclusion from the row above starts with its arrow, set in a little, so a fact and what it gives read
   as two steps. */
:root[data-alive-ui] body main.col .row.mvt-to{padding-left:1.1em}

/* Two cases, each graph above its own rows (§3) */
:root[data-alive-ui] body main.col .look-case>figure.diagram{margin:0 0 14px}
:root[data-alive-ui] body main.col .look-case>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 .look-case .row+.row{margin-top:10px}
:root[data-alive-ui] body main.col .look-case .katex{font-size:1.04em}

/* §5's table: times across the top, positions under them, the row names in the first column on the card's quiet tint */
:root[data-alive-ui] body main.col .mvt-table{border-collapse:separate;border-spacing:0;margin:0 auto 6px}
:root[data-alive-ui] body main.col .mvt-table :is(th,td){padding:8px 20px;text-align:center;font-weight:400}
:root[data-alive-ui] body main.col .mvt-table th{text-align:left;background:var(--look-tint);border-radius:10px 0 0 10px}
:root[data-alive-ui] body main.col .mvt-table tr:first-child th{border-radius:10px 0 0 0}
:root[data-alive-ui] body main.col .mvt-table tr:last-child th{border-radius:0 0 0 10px}
:root[data-alive-ui] body main.col .mvt-table .katex{font-size:1.08em}
:root[data-alive-ui] body main.col .mvt-q{display:flex;flex-wrap:wrap;justify-content:center;gap:8px 40px;margin-top:16px}

/* Key concepts: a name over its row, the row given the card's full width (the shared side-by-side label left the maths
   120 px). */
:root[data-alive-ui] body main.col .look-kgrid .kr{display:block;border:0;padding:0;margin:0}
/* the wide first card: its figure at its own size beside the two theorems */
:root[data-alive-ui] body main.col .look-kgrid .kc.wide .look-kpair{grid-template-columns:auto minmax(0,1fr)}
:root[data-alive-ui] body main.col .look-kgrid .kr+.kr{margin-top:12px}
:root[data-alive-ui] body main.col .look-kgrid .kr .kh{display:block;margin:0 0 4px}
:root[data-alive-ui] body main.col .look-kgrid .kr .kv{min-width:0;padding:0}
:root[data-alive-ui] body main.col .look-kgrid .kv .math-chain{margin:0}

/* An answer's label is maths at the size of the problem it answers */
:root[data-alive-ui] body main.col .prob .answer-fields label .katex{font-size:21px}

/* Practice 7: the answer reads as the one line it is, −1 ≤ f(5) ≤ 19 */
:root[data-alive-ui] body main.col #p7 .answer-fields{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
:root[data-alive-ui] body main.col #p7 .answer-fields label{display:flex;align-items:center;gap:10px}
:root[data-alive-ui] body main.col #p7 .answer-fields input{width:120px}

@media (max-width:640px){
  /* the shared card padding is already 14 px on a phone; a figure standing on its own takes the same, so it keeps its size */
  :root[data-alive-ui] body main.col>section>figure.diagram{padding:14px}
  :root[data-alive-ui] body main.col .look-pair.mvt-pair{grid-template-columns:1fr}
  /* on a phone the card is one column, so its rows all start at the left; a theorem's name moves to the right end */
  :root[data-alive-ui] body main.col .mvt-span .math-chain,
  :root[data-alive-ui] body main.col .mvt-span :is(.row.mvt-split,.row.mvt-by){justify-content:flex-start}
  :root[data-alive-ui] body main.col .row.mvt-by>:last-child{margin-left:auto}
  :root[data-alive-ui] body main.col .mvt-wide{display:none}
  :root[data-alive-ui] body main.col .mvt-narrow{display:block}
  :root[data-alive-ui] body main.col .look-kgrid .kc.wide .look-kpair{grid-template-columns:1fr}
  :root[data-alive-ui] body main.col .look-kgrid>.kc.wide{padding:18px 12px}
  :root[data-alive-ui] body main.col .mvt-thm{padding:16px 14px 18px}
  :root[data-alive-ui] body main.col .mvt-if{flex-direction:column;align-items:center;gap:6px}
  :root[data-alive-ui] body main.col .mvt-if .katex{font-size:1em}
  :root[data-alive-ui] body main.col .mvt-thm .mvt-then>:first-child .katex{font-size:1.15em}
  :root[data-alive-ui] body main.col .mvt-thm .mvt-then .katex{font-size:1em}
  :root[data-alive-ui] body main.col .mvt-span .katex{font-size:1em}
  :root[data-alive-ui] body main.col .mvt-table :is(th,td){padding:8px 10px}
  :root[data-alive-ui] body main.col .mvt-q{flex-direction:column;align-items:center}
  :root[data-alive-ui] body main.col #p7 .answer-fields input{width:96px}
}

/* §6's goal is the widest line set large; on the narrowest phones it keeps its size above the body text but no more */
@media (max-width:380px){
  :root[data-alive-ui] body main.col .look-goal .katex{font-size:1.06em}
}
