/*
 * print.css — every content component must survive being printed.
 *
 * This is not a courtesy stylesheet. design-system.md §1 principle 2 makes
 * print-compatibility a system rule, because **this is how the products get
 * made**: the printable PDFs sold at M8 are assembled from these pages.
 * A prompt box that loses its text when printed is a broken product, not a
 * cosmetic bug.
 *
 * `!important` is permitted here and in reduced-motion only
 * (coding-standards.md §5).
 */

@media print {

	/* -----------------------------------------------------------------------
	 * Page setup
	 * -------------------------------------------------------------------- */

	@page {
		margin: 18mm 16mm;
	}

	html,
	body {
		background: #FFFFFF !important;
		color: #000000 !important;
		font-size: 11pt;
		line-height: 1.5;
	}

	/* -----------------------------------------------------------------------
	 * Remove everything that is navigation, not content
	 * -------------------------------------------------------------------- */

	.ait-header,
	.ait-drawer,
	.ait-drawer__backdrop,
	.ait-skip-link,
	.ait-footer__band,
	.ait-footer__cols,
	.ait-progress,
	.ait-iconbtn,
	nav,
	form,
	video,
	audio,
	iframe {
		display: none !important;
	}

	/* The legal line stays — attribution should survive a photocopy. */
	.ait-footer,
	.ait-footer__legal {
		display: block !important;
		border: 0 !important;
		margin: 0 !important;
		padding: 0 !important;
		background: transparent !important;
	}

	.ait-main {
		padding: 0 !important;
	}

	.ait-container,
	.ait-measure {
		max-width: none !important;
		padding: 0 !important;
		margin: 0 !important;
	}

	/* -----------------------------------------------------------------------
	 * Typography
	 * -------------------------------------------------------------------- */

	h1, h2, h3, h4 {
		color: #000000 !important;
		/* Never leave a heading stranded at the foot of a page. */
		break-after: avoid;
		page-break-after: avoid;
	}

	h1 { font-size: 20pt; }
	h2 { font-size: 15pt; }
	h3 { font-size: 13pt; }

	p, li, blockquote, figure, table {
		break-inside: avoid;
		page-break-inside: avoid;
		orphans: 3;
		widows: 3;
	}

	/*
	 * Print the destination of real links, so a printed guide stays usable.
	 * Deliberately NOT applied to in-page anchors or javascript: hrefs, which
	 * would just add noise.
	 */
	a[href^="http"]::after {
		content: " (" attr(href) ")";
		font-size: 9pt;
		word-break: break-all;
	}

	a {
		color: #000000 !important;
		text-decoration: underline !important;
	}

	/* -----------------------------------------------------------------------
	 * Content components — backgrounds drop to white, borders become rules
	 * (design-system.md §6). Colour is never the only signal, so the icon and
	 * text label carry the meaning once the fill is gone.
	 * -------------------------------------------------------------------- */

	.ait-callout,
	.ait-prompt,
	.ait-takeaways,
	.ait-what-you-need {
		background: #FFFFFF !important;
		border: 1pt solid #000000 !important;
		box-shadow: none !important;
		break-inside: avoid;
		page-break-inside: avoid;
	}

	/* The prompt box is the artifact readers came for. Its full text must
	 * print; only the copy button goes. */
	.ait-prompt__copy {
		display: none !important;
	}

	.ait-prompt__field {
		border-bottom: 1pt solid #000000 !important;
		font-weight: 700 !important;
	}

	table,
	th,
	td {
		border: 0.5pt solid #000000 !important;
	}

	thead th {
		background: #FFFFFF !important;
		font-weight: 700 !important;
	}

	img {
		max-width: 100% !important;
		break-inside: avoid;
		page-break-inside: avoid;
	}

	/* Shadows and rounded corners are screen affordances; on paper they are
	 * grey smudges and wasted toner. */
	* {
		box-shadow: none !important;
		border-radius: 0 !important;
	}
}
