/* Printed recipe / recipe book layout. Loaded with media="print" from head.php.
 *
 * Each recipe aims to fit on one A4 page. view-recipe-content.php picks a density class
 * (density-normal / -compact / -tight / -minimal / -long, see recipePrintDensity() in recipe_helper.php)
 * which shrinks the type and photo as needed. 'minimal' drops the photo, and 'long' recipes
 * flow onto a second page with the method continuing there.
 */

@page {
	size: A4;
	margin: 13mm 15mm 13mm;
}

/* recipe book: no page number on the cover, numbered pages after it (Chrome/Edge 131+ only) */
@page book-recipe {
	@bottom-center {
		content: counter(page);
		font-family: Georgia, "Times New Roman", serif;
		font-size: 9pt;
		color: #6f625a;
	}
}

html,
body {
	height: auto;
	background: white !important;
}

body {
	font-family: Georgia, "Times New Roman", serif;
	font-size: 10.5pt;
	line-height: 1.42;
	color: #1d1915;
	text-align: left;
}

.maincontent {
	display: block;
	width: 100%;
	max-width: none;
	margin: 0;
}

nav,
body > footer,
body > br,
#flashMessage,
#ajaxRecipeSelector,
.recipe-actions,
.print-options,
.recipe-extra,
.status-message,
.admin-approval,
.book-toolbar {
	display: none !important;
}

a {
	color: inherit;
}

.print-only {
	display: block;
}


/* ********************* Single recipe ******************************** */

.recipe-page {
	max-width: none;
	margin: 0;
	color: #1d1915;
}

.print-eyebrow {
	font-family: var(--font-display);
	font-size: 8pt;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.18em;
	color: #9c3f1c;
	margin: 0 0 1.5mm;
}

.recipe-hero,
.recipe-hero.no-photo {
	display: block;
	max-width: none;
	margin: 0 0 5mm;
}

.recipe-title {
	font-size: 25pt;
	line-height: 1.08;
	color: #1d1915;
	margin: 0 0 1.5mm;
}

.recipe-byline {
	font-size: 8.5pt;
	font-style: italic;
	color: #5c524b;
	margin: 0 0 2.5mm;
}

.recipe-intro {
	font-size: 1em;
	font-style: italic;
	line-height: 1.42;
	color: #3a322d;
	margin: 0 0 3mm;
}

.recipe-facts {
	margin: 0 0 4.5mm;
	padding: 1.6mm 0;
	border-top: 1.2pt solid #1d1915;
	border-bottom: 0.5pt solid #1d1915;
	break-inside: avoid;
}

.recipe-facts li {
	display: block;
	padding: 0 4.5mm;
	border-left: 0.5pt solid #b9ada3;
}

.recipe-facts .icon {
	display: none;
}

.recipe-facts .label,
.recipe-facts strong {
	display: inline;
	font-size: 8.5pt;
	color: #1d1915;
}

.recipe-facts .label {
	margin-right: 1.2mm;
	color: #6f625a;
	letter-spacing: 0.1em;
}

.recipe-photo {
	aspect-ratio: auto;
	height: 72mm;
	margin: 0 0 5mm;
	border-radius: 0;
	box-shadow: none;
	background: none;
	break-inside: avoid;
}

body.print-no-photo .recipe-photo {
	display: none;
}

.recipe-body {
	display: grid;
	grid-template-columns: 54mm minmax(0, 1fr);
	gap: 7mm;
	align-items: start;
}

.recipe-section-title {
	display: block;
	font-size: 11pt;
	text-transform: uppercase;
	letter-spacing: 0.12em;
	color: #9c3f1c;
	margin: 0 0 2mm;
	padding: 0 0 1.2mm;
	border-bottom: 0.5pt solid #9c3f1c;
	break-after: avoid;
}

.recipe-ingredients {
	position: static;
	padding: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
}

.recipe-ingredients .serves-note {
	margin: 0 0 1.5mm;
	font-size: 8.5pt;
	font-style: italic;
	color: #5c524b;
}

