/* Taylor and Maclaurin Series: page layout. No colours here: every colour is the course palette's (../lib/lesson-colors.css),
   through the macros in katex-macros.json (planning/colour.md):
     \dv  pink    a derivative value at the centre, and the n! that turns it into a coefficient or back (C is f(0));
     \ps  blue    a partial sum: a series stopped after a term, or a series at a number;
     \iv  green   the interval where a series equals its function, "every x";
     \su  violet  u, and the expression put in for it;
     \pw  orange  the power in a general term, and the factorial or denominator that matches it. */

/* a sub-part of a section, set like the reference's */
:root[data-alive-ui] body main.col h3.sub{font:500 22px/1.3 'STIX Two Text',Georgia,serif;color:var(--ink);margin:40px 0 4px}
:root[data-alive-ui] body main.col h3.sub .katex{font-size:1em}

/* a chain read one move per "=": the wide copy on a wide screen, a narrower break of the same chain on a phone */
:root[data-alive-ui] body main.col .tm-narrow{display:none}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .tm-wide{display:none}
  :root[data-alive-ui] body main.col .tm-narrow{display:block}
}

/* a figure beside its rows, the figure at its own width and the rows taking the rest */
:root[data-alive-ui] body main.col .look-pair.tm-pair{grid-template-columns:auto minmax(0,1fr)}
@media (max-width:640px){:root[data-alive-ui] body main.col .look-pair.tm-pair{grid-template-columns:1fr}}

/* Derivatives at the centre, in columns: one column per derivative (the function, its value at the centre, and the term
   it gives), read across on a wide screen; on a phone the same cells turn into one row per derivative, read down, so the
   derivative, its value and its term still sit together. --rows is how many kinds of cell each derivative has. */
:root[data-alive-ui] body main.col .tm-dtab{display:grid;grid-template-rows:repeat(var(--rows),auto);grid-auto-flow:column;grid-auto-columns:auto;justify-content:center;align-items:center;gap:14px var(--cg,22px)}
:root[data-alive-ui] body main.col .tm-dtab>span{text-align:center;white-space:nowrap;min-height:1em}
:root[data-alive-ui] body main.col .tm-dtab>.tm-l{text-align:right;padding-right:8px}
:root[data-alive-ui] body main.col .tm-dtab .katex{white-space:nowrap}
:root[data-alive-ui] body main.col .look-card>.tm-dtab+.row{margin-top:20px}
:root[data-alive-ui] body main.col .look-card>.tm-cases+.row{margin-top:20px}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .tm-dtab{grid-template-rows:none;grid-template-columns:repeat(var(--rows),auto);grid-auto-flow:row;gap:10px 26px}
  :root[data-alive-ui] body main.col .tm-dtab>.tm-l{text-align:center;padding:0 0 4px}
}

/* cases by the x put in: the value on the left, its maths beside it */
:root[data-alive-ui] body main.col .tm-cases{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:16px 22px;align-items:center}
:root[data-alive-ui] body main.col .tm-cases>.tm-x{text-align:right;white-space:nowrap}
:root[data-alive-ui] body main.col .tm-cases>.tm-x .katex{font-size:1.1em}
:root[data-alive-ui] body main.col .tm-cases>.tm-m{min-width:0}
:root[data-alive-ui] body main.col .tm-cases>.tm-m>.math-chain+.math-chain{margin-top:6px}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .tm-cases{grid-template-columns:minmax(0,1fr);gap:4px}
  :root[data-alive-ui] body main.col .tm-cases>.tm-x{text-align:left}
  :root[data-alive-ui] body main.col .tm-cases>.tm-m+.tm-x{margin-top:12px}
  :root[data-alive-ui] body main.col .tm-cases>.tm-x .katex{font-size:1em}
}

/* The series to know: one row per function, its terms, its general term and its interval in columns, so the interval
   column reads down the table. The binomial series has no general term, so its terms take that column too. On a phone
   each row is the function beside its terms, with the general term and the interval under the terms. */
