/**
 * Print Styles for Pohadkozeme
 *
 * Optimized for printing fairy tales - presentable layout with branding
 *
 * @package Pohadkozeme
 * @version 3.3.0
 */

@media print {
	/* ==========================================================================
	   Base styles
	   ========================================================================== */
	html, body {
		background: none !important;
		color: #000 !important;
		font-size: 12pt !important;
		line-height: 1.6 !important;
	}

	* {
		box-shadow: none !important;
		text-shadow: none !important;
		border: none !important;
		border-top: none !important;
		border-bottom: none !important;
		border-left: none !important;
		border-right: none !important;
		outline: none !important;
	}

	/* Reset all pseudo-elements that might cause lines */
	*::before,
	*::after {
		display: none !important;
		border: none !important;
		background: none !important;
	}

	/* ==========================================================================
	   Hide unnecessary elements
	   ========================================================================== */
	.main-navigation,
	.site-footer,
	.header-social-link,
	.widget,
	.sidebar,
	.sidebar-area,
	.footer-widget-wrapper,
	.comments-area,
	.comment-respond,
	.navigation,
	.post-navigation,
	#infinite-handle,
	.entry-meta,
	.cat-links,
	.tags-links,
	.author-profile,
	.post-thumbnail,
	.meta-actions,
	.meta-separator,
	.backtotop,
	#search-modal,
	.site-bottom,
	.reading-progress-bar,
	.pohadkozeme-poll-container,
	.pohadko-poll-container,
	.kk-star-ratings,
	.post-actions,
	.header-actions,
	.menu-toggle,
	#header-image,
	.skip-link,
	.site-header {
		display: none !important;
	}

	/* ==========================================================================
	   Print header - simple text format (only on first page)
	   ========================================================================== */
	.print-header {
		display: block !important;
		margin-bottom: 12pt !important;
		padding-bottom: 8pt !important;
		border: none !important;
		border-bottom: 1pt solid #ddd !important;
		page-break-after: avoid !important;
		page-break-inside: avoid !important;
	}

	.print-header-title {
		font-size: 11pt !important;
		font-weight: normal !important;
		color: #000 !important;
		margin: 0 0 2pt 0 !important;
	}

	.print-header-url {
		font-size: 9pt !important;
		color: #666 !important;
		margin: 0 !important;
		font-family: monospace !important;
	}

	/* ==========================================================================
	   Article title
	   ========================================================================== */
	.entry-header {
		margin-bottom: 14pt !important;
		padding: 0 !important;
	}

	.entry-title {
		font-size: 18pt !important;
		font-weight: bold !important;
		margin: 0 !important;
		color: #000 !important;
		line-height: 1.3 !important;
	}

	/* ==========================================================================
	   Content area
	   ========================================================================== */
	.entry-content {
		font-size: 11pt !important;
		line-height: 1.7 !important;
		color: #000 !important;
		text-align: justify !important;
	}

	.entry-content p {
		margin: 0 0 10pt 0 !important;
		orphans: 4 !important;
		widows: 4 !important;
	}

	/* ==========================================================================
	   Images - float for text wrapping
	   ========================================================================== */
	.entry-content img {
		max-width: 40% !important;
		height: auto !important;
		float: right !important;
		margin: 0 0 10pt 14pt !important;
		border: 1pt solid #ddd !important;
		padding: 3pt !important;
	}

	/* First image floats left for variety */
	.entry-content p:first-of-type img,
	.entry-content > img:first-of-type {
		float: left !important;
		margin: 0 14pt 10pt 0 !important;
	}

	.entry-content figure,
	.entry-content .wp-block-image {
		max-width: 40% !important;
		float: right !important;
		margin: 0 0 8pt 14pt !important;
		padding: 0 !important;
	}

	.entry-content figure img,
	.entry-content .wp-block-image img {
		float: none !important;
		max-width: 100% !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	/* Hide image captions */
	.entry-content figcaption,
	.entry-content .wp-caption-text,
	.entry-content .wp-element-caption {
		display: none !important;
		height: 0 !important;
		margin: 0 !important;
		padding: 0 !important;
	}

	/* Clear floats after content - exception from global ::after reset */
	.entry-content::after {
		content: "" !important;
		display: table !important;
		clear: both !important;
	}

	/* ==========================================================================
	   Links - no special styling for print
	   ========================================================================== */
	a,
	a:link,
	a:visited,
	a:hover,
	a:active {
		color: #000 !important;
		text-decoration: none !important;
	}

	/* ==========================================================================
	   Layout
	   ========================================================================== */
	.site-content {
		max-width: none !important;
		padding: 0 !important;
		margin: 0 !important;
	}

	#page {
		width: 100% !important;
		max-width: none !important;
		padding: 0 !important;
		margin: 0 !important;
	}

	article {
		margin: 0 !important;
		padding: 0 !important;
	}

	.post-full,
	.post-full-summary {
		max-width: none !important;
		padding: 0 !important;
		margin: 0 !important;
	}

	/* ==========================================================================
	   Print footer - citation and copyright
	   ========================================================================== */
	.print-footer {
		display: block !important;
		margin-top: 20pt !important;
		padding-top: 10pt !important;
		border: none !important;
		border-top: 1pt solid #ddd !important;
		font-size: 9pt !important;
		color: #555 !important;
		clear: both !important;
	}

	.print-footer p {
		margin: 0 0 4pt 0 !important;
		text-align: left !important;
	}

	.print-footer .print-citation {
		font-style: italic !important;
	}

	/* ==========================================================================
	   Page breaks - prevent cut lines
	   ========================================================================== */
	h1, h2, h3, h4, h5, h6 {
		page-break-after: avoid !important;
		page-break-inside: avoid !important;
		break-after: avoid !important;
		break-inside: avoid !important;
	}

	img, figure {
		page-break-inside: avoid !important;
		break-inside: avoid !important;
	}

	p {
		orphans: 4 !important;
		widows: 4 !important;
		page-break-inside: avoid !important;
		break-inside: avoid !important;
	}

	/* Avoid breaking inside paragraphs with images */
	p:has(img) {
		page-break-inside: avoid !important;
		break-inside: avoid !important;
	}

	/* Keep entry content together where possible */
	.entry-content {
		page-break-before: avoid !important;
	}

	/* ==========================================================================
	   Page margins and running headers/footers
	   ========================================================================== */
	@page {
		margin: 2cm;
	}

	@page :first {
		margin-top: 1.5cm;
	}

	/* Explicitly disable any running headers/footers */
	@page :left {
		margin: 2cm;
	}

	@page :right {
		margin: 2cm;
	}
}
