/*
 * The rendered report.
 *
 * This sheet is loaded SITE-WIDE from templates/header.php with an
 * unconditional media="print" link -- not scoped to any one page -- because
 * the scanner renders the PUBLIC result page (templates/scan-result.php)
 * with media: print for the PDF, and that page has no way to load a
 * stylesheet only it uses. That means every OTHER page under this header
 * (every /account/ template included) is printable through the exact same
 * sheet, whether anyone ever means to print one or not. The hide-list below
 * is therefore the UNION of the live controls on both: .scan-email (the
 * result page's report-by-email form) and .scan-rescan ("Scan again") from
 * scan-result.php, plus .scan-form and .scan-form__button, which are the
 * login form, the "Open my reports" button, the compare-runs form, the
 * "Download this report as PDF" button and the "Log out" button across
 * account-login.php, account-enter.php, account-list.php and
 * account-app.php. Removing either half re-exposes a live control on paper
 * for the pages that half covers; see PrintStylesheetDriftTest for the check
 * that keeps this list matched to the templates it must cover.
 *
 * .scan-share is DELIBERATELY NOT in this list, despite its name reading
 * like a social-share affordance. templates/scan-result.php's markup says
 * otherwise: it is a `<span>` carrying the finding's point deduction ("-N
 * points"), not a control. It is content, and a binding decision requires
 * the PDF to carry exactly the same content as the free public result page
 * -- hiding it would silently drop a real number from the one document the
 * client keeps. Do not re-add it on the strength of the class name alone.
 */
@media print {
  header, footer, nav, .scan-email, .scan-rescan,
    .scan-form, .scan-form__button, .scan-link--back { display: none !important; }
  /* The cookie banner is injected by /js/cookie-banner.js, which sets
   * className = 'khalaq-cookie-banner' (js/cookie-banner.js:20). A consent
   * prompt printed across an audit report is the most obviously wrong thing
   * that could appear on it. */
  .khalaq-cookie-banner { display: none !important; }

  body { background: #fff; color: #111; font-size: 11pt; }

  /* scan-result.php has no <details> element at all -- a locked finding
   * renders as a static "Where exactly, and what to do about it, is in the
   * paid report." message, not a disclosure triangle (see the
   * scan-finding--locked branch in that template). These rules are inert on
   * this page, and that is correct: a locked finding must stay withheld in
   * the PDF exactly as it is on screen. Left in place only in case a future
   * template on this print sheet does use <details>. */
  details { display: block; }
  details > summary { list-style: none; font-weight: 600; }
  details > *:not(summary) { display: block !important; }

  /* A finding split across a page break reads as two half-findings. */
  .scan-finding, .scan-group__item { break-inside: avoid; page-break-inside: avoid; }

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

  @page { size: A4; margin: 18mm 16mm; }
}
