/* Site-wide print stylesheet (Phase 8, SHELL-07).
 * Companion to per-tool print.css files (e.g. bow-tie keeps its own landscape sheet).
 * jsdom CSSOM gate: frontend/tests/print-css.spec.js walks @media print cssRules + raw-string
 * checks @page (jsdom does NOT expose @page reliably via cssRules — Research §4).
 *
 * Cascade ordering: this sheet loads via <link rel="stylesheet" media="print" href="/shared/print.css">
 * AFTER /shared/theme.css /layout.css /ui.css and BEFORE any per-tool print.css. Same-specificity
 * rules later-wins, so bow-tie/print.css landscape @page rule cascades on top of this portrait default
 * because bow-tie's link loads AFTER (in the bow-tie page's <head>). */

@page {
  size: A4 portrait;
  margin: 1.5cm;
}

@media print {
  /* Hide all chrome — header shell, footer, toolbars, buttons, modal dialogs */
  #app-shell,
  #app-footer,
  .toolbar,
  button,
  dialog,
  [role="dialog"] {
    display: none !important;
  }

  /* Hide header navigation links explicitly (belt-and-braces vs #app-shell hide above).
   * The CSSOM gate asserts these selectors specifically. */
  a[aria-label="Back to dashboard"],
  a[aria-label="Authors"] {
    display: none !important;
  }

  /* Force black-on-white background — overrides theme.css gradient tokens */
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11pt;
  }

  /* Flatten panel decoration — retro shadows / gradients look bad on paper */
  .panel {
    background: #fff !important;
    box-shadow: none !important;
    border: 1px solid #000 !important;
    page-break-inside: avoid;
  }

  /* Generic SVG scaling — per-tool sheets may override (e.g. bow-tie landscape) */
  svg {
    max-width: 100%;
    height: auto;
  }

  /* Expand main content area to fill the printable page */
  #page-root {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
  }

  /* Drop link decoration noise in print */
  a {
    color: #000 !important;
    text-decoration: none !important;
  }
}
