/* Print packet styling — linked with media="print" on every page. */
@page { margin: 2cm; }

.site-header, .sidebar, .site-footer, .print-action,
.theme-toggle, .header-search, .mobile-nav, .world-map, .crumb,
.toc, .heading-anchor, .skill-anchor, .skill-filter, .come-play {
  display: none !important;
}
body {
  background: #fff !important;
  color: #000 !important;
  font-size: 12pt;
  line-height: 1.5;
}
.shell { display: block; max-width: none; padding: 0; }
main { max-width: none; }
h1, h2, h3 { color: #000; }
main h1::after {
  content: " — Numina Reference";
  font-size: 0.5em;
  font-weight: normal;
  color: #444;
}
a { color: #000; text-decoration: none; }
main a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.85em; }
blockquote, table, li, dl { break-inside: avoid; }
.printable main h2 { break-before: page; }
.printable main h2:first-of-type { break-before: avoid; }

/* Card sheets are meant to be folded and carried, so they must stay dense: no
   per-section page breaks, tighter type, and tables that keep their rows
   together instead of spreading over several sheets. */
.cardsheet main h2 { break-before: auto; }
.cardsheet { font-size: 7.5pt; line-height: 1.18; }
.cardsheet main h1 { font-size: 14pt; margin-bottom: 0.15rem; }
.cardsheet main h1::after { content: none; }
.cardsheet main h2 { font-size: 10pt; margin: 0.35rem 0 0.1rem; }
.cardsheet main h3 { font-size: 8.5pt; margin: 0.25rem 0 0.05rem; }
.cardsheet main p { margin: 0.15rem 0; }
.cardsheet main .lede { font-size: 8pt; }
.cardsheet main table { margin: 0.15rem 0; width: 100%; }
.cardsheet main th, .cardsheet main td { padding: 1px 4px !important; }
.cardsheet main h2, .cardsheet main h3, .cardsheet main table { break-inside: avoid; }
.cardsheet main h2, .cardsheet main h3 { break-after: avoid; }
.infobox { float: none; border: 1px solid #999; box-shadow: none; }

/* neutralize screen ornamentation for print */
.orn { display: none !important; }
body { background-image: none !important; }
.card::before, .card::after,
.home-card::before, .home-card::after,
.infobox::before, .infobox::after,
.site-header::after, .site-footer::before,
.wordmark::before, hr::before, hr::after,
.shell main > h2::after { content: none !important; display: none !important; }
h1, h2, h3, h4, p::first-letter { text-shadow: none !important; }
.shell main > h2 { background: none !important; border-bottom: 1px solid #000; }
hr { background: none !important; border-top: 1px solid #999; }
/* Tables are wrapped in div.table-scroll on screen. On paper there is no
   scrolling to do and an overflow box would clip a wide table at the page
   edge instead of letting it break, so the wrapper is nothing here. */
.table-scroll { overflow: visible !important; }
table { border: 1px solid #999 !important; box-shadow: none !important; padding: 0 !important; }
th, td { border: 1px solid #999 !important; background: none !important; }
.infobox__flag { clip-path: none; box-shadow: none; }
blockquote { border-top: none; border-bottom: none; }

/* The character builder prints its card and nothing else: the form, the
   verdict, the notes and the lede are the screen's, and the card (rendered by
   build-view.js's renderCard) is the sheet. The page is cardsheet: true, so
   the dense rules above apply to it. */
.builder-page h1, .builder-page .lede, .builder-page .builder__unofficial, .builder-page [data-builder-needs-js],
.builder-page .builder__bar, .builder-page .builder__form, .builder-page .builder__verdict-section,
.builder-page .builder__card-section > h2, .builder-page .builder__card-section > .builder__hint {
  display: none !important;
}
.builder-page .sheet { border: none; padding: 0; background: none; font-size: inherit; line-height: inherit; }
.builder-page .sheet__skills, .builder-page .sheet__attributes { font-size: inherit; margin: 0.15rem 0; }
.builder-page .sheet__title { font-size: 12pt; font-weight: bold; margin: 0; }
.builder-page .sheet__blank-line { display: inline-block; width: 5cm; border-bottom: 1px solid #000; }
.builder-page .sheet__choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 0.4cm; margin: 0.15rem 0; }
.builder-page .sheet__choice dt { font-weight: bold; }
.builder-page .sheet__choice dd { margin: 0; }
.builder-page .sheet__skills, .builder-page .sheet__attributes { break-inside: auto; }
.builder-page .sheet__skills tr { break-inside: avoid; }
.builder-page .sheet__attributes td { text-align: center; font-size: 10pt; }
.builder-page .sheet__url { font-size: 6.5pt; word-break: break-all; color: #444; }

/* --- The print packet ------------------------------------------------------
   mechanics/packet.njk assembles chapters into one document inside
   div.packet-doc. Printing that page prints the document and nothing that
   built it: the cover, the combined contents, then every chapter, each
   starting on its own sheet.

   The page number is a @page margin box on a named page, so it is on the
   packet and not on the six chapters that already print one at a time — the
   Combat Quick Reference card in particular has to stay exactly as it was.
   Chromium honours margin boxes (verified against Chromium 1194, the version
   test/a11y pins); Firefox ignores them and falls back to its own print
   footer, which is why nothing in the packet depends on the number being
   there. The contents lists chapters rather than page numbers because
   target-counter(), the only thing that could put a page number beside a
   contents entry, is in no shipping browser. */
@page packet {
  @bottom-center {
    content: counter(page) " / " counter(pages);
    font-size: 9pt;
    color: #444;
  }
}
.packet-page > *:not(.packet-doc) { display: none !important; }
.packet-doc[hidden] { display: none !important; }
.packet-doc { page: packet; }
.packet-doc__message { display: none !important; }
.packet-cover {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  border: none;
  padding: 0;
}
.packet-cover__site { font-size: 14pt; letter-spacing: 0.2em; text-transform: uppercase; margin: 0 0 0.6rem; }
.packet-cover__title { font-size: 30pt; margin: 0; border: none; background: none !important; }
.packet-cover__note { font-size: 10pt; color: #444; margin: 0.8rem 0 0; }
.packet-contents { break-before: page; }
.packet-contents ol { padding-left: 1.4rem; }
.packet-contents li { margin: 0.25rem 0; }
.packet-chapter { break-before: page; }
.packet-chapter__title { font-size: 20pt; border-bottom: 1px solid #000; }
/* Inside the packet a link to another chapter in the same packet has been
   rewritten to a fragment, so printing its href would print "(#packet-…)". */
.packet-doc a[href^="#"]::after { content: none; }
