/* print.css: Jake's Dominions 6 Wiki (WIKI-M7-01). Loaded by Shell.astro as <link rel="stylesheet" href="/print.css" media="print">, so it costs no
   screen bytes. Rules from spec/13-print.md, adapted to the class names the build uses. Forced light theme; nothing depends on ink colour.
   Components that already print themselves (the data table, the version marker, the callouts) keep their own rules in their own files; this sheet
   holds what is global. The canonical host is written as "dom6.wiki" (D4: change here if the domain changes). */

@page { size: A4; margin: 16mm; }
@page wide { size: A4 landscape; margin: 12mm; }

/* Progressive: CSS page-margin boxes (Chromium). Other engines ignore these and show .print-header only. */
@page {
  @bottom-left { content: "Jake's Dominions 6 Wiki · dom6.wiki"; font: 8pt "IBM Plex Sans", sans-serif; color: #453F33; }
  @bottom-right { content: "page " counter(page) " of " counter(pages); font: 8pt "IBM Plex Sans", sans-serif; color: #453F33; }
}

@media print {
  /* 1. Forced light theme: literal values, so print never depends on the OS theme or data-theme. */
  /* :root repeated: the token sheets set the same variables under [data-theme] and prefers-color-scheme selectors, and they load after this file. */
  html:root:root:root, html:root:root:root[data-theme], html:root:root:root[data-theme="dark"], html:root:root:root[data-theme="light"] {
    color-scheme: light;
    --bg-sunken: #FFFFFF; --bg-base: #FFFFFF; --bg-raised: #FFFFFF; --bg-overlay: #FFFFFF;
    --bg-hearth: #FFFFFF; --bg-hearth-raised: #FFFFFF;
    --border-subtle: #B3A688; --border-strong: #83775F; --border-control: #83775F;
    --text-primary: #1B1812; --text-secondary: #1B1812; --text-muted: #453F33; --text-opinion: #1B1812;
    --text-link: #1B1812; --text-link-hover: #1B1812; --text-visited: #1B1812; --text-danger: #A62A14; --text-on-hero: #1B1812;
    --accent-brass: #8A5510; --accent-cinnabar: #A83C18; --rule-opinion: #5E5647;
    --table-stripe: #FFFFFF; --table-hover: #FFFFFF; --table-selected: #FFFFFF; --table-cell-hi: #FFFFFF;
    --table-diff-add: #FFFFFF; --table-diff-del: #FFFFFF;
    /* The type scale, in points: body 10.5pt, headings one step down (20 / 15 / 12.5pt), tables 8.5pt, nothing below 8pt (13 "Type"). */
    --fs-display-lg: 20pt; --fs-display: 20pt; --fs-display-sm: 20pt; --fs-h1: 20pt; --fs-h2: 15pt; --fs-h3: 12.5pt;
    --fs-lead: 12pt; --fs-prose: 10.5pt; --fs-ui: 9.5pt; --fs-caption: 8.5pt; --fs-micro: 8pt;
  }
  html, body { background: #FFFFFF !important; color: #1B1812 !important; }
  html body { font-size: 10.5pt; line-height: 1.45; }
  h1, h2, h3 { break-after: avoid; page-break-after: avoid; }
  p, li, dd { orphans: 3; widows: 3; }
  * { box-shadow: none !important; text-shadow: none !important; animation: none !important; transition: none !important; }

  /* 2. Removed: chrome, navigation, controls, everything that only works on screen. */
  .c-nav, .c-drawer, .c-sectionnav, .c-toc, .shell__rail, .shell__toc, .c-search, .c-searchpanel, .c-steps, .c-stepnav, .c-offramp,
  .c-table__controls, .c-filter, .c-colmenu, .c-facetmenu, .c-table__tools, .c-table__copyfield,
  .c-themetoggle, .c-langslot, .c-editaffordance, .c-footer, .c-skip, .c-versiontoggle, .c-toolshell__controls, .c-button,
  .nation__links, [data-print="hide"] { display: none !important; }
  /* Buttons that carry text (sort headers, glossary terms) print as plain text. */
  th > button, button.c-g { all: unset; font: inherit; }

  /* 3. The print header (first page). The mono mark is the only brand element that prints. */
  .print-header { display: flex !important; gap: 8pt; align-items: center; border-bottom: 0.75pt solid #83775F;
    padding-bottom: 4pt; margin-bottom: 10pt; font: 8.5pt "IBM Plex Sans", sans-serif; color: #453F33; }
  .print-header .c-lockup__mark { inline-size: 14pt; block-size: 14pt; }
  .print-header svg { color: #1B1812; }
  .print-header .print-title { flex: 1 1 auto; min-inline-size: 0; }
  .print-header .print-url { font-family: "IBM Plex Mono", monospace; }
  .print-footer { display: block !important; margin-top: 12pt; font: 8pt "IBM Plex Sans", sans-serif; color: #453F33; }

  /* 4. Layout: sticky, overflow and containment containers reset; the shell is one block. */
  .shell, .shell__main, .content { display: block !important; max-width: none !important; padding-inline: 0 !important; }
  [data-bleed] { max-width: none !important; }
  main { padding: 0 !important; }
  .content > * { margin-block: 0 8pt; }
  /* Closed <details> are opened by print.island.ts (beforeprint); ::details-content covers engines that support it. */
  details::details-content { content-visibility: visible; display: block; }
  details > summary { list-style: none; }
  details > summary::-webkit-details-marker { display: none; }

  /* 5. Tables: thead repeats, rows never split, stripes become hairlines (the data table's own file adds the rest). */
  table { border-collapse: collapse; width: 100%; font: 8.5pt/1.3 "IBM Plex Sans", sans-serif; }
  thead { display: table-header-group; }
  tr { break-inside: avoid; page-break-inside: avoid; }
  th, td { border-bottom: 0.5pt solid #B3A688; padding: 2pt 4pt; background: none !important; }
  caption { caption-side: top; text-align: left; font-weight: 600; padding-bottom: 3pt; }
  .c-table__more-online { display: block !important; font: 8pt "IBM Plex Sans", sans-serif; margin-top: 3pt; }
  .c-table[data-wide="true"] { page: wide; }
  tr[hidden] { display: table-row !important; }

  /* 6. Colour-independent signals. */
  .c-pathchip { background: none !important; border: 0.75pt solid #1B1812 !important; color: #1B1812 !important; }
  .c-diff del, .c-table__row--del { text-decoration: line-through; }
  .c-diff ins { text-decoration: underline; }
  .c-callout, .c-opinion, .c-stale { border-left: 3pt solid #453F33 !important; background: none !important; break-inside: avoid; }
  .c-g { text-decoration: underline dashed; } .c-g__def { display: none !important; }
  .c-terms { display: block !important; break-before: auto; }

  /* 7. Links: internal paths and external URLs are printed; in-page anchors, breadcrumbs, row names and glossary terms print nothing extra. */
  a { color: #1B1812 !important; text-decoration: underline; }
  main a[href^="/"]::after { content: " (dom6.wiki" attr(href) ")"; font: 8pt "IBM Plex Mono", monospace; color: #453F33; }
  main a[href^="http"]::after { content: " (" attr(href) ")"; font: 8pt "IBM Plex Mono", monospace; color: #453F33; word-break: break-all; }
  main a[href^="#"]::after, .c-breadcrumb a::after, .c-table th[scope="row"] a::after, .c-table__name a::after, .c-g::after { content: none !important; }

  /* 8. Images. */
  figure { break-inside: avoid; }
  img[alt=""], .c-sectionhero__plate, .c-plate, .decorative { display: none !important; }
  /* The unit sprite is a decorative img[alt=""] (hidden above): its framed box would print empty, so the box goes too (WIKI-SEO-01). */
  .c-statblock__sprite { display: none !important; }
  figcaption { font: 8.5pt/1.3 "IBM Plex Sans", sans-serif; }
}

/* Pass 2: evidence. Chips print as bracketed text with their border; glyphs are decorative. */
@media print {
  .c-prov svg, .c-evm svg, .c-findingstatus svg { display: none; }
  .c-hypothesis { border-style: dashed !important; background: none !important; }
  .c-contradiction__cols { display: block; }
}

/* Hidden on screen. */
.print-header, .print-footer { display: none; }
