/* Print / Save-as-PDF layout. Loaded with media="print", so it only ever
   applies to paper. Everything but the assembled book is dropped, and the
   book is re-coloured for ink regardless of the reader's screen theme. */

@page {
  margin: 20mm 18mm;
}

.skip-link,
.sticky-head,
.progress-strip,
.layout,
.book-toolbar,
.book-hint,
dialog {
  display: none !important;
}

html, body {
  background: #fff !important;
  color: #000 !important;
  margin: 0;
  padding: 0;
}

/* Printing straight from the wizard (Ctrl/Cmd+P) still prints the book:
   app.js assembles it on `beforeprint`, and this reveals the hidden section. */
.book-view,
.book-view[hidden] {
  display: block !important;
  max-width: none;
  margin: 0;
  padding: 0;
}

.book {
  background: transparent;
  color: #000;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  font-size: 11.5pt;
  line-height: 1.6;
}

.book-titlepage {
  border-bottom: 0;
  padding: 22vh 0 0;
  break-after: page;
  page-break-after: always;
}
.book-title { font-size: 30pt; }
.book-byline { font-size: 13pt; color: #000; }
.book-dedication { color: #333; }
.book-stamp { color: #555; }

.book-contents {
  border-bottom: 0;
  padding: 0;
  break-after: page;
  page-break-after: always;
}

.book-chapter {
  padding: 0;
  break-before: page;
  page-break-before: always;
}
/* Paper is always white, so the dark-ink mark wins regardless of the
   reader's screen theme — a dark-mode viewer would otherwise print the
   pale variant onto white and get nothing. */
.book-mark { display: block !important; width: 13mm; height: 13mm; margin-bottom: 4mm; }
.book-mark.is-dark { display: none !important; }

.book-chapter-number { color: #555; }
.book-chapter-title {
  font-size: 20pt;
  margin: .2rem 0 1.5rem;
  break-after: avoid;
  page-break-after: avoid;
}

.book-entry-prompt {
  color: #444;
  break-after: avoid;
  page-break-after: avoid;
}

.book-entry-text {
  orphans: 2;
  widows: 2;
}

.book-empty { display: none; }
