/* Typesetting shared by every case page (home.html, _crm-case.html). Rules: TYPOGRAPHY.md.
   Loads right after home-text.css. Every selector sits in :where(), so it has no specificity:
   a case stylesheet (home-mum.css, _crm-case.css…) always wins over these defaults.
   Sizes, line-heights and the measure stay where they are (style.css, home.css, home-text.css). */

/* the whole page: kerning on (the default, stated), breaks only where the text allows them */
:where(body) {
  font-kerning: normal;
  hyphens: manual;          /* no automatic hyphenation; a soft hyphen &shy; only where a word must break */
  overflow-wrap: break-word;
}

/* prose: lines fill the measure one by one (greedy); full stops and commas may hang past the edge (Safari).
   Not text-wrap: pretty: Safari evens out the whole paragraph with it, so lines end 50–140px short of the measure
   and a two-line paragraph breaks like balance ("…shown here are / from the Telegram version.", 01.11).
   A lone last word is kept off by typeset.py instead (the last two words are glued with &nbsp;), in every browser. */
:where(.case, .info) :where(p, li, figcaption, dd, blockquote) {
  text-wrap: wrap;
  hanging-punctuation: allow-end;
}

/* headings and short centred lines: even lines */
:where(.case, .info) :where(h1, h2, h3, summary) { text-wrap: balance; }

/* figures that line up in a column or change: one width per digit. Figures in prose stay proportional */
:where(.figures dt, .cv dt, .row-year, .row-num, .sec-num, .sec-measure, .lb-count) { font-variant-numeric: tabular-nums; }

/* links in text: a long URL breaks instead of pushing past the column */
:where(.case, .info) :where(p, dd, li, figcaption) a { overflow-wrap: anywhere; }

/* keys in the text: a small grey keycap (first used in the CRM case) */
:where(kbd) {
  display: inline-block;
  min-width: 1.5em;
  padding: .1em .4em;
  border-radius: 5px;
  background: rgba(0, 0, 0, .07);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .12);
  font: inherit;
  font-size: .85em;
  line-height: 1.3;
  text-align: center;
  vertical-align: .05em;
  white-space: nowrap;
}
