/* Print stylesheet — linked with media="print", so a browser does not fetch
 * it during a normal screen render.
 *
 * Loaded after assets/styles.css in the document, so these rules win on order
 * where the specificity is equal.
 *
 * The goal is that a printed page reads as a document rather than a
 * screenshot of a web page. The screen layout is driven by vw-based clamps,
 * and in print vw resolves against the page box — left alone, every section
 * kept several rem of screen-sized vertical space and the 34rem column sat
 * in the middle of a 6.5in page. So the type scale, spacing and measure are
 * all pinned to absolute units here.
 *
 * Page-specific additions live in print-post.css, linked only by the blog.
 */

/* Advisory only: the print dialog's own orientation and margin settings win
 * over this in every major browser. It sets the default, and @page margin
 * reserves space for the headers and footers some browsers add. */
@page {
  size: letter portrait;
  margin: 0.6in 0.7in;
}

:root {
  /* Paper is not a screen: no dark background, no accent colour. */
  --bg: #fff;
  --fg: #000;
  --muted: #333;
  --accent: #000;
  --rule: #999;

  --content-w: none;
  --gutter: 0;
  --section-gap: 0.9rem;
}

html,
body {
  margin: 0;
  padding: 0;
  background: #fff;
}

body {
  color: #000;
  font-size: 9.5pt;
  line-height: 1.42;
  /* WebKit honours this; without it a dark-theme reader gets dark text on
     white paper with washed-out greys. */
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

a,
a:link,
a:visited {
  color: #000;
}

/* Chrome that only exists on screen. */
.skip-link,
.topbar,
.post-footer {
  display: none;
}

/* Cap the measure rather than filling the page.
 *
 * The browser's print dialog decides orientation, and its setting overrides
 * @page — no CSS can force portrait. So rather than assume, the text is
 * capped at a readable measure and centred. If the paper is portrait this
 * fills the page as before; if the reader has landscape selected, they get a
 * centred column instead of 121-character lines. */
.wrap {
  max-width: 7in;
  margin: 0 auto;
  padding: 0;
}

main {
  padding: 0;
}

h2 {
  font-size: 9pt;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 0.5rem;
}

/* A heading must never be stranded at the foot of a page. */
h2,
h1 {
  break-after: avoid;
}

p,
li {
  orphans: 2;
  widows: 2;
}

/* Animations do not belong on paper, and an element left at opacity 0 by a
   fill-mode would print blank. */
* {
  animation: none !important;
  opacity: 1 !important;
  transform: none !important;
}