/* ===== Hippo — printing an exam onto paper ================================
   The 2026-09-04 call asked for "download the transcribed exam as a PDF and take
   it on paper". This is print CSS and window.print(): no library, no npm, no
   server round trip, no Claude call, and therefore no cost. The browser's own
   print dialog is the PDF writer.

   Same contract as quiz.css and home.css: scoped under body[data-ui="v2"], set
   only by quiz.js and only when localStorage.hippo_ui === "v2". Delete the
   <script src="print.js"> tag and the sheet is never built, so there is nothing
   to print and these rules have nothing to act on. ====================== */

/* On screen the sheet does not exist. It is only ever filled just before printing. */
body[data-ui="v2"] #print-sheet { display: none; }
body[data-ui="v2"] .qb-link.do-print[hidden] { display: none !important; }

@media print {
  /* Hide the application, show the sheet. Everything is listed rather than using a
     blanket rule so that a node added later is visible-by-accident rather than
     missing-by-accident — a missing question on a printed exam is the bad failure. */
  body[data-ui="v2"] .topbar,
  body[data-ui="v2"] .anon-bar,
  body[data-ui="v2"] .pane-left,
  body[data-ui="v2"] .pane-right,
  body[data-ui="v2"] .pane-lib,
  body[data-ui="v2"] .pane-home,
  body[data-ui="v2"] .quiz-actions,
  body[data-ui="v2"] #quiz-bar,
  body[data-ui="v2"] .toast,
  body[data-ui="v2"] .paywall,
  body[data-ui="v2"] .acct-modal,
  body[data-ui="v2"] .gate { display: none !important; }

  body[data-ui="v2"] #print-sheet { display: block; }
  body[data-ui="v2"] .split { display: block; padding: 0; margin: 0; }
  body[data-ui="v2"] { background: #fff; }

  @page { margin: 16mm 14mm; }

  #print-sheet {
    color: #000; background: #fff; font-size: 11pt; line-height: 1.45;
  }
  #print-sheet .ps-head { border-bottom: 1.5pt solid #000; padding-bottom: 6pt; margin-bottom: 12pt; }
  #print-sheet .ps-title { font-size: 15pt; font-weight: 700; margin: 0 0 3pt; }
  #print-sheet .ps-meta { font-size: 9.5pt; }
  #print-sheet .ps-name-line { margin-top: 8pt; font-size: 10pt; }

  /* A question must never be split across two sheets of paper: half a stem at the
     bottom of one page is the thing that makes a printout unusable. */
  #print-sheet .ps-q { break-inside: avoid; page-break-inside: avoid; margin-bottom: 11pt; }
  #print-sheet .ps-q-text { font-weight: 600; margin-bottom: 4pt; }
  #print-sheet .ps-opt { margin: 0 0 2pt 14pt; text-indent: -14pt; }
  #print-sheet .ps-blank { border-bottom: 0.7pt solid #666; height: 15pt; margin: 3pt 0 0 14pt; }
  #print-sheet .ps-blank + .ps-blank { margin-top: 8pt; }

  /* The key is a separate sheet ON PURPOSE. Printing it on the back of question 12 is
     the same as not having an exam to sit. */
  #print-sheet .ps-key { break-before: page; page-break-before: always; }
  #print-sheet .ps-key h2 { font-size: 13pt; margin: 0 0 8pt; }
  #print-sheet .ps-ans { break-inside: avoid; page-break-inside: avoid; margin-bottom: 6pt; font-size: 10pt; }
  #print-sheet .ps-ans b { font-weight: 700; }
  #print-sheet .ps-expl { font-size: 9.5pt; color: #333; margin-left: 14pt; }
  #print-sheet .ps-foot { margin-top: 14pt; font-size: 8.5pt; color: #555; }
}
