/**
 * Country PDF/print layout — plain CSS (no Tailwind build required).
 * Active when body has class strl-print-flow ( ?_strl_print= in URL ).
 * Screen capture for html2pdf uses #main.strl-pdf-capture-root (clone survives into parent doc).
 */

@media screen {
	.strl-print-doc-header,
	.strl-print-source-url {
		display: none !important;
	}

	/**
	 * Print iframe (?_strl_print=): show logo on screen so the image loads.
	 * display:none on the normal page prevents loading; capture would then miss it.
	 */
	body.strl-print-flow .strl-print-doc-header {
		display: block !important;
		visibility: visible !important;
		margin-bottom: 1.5rem;
		text-align: left;
	}

	body.strl-print-flow .strl-print-doc-header img {
		display: block !important;
		visibility: visible !important;
		max-height: 96px;
		height: auto;
		width: auto;
		max-width: 220px;
		object-fit: contain;
		object-position: left;
	}

	/**
	 * html2pdf / html2canvas capture mode (screen only).
	 * Mirrors @media print rules. Root class is on #main so styles apply after html2pdf clones it.
	 */
	#main.strl-pdf-capture-root .strl-print-doc-header,
	#main.strl-pdf-capture-root .strl-print-source-url {
		display: block !important;
		visibility: visible !important;
	}

	#main.strl-pdf-capture-root .strl-print-doc-header {
		margin-bottom: 1.5rem;
		text-align: left;
	}

	#main.strl-pdf-capture-root .strl-print-doc-header img {
		display: block !important;
		visibility: visible !important;
		max-height: 96px;
		height: auto;
		width: auto;
		max-width: 220px;
		object-fit: contain;
		object-position: left;
	}

	#main.strl-pdf-capture-root a.btn[href*='legislation'],
	#main.strl-pdf-capture-root a[href*='legislation'].btn,
	#main.strl-pdf-capture-root a.btn[href*='Legislation'],
	#main.strl-pdf-capture-root a[href*='Legislation'].btn,
	#main.strl-pdf-capture-root a.btn[href*='l%C3%A9gislation'],
	#main.strl-pdf-capture-root a.btn[href*='législation'] {
		display: none !important;
	}

	#main.strl-pdf-capture-root #site-header,
	#main.strl-pdf-capture-root .offcanvas,
	#main.strl-pdf-capture-root #mobile-menu,
	#main.strl-pdf-capture-root .grecaptcha-badge,
	#main.strl-pdf-capture-root footer.section {
		display: none !important;
	}

	#main.strl-pdf-capture-root [data-print-page],
	#main.strl-pdf-capture-root .strl-print-page-btn,
	#main.strl-pdf-capture-root .strl-country-pdf-btn,
	#main.strl-pdf-capture-root .sidebar-item:has([data-print-page]),
	#main.strl-pdf-capture-root .sidebar-item:has(.strl-country-pdf-btn),
	#main.strl-pdf-capture-root div:has(> .strl-country-pdf-btn) {
		display: none !important;
	}

	#main.strl-pdf-capture-root .strl-print-exclude {
		display: none !important;
	}

	#main.strl-pdf-capture-root {
		color: #000;
		font-size: 16px;
		line-height: 1.45;
		max-width: 100%;
	}

	/* Compact page header → body gap (hero image / min-heights / section margins). */
	#main.strl-pdf-capture-root .header-50-50 .background-layer,
	#main.strl-pdf-capture-root .header-50-50 .accent-border,
	#main.strl-pdf-capture-root .breadcrumbs {
		display: none !important;
	}

	#main.strl-pdf-capture-root .header-50-50,
	#main.strl-pdf-capture-root .header-simple {
		min-height: 0 !important;
		height: auto !important;
		padding-top: 0 !important;
		padding-bottom: 0 !important;
		margin: 0 !important;
		background: transparent !important;
	}

	#main.strl-pdf-capture-root .header-50-50 .grid-container,
	#main.strl-pdf-capture-root .header-simple .grid-container {
		padding-top: 0 !important;
		padding-bottom: 0.5rem !important;
		height: auto !important;
	}

	#main.strl-pdf-capture-root .header-50-50 .grid,
	#main.strl-pdf-capture-root .header-50-50 .h-full,
	#main.strl-pdf-capture-root .header-simple .h-full,
	#main.strl-pdf-capture-root .header-simple [class*='min-h-'] {
		height: auto !important;
		min-height: 0 !important;
	}

	#main.strl-pdf-capture-root .header-50-50 .flex.flex-col.justify-center {
		justify-content: flex-start !important;
	}

	#main.strl-pdf-capture-root .header-50-50 h1,
	#main.strl-pdf-capture-root .header-simple h1 {
		margin-bottom: 0.25rem !important;
		color: #064864 !important;
	}

	#main.strl-pdf-capture-root .header-simple h1,
	#main.strl-pdf-capture-root .header-simple h2 {
		color: #064864 !important;
	}

	#main.strl-pdf-capture-root .header-50-50 + section,
	#main.strl-pdf-capture-root .header-simple + section,
	#main.strl-pdf-capture-root .header-50-50 + .text-block,
	#main.strl-pdf-capture-root .header-simple + .text-block {
		margin-top: 0.5rem !important;
		margin-bottom: 1rem !important;
		padding-top: 0 !important;
	}

	#main.strl-pdf-capture-root .text-block.single-content .text > :first-child {
		margin-top: 0 !important;
	}

	/* Title moved into text column (see compactHeaderForCapture). */
	#main.strl-pdf-capture-root .strl-pdf-page-title {
		margin: 0 0 0.75rem !important;
		padding: 0 !important;
	}

	#main.strl-pdf-capture-root .strl-pdf-page-title h1,
	#main.strl-pdf-capture-root .strl-pdf-page-title h2 {
		color: #064864 !important;
	}

	#main.strl-pdf-capture-root .strl-pdf-page-title h1 {
		margin: 0 0 0.35rem !important;
	}

	#main.strl-pdf-capture-root .strl-pdf-page-title h2 {
		margin: 0 !important;
	}

	#main.strl-pdf-capture-root .text-block.single-content {
		margin-top: 0 !important;
		padding-top: 0 !important;
	}

	/*
	 * Avoid splitting small blocks only.
	 * Do NOT avoid on p/h1/sections — that pushes body text to the next page
	 * and leaves the title alone above a half-empty page.
	 */
	#main.strl-pdf-capture-root :is(img, tr, li, .people-card, .strl-pdf-tooltip) {
		break-inside: avoid;
		page-break-inside: avoid;
	}

	#main.strl-pdf-capture-root :is(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6) {
		color: #064864;
	}

	#main.strl-pdf-capture-root :is(p, h1, h2, h3, h4, h5, h6, section, .text-block) {
		break-inside: auto;
		page-break-inside: auto;
		break-after: auto;
		page-break-after: auto;
	}

	#main.strl-pdf-capture-root a:not(.btn) {
		color: #000;
		text-decoration: underline;
	}

	#main.strl-pdf-capture-root .text-block .flex.flex-wrap {
		display: block !important;
	}

	#main.strl-pdf-capture-root .text-block .flex.flex-wrap > div,
	#main.strl-pdf-capture-root [class*='flex-col-'],
	#main.strl-pdf-capture-root .flex-full {
		flex: none !important;
		width: 100% !important;
		max-width: 100% !important;
		margin-left: 0 !important;
		min-width: 0 !important;
	}

	#main.strl-pdf-capture-root .grid {
		display: block !important;
	}

	#main.strl-pdf-capture-root .grid > * {
		width: 100% !important;
		max-width: 100% !important;
	}

	/* People card: keep photo circular — blanket grid rules above stretch it. */
	#main.strl-pdf-capture-root .people-card .card-inner.grid {
		display: grid !important;
		grid-template-columns: 116px 1fr !important;
		gap: 22px !important;
		align-items: start !important;
	}

	#main.strl-pdf-capture-root .people-card .card-inner.grid > * {
		width: auto !important;
		max-width: none !important;
	}

	#main.strl-pdf-capture-root .people-card header {
		width: 116px !important;
		height: 116px !important;
		max-width: 116px !important;
		max-height: 116px !important;
		min-width: 116px !important;
		min-height: 116px !important;
		overflow: hidden !important;
		border-radius: 9999px !important;
		background-size: cover !important;
		background-position: center !important;
		background-repeat: no-repeat !important;
	}

	/* Img hidden after JS sets header background (html2canvas ignores object-fit). */
	#main.strl-pdf-capture-root .people-card header picture,
	#main.strl-pdf-capture-root .people-card header img {
		display: none !important;
	}

	#main.strl-pdf-capture-root .grid-container {
		max-width: 100% !important;
		width: 100% !important;
		margin-left: auto !important;
		margin-right: auto !important;
	}

	/* Source page: last block in #main (see moveSourceToBottom). */
	#main.strl-pdf-capture-root > .strl-print-source-url {
		display: block !important;
		visibility: visible !important;
		width: 100% !important;
		max-width: 100% !important;
		margin-top: 2rem;
		margin-bottom: 0;
		padding-top: 1.5rem;
		border-top: 1px solid #d1d5db;
		color: #000;
		font-size: inherit;
		line-height: inherit;
	}

	#main.strl-pdf-capture-root .strl-print-source-url > p:first-of-type {
		font-weight: 600;
		color: #064864;
		margin-bottom: 0.35rem;
	}

	#main.strl-pdf-capture-root .strl-print-source-url a {
		color: #000;
		text-decoration: underline;
		word-break: break-all;
	}

	#main.strl-pdf-capture-root .text-block.single-content .flex.flex-wrap > div:last-child > div {
		display: flex;
		flex-direction: column;
	}

	#main.strl-pdf-capture-root .text-block.single-content .strl-sidebar-item-button {
		order: 40;
	}

	#main.strl-pdf-capture-root .text-block.single-content .strl-sidebar-item-contact {
		order: 100;
	}

	/* Contact / More information moved to end of #main via JS. */
	#main.strl-pdf-capture-root > .strl-sidebar-item-contact {
		display: block !important;
		width: 100% !important;
		max-width: 100% !important;
		margin-top: 2rem !important;
		margin-bottom: 0 !important;
	}

	#main.strl-pdf-capture-root .people-card a[href^='mailto:'] {
		color: #064864 !important;
		text-decoration: underline !important;
	}

	#main.strl-pdf-capture-root .strl-no-print {
		display: none !important;
	}

	/* Flattened tooltip shortcodes (see expandTooltipsForCapture). */
	#main.strl-pdf-capture-root .strl-pdf-tooltip {
		display: block !important;
		margin: 0.5rem 0;
	}

	#main.strl-pdf-capture-root .strl-pdf-tooltip-title {
		font-weight: 600;
		color: #064864;
		margin: 0 0 0.25rem;
	}

	#main.strl-pdf-capture-root .strl-pdf-tooltip-body {
		padding-left: 0.5rem;
		border-left: 2px solid #064864;
		font-size: 0.8125rem;
		line-height: 1.4;
		color: #000;
	}

	#main.strl-pdf-capture-root .strl-pdf-tooltip-body * {
		color: #000 !important;
	}

	#main.strl-pdf-capture-root .grid-x {
		margin: 0 !important;
		max-width: 95% !important;
	}
}

