/*
 * Print stylesheet, loaded with media="print".
 *
 * A recipe is printed to be cooked from: black on white, no shadows, nothing
 * tilted. On a post that holds a recipe card only the title, the picture
 * (small) and the card go to paper; the story stays on the screen. Any other
 * page prints its whole text. The last line names the site and the address.
 */

@page {
	margin: 16mm 14mm;
}

*,
*::before,
*::after {
	background: transparent !important;
	box-shadow: none !important;
	color: #000 !important;
	rotate: none !important;
	text-shadow: none !important;
	transform: none !important;
}

/* Every size in the theme is in rem, so this one line sets the whole page three quarters as large: about 10.5pt text. */
html {
	font-size: 75%;
}

html,
body {
	background: #fff !important;
}

.wp-site-blocks {
	display: block;
	min-height: 0;
}

/* What paper has no use for. */
.wp-site-blocks > header,
.wp-site-blocks > footer,
.skip-link,
.wp-block-navigation,
.wp-block-search,
.wp-block-buttons,
.wp-block-comments,
.wp-block-query-pagination,
.tpt-post-nav,
.tpt-section,
.tpt-post-meta,
.tp-recipe__actions {
	display: none !important;
}

/* A post with a recipe card: the card, not the story. */
body.single-post:has(.wp-block-taikinapoika-recipe) .tpt-post-body > :not(.wp-block-taikinapoika-recipe) {
	display: none !important;
}

body.single-post:has(.wp-block-taikinapoika-recipe) .wp-block-post-excerpt {
	display: none !important;
}

.wp-site-blocks > main,
.has-global-padding {
	padding: 0 !important;
}

.tpt-left > * {
	margin-inline: 0 !important;
	max-width: none !important;
}

/* Title, with the picture small beside it. */
.tpt-post-header {
	align-items: flex-start;
	display: flex;
	flex-wrap: nowrap;
	gap: 8mm;
	justify-content: space-between;
	margin: 0 0 6mm;
}

.tpt-post-header__text {
	flex: 1 1 auto;
}

.tpt-post-header .wp-block-post-title,
.tpt-page-title,
h1 {
	font-size: 26pt !important;
	line-height: 1.1;
	margin: 0;
}

.tpt-post-header > .wp-block-post-featured-image.is-style-print {
	flex: 0 0 45mm;
	padding: 0;
	width: 45mm;
}

.tpt-post-header > .wp-block-post-featured-image.is-style-print figcaption {
	display: none;
}

/* The card. */
.tp-recipe {
	border: 0 !important;
	border-top: 2pt solid #000 !important;
	border-radius: 0 !important;
	margin: 0 !important;
	padding: 4mm 0 0 !important;
}

.tp-recipe .tp-recipe__title {
	font-size: 18pt;
}

.tp-recipe__facts > li {
	border: 0.75pt solid #000;
}

.tp-recipe__body {
	gap: 6mm 10mm;
	margin-block-start: 5mm;
}

.tp-recipe__list td {
	border-bottom: 0.5pt solid #000 !important;
	padding-block: 1.2mm;
}

.tp-recipe__steps {
	gap: 3mm;
}

.tp-recipe__steps > li::before {
	border: 0.75pt solid #000;
}

.tp-recipe__list tr,
.tp-recipe__steps > li,
.tp-recipe__facts > li,
.tp-recipe .tp-recipe__tip {
	break-inside: avoid;
}

.tp-recipe h3,
.tp-recipe h4 {
	break-after: avoid;
}

.tp-recipe .tp-recipe__tip {
	font-size: 15pt;
	margin-block-start: 5mm;
}

/* Whole pages: keep pictures and headings sensible. */
img {
	max-width: 100% !important;
}

figure,
blockquote,
tr {
	break-inside: avoid;
}

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

a {
	text-decoration: none;
}

.wp-block-image.is-style-print,
.wp-block-post-featured-image.is-style-print,
.wp-block-group.is-style-print {
	padding: 0;
}

.wp-block-group:is(.is-style-note, .is-style-panel-butter, .is-style-panel-ink) {
	border: 0.75pt solid #000;
	float: none !important;
	width: auto !important;
}

/* The last line: where this came from. */
.wp-site-blocks .tpt-print-footer {
	border-top: 0.75pt solid #000;
	display: block !important;
	font-size: 9pt;
	margin: 6mm 0 0 !important;
	overflow-wrap: anywhere;
	padding-top: 2.5mm;
}
