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

/* §1's four steps: each step's name in a column of its own, its maths beside it, starting at the left */
:root[data-alive-ui] body main.col .look-card .row.opt-lrow{display:grid;grid-template-columns:150px minmax(0,1fr);column-gap:16px;align-items:center}
:root[data-alive-ui] body main.col .look-card .row.opt-lrow+.row.opt-lrow{margin-top:14px}
:root[data-alive-ui] body main.col .look-card .row.opt-lrow>.row-label{font:500 15px/1.35 var(--lf-label);color:var(--ink);min-width:0;width:auto}
:root[data-alive-ui] body main.col .look-card .row.opt-lrow :is(.math-chain,.katex-display){margin:0;justify-content:flex-start}
:root[data-alive-ui] body main.col .opt-cell{min-width:0}
/* a step's maths over two or more lines: each line a step, a little apart */
:root[data-alive-ui] body main.col :is(.opt-cell,.kv)>:is(.opt-wide,.opt-narrow)>*+*,
:root[data-alive-ui] body main.col .opt-kstack>*+*{margin-top:6px}

/* A row that reads on one line on a wide page takes one piece per line on a phone, so nothing breaks mid-step */
:root[data-alive-ui] body main.col .opt-narrow{display:none}
:root[data-alive-ui] body main.col .look-card :is(.opt-wide,.opt-narrow)+:is(.row,.opt-wide,.opt-narrow),
:root[data-alive-ui] body main.col .look-card .row+:is(.opt-wide,.opt-narrow){margin-top:12px}
:root[data-alive-ui] body main.col .look-card .opt-narrow>.row+.row{margin-top:8px}

/* Key concepts: a step's name over its row, the row given the card's full width */
: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}

@media (max-width:640px){
  :root[data-alive-ui] body main.col .look-card .row.opt-lrow{grid-template-columns:76px minmax(0,1fr);column-gap:10px;align-items:start}
  :root[data-alive-ui] body main.col .look-card .row.opt-lrow>.row-label{font-size:13.5px;padding-top:4px}
  :root[data-alive-ui] body main.col .opt-wide{display:none}
  :root[data-alive-ui] body main.col .opt-narrow{display:block}
}

/* Practice solutions: a list of values one per line on a phone (the .opt-wide/.opt-narrow pair above) */
:root[data-alive-ui] body main.col .sol .ln>:is(.opt-wide,.opt-narrow)>.math-chain+.math-chain,
:root[data-alive-ui] body main.col .sol .ln>:is(.opt-wide,.opt-narrow)>*+*{margin-top:4px}
