/* ============================================================================
   claudia-print.css  ·  JIS-B5 print rules for Nipyon Go!
   Link LAST. Turns the stacked screen preview into a clean B5 print/PDF.
   In the browser print dialog: paper = B5, margins = None, Background graphics = ON.
   ========================================================================== */

@page {
  size: 182mm 257mm;   /* JIS-B5 */
  margin: 0;
}

@media print {
  html, body {
    background: #fff !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  /* hide screen-only chrome */
  .screen-only { display: none !important; }

  /* each .page becomes exactly one printed sheet */
  .page {
    width: 182mm !important;
    height: 257mm !important;
    min-height: 257mm !important;
    max-height: 257mm !important;
    margin: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    break-after: page;
    page-break-after: always;
    overflow: hidden !important;
  }
  .page:last-child { page-break-after: auto; }

  /* keep the brand colours/fills when printing */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  /* avoid awkward splits inside teaching components */
  .kanji-card, .dialogue, .quest, .cast-card, .chira-core, .chira-grammar,
  .chira-accent, .chira-bento, .turn, .haiku, .polaroid {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* The print-fit compaction layer (2026-07-05) was removed on 2026-11-05 (DECISIONS D23):
   every page is now one true B5 sheet on screen, so paper prints exactly what the screen shows.
   tools/build_release.mjs fails if a page runs past its sheet in print. */
