/* Intermediate Value Theorem: page layout. No colours here: every colour is the course palette's (../lib/lesson-colors.css).
   Colour macros (katex-macros.json, meanings in planning/colour.md): \inp an input on the x-axis (blue), \hgt a height the
   theorem compares (pink), \gfn g, the one function made from two sides (green), \lsd the left side (violet), \rsd the right
   side (orange). A minus that belongs to the right side is written \rsd{{}- x}, so it keeps its binary spacing. */

/* A row of maths that wraps only between its pieces: each <tex d> inside is one piece, so a long statement breaks before its
   "⇒" or between its clauses, never inside an expression. One copy serves every width. */
:root[data-alive-ui] body main.col .ivt-flow{display:flex;flex-wrap:wrap;align-items:center;column-gap:.45em;row-gap:6px;min-width:0}
:root[data-alive-ui] body main.col .ivt-flow>.math-chain{flex:0 1 auto;margin:0;min-width:0}
:root[data-alive-ui] body main.col .look-goal .ivt-flow{justify-content:center}
:root[data-alive-ui] body main.col .sol .ln .ivt-flow{margin:12px 0}

/* A justification: the three things a test grades, each with its label beside it, the maths lined up in one column. */
:root[data-alive-ui] body main.col .ivt-just{display:grid;grid-template-columns:max-content minmax(0,1fr);column-gap:22px;row-gap:14px;align-items:center}
:root[data-alive-ui] body main.col .ivt-just>.row{display:contents}
:root[data-alive-ui] body main.col .ivt-just .row-label{font:500 15px/1.35 var(--lf-label);color:var(--ink);min-width:0}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .ivt-just{grid-template-columns:minmax(0,1fr);row-gap:4px}
  :root[data-alive-ui] body main.col .ivt-just>.row:not(:first-child)>.row-label{margin-top:12px}
}

/* A figure beside its rows at the figure's own width; the rows take what is left. */
:root[data-alive-ui] body main.col .look-pair.ivt-pair{grid-template-columns:auto minmax(0,1fr)}
@media (max-width:640px){:root[data-alive-ui] body main.col .look-pair.ivt-pair{grid-template-columns:1fr}}

/* the count a chain of gap checks ends on sits a little apart from the checks */
:root[data-alive-ui] body main.col .look-card .row.ivt-last{margin-top:20px}

/* the made table of section 4: across on a wide screen, down on a narrow phone, where its six columns don't fit */
:root[data-alive-ui] body main.col .ivt-tn{display:none}
@media (max-width:375px){
  :root[data-alive-ui] body main.col .ivt-tw{display:none}
  :root[data-alive-ui] body main.col .ivt-tn{display:block}
}

/* a two-part choice problem: the part's letter before its choices */
:root[data-alive-ui] body main.col .prob .ivt-plab{font:600 16px/1.4 'STIX Two Text',Georgia,serif;color:var(--ink);margin:14px 0 2px}
:root[data-alive-ui] body main.col .prob .part+.part{margin-top:10px}

/* a piece's own display margins would open the gaps between wrapped pieces */
:root[data-alive-ui] body main.col .ivt-flow .katex-display,:root[data-alive-ui] body main.col .ivt-flow .math-part{margin:0}

/* section 4: the table beside its dots, the two questions under both */
:root[data-alive-ui] body main.col .look-pair.ivt-tpair{column-gap:18px}
:root[data-alive-ui] body main.col .look-pair.ivt-tpair>.ivt-under{grid-column:1/-1;margin-top:10px}

/* Key concepts 1: the figure at its own width, its labels at the size they were drawn (the Key concepts sheet's
   smaller maths size is for its rows, and inherited into the figure's labels it made them read small) */
:root[data-alive-ui] body main.col .look-kpair.ivt-kpair{grid-template-columns:auto minmax(0,1fr)}
:root[data-alive-ui] body main.col .look-kpair.ivt-kpair .review-figure{max-width:none;margin:0}
:root[data-alive-ui] body main.col .kc .review-figure svg .katex{font-size:1.21em}
@media (max-width:640px){:root[data-alive-ui] body main.col .look-kpair.ivt-kpair{grid-template-columns:1fr}}

/* a goal that doesn't fit a phone on one line: the same goal broken where its sentence breaks, one copy per width */
:root[data-alive-ui] body main.col .ivt-narrow{display:none}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .ivt-wide{display:none}
  :root[data-alive-ui] body main.col .ivt-narrow{display:block}
}
