/* Arc Length of Parametric Curves: 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:
     \hor  blue    the horizontal change: dx, dx/dt, its value and its square, the horizontal leg;
     \ver  green   the vertical change: dy, dy/dt, its value and its square, the vertical leg;
     \spd  pink    ds, the root and the speed, and the square under the root once it is a square;
     \tv   violet  values of t: the bounds, the t-values found, t = … labels.
   Orange (the negative lobe, the second lap) lives only in the films, the card and fig-8. */

/* a chain or goal written twice: the wide break above 640 px, the narrow one (one move per line) below */
:root[data-alive-ui] body main.col .pal-narrow{display:none}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .pal-wide{display:none}
  :root[data-alive-ui] body main.col .pal-narrow{display:block}
}

/* the arc length formula, the section's result: set like a goal row, large and quiet, on the paper (one equation, so no
   card and no lamp) */
:root[data-alive-ui] body main.col .pal-eq{width:fit-content;max-width:100%;margin:22px auto 26px}
:root[data-alive-ui] body main.col .pal-eq .math-chain{margin:0;justify-content:center}
:root[data-alive-ui] body main.col .pal-eq .katex{font-size:1.15em}

/* rows the writer named ("In terms of t", "One lap"): the name beside its maths, in sentence case, since the names hold
   the letters t, x and y and the shared row label's capitals would turn them into T, X and Y. The maths of the rows sits
   in one column, so the two ds rows of section 1 line up at ds. On a phone the name sits above its maths, which then has
   the card's width. */
:root[data-alive-ui] body main.col .pal-forms{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:12px 22px;align-items:center}
:root[data-alive-ui] body main.col .look-card .row+.pal-forms{margin-top:14px}
:root[data-alive-ui] body main.col .pal-lab{font:500 16px/1.35 'STIX Two Text',Georgia,serif;color:var(--ink)}
:root[data-alive-ui] body main.col .pal-m{min-width:0}
:root[data-alive-ui] body main.col .pal-m .math-chain{justify-content:flex-start}
:root[data-alive-ui] body main.col .pal-m .katex-display{margin:0}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .pal-forms{grid-template-columns:1fr;gap:2px}
  :root[data-alive-ui] body main.col .pal-forms .pal-m+.pal-lab{margin-top:12px}
}

/* a figure beside its rows takes its own width, and the rows the rest (the shared .9 : 1.1 split would draw the circle at
   about 70% of its size, its labels with it) */
@media (min-width:641px){
  :root[data-alive-ui] body main.col .look-pair.pal-pair{grid-template-columns:auto minmax(0,1fr)}
}
:root[data-alive-ui] body main.col .look-pair.pal-pair .look-rows .math-chain{justify-content:flex-start}

/* section 3's worked result: the cube the last step uses sits beside the chain on a wide screen, under it on a phone */
:root[data-alive-ui] body main.col .look-card .row.pal-note .katex{font-size:.98em}
@media (min-width:641px){
  :root[data-alive-ui] body main.col .pal-result{display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:32px;align-items:end}
  :root[data-alive-ui] body main.col .pal-result>.row.pal-note{margin:0 0 4px}
}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .look-card .row.pal-note{margin-top:16px}
}

/* on a phone a figure standing in a section may use more of the card's side padding, so it stays near its own size */
@media (max-width:640px){
  :root[data-alive-ui] body main.col>section>figure.diagram{padding:14px 6px}
  :root[data-alive-ui] body main.col .look-pair>figure.diagram{margin:0 -8px}
}

/* practice: a problem's figure under its statement, at its own size, in line with the answer */
:root[data-alive-ui] body main.col .prob figure.pal-given{margin:12px 0 10px 44px;padding:0}
:root[data-alive-ui] body main.col .prob figure.pal-given>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 .prob figure.pal-given{margin:12px -8px 10px}
}
/* problem 3's statement holds two tall fractions; as inline blocks each claims its own height, so when the statement wraps
   on a phone they no longer run into each other */
:root[data-alive-ui] body main.col #p3>.st>div .katex{display:inline-block;padding:3px 0}
:root[data-alive-ui] body main.col .prob .answer-fields label .katex{margin-right:10px}

/* Key concepts: each concept spans the grid. Its notes are paragraphs of four to eight lines, which in half a column ran
   twenty lines deep, and its two figures were drawn at three quarters of their size there, labels with them. A row's name
   sits above its maths, in sentence case for the same reason as the rows' names above; on a wide screen the formula rows
   sit two to a line, and a figure sits beside its rows at its own size. */
: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 .kh{text-transform:none;letter-spacing:0}
:root[data-alive-ui] body main.col .look-kgrid .kc .kv{overflow:visible}
@media (min-width:641px){
  :root[data-alive-ui] body main.col .look-kgrid .kc .kb>.look-krows{display:grid;grid-template-columns:1fr 1fr;column-gap:32px;align-items:start}
  :root[data-alive-ui] body main.col .look-kgrid .look-kpair{grid-template-columns:auto minmax(0,1fr);gap:8px 32px}
}
/* on a phone the rows' sheet keeps less side padding, so Key concept 3's root and its absolute value fit on their line */
@media (max-width:640px){
  :root[data-alive-ui] body main.col .look-kgrid .look-krows{padding:12px 10px}
}
