/* R6 B7 — print only the content column: no nav/sidebar/header/footer, no
 * images by default (a `.print-images` class on <body>/wrapper opts back in),
 * and admonitions/headings don't split across a page break. */
@media print {
  .md-header,
  .md-sidebar,
  .md-tabs,
  .md-footer,
  .md-nav,
  .md-search,
  .md-top,
  .jump-bar,
  .progress-bar,
  .wakelock-toggle,
  .md-content__button,
  .md-source-file,
  .md-typeset .headerlink,
  .md-typeset .footnote-backref {
    display: none !important;
  }

  .md-main__inner,
  .md-content,
  .md-grid {
    margin: 0 !important;
    max-width: 100% !important;
    padding: 0 !important;
  }

  .md-typeset { font-size: 11pt; }

  .md-typeset img { display: none; }
  .print-images .md-typeset img { display: inline-block; max-width: 100%; }

  .md-typeset .admonition,
  .md-typeset details,
  .md-typeset table {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Collapsed <details> (e.g. step pages' "What you're looking at") must be
   * readable on paper — nothing to click there. Force every details block
   * open regardless of its `open` attribute. Chromium ≥131 / WebKit ≥18.4 put
   * the closed body behind `::details-content { content-visibility: hidden }`,
   * where the child-display rule alone is a no-op (measured, Chrome 152); the
   * display rules stay for engines without the pseudo-element. */
  .md-typeset details:not([open])::details-content {
    content-visibility: visible !important;
  }
  .md-typeset details:not([open]) {
    display: block;
  }
  .md-typeset details:not([open]) > *:not(summary) {
    display: block !important;
  }

  .md-typeset h1,
  .md-typeset h2,
  .md-typeset h3 {
    break-after: avoid;
    page-break-after: avoid;
  }

  .print-page-break { break-before: page; page-break-before: always; }
}

/* Fastener gauge (docs/print/bin-labels.md, scripts/build_printables.py): the SVG is
 * drawn in mm and must print 1:1, so the screen-only max-width is lifted on paper
 * and the drawing never splits across a page. */
@media print {
  .fastener-gauge { break-inside: avoid; page-break-inside: avoid; }
  .fastener-gauge svg.fastener-gauge__svg {
    width: 172mm !important;
    max-width: none !important;
    height: auto !important;
  }
}