@media print {
	body.strl-print-flow .strl-print-doc-header,
	body.strl-print-flow .strl-print-source-url {
		display: block !important;
		visibility: visible !important;
	}

	body.strl-print-flow .strl-print-doc-header {
		margin-bottom: 1.5rem;
		text-align: left;
	}

	body.strl-print-flow .strl-print-source-url {
		margin-top: 3rem;
		margin-bottom: 2.5rem;
		padding-top: 1.5rem;
		border-top: 1px solid #d1d5db;
		color: #000;
		font-size: 0.875rem;
	}

	body.strl-print-flow .strl-print-source-url a {
		color: #000;
		text-decoration: underline;
	}

	body.strl-print-flow .strl-print-source-url > p:first-of-type {
		font-weight: 600;
		color: #064864;
		margin-bottom: 0.5rem;
	}

	body.strl-print-flow .strl-print-doc-header img {
		display: block !important;
		visibility: visible !important;
		max-height: 96px;
		height: auto;
		width: auto;
		max-width: 220px;
		object-fit: contain;
		object-position: left;
		-webkit-print-color-adjust: exact;
		print-color-adjust: exact;
	}

	/* Legislation CTA in rich text (href pattern; see also strl_country_print_strip_legislation_cta). */
	body.strl-print-flow #main a.btn[href*="legislation"],
	body.strl-print-flow #main a[href*="legislation"].btn,
	body.strl-print-flow #main a.btn[href*="Legislation"],
	body.strl-print-flow #main a[href*="Legislation"].btn,
	body.strl-print-flow #main a.btn[href*="l%C3%A9gislation"],
	body.strl-print-flow #main a.btn[href*="législation"] {
		display: none !important;
	}

	body.strl-print-flow #site-header,
	body.strl-print-flow .offcanvas,
	body.strl-print-flow #mobile-menu,
	body.strl-print-flow .grecaptcha-badge,
	body.strl-print-flow footer.section {
		display: none !important;
	}

	body.strl-print-flow [data-print-page],
	body.strl-print-flow .strl-print-page-btn,
	body.strl-print-flow .strl-country-pdf-btn {
		display: none !important;
	}

	body.strl-print-flow .strl-print-exclude {
		display: none !important;
	}

	body.strl-print-flow #main {
		color: #000;
		font-size: 94%;
		line-height: 1.45;
		max-width: 100%;
	}

	body.strl-print-flow #main :is(h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6) {
		color: #064864;
	}

	body.strl-print-flow #main a:not(.btn) {
		color: #000;
		text-decoration: underline;
	}

	body.strl-print-flow .text-block .flex.flex-wrap {
		display: block !important;
	}

	body.strl-print-flow .text-block .flex.flex-wrap > div {
		width: 100% !important;
		max-width: 100% !important;
		margin-left: 0 !important;
		min-width: 0 !important;
	}

	body.strl-print-flow .grid-container {
		max-width: 100% !important;
		margin-left: auto !important;
		margin-right: auto !important;
	}

	body.strl-print-flow .text-block.single-content .flex.flex-wrap > div:last-child > div {
		display: flex;
		flex-direction: column;
	}

	body.strl-print-flow .text-block.single-content .strl-sidebar-item-button {
		order: 40;
	}

	body.strl-print-flow .text-block.single-content .strl-sidebar-item-contact {
		order: 100;
	}

	body.strl-print-flow .strl-no-print {
		display: none !important;
	}

	/* Tooltip shortcode: show footnote body in print (was opacity-0 / off-screen). */
	body.strl-print-flow .tooltip-shortcode-wrapper {
		display: block !important;
		position: relative !important;
		margin: 0.35rem 0;
	}

	body.strl-print-flow .tooltip-shortcode-wrapper > button {
		display: inline !important;
		background: none !important;
		border: none !important;
		padding: 0 !important;
		font: inherit !important;
		color: #064864 !important;
		cursor: default !important;
	}

	body.strl-print-flow .tooltip-shortcode-wrapper > button i {
		display: none !important;
	}

	body.strl-print-flow .tooltip-shortcode-wrapper > button span {
		border-bottom: 0 !important;
	}

	body.strl-print-flow .tooltip-shortcode-wrapper > span[role='tooltip'] {
		position: static !important;
		opacity: 1 !important;
		visibility: visible !important;
		pointer-events: auto !important;
		transform: none !important;
		left: auto !important;
		right: auto !important;
		top: auto !important;
		bottom: auto !important;
		width: auto !important;
		max-width: 100% !important;
		display: block !important;
		margin: 0.25rem 0 0 0 !important;
		padding: 0 0 0 0.5rem !important;
		border-left: 2px solid #064864 !important;
		z-index: auto !important;
		background: transparent !important;
		color: #000 !important;
		font-size: 0.8125rem !important;
		line-height: 1.4 !important;
		box-shadow: none !important;
	}

	body.strl-print-flow .tooltip-shortcode-wrapper > span[role='tooltip']::before {
		display: none !important;
		content: none !important;
	}

	body.strl-print-flow .tooltip-shortcode-wrapper > span[role='tooltip'] * {
		color: #000 !important;
	}

	body.strl-print-flow .grid-x {
		margin: 0 !important;
		max-width: 95% !important;
	}
}
