/* Area in Polar Coordinates: page layout. No colours here: every colour is the course palette's (../lib/lesson-colors.css).
   Colour meanings (planning/colour.md), one macro each in katex-macros.json:
     \ang  blue    the angle: θ as the angle, dθ (\ang{d\theta}), every bound, found angle and interval, the ray θ + π;
     \rr   pink    r: its values, the curve's formula and its square, the curve r traces (the cardioid in a two-curve problem);
     \da   green   the wedge and the area it fills (dA);
     \cvb  violet  the second curve in a two-curve problem (3cos θ, R), its end of a piece and its values;
     \wrong orange what a wrong count adds: the wedge of radius R − r. */

/* A plot and its unit circle: two drawings at their own size, side by side, the unit circle under the plot on a phone. */
:root[data-alive-ui] body main.col .ap-fig{display:flex;justify-content:center;align-items:flex-start}
:root[data-alive-ui] body main.col .ap-fig>svg{flex:none}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .ap-fig{flex-direction:column;align-items:center;gap:6px}
  :root[data-alive-ui] body main.col .ap-fig>svg{margin-top:0!important}
}

/* A lone equation: on the paper, centred, the size of a card's rows; not a block, so no card and no lamp. */
:root[data-alive-ui] body main.col .ap-eq{margin:18px 0 22px}
:root[data-alive-ui] body main.col .ap-eq .math-chain{margin:0;justify-content:center}
:root[data-alive-ui] body main.col .ap-eq .katex-display{margin:0}
:root[data-alive-ui] body main.col .ap-eq .katex{font-size:1.1em}
/* the polar area formula, the section's result: set like a goal row, large and quiet */
:root[data-alive-ui] body main.col .ap-formula .katex{font-size:1.3em}

/* A chain of steps joined by arrows: each step whole, wrapping only between steps (the next line starts at its arrow). */
:root[data-alive-ui] body main.col .ap-flow{display:flex;flex-wrap:wrap;justify-content:flex-start;align-items:center;gap:4px 10px}
:root[data-alive-ui] body main.col .ap-flow>*{margin:0;flex:none;max-width:100%}
:root[data-alive-ui] body main.col .ap-flow .katex-display,:root[data-alive-ui] body main.col .ap-flow .math-chain{margin:0}

/* A worked result: one aligned chain, two moves to a line on a wide screen and one per "=" on a phone (ap-wide, ap-narrow).
   The identity it uses sits above it on a quiet sheet, where the sentence before has just named it: a fact the chain
   uses, not a step of it. */
:root[data-alive-ui] body main.col .ap-narrow{display:none}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .ap-wide{display:none}
  :root[data-alive-ui] body main.col .ap-narrow{display:block}
}
:root[data-alive-ui] body main.col .ap-id{width:fit-content;max-width:100%;margin:0;padding:6px 14px;border-radius:10px;background:var(--look-tint)}
:root[data-alive-ui] body main.col .look-card .row.ap-id+.row{margin-top:16px}

/* A figure beside its rows, where the figure is narrow enough to keep its own size there: the figure takes its own
   width and the rows the rest (the shared pair splits the card .9 : 1.1, which would shrink these figures). */
@media (min-width:641px){
  :root[data-alive-ui] body main.col .look-pair.ap-pair{grid-template-columns:auto minmax(0,1fr)}
}

/* The two pieces of section 6, each over its own area. */
:root[data-alive-ui] body main.col .ap-pieces .look-case{display:flex;flex-direction:column;align-items:center;justify-content:space-between;gap:10px}
:root[data-alive-ui] body main.col .ap-pieces figure.diagram{margin:0}
:root[data-alive-ui] body main.col .ap-pieces figure.diagram>svg{display:block}
:root[data-alive-ui] body main.col .ap-pieces .katex-display{margin:0}

/* A case's heading inside a compare card */
:root[data-alive-ui] body main.col .look-case .ap-head{margin-bottom:8px}
:root[data-alive-ui] body main.col .look-case .ap-head .katex-display,:root[data-alive-ui] body main.col .look-case .katex-display{margin:0}
:root[data-alive-ui] body main.col .look-case .row+.row{margin-top:8px}

/* Key concepts: a row's name above its maths, so the maths has the card's width */
: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 .kc .kv{overflow:visible}
:root[data-alive-ui] body main.col .look-kgrid .kc .kv{gap:6px 12px}
:root[data-alive-ui] body main.col .look-kgrid .kc .kv :is(.katex-display,.math-chain){margin:0}
/* a title with maths in it reads as one line of text (the title row is a flex row with its number) */
:root[data-alive-ui] body main.col .look-kgrid .kn>span{display:inline}
:root[data-alive-ui] body main.col .look-kgrid .review-figure{margin:0 0 12px}
:root[data-alive-ui] body main.col .look-kgrid .review-figure>svg{width:auto;max-width:100%;height:auto;display:block;margin:0 auto}
:root[data-alive-ui] body main.col .look-kgrid .look-kpair .review-figure{margin:0}

/* Practice: a given figure under its statement */
:root[data-alive-ui] body main.col .prob>figure.diagram{margin:10px 0 14px 44px}
:root[data-alive-ui] body main.col .prob>figure.diagram>svg{width:auto;max-width:100%;height:auto;display:block;margin:0 auto}
@media (max-width:640px){:root[data-alive-ui] body main.col .prob>figure.diagram{margin-left:0}}

/* A card of one row (an arrow chain, the two turns of section 3) centres it; a card of several rows reads down its left edge. */
:root[data-alive-ui] body main.col .look-card>.row:only-child.ap-flow{justify-content:center}
:root[data-alive-ui] body main.col .look-card>.row:only-child .math-chain{justify-content:center}
/* a goal in two lines on a phone */
:root[data-alive-ui] body main.col .look-goal .katex-display{margin:0}
