/* Logarithmic Differentiation: this page's own layout. It defines no colours: every colour on the page is a course
   palette role (lib/lesson-colors.css, through alive/lesson-look.css), set in the maths by the macros in katex-macros.json:
     \ex (lc-pink)    x in the exponent, and the part of the derivative it gives (the exponential rule's part);
     \bs (lc-blue)    x in the base (x² + 1 in section 2), and the part it gives (the power rule's part);
     \yy (lc-green)   y, the function whose log is taken, and the expression written back for it;
     \fa (lc-orange)  section 3: the power factor x³ in the numerator, into 3 ln x and 3/x;
     \rf (lc-blue)    section 3: the root factor √(x² + 3), into ½ ln(x² + 3) and x/(x² + 3);
     \fd (lc-violet)  section 3: the denominator factor (x + 1)², with its minus, into −2 ln(x + 1) and −2/(x + 1).
   The meanings, and where colour is left out on purpose, are planning/colour.md. */

/* a short label over the maths it names ("Constant base", "Log rule"): sentence case in the page's ink, so a symbol
   in it (ln u, x = 1) keeps its case, which the shared uppercase row heads would turn into capitals */
:root[data-alive-ui] body main.col .ld-lab{font:500 15px/1.35 var(--lf-label);color:var(--ink);letter-spacing:0;text-transform:none}
:root[data-alive-ui] body main.col .look-card>.ld-lab{text-align:center;margin-bottom:10px}

/* two cases side by side: the label over each, the maths centred under it */
:root[data-alive-ui] body main.col .ld-pair .look-case{display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:8px}
:root[data-alive-ui] body main.col .ld-pair .look-case .math-chain{justify-content:center}

/* a step with the rule it uses beside it (a wide screen) or under it (a phone): the rule is the reason for the step,
   so it sits next to it rather than in the list of steps */
:root[data-alive-ui] body main.col .ld-side{display:grid;grid-template-columns:minmax(0,1.35fr) minmax(0,1fr);gap:14px 36px;align-items:center}
:root[data-alive-ui] body main.col .ld-side .ld-main .math-chain{justify-content:center}
:root[data-alive-ui] body main.col .ld-side .ld-note{display:flex;flex-direction:column;align-items:center;gap:6px;text-align:center}
:root[data-alive-ui] body main.col .ld-side .ld-note .math-chain{justify-content:center}

/* section 3's log laws: four short laws in a two-by-two grid, one column on a phone */
:root[data-alive-ui] body main.col .ld-laws{display:grid;grid-template-columns:repeat(2,minmax(0,max-content));justify-content:center;gap:10px 48px}
:root[data-alive-ui] body main.col .ld-laws .math-chain{justify-content:center}

/* section 4's three terms: each rule's name beside its row, the sum under them after a space */
:root[data-alive-ui] body main.col .ld-grid{display:grid;grid-template-columns:max-content max-content;justify-content:center;align-items:center;gap:12px 28px}
:root[data-alive-ui] body main.col .ld-grid .math-chain{justify-content:flex-start}
:root[data-alive-ui] body main.col .ld-sum{margin-top:20px}
:root[data-alive-ui] body main.col .ld-sum .math-chain{justify-content:center}

/* the goal for section 3 is two lines: the function, then what we want */
:root[data-alive-ui] body main.col .look-goal .math-chain+.math-chain{margin-top:4px}

/* a chain broken where it moves on: the wide form on a wide screen, one move to a line on a phone, so nothing scrolls */
:root[data-alive-ui] body main.col .ld-narrow{display:none}

/* Key concepts: each row's label above its maths, rows separated by space rather than rules: beside it, the shared
   150 px label column left a half-width card 120 px for the maths */
: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:15px}
:root[data-alive-ui] body main.col .look-krows .kv .math-chain{margin:0}

/* the solutions' displayed rows sit close under their sentence */
:root[data-alive-ui] body main.col .sol .txt .ln .math-chain{margin:8px 0 4px}

/* an answer read as one line: "y'(1) = [  ]" */
:root[data-alive-ui] body main.col .prob .answer-fields label{align-items:center}

@media (max-width:640px){
  :root[data-alive-ui] body main.col .ld-wide{display:none}
  :root[data-alive-ui] body main.col .ld-narrow{display:block}
  :root[data-alive-ui] body main.col .ld-side{grid-template-columns:minmax(0,1fr)}
  :root[data-alive-ui] body main.col .ld-laws{grid-template-columns:minmax(0,max-content)}
  :root[data-alive-ui] body main.col .ld-grid{grid-template-columns:minmax(0,1fr);justify-content:stretch;gap:2px}
  :root[data-alive-ui] body main.col .ld-grid .ld-lab{margin-top:10px}
  :root[data-alive-ui] body main.col .ld-grid .ld-lab:first-child{margin-top:0}
}

/* a card's chain sits in the middle of its card, as the goal and the films' problems do */
:root[data-alive-ui] body main.col .look-card>.row .math-chain{justify-content:center}
/* Key concept 2's title: the words and their xˣ read as one phrase */
:root[data-alive-ui] body main.col .look-kgrid .kn>span .katex{font-size:1em}
/* an answer's label at the size of the statement's maths: d/dx and π/2 were too small to read at the shared caption size */
:root[data-alive-ui] body main.col .prob .answer-fields label .katex{font-size:1.25em}
