/* Center of Mass: page layout. No colours here: every colour is the course palette's (../lib/lesson-colors.css).
   The colour macros (katex-macros.json) follow planning/colour.md:
     \xs  pink    the x side: the x-coordinate a piece counts at, M_y and x̄
     \ys  blue    the y side: the y-coordinate a piece counts at (a rectangle's middle height), M_x and ȳ
     \wt  green   how much a piece counts: a mass, a piece's mass, a rectangle's area factor, M and A
     \btm violet  the rectangle's bottom, as a distance from the x-axis (section 6 only)
     \hlf orange  half the height, (f − g)/2 (section 6 only) */

/* a figure beside its rows, drawn at its own size: the figure's column is as wide as its drawing and the rows take
   the rest (the shared .9fr/1.1fr split shrank these 360 px figures and their labels to fit) */
@media (min-width:641px){
  :root[data-alive-ui] body main.col .look-pair.com-pair{grid-template-columns:auto minmax(0,1fr)}
  :root[data-alive-ui] body main.col .look-pair.com-pair.com-pair-r{grid-template-columns:minmax(0,1fr) auto}
}
:root[data-alive-ui] body main.col .com-pair .look-rows .math-chain{justify-content:center}
:root[data-alive-ui] body main.col .com-pair>figure.diagram figcaption{margin-top:6px;text-align:center}

/* a chain read one move per line: a wide and a narrow break of the same chain, one shown per width */
:root[data-alive-ui] body main.col .com-narrow{display:none}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .com-wide{display:none}
  :root[data-alive-ui] body main.col .com-narrow{display:block}
}

/* section 5: x and f(x)/2 in front of the same area f(x) dx, the area lined up so only the coloured factor changes */
:root[data-alive-ui] body main.col .com-weigh{display:grid;grid-template-columns:auto auto;justify-content:center;align-items:center;column-gap:20px;row-gap:16px}
:root[data-alive-ui] body main.col .com-weigh .com-lab{font:500 17px/1.3 'STIX Two Text',Georgia,serif;color:var(--ink)}
:root[data-alive-ui] body main.col .com-weigh>.math-chain{margin:0;justify-content:flex-start}

/* centred rows in a card of results */
:root[data-alive-ui] body main.col .look-card.com-c .math-chain{justify-content:center}

/* Key concepts: the x̄ side and the ȳ side of one entry side by side, stacked on a phone */
:root[data-alive-ui] body main.col .com-kcols{display:grid;grid-template-columns:1fr 1fr;gap:10px 18px}
: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;justify-content:center}
@media (min-width:641px){
  :root[data-alive-ui] body main.col .look-kpair.com-kpair{grid-template-columns:auto minmax(0,1fr)}
}
:root[data-alive-ui] body main.col .com-kbelow{margin-top:12px}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .com-kcols{grid-template-columns:1fr}
}

/* practice: several answers in one row of fields */
:root[data-alive-ui] body main.col .prob .answer-fields{display:flex;flex-wrap:wrap;gap:10px 22px}
:root[data-alive-ui] body main.col .prob .answer-fields label>input{width:130px}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .prob .answer-fields label>input{width:130px}
}
/* a solution's chain lines up on its "=" */
:root[data-alive-ui] body main.col .sol .txt .math-chain{margin:8px 0 2px}
