/* Antiderivatives and Indefinite Integrals: page layout. No colours here: every colour is the course palette's (../lib/lesson-colors.css).
   The colour macros (katex-macros.json), one per meaning in planning/colour.md:
     \cst  green   C, the constant of integration (and C2, and every value of C)
     \ta   blue    a single integrand and its antiderivative, or a sum's first term and what it becomes
     \tb   pink    a sum's second term and what it becomes (sections 2 to 5)
     \tc   violet  a sum's third term and what it becomes (sections 2 and 5)
     \giv  pink    the given value a condition hands over (sections 6 and 7)
     \slp  violet  a slope (sections 1 and 3)
     \cone violet  C1, the constant of f' (section 7)
     \dn   orange  what differentiating the answer brings down, and what cancels it
   Page blocks, prefixed adx-: */

/* a chain that reads one move per line on a phone: a wide and a narrow copy of the same maths */
:root[data-alive-ui] body main.col .adx-narrow{display:none}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .adx-wide{display:none}
  :root[data-alive-ui] body main.col .adx-narrow{display:block}
}

/* section 1: the three derivatives beside the shifted parabolas; the figure keeps its own size, the rows take the rest */
:root[data-alive-ui] body main.col .look-pair.adx-pair{grid-template-columns:minmax(0,1fr) auto}
:root[data-alive-ui] body main.col .look-pair.adx-pair .look-rows .math-chain{justify-content:center}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .look-pair.adx-pair{grid-template-columns:1fr;padding:14px 6px}
}

/* section 3: ln|x| and 1/x at one scale, side by side, and one above the other on a phone so each keeps its size */
:root[data-alive-ui] body main.col>section>figure.diagram.adx-panels{display:flex;flex-wrap:wrap;justify-content:center;align-items:flex-start;gap:6px 10px}
:root[data-alive-ui] body main.col>section>figure.diagram.adx-panels>svg:not(.katex svg){margin:0}

/* a figure on its own: on a phone the card's side padding goes to the figure, so it isn't drawn smaller than itself */
@media (max-width:640px){
  :root[data-alive-ui] body main.col>section>figure.diagram{padding:12px 4px}
}

/* the derivative table read backwards: each derivative beside the integral it gives; one under the other on a phone */
:root[data-alive-ui] body main.col .adx-tr{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:4px 28px;align-items:center}
:root[data-alive-ui] body main.col .adx-tr+.adx-tr{margin-top:10px}
:root[data-alive-ui] body main.col .adx-td .math-chain{margin:0}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .adx-tr{grid-template-columns:1fr;gap:2px}
  :root[data-alive-ui] body main.col .adx-tr+.adx-tr{margin-top:18px}
}

/* a check or a new stage inside a card of rows: space, not a rule */
:root[data-alive-ui] body main.col .look-card .row.adx-gap{margin-top:22px}

/* Key concepts: a table entry of rows sits on the concept's quiet sheet */
:root[data-alive-ui] body main.col .look-krows .row+.row{margin-top:10px}
:root[data-alive-ui] body main.col .look-krows .math-chain{margin:0}


/* practice on a phone: the answer line's integral stays whole (it broke after each + and − over three lines), and the box
   takes the width that's left, so "integral = [box] + C" reads as one line */
@media (max-width:640px){
  :root[data-alive-ui] body main.col .prob .answer-fields label .katex{white-space:nowrap}
  :root[data-alive-ui] body main.col .prob .answer-fields input{min-width:0;flex:1 1 80px}
}
