/* Newton's Method: page layout. No colours here: every colour is the course palette's (../lib/lesson-colors.css). */

/* A chain that reads on one or two lines on a wide page takes one fact or one step per line on a phone, so nothing
   breaks mid-step */
:root[data-alive-ui] body main.col .nm-narrow{display:none}
/* a narrow copy that opens its card sits where the hidden wide one would */
:root[data-alive-ui] body main.col .look-card>.nm-wide:first-child+.nm-narrow{margin-top:0}

/* The table of guesses: a little tighter than a card of steps, so the five guesses read as one column */
:root[data-alive-ui] body main.col .look-card.nm-table .row+.row{margin-top:6px}

/* Key concepts: a name over its row, the row given the card's full width (the shared side-by-side label left the maths
   78 px) */
:root[data-alive-ui] body main.col .look-kgrid .kr{display:block;border:0;padding:0;margin:0}
:root[data-alive-ui] body main.col .look-kgrid .kr+.kr{margin-top:12px}
:root[data-alive-ui] body main.col .look-kgrid .kr .kh{display:block;margin:0 0 4px}
:root[data-alive-ui] body main.col .look-kgrid .kr .kv{min-width:0;padding:0}
:root[data-alive-ui] body main.col .look-kgrid .kv .math-chain{margin:0}
/* the wide first card: the triangle at its own size beside the formula */
:root[data-alive-ui] body main.col .look-kgrid .kc.wide .look-kpair{grid-template-columns:auto minmax(0,1fr)}

@media (max-width:640px){
  :root[data-alive-ui] body main.col .nm-wide{display:none}
  :root[data-alive-ui] body main.col .nm-narrow{display:block}
  /* the shared card padding is already 14 px on a phone; a figure standing on its own takes the same, so it keeps its size */
  :root[data-alive-ui] body main.col>section>figure.diagram{padding:14px}
  :root[data-alive-ui] body main.col .look-kgrid .kc.wide .look-kpair{grid-template-columns:1fr}
}
/* the two goals are the widest lines set large; on the narrowest phones they keep their size above the body text but no more */
@media (max-width:380px){
  :root[data-alive-ui] body main.col .look-goal .katex{font-size:1.04em}
}

/* Section 1's general step: its name beside the formula, at the formula's displayed size; on a phone the name sits above it */
:root[data-alive-ui] body main.col .look-card .row.nm-lab{display:flex;flex-wrap:wrap;align-items:center;gap:6px 22px}
:root[data-alive-ui] body main.col .look-card .row.nm-lab>.row-label{font:500 15px/1.35 var(--lf-label);color:var(--ink);min-width:0;width:auto}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .look-card .row.nm-lab{column-gap:12px}
  :root[data-alive-ui] body main.col .look-card .row.nm-lab>.row-label{font-size:14px}
}
