/**
 * Školka – print styles (enqueued with media="print").
 *
 * Main goal: one Jídelníček week on one A4 page (single week and the current
 * week on the archive). Everything else prints as plain black-on-white text;
 * navigation, buttons and decorations are dropped.
 */

@page {
	size: a4;
	margin: 12mm;
}

/* ---------- Hide chrome, interactive elements and decorations ---------- */

#wpadminbar,
.skip-link,
.sk-topbar,
.site-header,
.main-navigation,
#mobile-menu-control-wrapper,
.site-footer,
.sk-breadcrumbs,
.sk-hero__actions,
.sk-print-button,
.sk-btn,
.wp-block-buttons,
.wp-block-file__button,
.sk-post-footer,
.sk-post-nav,
.sk-chips,
.navigation.pagination,
.page-links,
.sk-comments,
.comments-area,
.search-form,
.sk-section__link,
.sk-card__placeholder,
.sk-hero::before,
.sk-hero::after,
.sk-hero-block::before,
.sk-section--tinted::before,
.sk-eyebrow::before,
.sk-hero__eyebrow::before,
.sk-menu-day__title::before,
.sk-menu-note::before,
.wp-block-details > summary::before {
	display: none !important;
}

.sk-print-only {
	display: block !important;
}

html {
	margin-top: 0 !important;
}

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

/* Same specificity as design-system.css's li::marker; wins because this file loads later. */
li::marker {
	color: #000;
}

/* ---------- Page and content flow ---------- */

body {
	font-size: 11pt;
	line-height: 1.45;
}

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

p,
li {
	orphans: 3;
	widows: 3;
}

img,
figure,
table,
.sk-card,
.wp-block-quote {
	break-inside: avoid;
	page-break-inside: avoid;
}

/* Lead and top-level images stay small enough to share the first page with the text. */
.sk-featured__image,
.sk-entry > .wp-block-image img {
	width: auto;
	max-height: 80mm;
	margin-inline: auto;
}

.sk-container,
.sk-entry {
	max-width: none !important;
	padding: 0 !important;
}

.sk-entry > *,
.sk-entry > .alignwide,
.sk-entry > .alignfull {
	width: auto;
	max-width: none;
	margin-inline: 0;
}

.sk-section,
.sk-article,
.sk-front-content {
	padding: 0 !important;
}

.sk-hero {
	overflow: visible;
	padding: 0 0 4mm !important;
}

.sk-hero__title {
	max-width: none;
	font-size: 20pt;
}

.sk-hero__lead,
.sk-hero__meta {
	margin-top: 1.5mm;
	font-size: 11pt;
}

.is-style-skolka-card,
.is-style-skolka-card-stitched,
.sk-password-form,
.sk-week-card {
	outline: 0 !important;
	border: 1px solid #555;
}

.sk-card {
	border: 1px solid #555;
}

.sk-badge {
	padding: 0 1.5mm;
	border: 1px solid #000;
}

/* Checklist ticks are background images; print a text tick instead. */
.is-style-skolka-checklist > li::before {
	content: "✓";
	top: 0;
	width: auto;
	height: auto;
	font-weight: 700;
}

/* Show where content links lead (not for linked images). */
.sk-entry a[href^="http"]:not(:has(img))::after {
	content: " (" attr(href) ")";
	font-size: 85%;
	word-break: break-all;
}

/* ---------- Jídelníček: one week on one A4 page ---------- */

.single-jidelnicek .sk-hero,
.post-type-archive-jidelnicek .sk-hero,
.post-type-archive-jidelnicek .sk-menu-archive,
.sk-menu-feature__header,
.sk-menu-feature__next {
	display: none !important;
}

.sk-print-header {
	margin: 0 0 4mm !important;
	padding-bottom: 2mm;
	border-bottom: 1.5pt solid #000;
	font-family: var(--sk-font-heading);
	font-size: 15pt;
	font-weight: 700;
	line-height: 1.2;
}

.sk-menu-week {
	font-size: 10.5pt;
	line-height: 1.3;
}

.sk-menu-week > * + * {
	margin-top: 2.5mm !important;
}

.sk-menu-week a[href^="http"]::after {
	content: none;
}

.sk-menu-note {
	margin: 0 0 3mm !important;
	font-size: 9pt;
}

.sk-menu-day {
	margin: 0;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	break-inside: avoid;
	page-break-inside: avoid;
}

.sk-menu-day__title {
	margin: 0 0 1mm !important;
	font-size: 11.5pt;
	font-weight: 700;
}

.sk-menu-day > .sk-menu-day__title + * {
	margin-top: 0 !important;
}

.sk-menu-week .wp-block-table {
	overflow: visible;
	margin: 0;
	border: 0 !important;
	border-radius: 0 !important;
}

.sk-menu-week table {
	border-collapse: collapse;
}

/* Beats .wp-block-table.is-style-skolka-menu table (0,2,1): a full-width collapsed 1px border falls just outside the page box. */
.sk-entry .wp-block-table table {
	width: calc(100% - 1px);
}

.sk-menu-week :is(th, td) {
	display: table-cell !important;
	padding: 1mm 2mm !important;
	border: 1px solid #555 !important;
	font-size: 10.5pt;
	line-height: 1.3;
	vertical-align: top;
}

.sk-menu-week tr {
	display: table-row !important;
}

.sk-menu-week .wp-block-table :is(th, td):first-child {
	width: 28mm !important;
	font-size: 9pt;
	font-weight: 700;
	letter-spacing: 0;
	text-transform: none;
}

.sk-menu-legend {
	margin-top: 3mm !important;
	font-size: 8.5pt;
	break-inside: avoid;
	page-break-inside: avoid;
}

.sk-menu-legend > summary {
	display: block;
	min-height: 0;
	padding: 0;
	font-weight: 700;
}

/* Print the allergen list even when the details element is closed (where supported). */
.sk-menu-legend::details-content {
	content-visibility: visible;
}

.sk-menu-legend :is(ol, ul) {
	margin: 1mm 0 0;
	padding-left: 5mm;
	font-size: 8.5pt;
	column-gap: 6mm;
	columns: 3;
}
