/* =========================================================
   INDEX.HTML PRINT FALLBACK
   Only linked from index.html (media="print"), NOT from
   print.html. This covers the case where someone hits
   Ctrl/Cmd+P directly on the live proposal page instead of
   using the "Print / Save PDF" button (which opens the
   dedicated, properly-paginated print.html via Paged.js).
   Deliberately NOT loaded on print.html — having both this
   file and assets/css/print.css active at once produces
   conflicting @page rules and broken pagination.
   ========================================================= */

@media print{

  @page{
    size: letter;
    margin: 0.45in 0.5in;
  }

  *{
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }

  html, body{
    background: #fff;
  }

  /* The sticky top nav (logo, email pill, duplicate top CTA) adds
     nothing on paper — the hero and closing CTA sections below already
     carry the "Continue to Agreement" call-to-action as real content. */
  .topbar{
    display: none !important;
  }

  /* Flatten shadows — they render as muddy gray boxes on paper */
  .card,
  .benefit-card,
  .btn,
  .hero-art img,
  .mockup-image,
  .post-addendum-image{
    box-shadow: none !important;
  }

  main{
    padding-top: 0;
  }

  /* ---- Core rule: keep each card whole ---- */
  .card,
  .benefit-card{
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Never let a heading print alone at the bottom of a page with its
     content pushed to the next — glue every heading to what follows it. */
  h1, h2, h3, h4,
  .eyebrow,
  .card-head,
  .steps-head,
  .tax-abatement-card .card-head,
  .state-incentive-box .card-head{
    break-after: avoid;
    page-break-after: avoid;
  }

  /* Repeated row/item patterns inside cards shouldn't split mid-row */
  .summary-row,
  .mini-list > div,
  .milestone-item,
  .tax-fact,
  .utility-forecast-meta > div,
  .utility-spend-grid > div,
  .state-incentive-grid .tax-fact,
  .steps-list li{
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Full-bleed photo breaks: never split the image itself. If a photo
     doesn't fit the remaining space, it moves to the next page whole. */
  .proposal-photo-break,
  .post-addendum-image-section{
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* The tax abatement card is long enough that it may still need to
     span two pages — allow a break between its two sub-sections
     (main abatement content vs. the NY State credit sub-box) rather
     than mid-paragraph, but keep each sub-section itself intact. */
  .tax-abatement-layout,
  .tax-fact-grid{
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .state-incentive-box{
    break-before: auto;
  }

  /* Charts should never be cut through the middle */
  .savings-chart-wrap,
  .utility-cost-chart{
    break-inside: avoid;
    page-break-inside: avoid;
  }

  /* Two-column proposal grid already stacks to one column at print
     width (see the 1040px breakpoint above) — each card in it is
     still protected by the .card rule above. */
}
