/* A4 print stylesheet — use with browser "Save as PDF" */

@page {
  size: A4 portrait;
  margin: 12mm 14mm 16mm;
}

@media print {
  :root {
    --a4-width: 100%;
  }

  html,
  body {
    background: white !important;
    font-size: 10pt;
  }

  .no-print {
    display: none !important;
  }

  .print-only {
    display: block !important;
  }

  .layout {
    display: block;
    max-width: none;
  }

  .main {
    padding: 0;
  }

  .a4-sheet {
    max-width: none;
    width: 100%;
    min-height: auto;
    margin: 0;
    padding: 0;
    box-shadow: none;
    border-radius: 0;
  }

  .doc-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    page-break-after: avoid;
  }

  .doc-title {
    font-size: 22pt;
  }

  .prose {
    font-size: 10pt;
    line-height: 1.55;
    color: #000;
  }

  .prose h1 {
    font-size: 16pt;
    page-break-after: avoid;
  }

  .prose h2 {
    font-size: 13pt;
    page-break-after: avoid;
    break-after: avoid;
  }

  .prose h3,
  .prose h4 {
    page-break-after: avoid;
    break-after: avoid;
  }

  .prose p,
  .prose li {
    orphans: 3;
    widows: 3;
  }

  .prose a {
    color: #000;
    text-decoration: none;
  }

  .prose a[href^='http']::after {
    content: ' (' attr(href) ')';
    font-size: 8pt;
    color: #555;
    word-break: break-all;
  }

  .prose a[href^='/']::after,
  .prose a[href^='#']::after {
    content: '';
  }

  .table-wrap {
    overflow: visible;
    border: 1px solid #ccc;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .prose table {
    font-size: 8.5pt;
  }

  .prose th {
    background: #eee !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .prose tr:nth-child(even) td {
    background: #f9f9f9 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .prose .code-block {
    background: #f5f5f5 !important;
    color: #111 !important;
    border: 1px solid #ddd;
    font-size: 8pt;
    page-break-inside: avoid;
    break-inside: avoid;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .prose .callout {
    background: #f5f5f5 !important;
    border-left-color: #666 !important;
    page-break-inside: avoid;
    break-inside: avoid;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .diagram {
    background: white !important;
    border: 1px solid #ccc;
    page-break-inside: avoid;
    break-inside: avoid;
    padding: 8px;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  .diagram svg {
    max-width: 100% !important;
  }

  .doc-pager {
    display: none;
  }

  .doc-footer {
    margin-top: 24px;
    font-size: 8pt;
    color: #666;
  }
}
