/* Printing. Any page prints as just its text and pictures: the theme's
   bar, sidebars, footer and buttons stay on screen. The print edition
   (singlehtml, html[data-edition="print"]) is the whole guide on one
   page, each chapter starting on a new sheet. print.js prints the light
   screenshots and colors whatever the reader's theme. */

/* On screen: the print edition's own banner, and no search (it has no
   search page). The front page's tip pointing here isn't needed here. */
.wpsd-print-banner { display: none; }
html[data-edition="print"] .wpsd-print-banner {
  display: block;
  position: sticky;
  top: 3.5rem;  /* just under the fixed top bar */
  z-index: 10;
  background: var(--nftt-body-bg);
  color: var(--nftt-body-color);
  margin: 0 0 1.5rem;
  padding: 0.75rem 1rem;
  border: 1px solid var(--nftt-border-color, #c9d0db);
  border-radius: 6px;
}
html[data-edition="print"] .wpsd-print-banner p { margin: 0; }
html[data-edition="print"] #snftt-nav-bar form,
html[data-edition="print"] #snftt-nav-bar [data-bs-target="#nfttSearch"],
html[data-edition="print"] .print-tip { display: none !important; }

@media print {
  #back-to-top-container,
  #snftt-nav-bar,
  .nftt-sidebar,
  .nftt-toc,
  .nftt-footer,
  #content nav[aria-label="breadcrumb"],
  .wpsd-print-banner,
  .print-tip,
  .headerlink,
  .copybtn,
  .mermaid-fullscreen-btn,
  dialog.wpsd-lightbox { display: none !important; }

  @page { margin: 16mm 14mm; }

  html, body { background: #fff !important; color: #000 !important; }
  :root { font-size: 11pt !important; }
  body { padding: 0 !important; margin: 0 !important; }

  .container-fluid, .nftt-page, .nftt-content {
    display: block !important;
    width: auto !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  a { color: inherit !important; text-decoration: underline; }
  #content img { max-width: 100% !important; height: auto !important; cursor: auto; }

  h1, h2, h3, h4 { break-after: avoid; page-break-after: avoid; }
  img, figure, table, pre, .admonition, .highlight { break-inside: avoid; page-break-inside: avoid; }
  p, li { orphans: 3; widows: 3; }

  /* The print edition: every chapter on a new sheet. */
  html[data-edition="print"] .toctree-wrapper > section { break-before: page; page-break-before: always; }
}
