/* Dedicated print layout for the comparison page (Ctrl+P). Loaded with media="print".
 * Without it the browser printed the whole site footer, the theme added every link URL in
 * brackets and the floating tray was printed over the content. Screen styles untouched. */
@media print {
	/* Floating tray: never on paper, whatever the page. */
	.cb-compare-tray {
		display: none !important;
	}

	/* No "size": portrait or landscape is the one chosen in the print dialog. */
	@page cb-compare {
		margin: 12mm 10mm;
	}

	html:has(#cb-compare-root .cb-compare-table),
	html:has(#cb-compare-root .cb-compare-table) body {
		page: cb-compare;
	}

	/* Keep only the ancestor path to the comparison and remove its siblings at every level. */
	body:has(#cb-compare-root .cb-compare-table) > :not(#cb-compare-root):not(:has(#cb-compare-root)),
	body:has(#cb-compare-root .cb-compare-table) *:has(#cb-compare-root) > :not(#cb-compare-root):not(:has(#cb-compare-root)) {
		display: none !important;
	}

	html:has(#cb-compare-root .cb-compare-table),
	body:has(#cb-compare-root .cb-compare-table),
	body:has(#cb-compare-root .cb-compare-table) *:has(#cb-compare-root) {
		display: block !important;
		position: static !important;
		float: none !important;
		width: auto !important;
		min-width: 0 !important;
		max-width: none !important;
		height: auto !important;
		min-height: 0 !important;
		max-height: none !important;
		margin: 0 !important;
		padding: 0 !important;
		overflow: visible !important;
		transform: none !important;
		background: #fff !important;
		border: 0 !important;
		box-shadow: none !important;
	}

	html body #cb-compare-root {
		display: block !important;
		width: 100% !important;
		margin: 0 !important;
		padding: 0 !important;
		font: 9pt/1.35 Arial, Helvetica, sans-serif !important;
		color: #202a30 !important;
		print-color-adjust: exact;
		-webkit-print-color-adjust: exact;
	}

	/* Page title, translated, carried by the shortcode container. */
	html body #cb-compare-root::before {
		content: attr(data-cb-print-title);
		display: block;
		margin: 0 0 4mm;
		padding: 0 0 3mm;
		border-bottom: 0.6mm solid #1A8DA1;
		font: 600 18pt/1.2 Arial, Helvetica, sans-serif;
		color: #202a30;
	}

	/* Theme print reset writes " (url)" after links: not on this page. */
	html body #cb-compare-root a::after,
	html body #cb-compare-root a[href]::after {
		content: none !important;
	}

	/* Actions are useless on paper. */
	html body #cb-compare-root button,
	html body #cb-compare-root .cb-compare-table__remove,
	html body #cb-compare-root .cb-compare-clear,
	html body #cb-compare-root .cb-compare-table__link {
		display: none !important;
	}

	html body #cb-compare-root .cb-compare-table-wrap {
		overflow: visible !important;
		max-width: none !important;
	}
	html body #cb-compare-root .cb-compare-table {
		width: 100% !important;
		min-width: 0 !important;
		table-layout: fixed;
		border-collapse: collapse !important;
	}
	html body #cb-compare-root .cb-compare-table thead {
		display: table-header-group; /* repeated on every sheet */
	}
	html body #cb-compare-root .cb-compare-table tr {
		break-inside: avoid;
		page-break-inside: avoid;
	}
	html body #cb-compare-root .cb-compare-table th,
	html body #cb-compare-root .cb-compare-table td {
		min-width: 0 !important;
		padding: 2mm 2.5mm !important;
		border: 0.25mm solid #bfc9ce !important;
		font: 9pt/1.35 Arial, Helvetica, sans-serif !important;
		color: #202a30 !important;
		text-align: center;
		vertical-align: top;
		overflow-wrap: anywhere;
	}
	html body #cb-compare-root .cb-compare-table thead th {
		background: #1A8DA1 !important;
		color: #fff !important;
		vertical-align: bottom;
	}
	html body #cb-compare-root .cb-compare-table thead th.cb-compare-table__corner {
		width: 28mm;
		background: #fff !important;
		border: 0 !important;
	}
	html body #cb-compare-root .cb-compare-table__row-label {
		background: #f2f4f5 !important;
		font-weight: 600 !important;
		text-align: left;
		white-space: normal !important;
	}
	html body #cb-compare-root .cb-compare-table__photo {
		display: block !important;
		width: 100% !important;
		max-width: 100% !important;
		height: 26mm !important;
		margin: 0 auto 2mm !important;
		object-fit: cover;
		border-radius: 0 !important;
	}
	html body #cb-compare-root .cb-compare-table__title {
		margin: 0 !important;
		font: 600 9pt/1.3 Arial, Helvetica, sans-serif !important;
		color: #fff !important;
	}
}
