/* ─────────────────────────────────────────────────────────────────────────
 * Print mode for the homeowner SPA.
 *
 * Activated when the page is loaded with ?print=1 — the boot snippet in
 * index.html adds .print-mode to <html> before any layout-affecting CSS
 * runs, so this stylesheet's rules apply on first paint and the chrome
 * never flashes into view.
 *
 * Purpose: render only the property report's lot-diagram + Development
 * Capacity Snapshot section (the same view that appears on the homepage
 * AFTER an address check), with no header, footer, address form, lead
 * capture, project tiles, or other interactive chrome. The headless
 * renderer in apps/api/src/services/site-plan-snapshot-pdf.ts loads this
 * URL and captures the rendered page to PDF.
 *
 * The selectors below are conservative: anything that isn't the zone
 * banner, lot preview, snapshot, or site checks is hidden. Adding new
 * homepage sections in the future will NOT automatically appear in the
 * PDF; explicitly allow-list them here if they should.
 * ───────────────────────────────────────────────────────────────────────── */

/* Letter-size print viewport on the headless renderer. Width pins the
 * layout so the diagram + chips sit at the same horizontal positions
 * across runs. The min-height keeps Letter portrait aspect so the PDF
 * doesn't get cropped if the snapshot fits in less than one page. */
html.print-mode,
html.print-mode body {
  width: 816px;
  min-height: 1056px;
  margin: 0;
  padding: 0;
  background: #ffffff;
  overflow-x: hidden;
}

html.print-mode body {
  /* Strip the homeowner SPA's max-width centring so the lot preview
   * spans the print page width. The inner card padding handles
   * breathing room. */
  display: block;
}

/* ─── Hide the chrome ─────────────────────────────────────────────────── */

html.print-mode .site-header,
html.print-mode .site-footer,
html.print-mode #consentBanner,
html.print-mode .consent-banner,
html.print-mode #cookie-banner,
html.print-mode #czpAddressForm,
html.print-mode .czp-address-form,
html.print-mode .czp-address,
html.print-mode #leadCaptureForm,
html.print-mode .lead-capture,
html.print-mode .czp-projects,
html.print-mode #czpProjectsHeader,
html.print-mode #czpTileGrid,
html.print-mode .czp-tile-grid,
html.print-mode .czp-projects-grid,
html.print-mode .sticky-realtor-handoff,
html.print-mode #realtorIntentEmphasis,
html.print-mode .embed-map-disclaimer,
html.print-mode #zonedInsightsDebug,
html.print-mode .skip-link,
html.print-mode .mobile-nav-toggle,
html.print-mode .czp-purenzyme-banner,
html.print-mode #chatPanel,
html.print-mode .chat-panel,
html.print-mode #welcomeScreen,
html.print-mode .welcome-screen,
html.print-mode #helpButton,
html.print-mode .help-button,
html.print-mode #czpStartBox,
html.print-mode .czp-start-box,
html.print-mode .lot-header-restart-label,
html.print-mode #czpCombineBar,
html.print-mode .czp-combine-btn,
html.print-mode #lotHeaderCombineLot {
  display: none !important;
}

/* ─── Keep the snapshot stack ─────────────────────────────────────────── */

/* Outer card wrapping the zone banner + lot preview + datasheet. Strip
 * the soft shadow + border-radius for print so the report reads as one
 * sheet, not a floating card on a coloured background. */
html.print-mode .czp-card,
html.print-mode .czp-zoning,
html.print-mode .czp-datasheet {
  box-shadow: none !important;
  border: none !important;
  border-radius: 0 !important;
  margin: 0 0 16px 0 !important;
  padding: 16px 20px !important;
  background: #ffffff !important;
}

/* Lot preview: hide the legacy aspect-ratio padding hack so the diagram
 * sizes naturally to its rendered SVG. */
html.print-mode .czp-lot-preview {
  margin-top: 12px !important;
  background: #ffffff !important;
}

/* ─── Body-level reset so SPA initial-state doesn't show empty card ──── */

/* Until the address has been resolved + /check has returned, hide the
 * snapshot card so the PDF capture only runs after window.__zonedPrintReady
 * fires. This is the visible analogue of the JS ready-signal; without it
 * a too-fast headless renderer could capture an empty card. */
html.print-mode:not(.print-ready) #czpLotPreview,
html.print-mode:not(.print-ready) #czpDatasheet,
html.print-mode:not(.print-ready) #czpZoningCard {
  visibility: hidden;
}

html.print-mode.print-ready #czpLotPreview,
html.print-mode.print-ready #czpDatasheet,
html.print-mode.print-ready #czpZoningCard {
  visibility: visible;
}
