/* ==========================================================================
   Print and PDF layout.
   The report is a deliverable: it gets printed, attached and archived, so the
   printed form is designed rather than inherited.
   ========================================================================== */

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

  .rpt-top,
  .rpt-actions,
  .rpt-nav,
  .rpt-nav__shell,
  .filters,
  .aside,
  .skip-link,
  .handoff,
  .reveal-tail,
  .print-hide { display: none !important; }

  /* Folded findings are unfolded by the beforeprint handler, but the attribute
     is belt and braces: a printed report must contain every finding it claims
     to, regardless of what was on screen. */
  #findingList .finding[hidden] { display: block !important; }

  body, .report { background: #fff !important; color: #111 !important; }

  .rpt-body { max-width: none; padding: 0; }
  .rpt-sec { break-inside: avoid; padding-block: 18pt; }

  /* Every finding opens: a printed report must not hide its own evidence. */
  .finding[open] .finding__body,
  .finding .finding__body { display: grid !important; }
  .finding { break-inside: avoid; }
  .finding__caret { display: none; }

  [data-mode] .mode-spec,
  [data-mode] .mode-dev { display: block !important; }

  /* 2.0.2: section tabs.
     report-tabs.js restores every panel on beforeprint, but this rule is the
     guarantee rather than the optimisation. A browser that prints without
     firing that event, a headless PDF renderer, or a saved page opened with
     scripting disabled must still produce the whole report. A tabbed
     deliverable that prints one tab is a document with nine missing chapters,
     and the person who discovers that is the client. */
  .rpt-sec[role='tabpanel'][hidden] { display: block !important; }

  /* Restore the separators. On screen the sections appear one at a time so the
     rules were removed; on paper they are stacked again and the reader needs to
     see where one ends and the next begins. */
  [data-tabbed] .rpt-sec {
    border-top: 1px solid #ddd !important;
    padding-top: 18pt !important;
  }
  [data-tabbed] .rpt-sec:first-of-type { border-top: none !important; }

  /* The strip is navigation. It is already hidden above, but it is also sticky
     on screen now, and a sticky element can survive into paged media. */
  [data-tabbed] .rpt-nav,
  .rpt-nav__shell { position: static !important; display: none !important; }

  pre {
    background: #f4f4f1 !important;
    color: #222 !important;
    border: 1px solid #ddd !important;
    white-space: pre-wrap;
  }

  .fix { background: #f2f7f4 !important; border-color: #cfe0d6 !important; }
  .fix p, .fix h3 { color: #1d4433 !important; }

  a[href]::after { content: ''; }

  .print-only { display: block !important; }
  .print-foot {
    margin-top: 18pt;
    padding-top: 8pt;
    border-top: 1px solid #ddd;
    font-size: 9pt;
    color: #555;
  }
}

.print-only { display: none; }