.ingredient-list li {
	padding: 1mm 0;
	border-bottom: 0.4pt dotted #b9ada3;
	line-height: 1.3;
	break-inside: avoid;
}

.ingredient-list input[type="checkbox"] {
	display: none;
}

.ingredient-list label {
	display: block;
}

.ingredient-list input:checked + span {
	color: inherit;
	text-decoration: none;
}

.method-steps li {
	grid-template-columns: 6.5mm minmax(0, 1fr);
	gap: 2mm;
	padding: 0 0 2.6mm;
	font-size: 1em;
	line-height: 1.42;
	break-inside: avoid;
}

.step-num {
	display: block;
	width: auto;
	height: auto;
	border-radius: 0;
	background: none;
	color: #9c3f1c;
	font-size: 15pt;
	line-height: 1;
	padding-top: 0.3mm;
}

.step-name {
	display: inline;
	margin-right: 1mm;
}

.recipe-print-footer {
	display: flex;
	justify-content: space-between;
	gap: 5mm;
	margin-top: 4mm;
	padding-top: 1.8mm;
	border-top: 0.5pt solid #b9ada3;
	font-size: 7.5pt;
	color: #6f625a;
	break-inside: avoid;
}


/* ********************* Densities ******************************** */

.density-compact,
.density-long {
	font-size: 9.6pt;
}

.density-compact .recipe-title,
.density-long .recipe-title {
	font-size: 22pt;
}

.density-compact .recipe-photo {
	height: 52mm;
}

.density-long .recipe-photo {
	height: 60mm;
}

.density-compact .recipe-body,
.density-long .recipe-body {
	grid-template-columns: 50mm minmax(0, 1fr);
}

.density-tight,
.density-minimal {
	font-size: 8.9pt;
	line-height: 1.34;
}

.density-tight .recipe-title,
.density-minimal .recipe-title {
	font-size: 20pt;
}

.density-tight .recipe-photo {
	height: 40mm;
}

.density-minimal .recipe-photo {
	display: none;
}

.density-tight .recipe-body,
.density-minimal .recipe-body {
	grid-template-columns: 48mm minmax(0, 1fr);
	gap: 6mm;
}

.density-tight .method-steps li,
.density-minimal .method-steps li {
	padding-bottom: 1.8mm;
	line-height: 1.34;
}

.density-tight .ingredient-list li,
.density-minimal .ingredient-list li {
	padding: 0.7mm 0;
}


/* ********************* Recipe book ******************************** */

.book-cover {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: 255mm;
	max-width: none;
	margin: 0;
	padding: 0 10mm;
	border-radius: 0;
	background: none;
	box-shadow: none;
	break-after: page;
}

.book-cover h1 {
	font-size: 40pt;
	color: #1d1915;
}

.book-cover-photo-wrap {
	max-width: 120mm;
	margin: 10mm auto;
}

.book-cover .book-description {
	font-size: 13pt;
}

.book-contents {
	max-width: none;
	margin: 0;
	padding: 10mm 10mm 0;
	break-after: page;
}

.book-contents h2 {
	font-size: 24pt;
	margin-bottom: 8mm;
}

.book-contents li {
	padding: 1.6mm 0;
	border-bottom-color: #b9ada3;
	break-inside: avoid;
}

.book-contents li::before {
	color: #9c3f1c;
}

.book-recipe {
	page: book-recipe;
	padding: 0;
	margin: 0;
	border: 0;
	break-before: page;
}

/* cook's tips print full width under the method (the other .recipe-extra sections stay hidden) */
.recipe-extra.recipe-tips {
	display: block !important;
	margin-top: 4mm;
}

.recipe-tips p {
	max-width: none;
	margin: 0;
	line-height: 1.42;
}

/* ticked-off steps and the step buttons print like the plain numbers */
.method-steps li.done > div {
	opacity: 1;
}

button.step-num {
	border: 0;
	padding: 0;
}

.breadcrumbs,
.recipe-related,
.ingredient-tools,
.method-hint,
.js-add-shopping {
	display: none !important;
}

/* shopping list page */
.shopping-list .ingredient-list input:checked + span {
	text-decoration: line-through;
}
