/**
 * print.css - what these pages look like on paper.
 *
 * ⚑ WHY THIS EXISTS. The whole product is pale text on a near-black background.
 * Every major browser prints WITHOUT background colours unless the reader ticks
 * "background graphics", which almost nobody does — so the dark background does
 * not arrive on the paper, but the near-white text does.
 *
 * Measured: text at **1.17:1 on white paper**. Effectively a blank sheet, and
 * the reader assumes the page is broken rather than that we never thought about
 * it.
 *
 * That matters most on the surfaces people actually print: a shared report sent
 * on to a lender, a stamp duty working for a solicitor, a works list handed to
 * a builder. None of them had a single `@media print` rule.
 *
 * Nothing here is visible on screen. Verified with
 * `test/cc3-pending/e2e/print-audit.mjs`, which measures the computed styles the
 * printer will actually use.
 */

@media print {
  /* ---------------------------------------------------------- the basics */
  html, body {
    background: #fff !important;
    color: #000 !important;
    font-size: 11.5pt;
  }

  /* Every dark panel becomes white with a hairline, so the STRUCTURE survives
     even though the colour does not. Without this the cards vanish and the
     figures run together as one block of text. */
  .card, .step, .out, .fig, .half, .disc, .chans, .app, .rfpg-share,
  .tile, .shared, .uplift, .warn, .gone, .note {
    background: #fff !important;
    color: #000 !important;
    border: 1px solid #999 !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
  }

  h1, h2, h3, h4, p, li, td, th, b, strong, span, div, label {
    color: #000 !important;
  }

  /* ⚑ AND THE TABLES, which the rule above made WORSE on its own.
     guide.css gives every table a dark page background. The panel rule above
     whitens .card/.step/.out/.fig/.half, and the rule above this one forces all
     text to black - but nothing reset a table, so an itemised breakdown printed
     as BLACK TEXT ON rgb(28, 17, 48). Measured under print media on
     /trades/ and /tools/stamp-duty/, both live.
     It survived a screen render, a phone render and an accessibility audit on
     every one of them, because nothing looks at a page the way a printer does
     unless it is asked to. The cost lands on exactly the sheet somebody prints
     to hand to a builder or a lender. */
  table, table.bands, table thead, table tbody, table tr, table th, table td {
    background: transparent !important;
    color: #000 !important;
    border-radius: 0 !important;
  }
  table { border: 1px solid #999 !important; }
  table th { border-bottom: 1px solid #999 !important; }
  table td { border-top: 1px solid #ccc !important; }

  /* Gradient text renders as NOTHING on paper: the fill is transparent and the
     gradient is a background, which the printer drops. The headline figure —
     the whole point of the page — would come out as an empty space. */
  .big, .amt, .n .v, .hero h1, .addr {
    background: none !important;
    -webkit-text-fill-color: #000 !important;
    color: #000 !important;
  }

  /* ------------------------------------------------- what does not belong */
  /* Buttons, inputs and navigation are meaningless on paper. The FORM VALUES
     are not — somebody printing a stamp duty working needs to see what was
     entered — so inputs stay, flattened. */
  header nav, .go, .addw, .cta, .cta-band, button, .foot-row,
  .rfpg-share button, .playhint, video, .sweep {
    display: none !important;
  }

  input, select, textarea {
    background: #fff !important;
    color: #000 !important;
    border: 1px solid #999 !important;
    box-shadow: none !important;
  }

  /* The mark is an SVG and prints fine; keep the identity on the page. */
  /* Printing drops backgrounds anyway, but saying so explicitly means the
     header is also right in a "save as PDF with background graphics" export,
     which is how somebody sending this to a lender is most likely to do it. */
  header { background: #fff !important; border-bottom: 1px solid #999 !important; }
  header .logo, header .logo-icon { color: #000 !important; }

  /* ----------------------------------------- the parts that MUST print */
  /*
   * ⚑ THE DISCLAIMER IS NOT DECORATION. On a printed sheet passed to a lender
   * it is the only thing saying this is an estimate and not a valuation, and
   * the page it came from is not there to be looked at. It prints, it does not
   * break across pages, and it is bordered so it cannot be mistaken for a
   * caption.
   */
  .disc, .foot-legal, .small, .notAdvice {
    color: #000 !important;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  .disc {
    border: 1px solid #000 !important;
    padding: 8pt 10pt !important;
    font-size: 9.5pt;
  }

  /* A table split across a page break loses its heading row and becomes
     unreadable. */
  table { break-inside: avoid; page-break-inside: avoid; }
  tr, .fig, .half { break-inside: avoid; page-break-inside: avoid; }
  h1, h2, h3 { break-after: avoid; page-break-after: avoid; }

  /* A link printed as blue underlined text goes nowhere on paper. Showing the
     destination is only useful for LINKS OUT — printing "(https://rfpg.ai/...)"
     after every internal link is noise. */
  a { color: #000 !important; text-decoration: none !important; }
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 8.5pt;
    color: #444 !important;
  }

  main { max-width: none !important; }
  @page { margin: 14mm; }
}
