/* nvllst reader — print stylesheet
 * Linked with media="print" — no @media wrapper needed.
 *
 * Strategy: the user's reading preferences are already applied to
 * <html> as data-* attributes by the pre-paint resolver, and
 * reader.css rules respond to them. We don't override font, size,
 * line-height, or alignment — we just strip screen layout, hide
 * chrome, and map the measure preference to page margins. */

/* ── Page margins — honour measure preference ───────────────── */

@page                        { margin: 1in 1.1in; }
html[data-measure="narrow"]  { --print-margin-inline: 1.5in; }
html[data-measure="wide"]    { --print-margin-inline: 0.7in; }

/* @page can't read custom properties, so we nudge body padding
   as a proxy when the user has chosen a non-default measure. */
html[data-measure="narrow"] body { padding-inline: 0.4in; }
html[data-measure="wide"]   body { padding-inline: 0; }

/* ── Hide all reader chrome ─────────────────────────────────── */

.reader-header,
.reader-toc,
.reader-search,
.reader-prefs,
.audio-player,
.selection-toolbar,
.note-popup,
.chapter-nav,
.note-icon,
.bookmark-icon,
.note-tooltip {
  display: none !important;
}

/* ── Reset screen layout ────────────────────────────────────── */

html, body {
  background: white !important;
  color: black !important;
}

/* Reader surface variables that reference theme tokens won't
   resolve to anything meaningful in print — pin the essentials. */
.chapter {
  color: black !important;
  max-width: 100%;             /* override the ch-based reading column */
  padding: 0;
  margin: 0;
}

.reader-main {
  max-width: 100%;
  padding: 0;
  margin: 0;
}

/* ── Page-break hygiene ─────────────────────────────────────── */

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

.chapter p,
.chapter blockquote {
  orphans: 3;
  widows: 3;
}

/* ── Scene breaks — force SVG ornament to print ─────────────── */

.chapter hr.scene-break {
  -webkit-print-color-adjust: exact;
          print-color-adjust: exact;
  background-color: black;
  margin: 3lh auto;
}

/* ── Strip interactive decorations ─────────────────────────── */

/* .w spans become plain inline text */
.chapter .w {
  display: inline;
  background: none !important;
  box-shadow: none !important;
  padding: 0 !important;
}

/* Highlight colours */
.chapter .hi-yellow,
.chapter .hi-green,
.chapter .hi-blue,
.chapter .hi-pink {
  background: none !important;
  box-shadow: none !important;
}

/* Bookmarked paragraph tint */
.chapter .bookmarked {
  background: none !important;
  padding-inline: 0 !important;
  margin-inline: 0 !important;
}
