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

/* A chain read one move per "=": two "=" to a line on a wide screen, one on a phone, so nothing scrolls sideways. */
:root[data-alive-ui] body main.col :is(.sf-narrow,.look-card .row.sf-narrow){display:none}
@media (max-width:640px){
  :root[data-alive-ui] body main.col :is(.sf-wide,.look-card .row.sf-wide){display:none}
  :root[data-alive-ui] body main.col :is(.sf-narrow,.look-card .row.sf-narrow){display:flex;justify-content:center}
}

/* Rows beside a figure: the figure keeps its own size (a field's 17 px numbers stay 17 px), the rows take the rest. */
:root[data-alive-ui] body main.col .look-pair.sf-pair{grid-template-columns:auto minmax(0,1fr);column-gap:20px}
:root[data-alive-ui] body main.col .look-pair.sf-pair .look-rows .row{display:flex;justify-content:center}

/* Section 3's two fields, each over its own row: drawn at its own size, centred in its case. */
:root[data-alive-ui] body main.col .look-case figure.diagram{margin:0 0 12px;display:flex;justify-content:center}
:root[data-alive-ui] body main.col .look-case figure.diagram>svg{width:auto;max-width:100%;height:auto}
:root[data-alive-ui] body main.col .look-case :is(.look-q,.look-a){display:flex;justify-content:center}

/* Section 5's two inequalities over the field they divide: the rows are too wide to sit beside a 400 px field. */
:root[data-alive-ui] body main.col .look-card.sf-stack figure.diagram{margin:16px 0 0;display:flex;justify-content:center}
:root[data-alive-ui] body main.col .look-card.sf-stack figure.diagram>svg{width:auto;max-width:100%;height:auto}
:root[data-alive-ui] body main.col .look-card.sf-stack .row{display:flex;justify-content:center}

/* A card's rows sit centred, like the goal above them and the rows beside a figure. */
:root[data-alive-ui] body main.col .look-card .row{display:flex;justify-content:center}

/* Practice 5's three limits: each answer with its own Check on its line, so the check reads as that limit's. */
:root[data-alive-ui] body main.col #p5 .part{display:flex;flex-wrap:wrap;align-items:center;column-gap:14px}
:root[data-alive-ui] body main.col #p5 .part>.answer-fields,:root[data-alive-ui] body main.col #p5 .part>.ans{margin-top:6px;margin-bottom:6px}
:root[data-alive-ui] body main.col #p5 .part>.hint{flex-basis:100%}
@media (min-width:641px){:root[data-alive-ui] body main.col #p5 .answer-fields input{width:170px}}

/* Section 1's table of slopes: one aligned table, centred beside its nine segments. */
:root[data-alive-ui] body main.col .sf-table{display:flex;justify-content:center}

/* Practice: a statement's field and a solution's figure at their own size, under the text they serve. */
:root[data-alive-ui] body main.col .prob figure.diagram{margin:14px 0 4px;display:flex;justify-content:center}
:root[data-alive-ui] body main.col .prob figure.diagram>svg{width:auto;max-width:100%;height:auto}

/* On a phone a field takes the card's width: the side padding a card of text needs would draw a field and its numbers
   under three quarters of their size (the figures are drawn about 400 px wide, the column is about 340). */
@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.sf-pair{grid-template-columns:minmax(0,1fr);padding:14px 6px}
  :root[data-alive-ui] body main.col .look-pair.sf-pair .look-rows{padding:0 8px}
  :root[data-alive-ui] body main.col .look-card.sf-stack{padding:14px 6px}
  /* Key concepts' rows: the shared sheet's padding left a 360 px phone under 220 px for a two-line chain */
  :root[data-alive-ui] body main.col .look-kgrid .look-krows{padding:10px 8px}
}
