@media print {
  @page {
    margin: 2cm 2.5cm;
  }

  /* Global print overrides */
  body {
    font-size: 11pt;
    line-height: 1.5;
    color: #000;
    background: #fff;
    padding: 0;
    display: block;
  }

  nav,
  footer,
  .skip-link {
    display: none;
  }

  main {
    padding: 0;
  }

  h1 { font-size: 22pt; }
  h2 { font-size: 16pt; }
  h3 { font-size: 13pt; }

  /* Expand link hrefs — skip internal and anchor links */
  a[href^="http"]::after,
  a[href^="https"]::after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #555;
    word-break: break-all;
  }

  /* Avoid page breaks inside key elements */
  h2, h3, h4 {
    page-break-after: avoid;
  }

  p, li {
    page-break-inside: avoid;
  }

  pre, blockquote {
    page-break-inside: avoid;
    break-inside: avoid;
    border: 1px solid #ccc;
  }

  pre {
    background: #fff;
    color: #000;
    white-space: pre-wrap;
    word-break: break-all;
  }

  .code-block-lang,
  .code-block-copy {
    display: none;
  }

  /* CV-specific: avoid breaks mid-section */
  .cv-section {
    page-break-inside: avoid;
  }
}
