/* ======= print.css (final) ======= */

/* A) Color + fonts actually render */
*{ -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/* B) Let content flow; no clipping from global layouts */
html, body { height:auto; overflow:visible !important; }

/* C) Make the PDF read like pages (and stop mid-card guillotines) */
section, article, .section, .card, .panel, .insight, .container, figure, .chart,
header, main, footer {
  break-inside: avoid !important;
  page-break-inside: avoid !important;
}

/* Keep headings with the block that follows */
h1, h2, h3 { break-after: avoid !important; page-break-after: avoid !important; }

/* D) Kill sticky/fixed in print (a common hidden culprit) */
.sticky, .fixed,
[style*="position:sticky"], [style*="position: fixed"] { position: static !important; top:auto !important; }

/* E) Normalize outer wrappers so charts don’t get a whole page to themselves */
body, main, .wrapper, .content, .container {
  margin:0 !important; padding:0 !important; width:100% !important; max-width:none !important;
}

/* F) Charts/images scale cleanly and stay with captions */
canvas, svg, img, figure, .chart {
  display:block !important;
  max-width:100% !important; height:auto !important;
  margin:0 0 10mm 0 !important;
  break-inside: avoid !important; page-break-inside: avoid !important;
}

/* G) Round corners/shadows look bad at page edges → flatten for print */
.card, .panel, .insight {
  box-shadow:none !important; border-radius:0 !important;
  outline:1px solid var(--border, #2A2A2A);
}

/* H) Tight, professional page geometry (tweak to A4 if needed) */
@page { size: Letter; margin:14mm 14mm; }

/* I) Force clean section starts when necessary (use sparingly) */
.page-break { break-before: page; page-break-before: always; }

/* J) OPTIONAL – “print-light” palette for maximum legibility on paper.
      Comment out this block if you want to keep the dark theme in PDF. */
:root{
  --bg-dark:#ffffff; --bg-card:#ffffff;
  --text-primary:#0A0A0A; --text-secondary:#333333;
  --border:#E5E5E5; --accent:#B3E675; --success:#00B56B; --warning:#7CC6FF;
}
body{ background:#fff !important; color:#0A0A0A !important; }
.callout, .alert, .badge { background:#F6F8FB !important; color:#111 !important; }
