/* ═══════════════════════════════════════════════════════════════════════
   wordhoard-print.css — the floor, and the four forms.
   Served at https://thewordhoard.com/print/wordhoard-print.css beside
   wordhoard-print.js; the only copy lives in packages/core/print (ADR 0017).

   It is SERVED rather than pasted because the canonical seven-line print
   block sat in wordhoard-theme.css for weeks and not one room used it
   (Word Hoard — Offline & Print, the paper architecture, 2026-09-07).

   Four forms, and a room declares which one it is rendering (through
   wordhoard-print.js, which also sets the paper for each):
     .wh-sheet      one evening        letter portrait, one page each
     .wh-booklet    a month            letter landscape, 2-up, saddle-stitched
     .wh-cards      memory work        letter landscape, 4-up at 3x5, backs mirrored
     .wh-broadside  one thing, large   letter portrait, 18–24pt

   The type is the house's own, self-hosted beside this file at
   thewordhoard.com/fonts/ (packages/core/fonts, SIL OFL): IM Fell English
   for the text, Courier Prime for refs and speakers. Never Google Fonts: a
   printed sheet must not look different by machine, or by whether the house
   had wi-fi. The URLs are relative to this stylesheet, so they resolve to
   the front door from any room's origin (a CORS fetch, which the front door
   answers with Access-Control-Allow-Origin: *). The families carry house
   names, so a room's screen "IM Fell English" from Google can never stand
   in for them. A room may still set --wh-print-serif / --wh-print-mono.
   Nothing is downloaded until a form is printed (the well is display:none).
   ═══════════════════════════════════════════════════════════════════════ */

@font-face {
  font-family: "WH Print Fell"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/im-fell-english-roman.woff2") format("woff2");
}
@font-face {
  font-family: "WH Print Fell"; font-style: italic; font-weight: 400; font-display: swap;
  src: url("../fonts/im-fell-english-italic.woff2") format("woff2");
}
@font-face {
  font-family: "WH Print Mono"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("../fonts/courier-prime-regular.woff2") format("woff2");
}
@font-face {
  font-family: "WH Print Mono"; font-style: normal; font-weight: 700; font-display: swap;
  src: url("../fonts/courier-prime-bold.woff2") format("woff2");
}

/* Nothing below shows on screen. The forms are built into a hidden well and
   only the printer ever sees them. */
#wh-print { display: none; }

