/* Limit Laws and Algebraic Techniques: page layout. No colours here: every colour is the course palette's (../lib/lesson-colors.css).
   The colour macros (katex-macros.json), one per meaning of planning/colour.md:
     \fv  violet  f, whatever sits in f's place (the top in sections 1 and 2), and from section 3 on the one function whose limit we want
     \gb  blue    g, whatever sits in g's place (the bottom in sections 1 and 2)
     \fac orange  the factor x − a that 0/0 points to, every copy of it, from the moment it is found (struck when it cancels)
     \iA  pink    A in the identities; the root being removed (√x, ∛x)
     \iB  green   B in the identities
     \lsd blue    the left side of the point (sections 8 and 9, practice 7)
     \rsd pink    the right side of the point
   Blue and pink each carry two meanings in separate parts of the page, never in one block (colour.md, "Blue and pink"). */

/* named rows (the laws): the name in its own column, so every law starts at one left edge and none drops under its name */
:root[data-alive-ui] body main.col .ll-law{display:grid;grid-template-columns:var(--ll-lw,6.4em) minmax(0,1fr);column-gap:22px;align-items:center}
:root[data-alive-ui] body main.col .ll-law+.ll-law{margin-top:12px}
/* a law and its condition are two pieces of maths on one line; the condition moves under the law, whole, when the line is short */
:root[data-alive-ui] body main.col :is(.ll-law,.look-krows)>.row.ll-two{display:flex;flex-wrap:wrap;align-items:center;gap:6px 30px;min-width:0}
:root[data-alive-ui] body main.col .ll-lab-l{--ll-lw:10.6em}
:root[data-alive-ui] body main.col .ll-lab .row-label{font:500 16.5px/1.35 'STIX Two Text',Georgia,serif;letter-spacing:0;text-transform:none;color:var(--ink);min-width:0;width:auto}
:root[data-alive-ui] body main.col :is(.look-card,.look-krows) .katex-display,:root[data-alive-ui] body main.col :is(.look-card,.look-krows) .math-part{margin:0}
:root[data-alive-ui] body main.col .look-krows .math-chain{margin:0;gap:6px 8px}
:root[data-alive-ui] body main.col .look-krows .row+.row{margin-top:12px}
:root[data-alive-ui] body main.col .look-krows{margin-bottom:4px}

/* the plug-in check under a goal: quiet, centred, not a block of its own */
:root[data-alive-ui] body main.col .ll-check{width:fit-content;max-width:100%;margin:-6px auto 26px}
:root[data-alive-ui] body main.col .ll-check .math-chain{margin:0;justify-content:center}

/* a chain lined up on "=": two moves to a line on a wide screen, one on a phone */
:root[data-alive-ui] body main.col :is(.look-card,.look-krows)>.row.ll-narrow{display:none}

/* Key concepts: the hole figure beside its rows at its own size */
:root[data-alive-ui] body main.col .ll-kpair{display:grid;grid-template-columns:auto minmax(0,1fr);gap:10px 26px;align-items:center}
:root[data-alive-ui] body main.col .kc .review-figure>svg:not(.katex svg){width:auto;max-width:100%;height:auto;display:block;margin:0 auto}
/* four short rows of the same kind: two to a line on a wide card */
:root[data-alive-ui] body main.col .look-krows.ll-kgrid2{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 28px;align-items:center}
:root[data-alive-ui] body main.col .look-krows.ll-kgrid2>.row+.row{margin-top:0}
/* a long chain inside a note may break at "=" rather than run past the card */
:root[data-alive-ui] body main.col .knote.ll-wrap .katex{white-space:normal}

/* the one-sided limits side by side: left on the left */
:root[data-alive-ui] body main.col .look-compare .look-case .math-chain{margin:0}
:root[data-alive-ui] body main.col .look-compare .look-case .katex-display{margin:0}

@media (max-width:640px){
  :root[data-alive-ui] body main.col .ll-law{grid-template-columns:1fr;row-gap:4px}
  :root[data-alive-ui] body main.col .ll-law+.ll-law{margin-top:16px}
  :root[data-alive-ui] body main.col :is(.look-card,.look-krows)>.row.ll-wide{display:none}
  :root[data-alive-ui] body main.col :is(.look-card,.look-krows)>.row.ll-narrow{display:block}
  :root[data-alive-ui] body main.col .ll-kpair{grid-template-columns:1fr}
  :root[data-alive-ui] body main.col .look-krows.ll-kgrid2{grid-template-columns:1fr}
  /* a figure card keeps a phone's padding, like every other card, so the figure keeps its size */
  :root[data-alive-ui] body main.col>section>figure.diagram{padding:14px}
}
