/* Print layout for every documentation page (browser Print / Save as PDF).
   Loaded after the doxygen-awesome sheets; nothing here applies on screen. */

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

@media print {
  /* The light palette is forced by the beforeprint handler in the header;
     this covers the page background when scripts are off. */
  html, body { background: #fff !important; }

  #top, #side-nav, #nav-path, .navpath, #main-nav, .sm-dox, #pf-search-row,
  .dark-mode-toggle, .pagefind-ui, .pf-search-trigger, footer, hr.footer, address.footer,
  .doxygen-awesome-fragment-copy-button, .doxygen-awesome-paragraph-link, a.anchorlink,
  .permalink, .interactive-toc, div.toc, .ui-resizable-handle, #MSearchSelectWindow,
  #MSearchResultsWindow {
    display: none !important;
  }

  /* The sidebar layout offsets and height-limits the content column. */
  #doc-content {
    margin: 0 !important; padding: 0 !important; height: auto !important;
    overflow: visible !important; position: static !important;
  }
  .contents, .header, div.headertitle {
    max-width: none !important; margin-left: 0 !important; margin-right: 0 !important;
    padding-left: 0 !important; padding-right: 0 !important;
  }
  /* The page title sits flush with the body text instead of being indented by
     the header padding. */
  .header .summary { display: none !important; }
  .header { border-bottom: 2px solid #e8383d !important; margin-bottom: 5mm !important; }
  .headertitle .title { margin: 0 !important; padding: 0 0 2mm !important; font-size: 22pt !important; }

  h1, h2, h3, h4, h5, h6 { break-after: avoid; }
  dl.section, img, .memitem, tr { break-inside: avoid; }
  img { max-width: 100%; height: auto; }
  .contents img { max-height: 110mm; width: auto; object-fit: contain; }
  a { text-decoration: none; }

  /* Code blocks: Doxygen lays every line out as a div inside a white-space:pre
     fragment, so the newlines between those divs print as blank lines, and the
     theme's hanging indent clips the first column. */
  div.fragment {
    white-space: normal !important; overflow: visible !important;
    margin-left: 0 !important; margin-right: 0 !important; max-width: 100% !important;
    box-sizing: border-box; font-size: 8.5pt !important; line-height: 1.35 !important;
    padding: 3mm 4mm !important; break-inside: auto;
  }
  div.fragment div.line {
    white-space: pre-wrap !important; overflow-wrap: anywhere; min-height: 1.35em;
    margin: 0 !important; padding: 0 !important; text-indent: 0 !important;
  }
  pre {
    white-space: pre-wrap !important; overflow-wrap: anywhere; font-size: 8.5pt;
    margin-left: 0 !important; margin-right: 0 !important; max-width: 100% !important;
    box-sizing: border-box; break-inside: auto;
  }
  div.fragment, pre, code, table th, dl.section, .memproto, .memname {
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }

  /* The theme turns tables into scrollable inline blocks, which on paper clips
     the right-hand columns and squeezes the rest into one word per line. A
     table wider than the page also makes Chrome shrink the whole document. */
  .contents table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname) {
    display: table !important; max-width: 100% !important;
    margin-left: 0 !important; margin-right: 0 !important;
  }
  .contents table:not(.memberdecls):not(.mlabels):not(.fieldtable):not(.memname) tbody {
    display: table-row-group !important;
  }
  table.doxtable td, table.doxtable th, table.markdownTable td, table.markdownTable th {
    padding: 1mm 1.8mm !important; font-size: 8.5pt !important; line-height: 1.3 !important;
    overflow-wrap: break-word;
  }
  table.doxtable td p, table.markdownTable td p { margin: 0 !important; }
  table.doxtable caption { font-size: 9pt !important; text-align: left; padding: 0 0 1mm !important; }
  .contents td, .contents th { white-space: normal !important; }
  .contents td code, .contents th code { white-space: normal !important; overflow-wrap: anywhere; }

  /* Chrome rasterises box-shadow into the PDF; the theme draws table outlines
     with it, so tables get a real border instead. */
  *, *::before, *::after { box-shadow: none !important; text-shadow: none !important; }
  table.doxtable, table.markdownTable {
    border: 1px solid var(--separator-color, #dedede) !important; border-collapse: collapse !important;
  }
}
