/* ---------------------------------------------------------------------------
   print.css — paper/PDF rendering for james.jcweatherhead.com
   Linked with media="print", so it has ZERO effect on screen.

   Strategy: every page derives its colours from the same :root design tokens
   (--bg, --text, --cream, --amber*, --line …). Re-defining those tokens inside
   @media print flips the ENTIRE site to an ink-friendly light palette in one
   move — no per-page class restyling needed for colour. We use `html:root` so
   the override outranks each page's inline `:root {}` regardless of source order.
   On top of that we: hide interactive chrome, linearise the landing layout,
   neutralise the few amber-filled badges, print URLs for content links, and
   guard against ugly page breaks.
--------------------------------------------------------------------------- */
@media print {

  /* 1 — Recolour the whole site by overriding the shared design tokens. */
  html:root {
    --bg:      #ffffff;
    --raise:   #ffffff;
    --card:    #ffffff;
    --cream:   #111111;   /* was the near-white display colour → now ink   */
    --text:    #1b1b1b;
    --dim:     #3d3d3d;
    --faint:   #666666;
    --amber:      #7a3f0d;  /* dark amber stays legible on white           */
    --amber-lit:  #7a3f0d;
    --amber-deep: #7a3f0d;
    --line:    #cfcfcf;
  }

  html { background:#fff; }
  body {
    background:#fff !important;      /* kill the radial amber wash          */
    color:#1b1b1b !important;
    font-size:10.5pt;
    line-height:1.45;
    -webkit-print-color-adjust:exact;
    print-color-adjust:exact;
  }

  /* 2 — Page box: generous, symmetric margins. */
  @page { margin:16mm 15mm; }

  /* 3 — Hide interactive / navigational chrome that means nothing on paper. */
  .skip,
  .bar,
  .home,
  .cats,
  .social,
  .docs,
  .more,
  .agent-cta,
  .agentbtn,
  .cta-row { display:none !important; }

  /* 4 — Landing: unstick the rail and linearise to a single column. */
  .shell   { display:block !important; }
  .rail    { position:static !important; max-height:none !important;
             overflow:visible !important; width:auto !important;
             border:0 !important; padding:0 !important; }
  .content { padding:0 !important; }

  /* 5 — Neutralise the amber-filled surfaces so nothing prints dark-on-dark. */
  .card--feature,
  .recognition,
  .pill--win {
    background:#fff !important;
    color:#7a3f0d !important;
  }
  .card--feature { border:1px solid #d8d8d8 !important; }
  .recognition   { border-left:3px solid #7a3f0d !important; }
  .pill--win     { border:1px solid #7a3f0d !important; }

  /* 6 — Content links: dark-amber, underlined, and print their target URL so
         a paper copy is self-contained. Scoped to prose/pubs to avoid noise. */
  .post a, .prose a, .pubs a, .foot a { color:#7a3f0d !important;
                                        text-decoration:underline; }
  .post a[href^="http"]::after,
  .prose a[href^="http"]::after,
  .pubs a[href^="http"]::after {
    content:" (" attr(href) ")";
    font-size:8.5pt;
    color:#666;
    word-break:break-all;
  }
  /* …but not when the visible text already IS the URL. */
  a[href^="mailto"]::after { content:""; }

  /* 7 — Keep related blocks intact across page breaks. */
  .card, .pub, .tl, .cert, .certs li, .skillset, .stat-strip,
  figure, img, pre, blockquote, .pull, .recognition, li {
    break-inside:avoid;
    page-break-inside:avoid;
  }
  h1, h2, h3, .sec__h, .name { break-after:avoid; page-break-after:avoid; }
  p, li { orphans:3; widows:3; }

  /* 8 — Media + preformatted diagrams. */
  img { max-width:100% !important; height:auto !important; }
  pre { font-size:7.5pt; line-height:1.25; white-space:pre;
        border:1px solid #d0d0d0 !important; }

  /* 9 — No motion / decoration on paper. */
  * { box-shadow:none !important; text-shadow:none !important;
      transition:none !important; animation:none !important; }
}
