/* Work: 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): \wt pink, a force or a piece's weight; \dist green,
   the distance a piece travels; \wa blue, the water and the bounds taken from it; \dest orange, where the pieces go. */

/* A row of separate facts ("weight …, distance …", a goal's conditions): each piece stays whole and the row wraps
   between pieces, never inside one, so a long setup line reads at every width without scrolling. */
:root[data-alive-ui] body main.col .wk-items{display:flex;flex-wrap:wrap;justify-content:flex-start;align-items:center;gap:8px 1.8em}
:root[data-alive-ui] body main.col .wk-items>.math-chain,:root[data-alive-ui] body main.col .wk-items>.katex-display{margin:0}

/* A goal is one maths piece (one equation, so the lamp passes over it), its conditions broken by hand at their commas
   into lines that fit a 360 px phone; on a phone it takes the page's maths size rather than 1.15em. */

/* A figure over its rows, in one card, where the rows need the full width (the rope's top 10 ft and its sum). */
:root[data-alive-ui] body main.col .look-card.wk-fig>figure.diagram{display:flex;justify-content:center;width:auto;max-width:none;margin:0 0 16px;padding:0;background:none;border:0;box-shadow:none}
:root[data-alive-ui] body main.col .look-card.wk-fig>figure.diagram>svg:not(.katex svg){display:block;width:auto;max-width:100%;height:auto;margin:0 auto}

/* A figure beside its rows at the figure's own width; the rows take what's left (the shared .9fr/1.1fr split drew the
   rope and graph figures at about 80%, labels with them). Stacks on a phone like every look-pair. */
:root[data-alive-ui] body main.col .look-pair.wk-pair{grid-template-columns:auto minmax(0,1fr)}

/* A worked chain, one move per "=": two "=" to a line on a wide screen, one on a phone. */
:root[data-alive-ui] body main.col .wk-narrow{display:none}

/* Key concepts: label over its maths, so a long row has the card's full width instead of 150 px beside a label. */
:root[data-alive-ui] body main.col .look-kgrid .kc .kr{grid-template-columns:1fr;gap:4px}
:root[data-alive-ui] body main.col .look-kgrid .kv{gap:6px 1.4em}
:root[data-alive-ui] body main.col .look-kgrid .kv :is(.math-chain,.katex-display){margin:2px 0}

/* Practice: the unit sits after the field, so an answer reads as one line ("W = [   ] ft-lb"). */
:root[data-alive-ui] body main.col .prob .answer-fields label{display:inline-flex;flex-wrap:wrap;align-items:center;gap:8px 10px}

@media (max-width:640px){
  :root[data-alive-ui] body main.col .look-pair.wk-pair{grid-template-columns:1fr}
  :root[data-alive-ui] body main.col .wk-wide{display:none}
  :root[data-alive-ui] body main.col .look-goal .katex{font-size:1em}
  :root[data-alive-ui] body main.col .wk-narrow{display:block}
  /* a figure on its own keeps more of its width on a phone */
  :root[data-alive-ui] body main.col>section>figure.diagram{padding:14px 8px}
  :root[data-alive-ui] body main.col .look-pair.wk-pair,:root[data-alive-ui] body main.col .look-card.wk-fig{padding:14px 8px}
  :root[data-alive-ui] body main.col .prob .answer-fields label{display:flex}
  :root[data-alive-ui] body main.col .prob .answer-fields input{width:auto;flex:1 1 140px}
}
