/* memoria-print.css — the Memoria's own pages, loaded AFTER the shared layer
   (https://thewordhoard.com/print/wordhoard-print.css).

   THE SPLIT (2026-09-26). The shared layer owns the paper: the floor any
   Ctrl+P gets, the @page for each form, the Booklet's imposition, its page
   numbers and running head, and the Sheet's leaves. It does not know what a
   held piece looks like, and it is not meant to. What stays here is only what
   the Memoria prints and no other room does: the cover, the contents with
   their page numbers, a piece with its dates, the record under it ("heard
   by …"), the door, the colophon. The old A5 print.css (one piece per page,
   the make_book.py prototype's shape) is retired: its paper and its hiding of
   the page are the shared layer's now.

   These rules are NOT print-only, on purpose. memoria.js lays the book out
   by measuring each page in an off-screen box (.m-measure) with these same
   rules, because a Booklet page that overflows its half-sheet is clipped,
   not reflowed. Every size is in pt or in, so the screen measures what the
   printer prints. Nothing here matches anything on the screen page: every
   selector starts at .m-book.

   The type is the layer's own (2026-09-26): "WH Print Fell" and "WH Print
   Mono", self-hosted at thewordhoard.com/fonts/ and declared by the shared
   stylesheet, so the book prints in the same face on every machine. Nothing
   on the screen ever loaded "IM Fell English", so the book used to set in
   whatever serif the machine had. memoria.js waits for the faces before it
   measures a page (WordHoardPrint.fontsReady()), or it would measure one
   face and print another. */

.m-book {
  font-family: var(--wh-print-serif, "WH Print Fell", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif);
  color: #000; font-size: 10.5pt; line-height: 1.42; font-variant: normal; letter-spacing: 0;
}
.m-book * { margin: 0; padding: 0; box-sizing: border-box; }
.m-book .m-mono { font-family: var(--wh-print-mono, "WH Print Mono", "Courier New", ui-monospace, monospace); }

/* the off-screen box the pages are measured in: a Booklet page's body, 4.6in wide */
.m-measure { position: absolute; left: -10000px; top: 0; width: 4.6in; visibility: hidden; display: flow-root; }

/* the cover */
.m-book .m-cover { text-align: center; padding-top: 1.6in; }
.m-book .m-mark { color: #7a6021; font-size: 18pt; letter-spacing: .5em; text-indent: .5em; }
.m-book .m-cover h1 { font-variant: small-caps; letter-spacing: .08em; font-size: 26pt; font-weight: 600; line-height: 1.1; margin: 6pt 0 12pt; }
.m-book .m-cover .m-name { font-size: 14pt; margin-bottom: 4pt; }
.m-book .m-cover .m-vol { font-size: 11pt; font-style: italic; margin-bottom: 4pt; }
.m-book .m-cover .m-epi { font-style: italic; font-size: 10.5pt; color: #333; margin: 18pt auto 0; max-width: 3.4in; }
.m-book .m-cover .m-facts { font-size: 8pt; color: #333; margin-top: 22pt; line-height: 1.6; }

/* headings shared by contents, a piece, the door */
.m-book h2.m-h { font-variant: small-caps; letter-spacing: .05em; font-weight: 600; font-size: 13.5pt; line-height: 1.2; border-bottom: 1px solid #7a6021; padding-bottom: 3pt; margin-bottom: 5pt; }
.m-book .m-cont { font-size: 8.5pt; color: #555; font-style: italic; margin-bottom: 6pt; }

/* contents: title, source, a dotted leader, the page */
.m-book .m-toc-line { display: flex; align-items: baseline; gap: 4pt; font-size: 10pt; line-height: 1.35; padding: 1.5pt 0; }
.m-book .m-toc-line .m-t { flex: 0 1 auto; overflow-wrap: anywhere; }
.m-book .m-toc-line .m-t i { color: #444; }
.m-book .m-toc-line .m-lead { flex: 1 1 .3in; border-bottom: 1px dotted #888; transform: translateY(-3pt); min-width: .3in; }
.m-book .m-toc-line .m-pg { flex: 0 0 auto; font-variant-numeric: tabular-nums; }
.m-book .m-toc-shelf { font-variant: small-caps; letter-spacing: .08em; color: #7a6021; font-size: 9pt; margin-top: 6pt; }

/* a piece */
.m-book .m-source { font-style: italic; color: #333; font-size: 10pt; margin-bottom: 2pt; }
.m-book .m-dates { font-size: 7.5pt; color: #444; line-height: 1.45; margin-bottom: 8pt; }
.m-book .m-line { min-height: 1.42em; overflow-wrap: anywhere; }
.m-book .m-line.m-v { padding-left: 1.2em; text-indent: -1.2em; }       /* verse: a wrapped line hangs */
.m-book .m-line.m-p + .m-line.m-p { margin-top: 3pt; }                   /* prose: paragraphs part a little */

/* the record under a piece: oldest first, one fact to a line */
.m-book .m-rec-h { font-variant: small-caps; letter-spacing: .1em; font-size: 8.5pt; color: #7a6021; border-top: 1px dotted #999; padding-top: 4pt; margin-top: 10pt; }
.m-book .m-rec { font-size: 7.5pt; line-height: 1.45; color: #222; padding-left: 1em; text-indent: -1em; }
.m-book .m-rec .m-heard { font-style: italic; }

/* the door, and the colophon */
.m-book .m-door { font-size: 9.5pt; line-height: 1.4; padding: 2pt 0; }
.m-book .m-door i { color: #444; }
.m-book .m-colophon { text-align: center; padding-top: 2.4in; font-size: 9pt; color: #333; line-height: 1.6; }
.m-book .m-colophon .m-mark { font-size: 14pt; margin-bottom: 8pt; }
.m-book .m-colophon p + p { margin-top: 8pt; }

/* the Sheet (one piece, letter portrait): the same book, a size up */
.m-book.m-sheet { font-size: 12pt; line-height: 1.5; }
.m-book.m-sheet .m-source { font-size: 11pt; }
.m-book.m-sheet .m-dates { font-size: 8.5pt; }
.m-book.m-sheet .m-rec-h { font-size: 9.5pt; margin-top: 16pt; }
.m-book.m-sheet .m-rec { font-size: 9pt; }
.m-book.m-sheet .m-line { break-inside: avoid; }

@media print {
  /* the floor, for what only this room has on screen */
  #cascade, .toast, footer { display: none !important; }
  /* This room's body is a full-height flex column on screen. Printed, a flex
     body keeps the form from breaking across pages, so while a form is up the
     body is a plain block again. */
  body.wh-printing { display: block !important; min-height: 0 !important; }
}
