/* ========================================================================
 * sinottico-print.css — A3-landscape PDF export of the sinottico page.
 *
 * Loaded only by /comune/[slug]/sinottico/[armadio] so it doesn't affect
 * the print layout of other pages. Activated by the "🖨 Esporta PDF"
 * button which calls window.print().
 *
 * Layout: 2 columns
 *   left  → SVG diagram (filled with the sinottico, fit to height)
 *   right → legend stacked above the FiberCop cartiglio
 * ====================================================================== */

@page {
	size: A3 landscape;
	margin: 10mm;
}

/* On screen, hide the print-only block entirely. */
@media screen {
	.print-only {
		display: none !important;
	}
}

@media print {
	/* Hide everything; we re-show only the print block. */
	body * {
		visibility: hidden;
	}
	.print-only,
	.print-only * {
		visibility: visible;
	}
	.print-only {
		display: block !important;
		position: absolute;
		left: 0;
		top: 0;
		width: 100%;
		box-sizing: border-box;
	}

	/* Anything explicitly marked no-print stays gone (saves the printer
	   from rendering screen-only headers, toasts, etc.). */
	.no-print,
	.no-print *,
	header.site-header,
	.toast-stack {
		display: none !important;
	}

	.print-root {
		display: grid;
		grid-template-columns: 1fr 90mm;
		gap: 6mm;
		width: 100%;
		box-sizing: border-box;
	}

	.print-svg-wrap {
		border: 1.5px solid #000;
		padding: 4mm;
		background: #fff;
		min-height: 240mm;
		max-height: 240mm;
		overflow: hidden;
	}
	.print-svg-wrap svg.sinottico {
		width: 100%;
		height: 100%;
		display: block;
	}

	.print-side {
		display: flex;
		flex-direction: column;
		gap: 4mm;
		min-width: 0;
	}

	.print-legend,
	.print-cartiglio {
		border: 1.5px solid #000;
		padding: 3mm 4mm;
		font-family: Arial, Helvetica, sans-serif;
		font-size: 8.5pt;
		color: #000;
		background: #fff;
		box-sizing: border-box;
	}

	.print-legend h2 {
		text-align: center;
		margin: 0 0 2mm;
		font-size: 11pt;
		letter-spacing: 0.04em;
	}
	.print-legend h3 {
		margin: 2mm 0 1mm;
		font-size: 9pt;
		text-transform: uppercase;
		border-bottom: 0.5px solid #000;
		padding-bottom: 0.5mm;
	}
	.print-legend ul {
		list-style: none;
		margin: 0;
		padding: 0;
		display: grid;
		grid-template-columns: 1fr;
		gap: 1mm 3mm;
	}
	.print-legend li {
		display: flex;
		align-items: center;
		gap: 2mm;
		font-size: 7.5pt;
		line-height: 1.2;
	}
	.print-legend .lg-ico {
		flex: 0 0 auto;
		width: 9mm;
		height: 9mm;
		--sin-stroke: #c00;
		--sin-fill: #fff;
	}
	.print-legend .cable-sample {
		flex: 0 0 auto;
		display: inline-block;
		width: 16mm;
		height: 0;
		border-top: 1.2pt solid #c00;
	}
	.print-legend .cable-spillato {
		border-top-style: dashed;
	}

	.print-cartiglio {
		flex: 0 0 auto;
	}
	.print-cartiglio .brand {
		font-size: 16pt;
		font-weight: 800;
		color: #c00;
		margin-bottom: 2mm;
		letter-spacing: 0.02em;
	}
	.print-cartiglio .ptitle {
		margin: 0;
		font-size: 8pt;
		font-weight: 700;
		text-transform: uppercase;
	}
	.print-cartiglio .psubtitle {
		margin: 0 0 2mm;
		font-size: 8pt;
		font-weight: 700;
		text-transform: uppercase;
		color: #444;
	}
	.print-cartiglio dl {
		display: grid;
		grid-template-columns: max-content 1fr;
		column-gap: 4mm;
		row-gap: 0.8mm;
		margin: 1mm 0 0;
	}
	.print-cartiglio dt {
		font-weight: 700;
		font-size: 7pt;
		text-transform: uppercase;
		letter-spacing: 0.02em;
	}
	.print-cartiglio dd {
		margin: 0;
		font-size: 8pt;
		word-break: break-word;
	}
}
