/* Export PDF = the browser's "Save as PDF" on this layout.
 * app.js adds html.printing on beforeprint (and forces the light theme) so the
 * charts re-measure at A4-landscape width before the print snapshot is taken. */

@page { size: A4 landscape; margin: 10mm; }

html.printing body { background: #fff; }
html.printing .shell { display: block; }
html.printing .sidebar,
html.printing .topbar,
html.printing .no-print,
html.printing .view-toggle { display: none !important; }
html.printing .print-only { display: block; }
html.printing .page { width: 1040px; max-width: none; padding: 0; margin: 0; gap: 14px; }
html.printing .card { box-shadow: none; break-inside: avoid; }
html.printing .section { break-inside: auto; }
html.printing #sec-collections,
html.printing #sec-scorecard,
html.printing #sec-health,
html.printing #sec-workforce,
html.printing #sec-alerts { break-before: page; }
html.printing .grid-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
html.printing .grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
html.printing .cap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html.printing .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
html.printing .grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
html.printing .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
html.printing .span-2 { grid-column: span 2; }
html.printing .chart { height: 250px; }
html.printing .chart-sm { height: 210px; }
html.printing .table-wrap { overflow: visible; }
html.printing .alert-row { grid-template-columns: 110px minmax(0, 1fr) 110px 170px; }
html.printing .alert-row.head { display: grid; }
html.printing .alert-row > :nth-child(2) { grid-column: auto; grid-row: auto; }

@media print {
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .sidebar, .topbar, .no-print { display: none !important; }
  .print-only { display: block; }
}

/* Catalog page prints straight from @media print (no chart re-layout needed). */
@media print {
  .shell { display: block; }
  body { background: #fff; }
  .page { max-width: none; padding: 0; }
  .card { box-shadow: none; break-inside: avoid; }
  .doc section { break-inside: auto; }
  .table-wrap { overflow: visible; }
}
