/* Site Recon — browser print / "print to PDF" path (BUILDER B)
 *
 * Used by window.SiteReportPDF.print(): js/pdf.js injects a
 * #site-recon-print-root element and adds body.site-recon-printing, then calls
 * window.print(). The jsPDF path (generate()) is the primary deliverable; this
 * sheet exists so a phone with a flaky PDF engine can still put the same report
 * on paper or into the OS print-to-PDF.
 *
 * The app shell is hidden generically (every direct child of <body> except the
 * print root), so nothing here depends on markup owned by Builder A.
 */

#site-recon-print-root { display: none; }

@page {
  size: letter portrait;
  margin: 0.6in;
}

@media print {
  html, body {
    background: #fff !important;
    color: #1e293b !important;
    font-family: 'Raleway', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    font-size: 9.5pt;
    line-height: 1.38;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Hide the live app; show only the generated report. */
  body > * { display: none !important; }
  body > #site-recon-print-root { display: block !important; }
  .no-print, .leaflet-control-container { display: none !important; }

  a { color: #00695c; text-decoration: none; }
  code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 7pt; color: #00695c; word-break: break-all; }

  .p-page {
    page-break-after: always;
    break-after: page;
    padding: 0;
  }
  .p-page:last-child { page-break-after: auto; break-after: auto; }

  .p-head {
    display: flex; justify-content: space-between; gap: 12pt; align-items: baseline;
    border-bottom: 1pt solid #00796b; padding-bottom: 4pt; margin-bottom: 12pt;
  }
  .p-firm { font-size: 7.5pt; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: #101e33; }
  .p-addr { font-size: 7.5pt; color: #47556b; text-align: right; }

  .p-kicker {
    font-size: 7.5pt; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase;
    color: #00796b; margin-bottom: 4pt;
  }
  .p-title { font-size: 19pt; font-weight: 800; letter-spacing: -0.015em; margin: 0 0 4pt; color: #101e33; }
  .p-h2 { font-size: 13pt; font-weight: 800; margin: 0 0 8pt; color: #101e33; }
  .p-h2::after {
    content: ''; display: block; width: 42pt; height: 1.6pt; background: #00796b; margin-top: 5pt;
  }
  .p-sub { font-size: 10pt; font-weight: 700; color: #00796b; margin-bottom: 10pt; }
  .p-sub2 { font-size: 9pt; font-weight: 800; color: #101e33; margin: 14pt 0 4pt; }

  .p-banner {
    border: 1pt solid #d69e2e; background: #fff4d6; color: #7c4204;
    font-size: 8.5pt; font-weight: 700; padding: 6pt 8pt; margin: 0 0 10pt;
  }

  .p-panel { border: 1pt solid #cbd5e1; background: #f4f6fa; padding: 8pt 10pt; margin-bottom: 12pt; }
  .p-piq { font-size: 13pt; font-weight: 800; color: #101e33; }
  .p-piq-sub { font-size: 9pt; color: #47556b; margin-top: 2pt; }

  table.p-tbl { width: 100%; border-collapse: collapse; table-layout: fixed; }
  table.p-tbl th {
    background: #101e33; color: #fff; font-size: 7pt; letter-spacing: 0.07em; text-transform: uppercase;
    text-align: left; padding: 4pt 6pt; vertical-align: bottom;
  }
  table.p-tbl td {
    border-bottom: 0.5pt solid #cbd5e1; padding: 5pt 6pt; font-size: 8.5pt;
    vertical-align: top; overflow-wrap: break-word; word-break: break-word;
  }
  table.p-tbl td.k { width: 34%; color: #47556b; }
  table.p-tbl td.sec { width: 24%; font-weight: 700; color: #101e33; }
  table.p-tbl tr { page-break-inside: avoid; break-inside: avoid; }
  table.p-tbl tr:nth-child(even) td { background: #f8fafc; }
  table.p-tbl .blank { color: #a32e2e; font-weight: 700; }
  table.p-tbl td img { width: 100%; max-height: 90pt; object-fit: contain; background: #eef1f6; }

  ol.p-docs { margin: 0; padding-left: 14pt; }
  ol.p-docs li { font-size: 8pt; margin-bottom: 4pt; }

  .p-photos { display: grid; grid-template-columns: 1fr 1fr; gap: 12pt; }
  .p-photo { border: 0.5pt solid #cbd5e1; page-break-inside: avoid; break-inside: avoid; margin: 0; }
  .p-photo img { width: 100%; height: 168pt; object-fit: contain; background: #eef1f6; display: block; }
  .p-photo .p-noimg {
    height: 168pt; background: #eef1f6; color: #47556b; font-style: italic; font-size: 8pt;
    display: flex; align-items: center; justify-content: center;
  }
  .p-photo .pmeta { padding: 5pt 6pt; }
  .p-photo .peid { font-size: 8pt; font-weight: 800; color: #00796b; }
  .p-photo .prm { font-size: 8pt; font-weight: 700; color: #101e33; }
  .p-photo .pcap { font-size: 7.5pt; color: #1e293b; margin-top: 2pt; }
  .p-photo .pts { font-size: 6.8pt; color: #5c6778; margin-top: 1pt; }
  .p-photo .phist {
    background: #a32e2e; color: #fff; font-size: 7pt; font-weight: 800;
    padding: 2pt 4pt; margin: 3pt 0;
  }

  .p-legal { font-size: 9pt; color: #1e293b; margin: 0 0 8pt; text-align: left; }
  .p-note { font-size: 7.5pt; color: #47556b; margin-top: 8pt; }

  .p-sig {
    border: 1pt solid #cbd5e1; padding: 8pt 10pt; margin-top: 14pt;
    page-break-inside: avoid; break-inside: avoid;
  }
  .p-sig h4 {
    font-size: 7.5pt; letter-spacing: 0.08em; text-transform: uppercase; color: #00796b; margin: 0 0 8pt;
  }
  .p-sigrow { display: flex; gap: 16pt; align-items: flex-end; }
  .p-sigrow > div:nth-child(1) { flex: 2.2; }
  .p-sigrow > div:nth-child(2) { flex: 1.5; }
  .p-sigrow > div:nth-child(3) { flex: 1; }
  .p-sigfield { border-bottom: 0.8pt solid #78859a; height: 26pt; }
  .p-siglab { font-size: 6.5pt; color: #5c6778; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 2pt; }
  /* DocuSign anchor strings: present in the text layer, invisible to a reader. */
  .p-anchor { color: #fff; font-size: 1pt; line-height: 1; height: 2pt; overflow: hidden; }

  .p-foot {
    border-top: 0.5pt solid #cbd5e1; margin-top: 14pt; padding-top: 4pt;
    font-size: 6.8pt; color: #5c6778;
  }

  /* PDF v2 cover: the approved high-contrast lockup is centered and preserves its native ratio. */
  .p-cover .p-head { display: none; }
  .p-cover-logo { display: block; width: 3.2in; height: auto; margin: 0 auto 16pt; }
  .p-cover .p-kicker, .p-cover .p-title, .p-cover .p-sub { text-align: center; }
  .p-cover .p-title { max-width: 450pt; margin-left: auto; margin-right: auto; }

}

/* On screen the print root never shows, even mid-generation. */
@media screen {
  #site-recon-print-root { display: none !important; }
}
