/**
 * Print stylesheet. SPEC §7.5.
 *
 * A real print stylesheet, not a screenshot. Both report sheets are roughly two
 * portrait pages, and the splitting bugs only show up past page 2 — test with
 * at least three pages of content, in Chrome AND Firefox.
 *
 * Charts are inline SVG rather than canvas precisely so they print in both
 * (§7.5, assets/js/ha-charts.js).
 */

@media print {
	@page {
		size: A4 portrait;
		margin: 15mm;
	}

	.ha-report-section,
	.ha-delta-block,
	.ha-chart,
	.ha-silhouette,
	.ha-macro-panel,
	.ha-norms-table,
	.ha-card {
		break-inside: avoid;
		page-break-inside: avoid;
	}

	.ha-report-header {
		break-after: avoid;
		page-break-after: avoid;
	}

	.ha-page-2 {
		break-before: page;
		page-break-before: always;
	}

	.ha-no-print,
	.ha-tabs,
	.ha-actions,
	.ha-app nav,
	.ha-app button {
		display: none;
	}

	/* No URL noise after links. */
	.ha-app a[href]::after {
		content: "";
	}

	.ha-app p {
		orphans: 3;
		widows: 3;
	}

	.ha-app {
		background: #fff;
		color: #000;
		--ha-text: #000;
		--ha-bg: #fff;
		--ha-surface: #fff;
		--ha-border: #999;
		--ha-text-muted: #444;
	}

	/* Keep the meaning-bearing colours, which are the whole point of a delta
	   block, but the report never relies on colour alone (§12.M). */
	.ha-app .ha-delta.ha-good,
	.ha-app .ha-delta.ha-bad,
	.ha-app .ha-norms-hit,
	.ha-app .ha-vo2-pip {
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}

	/* The chart's data table is a useful printed appendix, so open it. */
	.ha-chart-table {
		display: block;
	}

	.ha-chart-table > summary {
		display: none;
	}

	.ha-chart-table > table {
		display: table;
	}

	.ha-scroll-x {
		overflow: visible;
	}

	.ha-print-header {
		display: block;
		position: running(haHeader);
	}
}
