/* Print / PDF for the scrolling catalogues (cold rooms … plumbing). The PDFs are made with
   assets-src/megaclad-catalog/make-flow-pdf.cjs; this also makes the browser's own Print look right.
   The cover fills page 1, then sections flow on; cards, pictures and tables are kept whole; the 3D builder and
   viewer, the planners and other screen-only parts are left out. Page-specific fixes stay in each page. */
@page { size: A4; margin: 0 0 11mm; }
@media print {
  html, body { background: #fff; }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
  .reveal, .rv, [data-reveal] { opacity: 1 !important; transform: none !important; }

  /* screen-only parts */
  #builder, #see-3d, #planner, .cta-row, .acts, .no-print, .wa-float, .lb, .lightbox, .consent, video,
  .mcn, .mcn-sec, .mcn-act, .mcn-space, .print-btn, .dl { display: none !important; }

  /* sections flow on from one another (they are short); the cover gets page 1 to itself */
  /* a section that fits on a page is kept whole (moves to the next page rather than leaving its heading behind) */
  section { min-height: 0 !important; break-inside: avoid; }
  header.cover, section.cover { min-height: var(--pdf-page, 1540px) !important; break-after: page; box-sizing: border-box; display: flex; flex-direction: column; justify-content: center; }
  #contact { break-before: page; }
  .wrap > :first-child, .ckt, .marker, .tag, .sec-head, .shead, .head { break-after: avoid; break-inside: avoid; }
  /* job photo grids: shorter rows so a gallery fits on one page */
  .jobs { grid-auto-rows: 150px !important; }
  .jobs:has(> figure:nth-child(16)) { grid-auto-rows: 112px !important; }
  /* scroll boxes can't be split across pages in Chrome; let long tables run on */
  .sched, .tbl, .table-wrap { overflow: visible !important; }

  /* keep things whole */
  figure, img, svg, tr, li, blockquote, .card, .tile, .item, .row, .step, .spec, .fact, .grade, .type { break-inside: avoid; }
  h1, h2, h3, h4, .eyebrow, .kicker { break-after: avoid; }
  p { orphans: 3; widows: 3; }

  /* no sticky or fixed bits in print */
  [style*="position:sticky"], .sticky { position: static !important; }
}
