/* Shared paper delivery. B01 imports this leaf after shared component styles.
   Hosts mark reports/articles with data-print-content, optional data-print-urls,
   data-print-table and data-print-keep. data-print-hide omits irrelevant controls.
   Virtualized grids supply their complete semantic DataTable in a print slot. */
@layer structure {
  @media print {
    :root {
      --header-clearance: 0px;
      --print-canvas: var(--color-print-paper);
      --print-ink: var(--color-print-ink);
      color-scheme: light;
      background: var(--print-canvas);
      color: var(--print-ink);
    }
    :where(html) {
      scroll-behavior: auto;
    }
    :where(
      [data-print-hide],
      header[data-nav-fit],
      [data-part="skip-link"],
      [data-pattern="priority-nav"],
      [data-nav-mobile],
      [data-pattern="cookie-consent"],
      [data-pattern="consent-preferences"],
      [data-pattern="chat"],
      [data-pattern="footer"] [data-part="navigation"],
      [data-pattern="footer"] [data-part="signup"]
    ) {
      display: none;
    }
    :where([data-print-content], [data-pattern="prose"]) {
      max-inline-size: none;
      overflow: visible;
      content-visibility: visible;
      contain: none;
    }
    :where([data-print-content], [data-pattern="prose"])
      :where([data-print-table], [data-ui="table-scroll"]) {
      overflow: visible;
      max-block-size: none;
      max-inline-size: none;
    }
    :where([data-print-content], [data-pattern="prose"]) :where(table) {
      inline-size: 100%;
      min-inline-size: 0;
      table-layout: auto;
    }
    :where([data-print-content], [data-pattern="prose"]) :where(th, td) {
      position: static;
      white-space: normal;
      overflow-wrap: anywhere;
    }
    :where([data-print-content], [data-pattern="prose"]) :where(thead) {
      position: static;
      display: table-header-group;
    }
    :where([data-print-content], [data-pattern="prose"]) :where(caption) {
      position: static;
      inline-size: auto;
      block-size: auto;
      overflow: visible;
      clip-path: none;
      white-space: normal;
    }
    :where([data-print-content], [data-pattern="prose"]) :where(tfoot) {
      display: table-footer-group;
    }
    :where([data-print-content], [data-pattern="prose"]) :where(h1, h2, h3, h4, h5, h6) {
      break-after: avoid;
    }
    :where([data-print-content], [data-pattern="prose"]) :where(tr, figure, [data-print-keep]) {
      break-inside: avoid;
    }
    :where([data-print-content], [data-pattern="prose"]) :where(p, li) {
      orphans: 3;
      widows: 3;
    }
    /* URLs are opt-in; native fragment, telephone and mail links retain their labels. */
    :where([data-print-urls]) :where(a[href^="https://"], a[href^="http://"])::after {
      content: " (" attr(href) ")";
      overflow-wrap: anywhere;
    }
    :where([data-print-content] [data-pattern="capsule-panel-stack"]) {
      container-type: normal;
    }
    :where([data-print-content] [data-pattern="capsule-panel-stack"] [data-part="panel"]) {
      grid-template-columns: minmax(0, 1fr);
      overflow: visible;
      min-block-size: 0;
    }
    :where([data-print-content] [data-pattern="capsule-panel-stack"] [data-part="badge"]) {
      display: none;
    }
    :where([data-print-content] [data-pattern="capsule-panel-stack"])
      :where(
        [data-part="panel"],
        [data-part="media"],
        [data-part="image"],
        [data-part="content-inner"],
        [data-part="heading"]
      ) {
      animation: none;
      transform: none;
      clip-path: none;
      opacity: 1;
    }
  }
}
@layer components {
  @media print {
    /* Body/reading roots own paper roles below the pack's root theme; screen values stay intact. */
    :where(body, [data-print-content], [data-pattern="prose"]) {
      color-scheme: light;
      --color-canvas: var(--print-canvas);
      --color-surface: var(--print-canvas);
      --color-surface-raised: var(--print-canvas);
      --color-fg: var(--print-ink);
      --color-fg-muted: var(--print-ink);
      --color-accent-fg: var(--print-ink);
      background: var(--print-canvas);
      color: var(--print-ink);
    }
    :where([data-print-content] [data-pattern="capsule-panel-stack"])
      :where([data-part="panel"], [data-part="media"]) {
      box-shadow: none;
      clip-path: none;
    }
    :where([data-print-content], [data-pattern="prose"]) :where(a) {
      color: var(--print-ink);
      text-decoration: underline;
    }
  }
}
