/* Polar Coordinates and Polar Curves: page layout. No colours here: every colour is the course palette's (../lib/lesson-colors.css),
   through the macros in katex-macros.json (\dir green θ, \rfw blue r forward, \rbk pink r backward, \xco orange x, \yco violet y;
   planning/colour.md). Every rule is scoped :root[data-alive-ui] body main.col, because the sheet styles outrank a plain selector. */

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

/* a figure beside its rows, drawn at its own size: the figure takes the width it was drawn at, the rows the rest */
@media (min-width:641px){
  :root[data-alive-ui] body main.col .look-pair.pc-pair{grid-template-columns:auto minmax(0,1fr);column-gap:30px}
}
/* the three limaçons' smallest values, each beside its own panel of the figure */
:root[data-alive-ui] body main.col .pc-rows3{display:flex;flex-direction:column;justify-content:space-around;align-self:stretch;gap:18px}
:root[data-alive-ui] body main.col .look-rows.pc-rows3 .row+.row{margin-top:0}

/* a card of rows with the figure that shows them, the rows first: one block, one lamp */
:root[data-alive-ui] body main.col .look-card.pc-stack>figure.diagram{margin:16px 0 0;padding:0;background:none;border:0;box-shadow:none}
:root[data-alive-ui] body main.col .look-card.pc-stack>figure.diagram>svg:not(.katex svg){width:auto;max-width:100%;height:auto;display:block;margin:0 auto}

/* a table of rows read in pairs on a phone (an arc's range and sign, then the petal's tip): space between the pairs */
:root[data-alive-ui] body main.col .look-card .row.pc-next{margin-top:20px}
:root[data-alive-ui] body main.col .look-card .row.pc-tip{margin-top:4px}

/* a figure standing in a section keeps its own size on a phone: the card's side padding gives way, not the figure */
@media (max-width:640px){
  :root[data-alive-ui] body main.col>section>figure.diagram{padding:12px 6px}
  :root[data-alive-ui] body main.col .look-card.pc-stack{padding-left:6px;padding-right:6px}
  :root[data-alive-ui] body main.col .look-card.pc-stack>.row{padding:0 8px}
}

/* an answer written as a point: "(r, θ) = ( [ ], [ ] )", each field short and on one line with its brackets */
:root[data-alive-ui] body main.col .prob .answer-fields.pc-point{align-items:center;gap:6px 14px}
:root[data-alive-ui] body main.col .prob .answer-fields.pc-point label{display:inline-flex;align-items:center;gap:6px;flex-wrap:nowrap}
:root[data-alive-ui] body main.col .prob .answer-fields.pc-point input{width:110px;min-width:0}
:root[data-alive-ui] body main.col .prob .answer-fields.pc-point .pc-ans{display:flex;align-items:center;flex-wrap:wrap;gap:6px}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .prob .answer-fields.pc-point input{width:84px}
}

/* a choice of graphs: two to a row at every width, each graph under its letter, drawn small enough to fit a phone's half */
:root[data-alive-ui] body main.col .choices.lean-graphs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 18px;margin:14px 0}
:root[data-alive-ui] body main.col .prob .choices.lean-graphs>label{display:flex;flex-direction:column;align-items:center;gap:4px;min-width:0;width:auto;margin:0}
:root[data-alive-ui] body main.col .choices.lean-graphs svg:not(.katex svg){width:100%;height:auto;max-width:200px}
/* a list of points to tick, side by side where they fit */
:root[data-alive-ui] body main.col .choices.pc-row{display:flex;flex-wrap:wrap;gap:8px 22px;margin:14px 0}
:root[data-alive-ui] body main.col .choices.pc-row>label{width:auto;margin:0}

/* the check under a converted point sits a step apart from the conversion it checks */
:root[data-alive-ui] body main.col .look-card .row.pc-check{margin-top:18px}
/* Key concepts on a phone: three nested paddings (card, sheet, rows) left a table of equations 218 px; the maths gets that room back */
@media (max-width:640px){
  :root[data-alive-ui] body main.col .look-kgrid>.kc{padding-left:14px;padding-right:14px}
  :root[data-alive-ui] body main.col .look-kgrid .kc .kb{padding-left:8px;padding-right:8px}
  :root[data-alive-ui] body main.col .look-kgrid .look-krows{padding-left:10px;padding-right:10px}
}
/* a figure beside its rows, on a phone: the figure keeps its size (the card's side padding gives way) and the rows sit centred under it */
@media (max-width:640px){
  :root[data-alive-ui] body main.col .look-pair.pc-pair{padding-left:6px;padding-right:6px}
  :root[data-alive-ui] body main.col .look-pair.pc-pair>.look-rows{justify-self:center}
}
