/**
 * Cottage Cost Calculator — print styles.
 *
 * Two jobs:
 *  1. On screen, give the printable area (quote / shopping list) a clean
 *     paper-like preview so what she sees is what prints.
 *  2. In print, show ONLY the print area — black on white, roomy tables,
 *     letter-paper friendly — with no menus, buttons, or theme chrome.
 *
 * The print area markup uses the .cbc-print-* classes below plus the
 * shared .cbc-table styles (restyled here for print).
 */

/* ==========================================================================
   Screen — paper preview of the print area
   ========================================================================== */

.cbc-print-area {
	max-width: 760px;
	margin: 0 auto;
	padding: 24px;
	background: #fff;
	color: #22384F;
	font-size: 16px;
	line-height: 1.55;
}

.cbc-print-header {
	display: flex;
	align-items: center;
	gap: 16px;
	padding-bottom: 16px;
	margin-bottom: 20px;
	border-bottom: 2.5px solid #22384F;
}

.cbc-print-logo {
	max-width: 150px;
	max-height: 64px;
	width: auto;
	height: auto;
}

.cbc-print-business {
	font-size: 21px;
	font-weight: 700;
	line-height: 1.3;
}

.cbc-print-business-sub {
	font-size: 14px;
	color: #4A6076;
}

.cbc-print-title {
	font-size: 24px;
	font-weight: 700;
	line-height: 1.3;
	margin: 0 0 4px;
}

.cbc-print-meta {
	font-size: 14.5px;
	color: #4A6076;
	margin: 0 0 18px;
}

.cbc-print-block {
	margin-bottom: 22px;
}

.cbc-print-block-title {
	font-size: 17px;
	font-weight: 700;
	margin: 0 0 8px;
}

.cbc-print-area p {
	margin: 0 0 10px;
}

.cbc-print-keyline {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 9px 0;
	border-bottom: 1px dashed #C9D4DA;
	font-size: 16px;
}

.cbc-print-keyline:last-child {
	border-bottom: 0;
}

.cbc-print-keyline .cbc-print-value {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.cbc-print-total {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	margin-top: 14px;
	padding: 14px 16px;
	background: #D9F2F0;
	border-radius: 12px;
	font-size: 19px;
	font-weight: 800;
}

.cbc-print-total .cbc-print-value {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.cbc-print-footer {
	margin-top: 26px;
	padding-top: 12px;
	border-top: 1px solid #C9D4DA;
	font-size: 13.5px;
	color: #4A6076;
	text-align: center;
}

/* Roomy table inside the print area (screen preview). */
.cbc-print-area .cbc-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 15.5px;
	line-height: 1.5;
}

.cbc-print-area .cbc-table th,
.cbc-print-area .cbc-table td {
	padding: 10px 12px;
	text-align: left;
	vertical-align: top;
	border-bottom: 1px solid #D8E2E6;
}

.cbc-print-area .cbc-table .cbc-num {
	text-align: right;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}

.cbc-print-area .cbc-table tfoot td,
.cbc-print-area .cbc-table tfoot th {
	font-weight: 700;
	border-top: 2px solid #22384F;
	border-bottom: 0;
}

/* ==========================================================================
   Print — only the print area, black on white
   ========================================================================== */

@media print {

	@page {
		margin: 0.6in;
	}

	/* Hide everything on the page except the print area and its contents. */
	body * {
		visibility: hidden;
	}

	.cbc-print-area,
	.cbc-print-area * {
		visibility: visible;
	}

	.cbc-print-area {
		position: absolute;
		left: 0;
		top: 0;
		width: 100%;
		max-width: none;
		margin: 0;
		padding: 0;
		background: #fff;
		color: #000;
		font-family: inherit;
		font-size: 12.5pt;
		line-height: 1.5;
	}

	/* Anything marked no-print inside the area stays off the paper too. */
	.cbc-print-area .cbc-no-print,
	.cbc-no-print {
		display: none !important;
		visibility: hidden !important;
	}

	.cbc-print-header {
		border-bottom: 2pt solid #000;
		padding-bottom: 10pt;
		margin-bottom: 14pt;
	}

	.cbc-print-logo {
		max-width: 160px;
		max-height: 60px;
	}

	.cbc-print-business {
		font-size: 15pt;
		color: #000;
	}

	.cbc-print-business-sub,
	.cbc-print-meta,
	.cbc-print-footer {
		color: #000;
	}

	.cbc-print-title {
		font-size: 17pt;
		color: #000;
	}

	.cbc-print-block {
		margin-bottom: 16pt;
		break-inside: avoid;
		page-break-inside: avoid;
	}

	.cbc-print-block-title {
		font-size: 12.5pt;
		color: #000;
	}

	.cbc-print-keyline {
		border-bottom: 0.75pt solid #999;
		font-size: 12.5pt;
	}

	.cbc-print-total {
		background: none;
		border: 1.5pt solid #000;
		border-radius: 0;
		font-size: 13.5pt;
		color: #000;
		break-inside: avoid;
		page-break-inside: avoid;
	}

	.cbc-print-footer {
		border-top: 0.75pt solid #999;
		font-size: 9.5pt;
	}

	/* Tables: full width, plain #999 grid, no shading on paper. */
	.cbc-print-area .cbc-table {
		width: 100%;
		border-collapse: collapse;
		font-size: 11.5pt;
		color: #000;
	}

	.cbc-print-area .cbc-table caption {
		text-align: left;
		font-weight: 700;
		font-size: 12.5pt;
		padding: 0 0 6pt;
		color: #000;
	}

	.cbc-print-area .cbc-table th,
	.cbc-print-area .cbc-table td {
		padding: 6pt 8pt;
		border: 0.75pt solid #999;
		background: none !important;
		color: #000;
	}

	.cbc-print-area .cbc-table thead th {
		font-size: 10pt;
		text-transform: uppercase;
		letter-spacing: .02em;
		border-bottom: 1.25pt solid #000;
	}

	.cbc-print-area .cbc-table tbody tr {
		break-inside: avoid;
		page-break-inside: avoid;
	}

	.cbc-print-area .cbc-table tfoot td,
	.cbc-print-area .cbc-table tfoot th {
		border-top: 1.25pt solid #000;
		font-weight: 700;
	}

	/* Links print as plain text — no URLs sprawled across the page. */
	.cbc-print-area a {
		color: #000;
		text-decoration: none;
	}

	.cbc-print-area a[href]::after {
		content: "";
	}

	/* Keep headings with the block that follows them. */
	.cbc-print-area h1,
	.cbc-print-area h2,
	.cbc-print-area h3 {
		break-after: avoid;
		page-break-after: avoid;
		color: #000;
	}
}
