// Fylgja (https://fylgja.dev)
// Licensed under MIT Open Source

@media print {
	:root {
		--root-bg: white;
		--root-fg: black;
	}

	:is(h1, h2, h3, h4, h5, h6) {
		break-after: avoid;
	}

	:is(h2, h3, h4, h5, h6, p) {
		orphans: 3;
		widows: 3;
	}

	:is(tr, img, svg, pre, blockquote) {
		break-inside: avoid;
	}

	abbr[title]::after {
		content: " (" attr(title) ")";
	}

	a[href^="https://"]::after {
		content: " (" attr(href) ")";
	}

	// Repeat the table header per page
	thead {
		display: table-header-group;
	}

	// Keep bg colors for interactive elements
	:is(input, select, textarea, button, .btn) {
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}
}
