/* Area Between Curves: 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:
     \lin  green   the region's straight line, in every form, and every piece that came from it;
     \crv  violet  the region's curved boundary, likewise;
     \xax  orange  the x-axis while it plays a curve, y = 0 (section 2 and Key concept 2).
   Top, bottom, right, left, bounds, answers and combined heights stay ink. */

/* a figure beside its rows, at its own size: the figures are drawn 400 px wide with 17 px labels, so the figure takes
   its own width and the rows take the rest (the shared .9fr/1.1fr split drew them at about 70%). Below 760 px the rows
   would be too narrow beside it, so the pair stacks there rather than at 640. */
:root[data-alive-ui] body main.col .look-pair{grid-template-columns:minmax(0,400px) minmax(0,1fr);gap:8px 20px;padding:18px 16px}
:root[data-alive-ui] body main.col .look-pair>.look-rows{min-width:0}
:root[data-alive-ui] body main.col .look-pair>figure.diagram{padding:0}
/* a row that follows from both the figure and the rows beside it runs across the card under them */
:root[data-alive-ui] body main.col .look-pair>.abc-span{grid-column:1/-1;margin-top:10px;display:flex;justify-content:center}
@media (max-width:759px){:root[data-alive-ui] body main.col .look-pair{grid-template-columns:1fr;gap:14px} :root[data-alive-ui] body main.col .look-pair>.abc-span{justify-content:flex-start;margin-top:4px}}

/* a second group of rows in the same card (a check beside a result, a general height after a value) */
:root[data-alive-ui] body main.col :is(.look-card,.look-rows) .row.abc-next{margin-top:22px}

/* a chain read one move per "=": the wide form on a wide screen, the narrow form on a phone */
:root[data-alive-ui] body main.col .abc-narrow{display:none}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .abc-wide{display:none}
  :root[data-alive-ui] body main.col .abc-narrow{display:block}
}

/* Key concepts: every concept spans the grid. Each has a long note (up to a hundred words) and a two-piece formula or a
   figure beside its formula; in half-width cards the notes ran to twenty narrow lines and the two cards of a row ended
   far apart. Concept 1's figure sits beside its formula at its own size (drawn 280 px wide for this place). Rows are
   parted by space, not rules; a row with no label gives its maths the whole width, and a label sits beside its maths. */
:root[data-alive-ui] body main.col .look-kgrid .look-kpair{grid-template-columns:minmax(0,280px) minmax(0,1fr)}
:root[data-alive-ui] body main.col .look-kgrid .look-krows .kr{border-top:0;padding:8px 0}
:root[data-alive-ui] body main.col .look-kgrid .kr{grid-template-columns:190px minmax(0,1fr)}
:root[data-alive-ui] body main.col .look-kgrid .kr:not(:has(>.kh)){grid-template-columns:1fr}
:root[data-alive-ui] body main.col .look-kgrid .kv .katex{font-size:1em}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .look-kgrid .look-kpair{grid-template-columns:1fr}
  :root[data-alive-ui] body main.col .look-kgrid .kr{grid-template-columns:1fr;gap:6px}
}

/* an answer's label ("A =") at the size of the statement's maths, so the answer reads as one line */
:root[data-alive-ui] body main.col .prob .answer-fields label .katex{font-size:1.1em}

/* a figure standing on its own is a card like the rest; on a phone its padding matches the other cards', so the figure
   keeps as much of its own size as the screen allows */
@media (max-width:640px){:root[data-alive-ui] body main.col>section>figure.diagram{padding:14px 14px}}
