/* ==========================================================================
   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,
  .to-top { 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; }

  /* Paper is the finished state, whatever the screen was mid-way through.
     The line for `.reveal` itself was here already and was doing half the job:
     the entrance now hides the children of a group rather than the group, so a
     grid of six cards printed from a page whose script had run would put six
     empty rectangles on the paper and the rule above would report itself
     satisfied, because the grid it names is indeed visible. The descendant
     selector is the whole point of the second line — it reaches what the first
     one cannot see.

     Animations are stopped rather than left to finish. A keyframe with `both`
     holds its first frame through its delay, and the print snapshot is taken
     whenever the browser takes it; a chart caught in that window prints its
     bars at a thousandth of their length, which is not a slower version of the
     right answer, it is a blank chart.

     The two properties are reset over different reaches, and the difference is
     not tidiness. Opacity has to go all the way down, because the entrance hides
     children. Transform must not: the scatter plot's y-axis title is the one
     element in the kit drawn under a rotation, and its `x` is negative, which
     only makes sense once it is turned. A presentation attribute loses to any
     author rule, so a blanket `transform: none !important` strips the rotation
     and paints "KAT6B log2 fold change" two hundred and forty-seven pixels off
     the left of the canvas. The printed figure then has an unlabelled axis and
     nothing on the page says so. The entrance only ever translates a `.reveal`
     itself or a direct child of a `.grid` or `.steps`, so the child combinator
     reaches everything the reset was written for and stops short of the one
     element it was breaking. */
  .reveal, .reveal * { opacity: 1 !important; }
  .reveal, .reveal > * { transform: none !important; }
  .reveal, .reveal * { animation: none !important; transition: 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; }
}
