/* snapshot_print.css — the Snapshot's print path.
 *
 * The PDF is the browser's own print output, not a generated file. That is a deliberate
 * consequence of the privacy posture: the figures are computed on the member's device and
 * they never leave it, nothing is stored before the email form is submitted, and no PDF is
 * ever emailed. window.print() is therefore the whole delivery mechanism, and this stylesheet
 * is what makes the result a document rather than a screenshot of a web page.
 *
 * TWO THINGS HERE ARE COMPLIANCE REQUIREMENTS, not typography:
 *   The version footer repeats on EVERY page (books-and-records: the retained advertisement is
 *   the versioned engine plus the prose library plus the disclosure text, so a page that could
 *   be separated from the document still identifies what produced it).
 *   The disclosure package and the assumptions page must both print. They are never
 *   display:none in print, and the assembler refuses to build a document without them.
 *
 * ⚠️ EVERY RULE IS SCOPED TO html.sn-print, AND MUST STAY THAT WAY. Discovered Aug 14 2026
 * while wiring the Snapshot into /nypd/: that page already had a shipped print feature of its
 * own ("Print this summary", which prints the calculator under html.nd-print). This file used
 * to declare its rules globally, on the assumption that it owned the printed page. The moment
 * it was loaded on a page that prints something else, `form, input, select { display:none }`
 * took the member's own typed figures out of that older summary, and `a[href^="http"]::after`
 * appended raw URLs through it. Neither was visible on screen and neither harness could see
 * it, because the harnesses run in node and never load CSS. Two print paths on one page can
 * only coexist if each one's rules are scoped to its own mode.
 *
 * The one rule that CANNOT be scoped is @page, which is document-level by definition. Letter
 * portrait with a deep bottom margin therefore applies to both print paths on any page that
 * loads this file. That is accepted rather than worked around: the size is what a US member
 * prints anyway, and the deep bottom margin only costs the older summary some white space.
 *
 * Screen styles live with the page that mounts the Snapshot. This file is print only.
 */

