/** ------------------------------------------------------------------------- *
 * Print stylesheet
 *
 * Enqueued for all media; everything except the wrapper reset below is inside
 * @media print. screen.css is screen-only, so print starts from unstyled HTML
 * and gets a clean reading-mode layout: logo, title, byline, image, text.
 * -------------------------------------------------------------------------- */

/** ------------------------------------------------------------------------- *
 * Print layout wrapper (header.php/footer.php)
 *
 * Plain blocks on screen. In print its thead/tfoot repeat on every page and
 * give top/bottom margins, and the cell padding gives side margins, so the
 * output has margins even when the browser ignores @page margins (e.g. when
 * "Margins: None" is selected in the print dialog).
 * -------------------------------------------------------------------------- */
table.print-layout,
.print-layout > tbody,
.print-layout > tbody > tr,
.print-layout > tbody > tr > td {
	display: block;
	width: auto;
	margin: 0;
	padding: 0;
	border: 0;
}

.print-layout > thead,
.print-layout > tfoot {
	display: none;
}

@media print {

	table.print-layout {
		display: table;
		width: 100%;
		border-collapse: collapse;
		break-inside: auto;
		page-break-inside: auto;
	}

	.print-layout > thead {
		display: table-header-group;
	}

	.print-layout > tfoot {
		display: table-footer-group;
	}

	.print-layout > tbody {
		display: table-row-group;
	}

	.print-layout > thead > tr,
	.print-layout > tfoot > tr,
	.print-layout > tbody > tr {
		display: table-row;
	}

	.print-layout > thead > tr > td,
	.print-layout > tfoot > tr > td,
	.print-layout > tbody > tr > td {
		display: table-cell;
		padding: 0 18mm;
		vertical-align: top;
	}

	.print-page-space {
		height: 15mm;
	}

	@page {
		margin: 0;
	}

	/** ------------------------------------------------------------------------- *
	 * Hide everything that isn't the article
	 * -------------------------------------------------------------------------- */
	#sitenav,
	.menutoggle,
	aside,
	.sidebar,
	.adspace,
	.custom-adspace,
	footer.site-footer,
	.story-footer,
	.storytop header > .category-tag,
	.printLink,
	.navigation,
	#comments,
	#respond,
	#wpadminbar,
	iframe,
	form,
	button,
	script,
	noscript,
	.skip-link {
		display: none !important;
	}

	/* Lazy images that haven't loaded yet would print as empty boxes */
	img.lazyload,
	img.lazyloading,
	.wp-caption:has(img.lazyload),
	.wp-caption:has(img.lazyloading),
	.smartgallery .slide:has(img.lazyload),
	.smartgallery .slide:has(img.lazyloading) {
		display: none !important;
	}

	/** ------------------------------------------------------------------------- *
	 * Base
	 * -------------------------------------------------------------------------- */
	html,
	body {
		margin: 0;
		padding: 0;
		background: #fff;
	}

	body {
		font-family: Georgia, Palatino, "Palatino Linotype", Times, "Times New Roman", serif;
		font-size: 11pt;
		line-height: 1.5;
		color: #000;
	}

	a,
	a:visited {
		color: inherit;
		text-decoration: none;
	}

	p {
		margin: 0 0 0.8em 0;
		orphans: 3;
		widows: 3;
	}

	h1, h2, h3, h4, h5, h6 {
		font-family: freight-neo-pro, "Century Gothic", AppleGothic, sans-serif;
		font-weight: 600;
		line-height: 1.2;
		letter-spacing: -0.01em;
		margin: 1.2em 0 0.4em 0;
		break-after: avoid;
		page-break-after: avoid;
		break-inside: avoid;
		page-break-inside: avoid;
	}

	h2 { font-size: 15pt; }
	h3 { font-size: 13pt; }
	h4, h5, h6 { font-size: 11pt; }

	/* Superscripts don't push lines apart */
	sup,
	sub {
		font-size: 75%;
		line-height: 0;
		position: relative;
		vertical-align: baseline;
	}

	sup { top: -0.45em; }
	sub { bottom: -0.25em; }

	hr {
		border: 0;
		border-top: 0.5pt solid #999;
		margin: 1em 0;
	}

	blockquote {
		margin: 1em 0;
		padding: 0 0 0 5mm;
		border-left: 1.5pt solid #999;
		font-style: italic;
	}

	blockquote,
	.story-content table,
	pre,
	figure,
	img {
		break-inside: avoid;
		page-break-inside: avoid;
	}

	ul, ol {
		margin: 0 0 0.8em 0;
		padding-left: 6mm;
	}

	/** ------------------------------------------------------------------------- *
	 * Site header: logo only
	 * -------------------------------------------------------------------------- */
	header.site-header {
		margin: 0 0 6mm 0;
	}

	header.site-header h1 {
		margin: 0;
	}

	header.site-header h1 a {
		display: block;
		width: 40mm;
		height: 10mm;
		background: url("images/logos/Montages_taglogo.png") no-repeat left center;
		background-size: contain;
		color: transparent;
		overflow: hidden;
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}

	/** ------------------------------------------------------------------------- *
	 * Article header
	 * -------------------------------------------------------------------------- */
	.storytop figure.featured {
		margin: 0;
	}

	.storytop figure.featured img {
		display: block;
		width: 100%;
		height: auto;
	}

	.storytop header .category-tag {
		font-family: freight-neo-pro, "Century Gothic", AppleGothic, sans-serif;
		font-size: 9pt;
		text-transform: uppercase;
		letter-spacing: 0.06em;
		color: #555;
		margin: 5mm 0 1mm 0;
	}

	.storytop header h1 {
		font-size: 24pt;
		line-height: 1.15;
		margin: 0 0 2mm 0;
	}

	.storytop .byline p {
		font-family: freight-neo-pro, "Century Gothic", AppleGothic, sans-serif;
		font-size: 10pt;
		color: #333;
		margin: 0;
	}

	.storytop .byline .author-name {
		font-weight: 600;
	}

	.storytop .byline hr {
		margin: 3mm 0 5mm 0;
	}

	/* Featured image caption is rendered separately, below the header */
	.storysubtop .wp-caption-text.featured {
		font-size: 8.5pt;
		line-height: 1.35;
		font-style: italic;
		color: #444;
		margin: -3mm 0 5mm 0;
	}

	/** ------------------------------------------------------------------------- *
	 * Article content
	 * -------------------------------------------------------------------------- */
	.story-content {
		font-size: 11pt;
	}

	/* First paragraph is usually the bold lead */
	.story-content > p:first-child b,
	.story-content > p:first-child strong {
		font-size: 12pt;
		line-height: 1.45;
	}

	.story-content img {
		display: block;
		max-width: 100%;
		height: auto;
		max-height: 200mm;
		object-fit: contain;
		margin: 0 auto;
	}

	.story-content .alignleft {
		float: left;
		margin: 1mm 5mm 2mm 0;
		max-width: 50%;
	}

	.story-content .alignright {
		float: right;
		margin: 1mm 0 2mm 5mm;
		max-width: 50%;
	}

	.story-content .wp-caption {
		width: auto !important;
		max-width: 100% !important;
		margin: 4mm 0 5mm 0;
		break-inside: avoid;
		page-break-inside: avoid;
	}

	.story-content .wp-caption a {
		display: block;
	}

	.story-content .wp-caption-text {
		font-size: 8.5pt;
		line-height: 1.35;
		font-style: italic;
		color: #444;
		text-align: left;
		margin: 1.5mm 0 0 0;
	}

	/* Image paragraphs without caption */
	.story-content p > a:only-child > img,
	.story-content p > img:only-child {
		margin: 4mm auto 5mm auto;
	}

	/* Slideshows: print all slides as a two-column grid */
	.smartgallery {
		margin: 4mm 0 5mm 0;
	}

	.smartgallery figure {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 3mm;
		margin: 0;
	}

	.smartgallery .slide {
		break-inside: avoid;
		page-break-inside: avoid;
	}

	.smartgallery .slide img {
		width: 100%;
		max-height: none;
	}

	.smartgallery .slide .wp-caption-text {
		display: none;
	}

	.smartgallery > .wp-caption-text span {
		display: block;
	}

	/** ------------------------------------------------------------------------- *
	 * Source line added by js/print.js
	 * -------------------------------------------------------------------------- */
	.print-source {
		display: block !important;
		font-family: freight-neo-pro, "Century Gothic", AppleGothic, sans-serif;
		font-size: 9pt;
		color: #333;
		border-top: 0.5pt solid #999;
		margin-top: 8mm;
		padding-top: 2mm;
		break-inside: avoid;
		page-break-inside: avoid;
	}
}