:root[data-alive-ui] body main.col .tm-table{display:grid;grid-template-columns:max-content max-content max-content minmax(0,1fr);gap:16px 10px;align-items:center}
:root[data-alive-ui] body main.col .tm-table :is(.tm-sr,.tm-si){display:contents}
:root[data-alive-ui] body main.col .tm-table .tm-f{text-align:right}
:root[data-alive-ui] body main.col .tm-table .tm-e{display:flex;flex-wrap:wrap;gap:8px .32em;align-items:center}
:root[data-alive-ui] body main.col .tm-table .tm-k .tm-e{grid-column:2/4;width:0;min-width:100%}   /* adds no width of its own to the columns; its terms wrap inside them */
:root[data-alive-ui] body main.col .tm-table .tm-s{padding-left:4px}
:root[data-alive-ui] body main.col .tm-table .tm-i{padding-left:22px;white-space:nowrap}
:root[data-alive-ui] body main.col .tm-table .katex{white-space:nowrap}
:root[data-alive-ui] body main.col .look-krows.tm-table .katex{font-size:1.02em}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .tm-table{display:block}
  :root[data-alive-ui] body main.col .tm-table .tm-sr{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:4px 8px;align-items:center}
  :root[data-alive-ui] body main.col .tm-table .tm-sr+.tm-sr{margin-top:16px}
  :root[data-alive-ui] body main.col .tm-table .tm-sr.tm-k{grid-template-columns:minmax(0,1fr)}
  :root[data-alive-ui] body main.col .tm-table .tm-k .tm-f{text-align:left}
  :root[data-alive-ui] body main.col .tm-table .tm-k .tm-e{grid-column:auto;width:auto;min-width:0;padding-left:1.2em}
  :root[data-alive-ui] body main.col .tm-table .tm-k .tm-si{grid-column:auto;padding-left:1.2em}
  :root[data-alive-ui] body main.col .tm-table .tm-si{display:flex;flex-wrap:wrap;align-items:center;gap:2px 16px;grid-column:2}
  :root[data-alive-ui] body main.col .tm-table .tm-s{padding-left:0}
  :root[data-alive-ui] body main.col .tm-table .tm-i{padding-left:0}
}


/* Key concepts: rows on the quiet sheet */
:root[data-alive-ui] body main.col .look-krows .row+.row{margin-top:10px}
:root[data-alive-ui] body main.col .look-krows .math-chain{margin:0}

/* Practice: a polynomial answer is typed on one line after the function it expands */
:root[data-alive-ui] body main.col .prob .tm-ans label{display:flex;align-items:center;flex-wrap:wrap;gap:8px 10px;font-size:16px;color:var(--ink)}
:root[data-alive-ui] body main.col .prob .tm-ans input{width:320px}
:root[data-alive-ui] body main.col .prob .tm-ans input.tm-end{width:90px;text-align:center}
:root[data-alive-ui] body main.col .prob .tm-ans .tm-tag{font-size:16px;color:var(--ink)}
@media (max-width:640px){
  :root[data-alive-ui] body main.col .prob .tm-ans label{flex-wrap:nowrap;width:100%;min-width:0}
  :root[data-alive-ui] body main.col .prob .tm-ans input{width:auto;flex:1 1 0;min-width:0}
  :root[data-alive-ui] body main.col .prob .tm-ans input.tm-end{width:80px;flex:none}
}

/* the series-to-know card's title: a concept block's title, centred in the page's ink */
:root[data-alive-ui] body main.col .tm-ttl{text-align:center;font:500 19px/1.4 'STIX Two Text',Georgia,serif;color:var(--ink);margin:0 0 18px}
/* an interval answer: two ends typed around "< x <" */
:root[data-alive-ui] body main.col .prob .tm-ans .tm-int{display:flex;align-items:center;flex-wrap:wrap;gap:8px 10px}
