/*
 * Druckfassung der Website.
 * Ziel: eine ausgedruckte Seite sieht aus wie ein Firmendokument -
 * Briefkopf mit Logo und Anschrift oben, Quelle unten, dazwischen nur
 * der Inhalt. Navigation, Schaltflächen und Fußmenü kosten Papier.
 */

@page {
	margin: 14mm 15mm 14mm 15mm;
}

@media print {

	html, body {
		background: #fff !important;
		color: #000 !important;
		font-size: 10pt;
		line-height: 1.4;
	}

	/* ---- Briefkopf und Fußzeile, auf jeder Seite ---- */

	.schoening-druckkopf {
		display: flex !important;
		align-items: flex-end;
		justify-content: space-between;
		gap: 10mm;
		margin-bottom: 8mm;
		padding-bottom: 2.5mm;
		border-bottom: 0.6mm solid #E30613;
		break-after: avoid;
		page-break-after: avoid;
	}

	/* Muss nach der allgemeinen Bildregel stehen und gewinnt darum. */
	.schoening-druckkopf img {
		height: 14mm !important;
		max-height: 14mm !important;
		width: auto !important;
		max-width: none !important;
		flex: 0 0 auto;
	}

	.schoening-druckkopf .anschrift {
		text-align: right;
		font-size: 8pt;
		line-height: 1.45;
		color: #333;
		flex: 0 0 auto;
	}

	.schoening-druckfuss {
		display: block !important;
		margin-top: 8mm;
		padding-top: 2mm;
		border-top: 0.3mm solid #C9C5BF;
		font-size: 7.5pt;
		color: #555;
	}

	/* ---- Was auf Papier nichts verloren hat ---- */

	header.wp-block-template-part,
	footer.wp-block-template-part,
	.wp-block-navigation,
	.wp-block-buttons,
	.wp-block-button,
	.wp-block-search,
	.wp-block-site-logo,
	#wpadminbar,
	.schoening-kein-druck {
		display: none !important;
	}

	/* ---- Spalten bleiben Spalten ---- */
	/* WordPress stapelt Spalten unter 782px Breite. Eine A4-Seite ist
	   schmaler als das - ohne diese Regel bekommt jede Kachel ein Blatt. */

	.wp-block-columns {
		display: flex !important;
		flex-wrap: nowrap !important;
		gap: 6mm !important;
	}

	.wp-block-column {
		flex: 1 1 0% !important;
		min-width: 0 !important;
		margin: 0 !important;
	}

	/* ---- Flächen und Farben ---- */

	.has-anthrazit-background-color,
	.has-rot-background-color,
	.has-rot-dunkel-background-color,
	.has-sand-background-color {
		background: #fff !important;
		color: #000 !important;
	}

	.has-anthrazit-background-color *,
	.has-rot-background-color *,
	.has-weiss-color,
	.has-grau-hell-color {
		color: #000 !important;
	}

	.has-rot-color, .has-rot-hell-color { color: #A8040E !important; }

	/* ---- Typografie und Umbruch ---- */

	h1, h2, h3 { break-after: avoid; page-break-after: avoid; margin-top: 6mm; }
	h1 { font-size: 19pt; }
	h2 { font-size: 14pt; }
	h3 { font-size: 11.5pt; }

	.wp-block-column,
	figure { break-inside: avoid; page-break-inside: avoid; }

	.wp-block-group { padding-top: 4mm !important; padding-bottom: 4mm !important; }

	/* ---- Bilder ---- */

	img {
		max-width: 100%;
		max-height: 55mm;
		height: auto;
		object-fit: cover;
	}

	.wp-block-cover {
		min-height: 0 !important;
		max-height: 60mm;
		padding: 6mm !important;
	}

	.wp-block-cover__image-background { display: none !important; }
	.wp-block-cover__background { display: none !important; }
	.wp-block-cover .wp-block-cover__inner-container { position: static; }

	/* ---- Links ---- */

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

	.wp-block-post-content a[href^="http"]:not([href*="schoening-bau.de"])::after {
		content: " (" attr(href) ")";
		font-size: 7.5pt;
		color: #666;
		word-break: break-all;
	}
	.wp-block-post-content a[href^="tel:"]::after,
	.wp-block-post-content a[href^="mailto:"]::after,
	.wp-block-post-content .wp-block-image a::after {
		content: "" !important;
	}
}
