/* Print / Save-as-PDF. Linked with media="print", so it only applies when
   printing — both the #/print report and the live reader (print the chapter
   you're reading). Strips the UI, lays text on white paper, keeps the reader's
   text settings (the inline CSS vars survive) and any highlight colours. */

@page { margin: 18mm 16mm; }

/* Every decorative gold/tinted element (head/tailpiece ornaments, the
   parashah-name band, acrostic/scribal marks, song banners, the Torah-closing
   colophon…) derives its colour from these three custom properties, not a
   fixed hex — so overriding them once here fixes all of them at once,
   including the SVG ornaments (fill="var(--foil)" inside the <symbol>s in
   index.html, which inherits a custom property override same as any other
   element). Un-overridden, --foil/--foil-ink stay whatever the *screen*
   theme last resolved to — often the pale gold meant for a dark background
   or leather cover, which is nearly invisible on white paper. Contrast-
   checked against white: #6b4e18 is 7.7:1 (AAA), #333 is 12.6:1. */
:root {
  --foil: #6b4e18 !important;
  --foil-ink: #6b4e18 !important;
  --accent-ink: #333 !important;
}
/* Several of the elements above additionally dim themselves with opacity
   (a deliberate quiet touch against a live background) — on white paper
   that stacks with the already-conservative colours above and washes back
   out, so those specific ones are reset to fully opaque for print. */
.colophon-gloss, .parashah-mark .pm-name, .acrostic-mark .ac-name,
.scribal-mark .sm-he, .song-head .song-name, .song-mark .song-mark-name {
  opacity: 1 !important;
}

#topbar,
.reader-controls,
.par-toggles,
.chapnav,
.edition-tabs,
.star,
.linkcopy,
.hl-bar,
#toast,
.print-controls,
.search-bar,
.divider { display: none !important; }

body { background: #fff !important; color: #000 !important; }
#app { max-width: none; margin: 0; padding: 0; background: #fff !important; }

[data-theme="dark"] body .t.he,
[data-theme="dark"] body .t.en,
[data-theme="dark"] body .t.grc {
  text-shadow: none;
}

/* Force readable colours on paper (override accent / foil text). */
.chapter-title, .chapter-title .bne, .t, .vn, .vnum-inline, .reader-para,
.snippet, .result-open,
.section-head h2, .print-doc-title, .print-doc-sub, .print-doc-date,
.print-section-head, .print-item-label, .print-search-head, .print-more {
  color: #000 !important;
  -webkit-text-fill-color: #000 !important;
}

/* Keep passages / items from splitting across pages. */
.verse, .lv, .parallel .pv, .result, .print-item, .print-search { break-inside: avoid; }
.print-section-head, .print-search-head, .chapter-title { break-after: avoid; }
/* A lone stranded line at the top/bottom of a page reads as a mistake in a
   printed book — classic print-typography minimums, not applied on screen. */
.reader-para { orphans: 3; widows: 3; }

/* Tighten verse rules for print, like a printed psalter. */
.verse, .lv { border-bottom: none !important; padding: 0.06rem 0 !important; }
.parallel .pv, .pv-gutter { border-bottom: none !important; }

/* Keep highlighter colours when printing. */
.hl-mark, mark[data-color] {
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

/* Notes print as quiet quotes. */
.note-input, .print-note {
  border-left: 2px solid #999 !important;
  color: #333 !important;
  -webkit-text-fill-color: #333 !important;
}

a { color: #000 !important; text-decoration: none; }
.result { border-color: #ccc !important; }
.print-doc { border: none !important; padding: 0 !important; background: #fff !important; }
