/*
 * Print styles — loaded on every front-end page with media="print".
 *
 * Screen pages print badly for four reasons, each addressed here:
 * 1. Interactive chrome (nav, toggle, ticker, CTA band, footer nav)
 *    prints as dead weight.
 * 2. Placeholder gradient artwork and empty media boxes print as large
 *    blank or grey rectangles.
 * 3. The dark theme and mix-blend-mode effects invert or vanish on
 *    white paper.
 * 4. Cards and headings split across page boundaries.
 */

@media print {

	@page {
		margin: 18mm 15mm;
	}

	/* ---- 1. Force the print palette regardless of active theme ---- */
	:root,
	[data-theme="light"],
	[data-theme="dark"] {
		--wp--preset--color--ink: #1e1e1e;
		--wp--preset--color--paper: #ffffff;
		--wp--preset--color--paper-2: #ffffff;
		--rm-blend: normal;
		--rm-line: rgba(30,30,30,.2);
		--rm-line-soft: rgba(30,30,30,.1);
		--rm-ink-70: rgba(30,30,30,.75);
		--rm-ink-55: rgba(30,30,30,.6);
	}

	html,
	body {
		background: #ffffff !important;
		color: #1e1e1e !important;
	}

	* {
		box-shadow: none !important;
		text-shadow: none !important;
		mix-blend-mode: normal !important;
		animation: none !important;
		transition: none !important;
	}

	/* ---- 2. Hide screen-only chrome ---- */
	.rm-skip-link,
	.rm-theme-toggle,
	.rm-nav__cta,
	.rm-ticker,
	.rm-ticker-band,
	.rm-cta,
	.rm-footer__socials,
	.rm-footer__top nav,
	.rm-footer__heading,
	.rm-cs-card__link,
	.wp-block-search,
	form,
	.wp-block-buttons,
	.rm-lightbox,
	.rm-about-hero__parallax,
	.rm-team__photo,
	.rm-sidebar,
	.rm-section-link,
	.rm-row__link,
	.wp-block-query-pagination,
	.wp-block-comments,
	.wp-block-post-comments-form {
		display: none !important;
	}

	/* With the sidebar hidden, blog layouts run single column. */
	.rm-blog-layout {
		display: block !important;
	}

	/* Header reduces to the wordmark on its own line. */
	.rm-nav {
		position: static !important;
		background: none !important;
		border-bottom: 1px solid #d9d9d9;
	}

	.rm-nav .wp-block-navigation {
		display: none !important;
	}

	/* ---- 3. Placeholder artwork ---- */
	/* Empty media boxes and gradient tiles carry no information on
	   paper; collapse them rather than printing blank rectangles. */
	.rm-hero::before,
	.rm-cs-card__image:empty,
	.rm-spread__image:empty,
	[class*="rm-gallery__tile--"] {
		display: none !important;
	}

	.rm-cs-card__image img {
		max-height: 60mm;
		width: auto;
	}

	/* ---- 4. Fragmentation ---- */
	.rm-cs-card,
	.rm-plate,
	blockquote,
	figure,
	table {
		break-inside: avoid;
		page-break-inside: avoid;
	}

	h1, h2, h3, h4 {
		break-after: avoid;
		page-break-after: avoid;
	}

	/* ---- Layout and typography ---- */
	body {
		font-size: 11pt;
		line-height: 1.45;
	}

	.rm-hero {
		min-height: 0 !important;
		padding-top: 8mm !important;
	}

	.rm-section {
		padding-top: 8mm !important;
		padding-bottom: 8mm !important;
	}

	/* Two-up card grids hold at print width; anything wider folds to
	   two columns so metrics stay legible. */
	.rm-cs-grid {
		grid-template-columns: 1fr 1fr !important;
		gap: 6mm !important;
	}

	.rm-cs-card {
		border: 1px solid #d9d9d9 !important;
	}

	a {
		color: #1e1e1e !important;
		text-decoration: none;
	}

	/* Print the destination after real content links in running text,
	   but not after internal anchors or the wordmark. */
	.entry-content a[href^="http"]::after {
		content: " (" attr(href) ")";
		font-size: 8.5pt;
		color: #555;
		word-break: break-all;
	}

	/* Footer reduces to the identity line, contact block and notice. */
	.rm-footer {
		border-top: 1px solid #d9d9d9;
		padding-top: 5mm !important;
	}

	.rm-footer__top {
		display: block !important;
	}

	.rm-footer__bottom {
		margin-top: 4mm !important;
	}
}