@media print {

  /* ── the floor: any page of an opted-in room, printed with Ctrl+P ───────
     Black on white, no chrome, no cost in ink. The generic half of the
     theme's own print block (wordhoard-theme.css), which stays where it is
     for the front door's own selectors. */
  body { background: #fff !important; color: #000 !important; }
  main { max-width: none; }
  .wh-noprint, .wh-nav-fab, .wh-nav-panel, nav, button { display: none !important; }
  a { color: #000 !important; text-decoration: none; }
  h1, h2, h3, h4 { break-after: avoid; page-break-after: avoid; }
  p, li { orphans: 2; widows: 2; }

  /* ── when a form is up, the page IS the form ─────────────────────────── */
  body.wh-printing { margin: 0 !important; padding: 0 !important; }
  body.wh-printing > *:not(#wh-print) { display: none !important; }
  body.wh-printing #wh-print { display: block !important; }
  #wh-print {
    font-family: var(--wh-print-serif, "WH Print Fell", Georgia, "Times New Roman", serif);
    color: #000; font-size: 11pt; line-height: 1.4;
    -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  #wh-print * { box-sizing: border-box; }
  #wh-print .ref, #wh-print .who {
    font-family: var(--wh-print-mono, "WH Print Mono", "Courier New", ui-monospace, monospace);
  }

  /* ── 1. THE SHEET — one evening ──────────────────────────────────────── */
  .wh-sheet .leaf { break-after: page; page-break-after: always; }
  .wh-sheet .leaf:last-child { break-after: auto; page-break-after: auto; }
  .wh-sheet .leaf h2 { font-size: 15pt; margin: 0 0 .18in; }
  .wh-sheet .part { margin-bottom: .16in; break-inside: avoid; page-break-inside: avoid; }
  .wh-sheet .who {
    font-weight: 700; font-size: 8.5pt; line-height: 1.2; letter-spacing: .08em;
    text-transform: uppercase; color: #444;
  }
  .wh-sheet .said { font-size: 11pt; line-height: 1.45; }

  /* ── 2. THE BOOKLET — a month, folded once, stapled in the fold ──────── */
  .wh-booklet .sheet {
    position: relative; width: 11in; height: 8.5in; display: flex; overflow: hidden;
    break-after: page; page-break-after: always;
  }
  .wh-booklet .sheet:last-child { break-after: auto; page-break-after: auto; }
  .wh-booklet .half {
    position: relative; width: 5.5in; height: 8.5in;
    padding: .5in .45in .6in; display: flex; flex-direction: column; overflow: hidden;
  }
  /* the fold: a hairline a person can aim at, not a printed rule */
  .wh-booklet .half:nth-child(1) { border-right: 1px dotted #bbb; }
  .wh-booklet .half .body { flex: 1; overflow: hidden; }
  .wh-booklet .pgnum, .wh-booklet .runhead { position: absolute; bottom: .3in; }
  .wh-booklet .pgnum { font-size: 9.5pt; color: #333; }
  .wh-booklet .runhead { font-style: italic; font-size: 8.5pt; color: #666; }
  /* numbers at the outer corners, running heads toward the fold */
  .wh-booklet .half:nth-child(1) .pgnum   { left: .45in; }
  .wh-booklet .half:nth-child(2) .pgnum   { right: .45in; }
  .wh-booklet .half:nth-child(1) .runhead { right: .45in; }
  .wh-booklet .half:nth-child(2) .runhead { left: .45in; }

  /* the duplex test's own pages */
  .wh-booklet .dt { text-align: center; padding-top: .7in; }
  .wh-booklet .dt .arrow { font-size: 72pt; line-height: 1; font-weight: 700; }
  .wh-booklet .dt .big { font-size: 40pt; font-weight: 700; letter-spacing: .06em; margin-top: .1in; }
  .wh-booklet .dt .n { font-size: 11pt; color: #555; margin: .12in 0 .4in; }
  .wh-booklet .dt p { font-size: 12pt; line-height: 1.5; text-align: left; margin: 0 0 .8em; }
  /* clear of the footers and of a home printer's unprintable edge */
  .wh-booklet .dt-wrong {
    position: absolute; left: .45in; right: .45in; bottom: 1in; transform: rotate(180deg);
    text-align: center; font-size: 11pt; font-weight: 700; color: #000;
  }

  /* ── 3. THE CARDS — 4-up at 3x5, backs mirrored ──────────────────────
     Four 5in x 3in cards centred on a landscape sheet; crop marks sit in the
     margin at every cut line. The same layout on plain paper, glued to index
     cards, is how this has been done for a century. */
  .wh-cards .cardsheet {
    position: relative; width: 11in; height: 8.5in; overflow: hidden;
    display: grid; grid-template-columns: 5in 5in; grid-template-rows: 3in 3in;
    padding: 1.25in .5in;
    break-after: page; page-break-after: always;
  }
  .wh-cards .cardsheet:last-child { break-after: auto; page-break-after: auto; }
  .wh-cards .crop { position: absolute; display: block; background: #000; }
  .wh-cards .crop.v { width: .5pt; height: .3in; margin-left: -.25pt; }
  .wh-cards .crop.h { height: .5pt; width: .25in; margin-top: -.25pt; }
  .wh-cards .card {
    padding: .25in .3in; overflow: hidden;
    display: flex; flex-direction: column; justify-content: center;
    outline: .5pt dotted #ccc; outline-offset: -.5pt;   /* trimmed away with the cut */
  }
  .wh-cards .card.blank { outline: 0; }
  .wh-cards .card .ref  { font-weight: 700; font-size: 10pt; letter-spacing: .05em; }
  .wh-cards .card .text { font-size: 11pt; line-height: 1.35; }
  .wh-cards .card.face { text-align: center; }
  .wh-cards .card.face .ref  { font-size: 14pt; }
  .wh-cards .card.face .text { margin-top: .12in; }
  .wh-cards .card.back .ref  { margin-top: .12in; font-size: 8.5pt; color: #444; }

  /* ── 4. THE BROADSIDE — one thing, big ───────────────────────────────── */
  .wh-broadside .leaf {
    min-height: 9in; display: flex; flex-direction: column; justify-content: center;
    break-after: page; page-break-after: always;
  }
  .wh-broadside .leaf:last-child { break-after: auto; page-break-after: auto; }
  .wh-broadside .ref  { font-weight: 700; font-size: 13pt; letter-spacing: .08em; margin-bottom: .3in; }
  .wh-broadside .text { font-size: 22pt; line-height: 1.5; }
  .wh-broadside .text.short { font-size: 24pt; }
  .wh-broadside .text.long  { font-size: 18pt; }

  /* chord charts are monospace and their alignment IS the information */
  .chord-row, .lyric-row {
    font-family: "Courier New", ui-monospace, monospace !important;
    color: #000 !important; opacity: 1 !important; height: auto !important;
  }
}
