/*
 * Print stylesheet — Collection as an editorial reading-list document.
 * Loaded from index.html with media="print" so it stays out of the JS
 * render-blocking bundle. Repeat the layer-order statement so this file
 * can parse before tokens.css without flipping print to the lowest layer.
 */
@layer tokens, base, components, pages, patterns, utilities, print;

@layer print {
@media print {
  /* ── Strip web chrome ─────────────────────────── */
  .topnav,
  .site-footer,
  .scroll-progress,
  /* .scroll-to-top-btn hides itself in print (owner: polish.css) */
  .page-head-actions,
  .collection-actions,
  .collection-toolbar,
  .toolbar-sentinel,
  .collection-outline,
  .collection-inline-search,
  .view-switch,
  .collection-count-chip,
  body .toast,
  /* .mobile-drawer / .nav-burger live inside .topnav (already stripped) */
  .offline-banner,
  /* ── R10-33: workbench chrome on the reading/detail surfaces ──
     Toolbars, action rows, and editing affordances are screen-only.
     Element-qualified so these keys stay off the screen stylesheets'
     selector text (cross-file duplicates are style-drift failures). */
  header.reader-toolbar,
  div.reader-state-actions,
  div.annotation-actions,
  div.reader-citation-actions,
  span.saved-resource-control,
  div.resource-source-actions,
  div.resource-actions-links,
  form.relation-form,
  div.relation-form-actions,
  div.relation-row-actions,
  div.path-stage-actions,
  div.journal-toolbar,
  div.profile-actions,
  div.profile-tabs {
    display: none !important;
  }

  /* ── Paper reset: ink on white, no screen textures ─ */
  :root {
    --paper: #fff;
    --surface: #fff;
    /* Screen grain/dither/chevron tokens are SVG data-URIs. Neutralize them
       so print does not decode those payloads for a paper document. */
    --grain: none;
    --dither: none;
    --dither-paper: none;
    --select-chevron: none;
  }

  body {
    background: var(--surface-raised);
    color: #000;
    font-size: 11pt;
  }

  *,
  *::before,
  *::after {
    box-shadow: none !important;
    text-shadow: none !important;
  }

  /* ── Masthead → document masthead ─────────────── */
  .page-head,
  .collection-masthead {
    padding-bottom: 12pt;
    margin-bottom: 18pt;
    border-bottom: 2.5pt solid #000;
  }

  .page-head h1,
  .collection-masthead h1,
  .collection-masthead .display {
    font-size: 26pt;
    max-width: none;
  }

  /* nav.breadcrumb keeps this off the mobile hide rule's selector text —
     identical selectors across files are style-drift duplicates. */
  .page-head .eyebrow,
  .collection-masthead .eyebrow,
  .collection-masthead nav.breadcrumb {
    letter-spacing: var(--tracking-caps);
  }

  /* Masthead grids (avatar | copy | actions) flatten to a column in print.
     Element-qualified selectors: the .page-head--masthead keys are owned
     by page-chrome.css and cross-file duplicates are style-drift failures. */
  div.page-head--masthead,
  header.page-head--masthead {
    display: block !important;
  }

  .collection-live-tags {
    margin-bottom: 6pt;
  }

  .collection-stats {
    margin-top: 10pt;
    color: #333;
    font-size: 9pt;
  }

  /* ── Resource directory: grid → numbered list ─── */
  .resource-stream,
  .resource-stream-inner,
  .resource-stream .result-board {
    display: block !important;
  }

  .resource-stream {
    counter-reset: res;
  }

  .resource-stream [data-collection-resource] {
    break-inside: avoid;
    margin: 0 0 10pt;
    padding: 0 0 10pt;
    border: none !important;
    border-bottom: 0.5pt solid #999 !important;
    border-radius: 0 !important;
    background: transparent !important;
    counter-increment: res;
  }

  .resource-stream [data-collection-resource]::before {
    content: counter(res, decimal-leading-zero) '.';
    float: left;
    margin-right: 8pt;
    font-family: var(--font-serif);
    color: #666;
  }

  .resource-stream .result-card-top {
    font-size: 8pt;
    color: #666;
  }

  /* ── URL disclosure: links must be readable ───── */
  [data-collection-resource] a[href^='http']::after {
    content: ' — ' attr(href);
    font-size: 9pt;
    color: #555;
    word-break: break-all;
  }

  /* ── Page numbers ─────────────────────────────── */
  @page {
    margin: 2.2cm 1.8cm;

    @bottom-right {
      content: counter(page) ' / ' counter(pages);
      font-size: 9pt;
      color: #666;
    }
  }
}
}