@media print {

  /* ── page geometry ─────────────────────────────────────────────────────────
   * Generous bottom margin so the fixed footer never collides with body text.
   * Document-level, so read the note above about the other print path. */
  @page {
    size: Letter portrait;
    margin: 18mm 16mm 24mm 16mm;
  }

  html.sn-print, html.sn-print body {
    background: #fff !important;
    color: #111 !important;
    font: 10.5pt/1.5 Georgia, 'Times New Roman', serif;
    margin: 0;
    padding: 0;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* ── strip the site, keep the document ─────────────────────────────────────
   * Anything interactive is meaningless on paper and its absence must not shift the layout. */
  html.sn-print nav, html.sn-print header.sc-nav, html.sn-print .sc-nav,
  html.sn-print footer.sc-foot, html.sn-print .sc-foot,
  html.sn-print .nc-tabs, html.sn-print .nc-tab, html.sn-print button,
  html.sn-print .sn-noprint, html.sn-print .modal-overlay,
  html.sn-print form, html.sn-print input, html.sn-print select, html.sn-print textarea,
  html.sn-print iframe, html.sn-print video, html.sn-print audio,
  html.sn-print .nc-qc-form, html.sn-print .sn-locked, html.sn-print [data-noprint] {
    display: none !important;
  }

  html.sn-print a { color: #111 !important; text-decoration: none; }
  /* A printed page cannot be clicked, so a bare URL is the only way a reference survives.
   * Internal anchors are excluded: "(#section-3)" on paper is noise. */
  html.sn-print a[href^="http"]::after {
    content: " (" attr(href) ")"; font-size: 8.5pt; color: #444;
  }

  /* ── the document ──────────────────────────────────────────────────────────── */
  html.sn-print .sn-doc { max-width: none; margin: 0; }

  html.sn-print .sn-doc-head {
    border-bottom: 2pt solid #111;
    padding-bottom: 6pt;
    margin-bottom: 12pt;
  }
  html.sn-print .sn-doc-head h1 { font-size: 20pt; margin: 0 0 2pt; letter-spacing: .2pt; }
  html.sn-print .sn-doc-head .sn-sub { font-size: 10pt; color: #333; margin: 0; }

  html.sn-print h2 { font-size: 13pt; margin: 14pt 0 4pt; page-break-after: avoid; break-after: avoid; }
  html.sn-print h3 { font-size: 11.5pt; margin: 12pt 0 3pt; page-break-after: avoid; break-after: avoid; }
  html.sn-print p  { margin: 0 0 6pt; orphans: 3; widows: 3; }

  /* A section should not be split one line into the next page. Sections longer than a page
   * are allowed to break, because forbidding it outright pushes a long section onto a fresh
   * page and leaves half a page blank. */
  html.sn-print .sn-sec, html.sn-print .sn-nsec {
    page-break-inside: auto; break-inside: auto; margin-bottom: 8pt;
  }

  /* Tables are the figures. Never split one. */
  html.sn-print .sn-tbl {
    width: 100%;
    border-collapse: collapse;
    page-break-inside: avoid;
    break-inside: avoid;
    margin: 4pt 0 8pt;
  }
  html.sn-print .sn-tbl th, html.sn-print .sn-tbl td {
    text-align: left;
    padding: 3pt 6pt 3pt 0;
    border-bottom: .5pt solid #ccc;
    vertical-align: top;
  }
  html.sn-print .sn-tbl th { font-weight: normal; color: #333; width: 58%; }
  html.sn-print .sn-tbl td { text-align: right; font-variant-numeric: tabular-nums; }

  html.sn-print .sn-tag {
    font-size: 8.5pt; color: #444; font-style: italic;
    white-space: nowrap;
  }
  html.sn-print .sn-note { font-size: 9.5pt; color: #222; }
  html.sn-print .sn-opts { margin: 4pt 0 8pt 14pt; padding: 0; }
  html.sn-print .sn-opts li { margin-bottom: 5pt; page-break-inside: avoid; break-inside: avoid; }

  /* The blocking state must be impossible to print as if it were a finished estimate. */
  html.sn-print .sn-block { border: 1.5pt solid #111; padding: 8pt; }
  html.sn-print .sn-block::before {
    content: "This estimate is incomplete. Nothing below was produced.";
    display: block; font-weight: bold; margin-bottom: 4pt;
  }

  /* ── the disclosure package and the assumptions page ──────────────────────
   * Required in the PDF by compliance item 1. Start on a fresh page so they are legible as a
   * unit rather than trailing three lines under a table, and NEVER hide them. */
  html.sn-print .sn-disc, html.sn-print .sn-assump {
    page-break-before: always;
    break-before: page;
    display: block !important;
    font-size: 9pt;
    line-height: 1.45;
  }
  html.sn-print .sn-disc h3, html.sn-print .sn-assump h3 { font-size: 11pt; }
  html.sn-print .sn-disc p { margin-bottom: 5pt; }
  html.sn-print .sn-fine { font-size: 8.5pt; color: #333; }

  /* ── the version footer, on every page ────────────────────────────────────
   * position: fixed repeats a block on each printed page in the browsers this site targets.
   * This is a books-and-records requirement: a page separated from the rest still says what
   * produced it and on what assumptions. */
  html.sn-print .sn-runfoot {
    position: fixed;
    bottom: -16mm;
    left: 0; right: 0;
    font: 7.5pt/1.3 Georgia, serif;
    color: #333;
    border-top: .5pt solid #bbb;
    padding-top: 2pt;
    display: block !important;
  }
  html.sn-print .sn-runfoot .sn-rf-r { float: right; }

  /* Screen-only affordances that would otherwise print as dead furniture. */
  html.sn-print .sn-ver { display: none !important; }
}

/* On screen the running footer is redundant: the card already carries a version line, and a
 * fixed bar over the page would be in the way. */
@media screen {
  .sn-runfoot { display: none; }
}
