/* Related Rates: page layout. No colours here: every colour is the course palette's (../lib/lesson-colors.css), set in the
   maths by katex-macros.json: \gv blue (the rate given), \wn green (the rate wanted), \nr pink (a changing quantity with
   no rate given), \srf violet (the water's surface), \gvo orange (a second given rate), \gd mute (a guide). */

/* A chain that reads on one line on a wide page takes one step per line on a phone, so nothing breaks mid-step */
:root[data-alive-ui] body main.col .rr-narrow{display:none}

/* The three steps (Every moment, Rates, This moment): the labels in a column of their own, the maths beside them; a row
   with no label keeps to the maths column */
:root[data-alive-ui] body main.col .rr-steps{display:grid;grid-template-columns:max-content minmax(0,1fr);column-gap:24px;row-gap:14px;align-items:center}
:root[data-alive-ui] body main.col .rr-steps>.row{display:contents}
:root[data-alive-ui] body main.col .rr-steps>.row:not(:has(>.row-label))>*{grid-column:2}
:root[data-alive-ui] body main.col .rr-steps .row-label{font:500 15px/1.4 var(--lf-label);color:var(--ink);min-width:0}
:root[data-alive-ui] body main.col .rr-steps .katex-display,:root[data-alive-ui] body main.col .rr-steps .math-chain{margin:0}

/* The cone's side view beside its two rows: the figure at its own size, the rows the rest */
:root[data-alive-ui] body main.col .look-pair.rr-pair{grid-template-columns:auto minmax(0,1fr)}
:root[data-alive-ui] body main.col .look-pair.rr-pair .look-rows .row+.row{margin-top:16px}

/* a written solution's step title on its own line above its sentence */
:root[data-alive-ui] body main.col .sol .ln .step{display:block;font:500 17px/1.4 'STIX Two Text',Georgia,serif;letter-spacing:0;text-transform:none;margin:0 0 2px}

/* Key concepts: each row's label above its maths, space rather than rules between rows; the three set-ups at their own size */
:root[data-alive-ui] body main.col .look-krows .kr{grid-template-columns:minmax(0,1fr);gap:2px;border-top:0;padding:6px 0}
:root[data-alive-ui] body main.col .look-krows .kr .kh{font-size:16px}
:root[data-alive-ui] body main.col .look-kgrid .review-figure{max-width:none}
:root[data-alive-ui] body main.col .look-kgrid .review-figure>svg:not(.katex svg){width:auto;max-width:100%;height:auto;display:block;margin:0 auto}

@media (max-width:640px){
  :root[data-alive-ui] body main.col .rr-wide{display:none}
  :root[data-alive-ui] body main.col .rr-narrow{display:block}
  /* on a phone each label stays beside its maths, in a narrow column of two short lines; a row with no label, which
     carries on from the row above, takes the card's whole width */
  :root[data-alive-ui] body main.col .rr-steps{grid-template-columns:62px minmax(0,1fr);column-gap:12px}
  :root[data-alive-ui] body main.col .rr-steps .row-label{font-size:13px;line-height:1.3}
  :root[data-alive-ui] body main.col .rr-steps>.row:not(:has(>.row-label))>*{grid-column:1/-1}
  :root[data-alive-ui] body main.col .look-pair.rr-pair{grid-template-columns:minmax(0,1fr)}
}

/* the turning cone (fig-3) centred in its card, as the flat figures are */
:root[data-alive-ui] body main.col figure.diagram>.fig3d>svg:not(.katex svg){display:block;margin:0 auto}
