/* ==========================================================================
   Print — the report has to survive being sent as a PDF.
   ========================================================================== */
@media print {
  :root { --paper: #fff; --paper-sunk: #f4f4f2; }

  body { background: #fff; font-size: 10.5pt; }
  body::before, .masthead, .rail, .controls, .pager, .skip-link, .tip { display: none !important; }

  .layout, .layout--wide { display: block; }
  .marginalia { display: block; position: static; padding: 0; }
  .marginalia .prov { page-break-inside: avoid; }

  .page { max-width: none; padding: 0; }
  section { page-break-inside: auto; }
  h1, h2, h3 { page-break-after: avoid; }
  .card, .verdict, .note, .figure, .axis, .correction, table.data tr { page-break-inside: avoid; }

  /* Panels are collapsed by default in the browser; open everything on paper. */
  .axis__body[hidden] { display: block !important; }
  .correction dl { display: grid !important; }

  .reveal { opacity: 1 !important; transform: none !important; }

  /* Paper shows the whole data set, whatever the screen was showing when the
     reader pressed print. Of the two ways out of this — print the filter
     counter so the reader knows the page is a subset, or drop the filter and
     print everything — this is the second, and it is chosen because it is the
     policy the rest of this file already follows: eight lines up, every
     collapsed panel is forced open on paper. A printout of this report is an
     artefact that outlives the session that produced it, gets forwarded, gets
     excerpted, and has no controls on it to show that anything was ever
     narrowed. A sentence in the corner is a thin defence against that.

     The line above restoring dimmed marks was already here and was doing half
     the job. The rows were not restored with them, and the halves disagreed:
     printing this report with one facet pressed put 27 of 27 chart marks on the
     page and 18 of 47 table rows, so the figure and the table underneath it
     described different populations, with nothing in between to say why. Now
     both print in full and the counter, which would read "9 of 38 diseases
     shown" over a table of 38, correctly goes with the rest of the controls.

     Series switched off in the legend are deliberately left off. They are the
     one filtered state that accounts for itself on paper: the legend prints,
     and its entry for a hidden series is struck through beside the colour that
     is missing from the chart. */
  .mark.is-dim { opacity: 1 !important; }
  table.data tbody tr[hidden] { display: table-row !important; }
  @media (max-width: 640px) {
    /* The stacked layout draws rows as blocks. Forcing `table-row` on a paper
       size narrow enough to trigger it would rebuild the grid the layout has
       just taken apart, on a page too narrow to hold it. */
    table.data tbody tr[hidden] { display: block !important; }
  }

  a { color: inherit; text-decoration: none; }
  main a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 8pt;
    color: #646D75;
    word-break: break-all;
  }
  /* On paper an identifier is already its own address — a reader holding
     NCT04606446 can reach the study from it. Printing the registry URL after
     it repeats the number back at three times the length. */
  main a.ident::after { content: none; }
  .ident { border-bottom: 0; }

  .cite { vertical-align: baseline; }

  @page { margin: 16mm 14mm; }
}
