/* The Shell Method: page layout. No colours here: every colour is the course palette's (../lib/lesson-colors.css),
   through the macros in katex-macros.json (planning/colour.md): \rad pink the radius, \hgt green the height or length,
   \thk blue the thickness, \ax violet the axis of rotation, \hol orange the hole or inner radius. */

/* a chain: two "=" to a line on a wide screen, one on a phone, so nothing scrolls sideways */
:root[data-alive-ui] body main.col .sh-narrow{display:none}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .sh-wide{display:none}
  :root[data-alive-ui] body main.col .sh-narrow{display:block}
}

/* a single line of maths the sentence above points to: not a block, so no card and no lamp */
:root[data-alive-ui] body main.col .sh-eq{margin:14px 0 20px;display:flex;justify-content:center}
:root[data-alive-ui] body main.col .sh-eq .math-chain{justify-content:center;margin:0}
:root[data-alive-ui] body main.col .sh-eq .katex{font-size:1.1em}
:root[data-alive-ui] body main.col .sh-formula .katex{font-size:1.22em}
:root[data-alive-ui] body main.col .look-goal .math-chain{justify-content:center}

/* rows under their own short label (the writer's labels): the label sits over its maths at every width, so the maths
   never drops under a label beside it */
:root[data-alive-ui] body main.col .sh-lab{font:500 15px/1.35 'STIX Two Text',Georgia,serif;letter-spacing:0;text-transform:none;color:var(--ink);margin:0 0 4px}
:root[data-alive-ui] body main.col .sh-lab .katex{font-size:1.05em}
:root[data-alive-ui] body main.col .sh-lrows .row+.sh-lab,:root[data-alive-ui] body main.col .sh-lrows .row+.row+.sh-lab{margin-top:18px}
:root[data-alive-ui] body main.col .sh-lrows .sh-lab+.row{margin-top:0}
/* the three measures of a shell: each one whole, wrapping as a unit */
:root[data-alive-ui] body main.col .sh-chips{display:flex;flex-wrap:wrap;gap:6px 34px;align-items:baseline}
:root[data-alive-ui] body main.col .sh-chips>div{white-space:nowrap}
:root[data-alive-ui] body main.col .look-rows .row.sh-gap{margin-top:22px}

/* a figure beside its rows, the columns set from the figure's own width so it is drawn at (or near) its size */
:root[data-alive-ui] body main.col .look-pair.sh-pair-wide{grid-template-columns:minmax(0,1.2fr) minmax(0,.8fr)}
/* section 2's three axes: the figure at its own size over the three distances, one column per axis */
:root[data-alive-ui] body main.col .look-pair.sh-over{grid-template-columns:1fr;gap:16px}
:root[data-alive-ui] body main.col .sh-axes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px 18px;text-align:center}
:root[data-alive-ui] body main.col .sh-axes .math-chain{justify-content:center;margin:0}
:root[data-alive-ui] body main.col .sh-axcol>div+div{margin-top:4px}
:root[data-alive-ui] body main.col .sh-axhead{margin-bottom:2px}
@media (max-width:640px){:root[data-alive-ui] body main.col .sh-axes.sh-wide{display:none}}
:root[data-alive-ui] body main.col .look-pair .look-rows .math-chain{justify-content:center}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .look-pair.sh-pair-wide{grid-template-columns:1fr}
}
/* on a phone a figure keeps more of its own width: its card's side padding is the room it needs */
@media (max-width:420px){
  :root[data-alive-ui] body main.col>section>figure.diagram,:root[data-alive-ui] body main.col .look-pair{padding-left:6px;padding-right:6px}
  :root[data-alive-ui] body main.col .look-pair .look-rows{padding:0 8px}
}

