/* Print.
 *
 * Serves twice: what a reader gets from the browser's print dialog, and what
 * generates the CV PDF once data/cv.yaml is complete (plan 3.3). Those being
 * the same stylesheet is what stops the printed page and the downloaded file
 * from becoming two different documents.
 *
 * Printing is ink on paper, so the dark sheet is irrelevant and the design's
 * hairlines carry the structure exactly as they do on screen. */

@media print {
  /* Force the light sheet regardless of the reader's theme. */
  :root,
  :root[data-theme='dark'] {
    --bg-page: #fff;
    --bg-raised: #fff;
    --bg-subtle: #fff;
    --text-primary: #000;
    --text-secondary: #222;
    --text-tertiary: #555;
    --border-default: #ccc;
    --border-strong: #000;
    --accent: #000;
    --text-accent: #000;
  }

  @page {
    margin: 18mm 16mm;
  }

  html,
  body {
    background: var(--bg-page);
  }

  .sheet {
    min-height: 0;
    padding: 0;
  }

  .container {
    max-width: none;
  }

  /* Chrome, the live clock, the theme toggle and the grid overlay are all
     screen furniture. */
  .nav,
  .footer,
  .grid-overlay,
  .toast,
  .button,
  .backlink,
  .notice {
    display: none;
  }

  /* The overlay sets display:block when revealed, so hiding it on paper needs
     to match that specificity rather than reach for !important. */
  .grid-overlay[data-visible] {
    display: none;
  }

  /* The mono label column becomes a heading above its section: a 160px gutter
     wastes a fifth of the page width on paper. */
  .section {
    display: block;
    padding: var(--space-5) 0;
    break-inside: avoid;
  }

  .section__label {
    margin-bottom: var(--space-3);
  }

  .page-header {
    display: block;
    padding: 0 0 var(--space-5);
  }

  .display {
    font-size: 32pt;
  }

  .display--page {
    font-size: 28pt;
  }

  .lead {
    max-width: none;
    font-size: 11pt;
  }

  .list-row {
    grid-template-columns: 36pt minmax(0, 1fr) auto;
    padding: var(--space-3) 0;
    break-inside: avoid;
  }

  .list-row__title {
    font-size: 12pt;
  }

  .list-row__description,
  .practice__body {
    font-size: 10pt;
  }

  /* A URL a reader cannot click should still be readable. */
  a[href^='http']::after {
    content: ' (' attr(href) ')';
    font-family: var(--font-mono);
    font-size: 8pt;
    color: var(--text-tertiary);
  }
}
