/**
 * KMG Share — print media styles.
 *
 * Loaded with media="print". The screen version of the recipe page has too
 * much decoration (hero, big backgrounds, huge padding, decorative dots) to
 * print well, so instead of overriding every theme rule we hide the whole
 * page and reveal a purpose-built .kmg-share-print-card element that the
 * plugin injects into wp_footer.
 *
 * @package KMG_Share
 * @since   0.1.0
 */

@page {
	/* Wider left margin acts as Heftrand — leaves room for staple / binder. */
	margin: 1.5cm 1.5cm 1.5cm 2.5cm;
}

/* Reset paper: white background, black text, no theme backgrounds bleeding through. */
html,
body {
	background: #fff !important;
	color: #000 !important;
}

/* Hide every top-level page node except the print card. */
body > *:not(.kmg-share-print-card) {
	display: none !important;
}

.kmg-share-print-card {
	display: block !important;
	max-width: 100%;
	margin: 0;
	padding: 0;
	color: #000;
	background: #fff;
	font-family: Georgia, "Times New Roman", serif;
	font-size: 11pt;
	line-height: 1.4;
}

.kmg-share-print-card__header-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1em;
	margin-bottom: 1.5em;
}


.kmg-share-print-card__logo {
	flex: 0 0 180px;
	width: 180px;
}

.kmg-share-print-card__logo img {
	display: block;
	width: 100%;
	height: auto;
}

/* Header */

.kmg-share-print-card__header {
	margin-bottom: 1em;
}

.kmg-share-print-card__title-wrap {
	flex: 1;
	padding-top: 8px; /* nudge title/subhead pair down to match logo centerline */
}

.kmg-share-print-card__title {
	font-size: 22pt;
	font-weight: 700;
	margin: 0;
	break-after: avoid;
	page-break-after: avoid;
}

.kmg-share-print-card__diet {
	margin: 0.2em 0 0;
	font-family: Helvetica, Arial, sans-serif;
	font-size: 10pt;
	font-weight: 600;
	color: #555;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.kmg-share-print-card__lead {
	font-style: italic;
	margin: 0.6em 0 0;
}

/* Meta — bordered table, sized to fit all cells on one row */

.kmg-share-print-card__meta {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
	margin: 0.3em 0 0.6em;
	font-size: 8pt;
}

.kmg-share-print-card__meta th,
.kmg-share-print-card__meta td {
	border: 1px solid #ccc;
	padding: 0.3em 0.5em;
	text-align: left;
	vertical-align: middle;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

.kmg-share-print-card__meta th {
	font-family: Helvetica, Arial, sans-serif;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #333;
	font-size: 7pt;
}

.kmg-share-print-card__meta td {
	font-weight: 700;
	font-size: 9pt;
}

/* Sections (Zutaten, Zubereitung, Nährwerte) */

.kmg-share-print-card__section {
	margin-top: 1.2em;
}

.kmg-share-print-card__section h2 {
	font-size: 14pt;
	font-weight: 700;
	border-bottom: 1px solid #ccc;
	padding-bottom: 0.15em;
	margin: 0 0 0.6em;
	break-after: avoid;
	page-break-after: avoid;
}

.kmg-share-print-card__section h3 {
	font-size: 11pt;
	font-weight: 700;
	margin: 0.9em 0 0.4em;
	break-after: avoid;
	page-break-after: avoid;
}

/* Ingredients — two-column, table-like grid.
   Grid (rather than CSS columns) so rows read left-to-right, top-to-bottom,
   and paired cells share a row height automatically. */

.kmg-share-print-card__ingredients {
	list-style: none !important;
	padding: 0;
	margin: 0 0 0.5em;
	display: grid;
	grid-template-columns: 1fr 1fr;
	border-top: 1px solid #ccc;
}

/* Kill any theme-inherited bullets (::marker or ::before decorations). */
.kmg-share-print-card__ingredients li {
	list-style: none !important;
}
.kmg-share-print-card__ingredients li::marker {
	content: '' !important;
	color: transparent !important;
}
.kmg-share-print-card__ingredients li::before {
	content: none !important;
	display: none !important;
}

.kmg-share-print-card__ingredients li {
	display: grid;
	grid-template-columns: 6em 1fr;
	gap: 0.4em;
	padding: 0.3em 0.4em;
	border-bottom: 1px solid #ccc;
	break-inside: avoid;
	page-break-inside: avoid;
	align-items: center;
	font-size: 10pt;
}

/* Vertical rule between the two columns of ingredients. */
.kmg-share-print-card__ingredients li:nth-child(even) {
	border-left: 1px solid #ccc;
}

.kmg-share-print-card__ingredients .qty {
	font-weight: 700;
	text-align: right;
	padding-right: 0.5em;
	border-right: 1px solid #ccc;
	white-space: nowrap;
}

/* Preparation steps */

.kmg-share-print-card__steps {
	margin: 0 0 0.6em;
	padding-left: 1.6em;
}

.kmg-share-print-card__steps li {
	margin-bottom: 0.55em;
	break-inside: avoid;
	page-break-inside: avoid;
}

/* Nutrition — same look as the meta table */

.kmg-share-print-card__nutrition {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
	margin: 0.3em 0;
	font-size: 8pt;
}

.kmg-share-print-card__nutrition th,
.kmg-share-print-card__nutrition td {
	border: 1px solid #ccc;
	padding: 0.3em 0.5em;
	text-align: left;
	vertical-align: middle;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

.kmg-share-print-card__nutrition th {
	font-family: Helvetica, Arial, sans-serif;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	color: #333;
	font-size: 7pt;
}

.kmg-share-print-card__nutrition td {
	font-weight: 700;
	font-size: 9pt;
}

/* Footer */

.kmg-share-print-card__footer {
	margin-top: 1.5em;
	padding-top: 0.5em;
	border-top: 1px solid #ccc;
	font-family: Helvetica, Arial, sans-serif;
	font-size: 8.5pt;
	color: #444;
	text-align: right;
}