/* the summary of section 4: a real table, read across a row; on a phone each row becomes its own small stack */
:root[data-alive-ui] body main.col .sh-grid{padding:10px 18px}
:root[data-alive-ui] body main.col .sh-table{width:100%;border-collapse:collapse;font-size:16px;line-height:1.45}
:root[data-alive-ui] body main.col .sh-table th{font:600 13px/1.3 var(--lf-label);color:var(--ink);text-align:left;padding:10px 10px 8px;vertical-align:bottom}
:root[data-alive-ui] body main.col .sh-table td{padding:10px;vertical-align:top;color:var(--ink);border-top:1px solid var(--rule)}
:root[data-alive-ui] body main.col .sh-table td:last-child{font-weight:600}
:root[data-alive-ui] body main.col .sh-table .katex{font-size:1.04em;white-space:nowrap}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .sh-table,:root[data-alive-ui] body main.col .sh-table tbody,:root[data-alive-ui] body main.col .sh-table tr,:root[data-alive-ui] body main.col .sh-table td{display:block}
  :root[data-alive-ui] body main.col .sh-table thead{display:none}
  :root[data-alive-ui] body main.col .sh-table tr{padding:10px 0}
  :root[data-alive-ui] body main.col .sh-table tr+tr{border-top:1px solid var(--rule)}
  :root[data-alive-ui] body main.col .sh-table td{border:0;padding:3px 0;display:grid;grid-template-columns:100px minmax(0,1fr);gap:8px;align-items:baseline}
  :root[data-alive-ui] body main.col .sh-table td::before{content:attr(data-h);font:600 12px/1.5 var(--lf-label);color:var(--body)}
}

/* Key concepts: the label over its row, and the rows centred on the quiet sheet */
:root[data-alive-ui] body main.col .sh-krows .kr{display:block;padding:6px 0;border-top:0}
:root[data-alive-ui] body main.col .sh-krows .kr+.kr{margin-top:8px}
:root[data-alive-ui] body main.col .sh-krows .kh{display:block;margin:0 0 2px}
:root[data-alive-ui] body main.col .sh-krows .kv{display:block;overflow:visible}
:root[data-alive-ui] body main.col .sh-krows .kv .math-chain{justify-content:center;margin:0}
:root[data-alive-ui] body main.col .look-kgrid .kc>.kb>.sh-krows{margin-bottom:4px}

/* Key concepts: the first entry's figure stacked over its rows at its own size; the second's beside its rows */
:root[data-alive-ui] body main.col .sh-kfig{max-width:none;margin:0 0 14px;display:flex;justify-content:center}
/* the shell and its unrolled wall side by side on a wide screen, so the wall reads as what the shell becomes */
@media (min-width:641px){
  :root[data-alive-ui] body main.col .sh-kfig .fig3d-stack{flex-direction:row!important;align-items:center!important;gap:0!important}
  :root[data-alive-ui] body main.col .sh-kfig .fig3d{min-width:0;flex:0 1 300px}
}
:root[data-alive-ui] body main.col .sh-kfig svg:not(.katex svg){max-width:100%;height:auto}
:root[data-alive-ui] body main.col .look-kpair.sh-kpair{grid-template-columns:minmax(0,320px) minmax(0,1fr);margin-bottom:4px}
@media (max-width:640px){:root[data-alive-ui] body main.col .look-kpair.sh-kpair{grid-template-columns:1fr}}

/* the formula in a Key idea may break at its operators on a narrow phone rather than run past the edge */
@media (max-width:420px){:root[data-alive-ui] body main.col .key-idea .nb,:root[data-alive-ui] body main.col .key-idea .nb .katex{white-space:normal}}

/* practice: "V =" in front of its box, at the size of the problem's maths */
:root[data-alive-ui] body main.col .prob .answer-fields label{display:flex;align-items:center;gap:10px;font-size:18px;color:var(--ink)}
@media (max-width:640px){:root[data-alive-ui] body main.col .prob .answer-fields label{width:100%}:root[data-alive-ui] body main.col .prob .answer-fields label input{flex:1;width:auto}}
@media (max-width:420px){:root[data-alive-ui] body main.col .look-krows.sh-krows{padding-left:8px;padding-right:8px}}
