/* ---------------------------------------------------------------------------
   print.css - what the PDF looks like.

   Loaded with media="print", so none of this affects the screen.
   The page size itself (portrait for the proposal, landscape for the deck) is
   injected by app.js just before the print dialogue opens.
--------------------------------------------------------------------------- */

@page { margin: 0; }

/* ---- strip the tool away ---- */
.no-print,
.topbar,
.panel,
.banners,
.progress,
.measure-ruler,
.menu,
.skip-link { display: none !important; }

html, body {
  background: #fff !important;
  margin: 0 !important;
  padding: 0 !important;
  width: auto !important;
  height: auto !important;
}

.layout { display: block !important; }

.output {
  display: block !important;
  padding: 0 !important;
  margin: 0 !important;
}

/* Never scale the pages in print - the sheet IS the page. */
.doc, .deck { zoom: 1 !important; display: block !important; gap: 0 !important; }

/* Hidden view stays hidden. */
[hidden] { display: none !important; }

/* ---- one sheet, one page ---- */
.sheet {
  box-shadow: none !important;
  border-radius: 0 !important;
  margin: 0 !important;
  width: 210mm !important;
  min-height: 296.6mm !important;   /* a hair under A4 so it never spills */
  height: 296.6mm !important;
  overflow: hidden;
  page-break-after: always;
  break-after: page;
  page-break-inside: avoid;
  break-inside: avoid;
}
.sheet:last-child { page-break-after: auto; break-after: auto; }

.slide {
  box-shadow: none !important;
  border-radius: 0 !important;
  margin: 0 auto !important;
  page-break-after: always;
  break-after: page;
  page-break-inside: avoid;
  break-inside: avoid;
}
.slide:last-child { page-break-after: auto; break-after: auto; }

/* The deck is 16:9 on an A4 landscape page, so centre it vertically. */
.deck .slide { margin-top: 21mm !important; }

/* ---- nothing splits awkwardly ---- */
.sec-head, .sub-head, .day-head,
.nep-card, .theme-card, .sign-panel,
.chart, figure, tr, .decl-doc li {
  page-break-inside: avoid;
  break-inside: avoid;
}
.sec-head, .sub-head, .day-head {
  page-break-after: avoid;
  break-after: avoid;
}
thead { display: table-header-group; }
p { orphans: 3; widows: 3; }

/* ---- editing affordances disappear ---- */
.editable { background: none !important; box-shadow: none !important; }
p.editable::after { content: none !important; display: none !important; }
[contenteditable] { -webkit-user-modify: read-only; }

/* ---- make sure the colours actually print ---- */
* {
  -webkit-print-color-adjust: exact !important;
  print-color-adjust: exact !important;
}

/* Links should not print as blue underlined URLs inside a formal document. */
a { color: inherit; text-decoration: none; }
