/* Print / PDF styles for the CV. Loaded with media="print" only.
   Everything you might want to restyle is in the variables block below. */

@media print {
  :root,
  :root:not([data-theme="light"]),
  :root[data-theme="dark"],
  :root[data-theme="light"] {
    color-scheme: light;

    /* colour (text pairs are all >= 4.5:1 on white) */
    --p-paper: #fff;
    --p-ink: #111;
    --p-dim: #4a4a4a;
    --p-rule: #dadada;      /* decoration only, never text */
    --p-rule-strong: #b4b4b4;

    /* type */
    --p-serif: "Newsreader Print", Georgia, "Times New Roman", serif;
    --p-sans: "Hanken Print", Arial, Helvetica, sans-serif;
    --p-body: 10.5pt;
    --p-leading: 14.5pt;
    --p-label: 8pt;
    --p-caption: 9pt;
    --p-name: 12pt;
    --p-title: 26pt;
    --p-stat: 21pt;
    --p-stat-long: 12.5pt;
    --p-role: 12.5pt;

    /* space */
    --p-gap: 4mm;
    --p-section: 6mm;
    --p-indent: 4mm;
    --p-label-col: 28mm;
  }

  @page { size: A4; margin: 18mm; }

  html, body { background: var(--p-paper) !important; color: var(--p-ink) !important; }
  body {
    font: 400 var(--p-body)/var(--p-leading) var(--p-serif);
    overflow: visible;
    padding: 0;
  }
  * {
    animation: none !important;
    transform: none !important;
    box-shadow: none !important;
    letter-spacing: 0 !important;
    font-variant-ligatures: none !important;
    font-feature-settings: "liga" 0, "clig" 0 !important;
  }
  .stat b, .role h3 { opacity: 1 !important; }
  a { color: inherit; text-decoration: underline; text-decoration-thickness: .3pt; text-underline-offset: 1.2pt; text-decoration-color: #777; }

  /* things that only exist on screen */
  .noprint, .cord, nav.rail-nav, .role .side, .hero .links, footer, .scr, .ext, li.x, .cols > div.x, .cols p.x, .sum, .role .lead { display: none !important; }
  .prt { display: inline; }
  .pc { display: inline; }
  .sp { display: none; }

  /* shared label style */
  .label, .rl, .cols h2, .xp-head h2 {
    font: 500 var(--p-label)/1.4 var(--p-sans);
    letter-spacing: .04em !important;
    text-transform: uppercase;
    color: var(--p-dim);
  }

  /* header */
  .hero { min-height: 0; display: block; text-align: center; padding: 0 0 3mm; }
  .nm { display: flex; align-items: baseline; justify-content: center; gap: 3mm; }
  .nm b { font: 500 var(--p-name)/1.2 var(--p-sans); }
  .hero h1 { font: 300 var(--p-title)/1 var(--p-serif); margin: 3.5mm 0 2.5mm; text-wrap: initial; font-variation-settings: normal; }
  .hero p.l { font: 400 var(--p-body)/var(--p-leading) var(--p-sans); color: var(--p-dim); max-width: none; margin: 0 auto; }
  .hero p.l em { font: italic 400 1em var(--p-serif); }
  .hero p.contact { display: block; margin-top: 2.5mm; font: 400 9.5pt/1.4 var(--p-sans); color: var(--p-ink); }

  /* summary */
  .wrap { max-width: none; padding: 0; }
  .sum { max-width: none; margin: 0; padding: var(--p-gap) 0; display: block; border-top: .4pt solid var(--p-rule-strong); }
  .sum p { font: 400 var(--p-body)/var(--p-leading) var(--p-serif); }

  /* stat grid: number then caption, in source order */
  .stats {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.4mm 6mm;
    padding: 2.2mm 0; border-top: .4pt solid var(--p-rule); border-bottom: .4pt solid var(--p-rule);
  }
  .stat { display: block; padding: 0; border: 0; break-inside: avoid; }
  .stat b { display: block; font: 300 var(--p-stat)/1.05 var(--p-serif); margin-bottom: 1mm; }
  .stat.long b { font-size: var(--p-stat-long); line-height: 1.2; padding-top: 1.6mm; margin-bottom: 1.2mm; }
  .stat div { display: block; }
  .stat p { font: 400 var(--p-caption)/1.25 var(--p-serif); max-width: none; }
  .stat .label { display: block; margin-top: .8mm; }

  /* experience */
  .xp { max-width: none; padding: 4mm 0 0; }
  .xp-head { padding: 0 0 2mm; break-after: avoid; }
  .xp-head h2 { margin: 0; }
  .shell { display: block; }
  .roles { padding: 0; }
  .role { display: block; padding: 2mm 0 .4mm; border-top: .4pt solid var(--p-rule); scroll-margin: 0; }
  .role > div:last-child { border: 0; margin: 0; padding: 0; }
  .role h3 { font: 400 var(--p-role)/1.2 var(--p-serif); letter-spacing: 0; margin: 0 0 .6mm; break-after: avoid; }
  .role .pdates { display: inline; margin-left: 3mm; font: 400 var(--p-label)/1 var(--p-sans); color: var(--p-dim); }
  .role .rl { font-family: var(--p-sans); line-height: 1.4; color: var(--p-dim); margin: 0 0 1.2mm; break-after: avoid; break-inside: avoid; text-transform: none; font-size: 9pt; font-weight: 400; letter-spacing: 0 !important; }
  .role .rl br { display: none; }
  .role .rl i::after { content: " · "; font-weight: 400; }
  .role li:first-child { break-before: avoid; }
  .roles > .role:first-child, .roles > .role:first-of-type { border-top: 0; padding-top: 0; }
  .role .rl i { color: var(--p-ink); font-style: normal; font-weight: 400; }
  .role ul { display: block; max-width: none; margin: 0; }
  .role li {
    padding: 0 0 .55mm var(--p-indent); text-indent: calc(-1 * var(--p-indent)); margin: 0; border: 0;
    font: 400 var(--p-body)/var(--p-leading) var(--p-serif);
    break-inside: avoid; orphans: 2; widows: 2;
  }
  .role li:first-child { padding-top: 0; }
  .role li::before { content: "–"; display: inline-block; width: var(--p-indent); text-indent: 0; }

  /* earlier career: header on one line */
  h3.eh { display: block; font: 500 var(--p-label)/1.4 var(--p-sans); text-transform: uppercase; letter-spacing: .04em !important; color: var(--p-dim); margin: 2mm 0 0; padding-top: 1.6mm; border-top: .4pt solid var(--p-rule-strong); break-after: avoid; }
  .role.early { padding: 1.2mm 0 0; border-top: 0; break-inside: avoid; }
  .role.early h3, .role.early .rl, .role.early .rl i { display: inline; }
  .role.early h3 { font-size: 10.5pt; }
  .role.early .rl { margin: 0 0 0 3mm; }
  .role.early .rl br { display: none; }
  .role.early .rl i::after { content: " · "; font-weight: 400; }
  .role.early ul { margin-top: .4mm; }

  /* selected work, skills, writing, teaching, education */
  .cols { display: block; padding: 3mm 0 0; margin-top: 1.5mm; border-top: .4pt solid var(--p-rule-strong); }
  .cols > div { display: grid; grid-template-columns: var(--p-label-col) 1fr; gap: 0 3mm; padding: 0 0 .8mm; break-inside: avoid; }
  .cols h2 { margin: .5mm 0 0; }
  .cols p { max-width: none; font: 400 var(--p-body)/var(--p-leading) var(--p-serif); }
  .cols p + p { margin-top: 0; }
}
