/*
 * v3-print.css — Print overrides for v3 layout
 * Loaded LAST (after v3-layout.css) with media="print"
 * High-specificity rules to override all v3 layout chrome
 */

@media print {
	/* Hide chrome */
	.header,
	.header.navbar,
	.page-sidebar,
	#main-menu,
	#sidr,
	.noprint {
		display: none !important;
		position: static !important;
		visibility: hidden !important;
		height: 0 !important;
		width: 0 !important;
		overflow: hidden !important;
	}

	/* Reset layout — high specificity to beat html.condense-menu etc. */
	body,
	.page-container,
	.page-content,
	html.condense-menu .page-content {
		margin: 0 !important;
		padding: 0 !important;
		background: #fff !important;
	}

	.page-content > .clearfix {
		display: none !important;
	}

	.page-content > .content,
	.page-content > form > .content {
		margin-top: 0 !important;
		padding-top: 0 !important;
		background-color: #fff !important;
		border-radius: 0 !important;
		min-height: auto !important;
	}

	/* Dark mode: force white backgrounds & dark text for printing */
	html.dark-menus .page-content,
	html.dark-menus .page-container,
	html.dark-menus body,
	html.dark-menus .content {
		background: #fff !important;
		background-color: #fff !important;
		color: #333 !important;
	}

	html.dark-menus .page-content > .content,
	html.dark-menus .page-content > form > .content {
		background-color: #fff !important;
		color: #333 !important;
	}

	html.dark-menus .header.navbar,
	html.dark-menus .header .navbar-inner,
	html.dark-menus .page-sidebar {
		display: none !important;
	}
}

/* ===========================================
   wkhtmltopdf-safe rules (NO @media wrapper)
   wkhtmltopdf is based on old QtWebKit and has buggy support for:
   - flex / grid → force display:table-row / table-cell on tr/td/th
   - nested @media queries → keep these rules at the top level
   This file is only loaded with media="print" so these are safe.
   IMPORTANT: we do NOT force `display: table` on <table> itself, to avoid
   overriding app-level .hide-* classes that set `display: none`.
   Same for rows and cells: [class*="hid"] (.hide, .hidden, .hidden-print, .hide-<slug>)
   and .noprint are left out, else every column hidden on screen comes back on paper. */
.fiche-fct .table,
.ff-page .table {
	border-collapse: collapse !important;
	border-spacing: 0 !important;
}
.fiche-fct .table tr:not([class*="hid"]):not(.noprint),
.ff-page .table tr:not([class*="hid"]):not(.noprint) {
	display: table-row !important;
	flex-wrap: unset !important;
}
.fiche-fct .table td:not([class*="hid"]):not(.noprint),
.fiche-fct .table th:not([class*="hid"]):not(.noprint),
.ff-page .table td:not([class*="hid"]):not(.noprint),
.ff-page .table th:not([class*="hid"]):not(.noprint) {
	display: table-cell !important;
	box-shadow: none !important;
	outline: none !important;
}
.fiche-fct .table-bordered td,
.fiche-fct .table-bordered th,
.ff-page .table-bordered td,
.ff-page .table-bordered th {
	border: 1px solid #6F7B8A !important;
}
