/* ---- PLUMBING-WEB: print ----
   Loaded on every page with media="print" (src/render.mjs). A printed page keeps the content and drops what only works
   on screen: the header menu, the tab strips, the theme button, the live ticker and every control (range buttons,
   filters, pickers, pagers). It prints in the light colours whatever the theme, in black text on white, shows the
   address of every outside link (the sources) after its text, opens every <details> (web/theme.js opens them before
   printing; ::details-content covers browsers that support it) and keeps cards, figures and table rows from splitting
   across pages. */
@media print {
  /* the light palette, above both selectors in web/dark.css */
  :root:root:root {
    --bg: #ffffff;
    --panel: #ffffff;
    --text: #000000;
    --muted: #3d424d;
    --line: #c9cbd2;
    --grid: rgba(0, 0, 0, 0.12);
    --accent: #3730a3;
    --up: #0b6340;
    --down: #9b1c13;
    --c1: #4f46e5;
    --c2: #c2410c;
    --c3: #0d9488;
    --c4: #a21caf;
    --on-accent: #ffffff;
    --lv-crypto-ban: #8c2901;
    --lv-exchange-ban: #b83b07;
    --lv-scheduled-ban: #d8582e;
    --lv-delisted-under-pressure: #eb7955;
    --lv-mixers-targeted: #f79d81;
    --lv-no-restriction-found: #8eabe1;
    --lv-none: #e2e3e8;
    color-scheme: light;
  }

  @page { margin: 16mm 14mm; }

  html, body { background: #ffffff; color: #000000; }
  body { font-size: 11pt; line-height: 1.45; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; box-shadow: none; text-shadow: none; }
  .wrap { max-width: none; padding: 0; }

  /* screen-only parts */
  .skip,
  .site-header nav,
  .theme-toggle,
  .tabs,
  .how-toc,
  .foot-nav,
  .foot-feed,
  .tk,
  .tk-tools,
  .controls,
  .seg,
  .chg-filter,
  .tln-filter,
  .tk-filter,
  .fd-pick,
  .map-tools,
  .pager,
  button,
  select,
  input { display: none !important; }
  .site-header { border-bottom: 1px solid var(--line); position: static; }

  /* every <details> open, its summary kept as a heading */
  details::details-content { content-visibility: visible; display: block; }
  details > summary { list-style: none; font-weight: 650; }
  details > summary::-webkit-details-marker { display: none; }

  /* tables and wide parts print in full, not in a scrolling box */
  .table-wrap, .map-panel, .tk-list { overflow: visible !important; max-height: none !important; }
  table { break-inside: auto; }
  thead { display: table-header-group; }
  tfoot { display: table-footer-group; }
  tr, th, td { break-inside: avoid; }
  table.data { font-size: 9.5pt; }
  .map-side { min-height: 0; }
  .map-side-inner { position: static; }

  /* cards and figures stay whole; headings stay with what follows them */
  .tile, .file, .tech, .leak, .step, figure, .fig, .chart, .uplot, .side-box, .card, .pf-card, blockquote, pre, img, svg { break-inside: avoid; }
  h1, h2, h3, h4, .panel-head, summary { break-after: avoid; }
  p, li, dd { orphans: 3; widows: 3; }
  .panel { border-color: var(--line); break-inside: auto; }

  /* the address of each outside link, after its text */
  main a[href^="http"]::after,
  .site-footer a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.82em; font-weight: 400; color: var(--muted); word-break: break-all; }
  a { color: var(--text); text-decoration: underline; }
}
