/* ---------------------------------------------------------------
   Print stylesheet for initiative pages.
   Goal: a clean, complete, black-on-white legal-exhibit rendering.
   Browsers print their own header/footer (title, URL, date, page
   number) by default, so this sheet adds a citation line inside the
   page as a fallback for environments where that is disabled.
--------------------------------------------------------------- */

@media print {
  * {
    background: #fff !important;
    color: #000 !important;
    border-color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  html, body {
    font-size: 12pt;
    line-height: 1.5;
  }

  /* Chrome/navigation not useful on paper */
  .site-header,
  .site-footer,
  .breadcrumb,
  .skip-link,
  .nav-disclosure,
  .primary-nav,
  .about-hero {
    display: none !important;
  }

  .wrap {
    max-width: none;
    padding: 0;
  }

  a {
    text-decoration: underline;
    color: #000 !important;
  }

  /* Show the destination for external / registry links so the
     printed page is self-contained as an exhibit. */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 9pt;
    font-weight: normal;
  }

  .section {
    border-bottom: 1px solid #999;
    padding: 18pt 0;
    break-inside: avoid-page;
  }
  .section-alt { background: #fff !important; }

  h1, h2, h3 { break-after: avoid-page; }

  .steps li,
  .artifact-card,
  .problem-item,
  aside.callout,
  .initiative-entry,
  .routing-card {
    break-inside: avoid-page;
  }

  .anchor-link { display: none !important; }

  aside.callout {
    border: 1px solid #000;
    background: #fff !important;
  }
  aside.callout .callout-label { color: #000 !important; }

  .tier-badge,
  .tier-badge.tier-1,
  .tier-badge.tier-2,
  .status-pill,
  .status-pill.available,
  .status-pill.in-preparation {
    border: 1px solid #000 !important;
    color: #000 !important;
    background: #fff !important;
  }

  .btn {
    border: 1px solid #000 !important;
    color: #000 !important;
    background: #fff !important;
  }

  .status-list li::before {
    background: #fff !important;
    border-color: #000;
  }

  /* Registry: full hashes, complete tables, no clipped columns. */
  #filters,
  .filter-list {
    display: none !important;
  }
  .table-scroll {
    overflow-x: visible !important;
  }
  .registry-table {
    width: 100% !important;
    font-size: 10pt;
  }
  .registry-table th,
  .registry-table td {
    border-color: #000;
  }
  .registry-table tr {
    break-inside: avoid;
  }
  /* The Files section can contain many rows, so let the table itself
     paginate rather than forcing the whole section onto one page. */
  #files.section {
    break-inside: auto;
  }
  .registry-table.hash-table .hash-cell code {
    max-width: none;
    word-break: break-all;
  }
  code {
    background: #fff !important;
    border: 1px solid #999;
    white-space: nowrap;
  }
  /* Full hashes must still wrap (a 64-char hex string cannot be kept
     on one line), so this is the one exception to the no-wrap rule. */
  .hash-cell code {
    white-space: normal;
  }
  .version-banner {
    border-color: #000 !important;
    background: #fff !important;
  }

  /* Print-only citation footer: canonical path, for environments
     that suppress the browser's own header/footer. */
  .print-citation {
    display: block !important;
    margin-top: 24pt;
    padding-top: 8pt;
    border-top: 1px solid #000;
    font-size: 9pt;
  }
}
