/*
 * Eye Revolution Quotes — print stylesheet
 *
 * PDF output goals (per spec §8 + the "1 block = 1 landscape A4 page"
 * requirement):
 *
 *   • A4 landscape, zero @page margin (full-bleed)
 *   • Every .erq-section is exactly 297mm × 210mm (one PDF page)
 *   • Backgrounds extend edge-to-edge
 *   • All columns remain side-by-side (mobile breakpoint suppressed)
 *   • Scroll-snap / sidenav / reveal / header are all stripped
 *   • Dark sections retain their palette via print-color-adjust
 *
 * IMPORTANT user step for Chrome "Save as PDF":
 *   1. Print dialog → More settings → Margins: None
 *   2. Print dialog → Options → Background graphics: ✓
 *   (Both settings persist per Chrome profile once set.)
 *
 * Without those two settings the CSS here cannot guarantee a true
 * full-bleed result — Chrome will enforce its default margins and
 * strip coloured backgrounds.
 */

/* ── Page size + zero margin ────────────────────────────────── */

@page {
	size: A4 landscape;
	margin: 0;
}

/* Colour fidelity: retain every background + text colour */

*,
*::before,
*::after {
	-webkit-print-color-adjust: exact !important;
	print-color-adjust: exact !important;
}

/* ── Reset root + scroll infrastructure ──────────────────────── */

html,
body,
body.page-template-page-quote {
	width: 297mm !important;
	height: auto !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: visible !important;
	background: #ffffff !important;
}

.erq-quote,
.erq-scroller,
.erq-scroller .wp-block-post-content,
.wp-block-post-content {
	width: 297mm !important;
	max-width: none !important;
	height: auto !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: visible !important;
	scroll-snap-type: none !important;
	scroll-behavior: auto !important;
	display: block !important;
}

/* ── Hide screen-only chrome ─────────────────────────────────── */

.erq-header,
.erq-sidenav,
.erq-scroll-hint,
.erq-print-btn,
.wp-block-navigation,
.skip-link {
	display: none !important;
}

/* ── Every section = one A4 landscape page ──────────────────── */

.erq-scroller .erq-section,
.erq-section {
	width: 297mm !important;
	height: 210mm !important;
	max-width: 297mm !important;
	max-height: 210mm !important;
	min-height: 0 !important;
	margin: 0 !important;
	overflow: hidden !important;
	page-break-after: always !important;
	page-break-inside: avoid !important;
	break-after: page !important;
	break-inside: avoid !important;
	position: relative !important;
	box-sizing: border-box !important;
	display: flex !important;
	flex-direction: column !important;
	justify-content: center !important;
}

/* Flow sections (Estimate, Brief) are allowed to span pages. We
 * still enforce min-height 210mm so that when content fits 1 page,
 * it centers nicely; when it overflows, the section grows past the
 * fold and page-break-inside:auto lets the browser split pages.
 */

.erq-scroller .erq-section--flow,
.erq-section--flow {
	min-height: 210mm !important;
	height: auto !important;
	max-height: none !important;
	overflow: visible !important;
	page-break-inside: auto !important;
	break-inside: auto !important;
}

/* Last section: no trailing blank page */

.erq-scroller .erq-section:last-child,
.erq-section:last-child {
	page-break-after: auto !important;
	break-after: auto !important;
}

/* ── Reveal animations: everything visible ───────────────────── */

.erq-section > *,
.erq-section.is-visible > *,
.erq-scroller .erq-section > *,
.erq-scroller .erq-section.is-visible > * {
	opacity: 1 !important;
	transform: none !important;
	transition: none !important;
	animation: none !important;
}

/* ── Columns always side-by-side (kill mobile stacking) ──────── */

.wp-block-columns,
.wp-block-columns.is-stacked-on-mobile,
.erq-section .wp-block-columns {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: nowrap !important;
	gap: 0 !important;
	margin: 0 !important;
	align-items: stretch !important;
	width: 100% !important;
}

.wp-block-column {
	margin: 0 !important;
	flex-shrink: 1;
	flex-grow: 1;
}

/* Override any mobile breakpoint that forces flex-basis: 100% */

.erq-split .wp-block-column {
	flex-basis: 50% !important;
	min-width: 0 !important;
}

/* Stats band: 3 equal columns */

.erq-stats .wp-block-column {
	flex-basis: 33.333% !important;
}

/* Services grid: 3×2 layout inside a grid group */

.erq-services {
	display: grid !important;
	grid-template-columns: repeat(3, 1fr) !important;
	gap: 0 !important;
	width: 100% !important;
}

/* ── Split-media columns: fill their half completely ─────────── */

.erq-split__media {
	align-self: stretch !important;
	height: 210mm !important;
	position: relative !important;
}

.erq-split__media .wp-block-cover,
.erq-split__media .wp-block-image,
.erq-split__media figure,
.erq-split__media img {
	width: 100% !important;
	height: 100% !important;
	max-height: 210mm !important;
	min-height: 210mm !important;
	object-fit: cover !important;
	margin: 0 !important;
}

/* Cover blocks (placeholder dark panels): fill fully */

.erq-split__media .wp-block-cover__background,
.erq-split__media .wp-block-cover__image-background {
	width: 100% !important;
	height: 100% !important;
}

/* ── Meta columns on Cover — keep 50/50 with divider ─────────── */

.erq-section--cover .erq-meta-cols,
body .erq-meta-cols {
	display: flex !important;
	flex-direction: row !important;
	gap: 0 !important;
	width: 100% !important;
	max-width: 140mm !important;
	margin-inline: auto !important;
}

.erq-section--cover .erq-meta-cols .wp-block-column,
body .erq-meta-cols .wp-block-column {
	flex: 0 0 50% !important;
	flex-basis: 50% !important;
	max-width: 50% !important;
	box-sizing: border-box !important;
}

.erq-section--cover .erq-meta-cols .wp-block-column:first-child,
body .erq-meta-cols .wp-block-column:first-child {
	text-align: right !important;
	padding-right: 6mm !important;
	padding-left: 0 !important;
	border-left: 0 !important;
}

.erq-section--cover .erq-meta-cols .wp-block-column:last-child,
body .erq-meta-cols .wp-block-column:last-child {
	text-align: left !important;
	padding-left: 6mm !important;
	padding-right: 0 !important;
	border-left: 1px solid rgba(107, 98, 69, 0.35) !important;
}

/* ── Page-break guards for atomic elements ──────────────────── */

h1, h2, h3, h4, h5, h6,
figure,
.wp-block-image,
.wp-block-cover,
.erq-cover-brand,
.erq-meta-cols,
.erq-stats {
	page-break-inside: avoid !important;
	break-inside: avoid !important;
}

/* Widows / orphans */

p, li {
	orphans: 3;
	widows: 3;
}

/* Table rows: never split mid-row */

.wp-block-table tr,
.erq-estimate tr {
	page-break-inside: avoid !important;
	break-inside: avoid !important;
}

/* ── Dark sections retain palette in print ──────────────────── */

.erq-section--dark,
.has-charcoal-background-color {
	background-color: #1E2028 !important;
	color: #F5F3EE !important;
}

.erq-section--dark h1,
.erq-section--dark h2,
.erq-section--dark h3,
.erq-section--dark h4,
.has-charcoal-background-color h1,
.has-charcoal-background-color h2,
.has-charcoal-background-color h3,
.has-charcoal-background-color h4 {
	color: #F5F3EE !important;
}

.erq-section--dark .erq-eyebrow,
.has-charcoal-background-color .erq-eyebrow {
	color: var(--wp--preset--color--gold-mid) !important;
}

/* Warm-white sections: the cream goes edge-to-edge */

.has-warm-white-background-color {
	background-color: #FAFAF7 !important;
}

.has-off-white-background-color {
	background-color: #F5F3EE !important;
}

/* ── Editorial hints hidden in print ────────────────────────── */

.erq-hint,
.erq-image-hint {
	display: none !important;
}

/* ── Links: underlined dark-gold for print legibility ───────── */

.erq-section a {
	color: #6B6245 !important;
	text-decoration: underline;
}

/* Dark section links stay gold */

.erq-section--dark a,
.has-charcoal-background-color a {
	color: #D4C9A8 !important;
}

/* ── Pattern-specific print tweaks ──────────────────────────── */

/* Sustainability grid: 3 columns side-by-side */

.erq-sustain__grid {
	display: flex !important;
	flex-direction: row !important;
	gap: 8mm !important;
}

.erq-sustain__grid .wp-block-column {
	flex-basis: 33.333% !important;
}

/* Spherical example: hero fills most of page, caption strip at bottom */

.erq-section--spherical {
	padding: 0 !important;
	display: flex !important;
	flex-direction: column !important;
}

.erq-spherical__hero {
	flex: 1 1 auto !important;
	min-height: 0 !important;
	height: auto !important;
}

.erq-spherical__caption {
	flex: 0 0 auto !important;
	padding: 6mm 20mm !important;
	background: #1E2028 !important;
}

.erq-spherical__caption p,
.erq-spherical__caption a {
	color: #F5F3EE !important;
}

/* Estimate section: flow (may span pages), restore visible padding */

.erq-section--estimate {
	padding: 15mm 20mm !important;
}

/* Category rows: keep with at least one line item that follows */

.erq-estimate__category {
	page-break-after: avoid !important;
	break-after: avoid !important;
}

.erq-estimate__grand {
	page-break-before: avoid !important;
	break-before: avoid !important;
}

/* Brief: flow, flexible padding */

.erq-section--brief {
	padding: 0 !important;
}

/* CTA button: preserve in print for distributed hard copy */

.erq-cta__primary .wp-block-button__link,
.wp-block-button__link {
	background: #B0A27A !important;
	color: #ffffff !important;
	border-radius: 15px !important;
	text-decoration: none !important;
}

/* Thank you H1 in uppercase */

.erq-section--thank-you h1 {
	font-family: "Cormorant Garamond", Georgia, serif !important;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

/* Estimate notes list */

.erq-notes__list {
	padding-left: 1.2em !important;
	list-style: disc;
}

.erq-notes__list li {
	margin-bottom: 0.4em;
	line-height: 1.55;
}

/* ── Estimate — Summary (single page) ─────────────────────── */

.erq-section--estimate-summary {
	padding: 15mm 20mm !important;
}

.erq-estimate-summary,
.erq-estimate-summary table,
.erq-estimate-summary__grand {
	page-break-inside: avoid !important;
	break-inside: avoid !important;
}

/* ── Estimate — Full Detail (may span pages) ──────────────── */

.erq-section--estimate-full {
	padding: 15mm 20mm !important;
}

/* Table multi-page support */
.erq-estimate-full {
	table-layout: fixed !important;
	width: 100% !important;
}

.erq-estimate-full thead {
	display: table-header-group !important; /* Repeat header on each page */
}

.erq-estimate-full tr {
	page-break-inside: avoid !important;
	break-inside: avoid !important;
}

/* Keep category header with the first line item that follows */
.erq-estimate-full .erq-estimate-category {
	page-break-after: avoid !important;
	break-after: avoid !important;
}

/* Keep subtotal with the category above it where possible */
.erq-estimate-full .erq-estimate-subtotal {
	page-break-before: avoid !important;
	break-before: avoid !important;
}

/* Keep discount + grand total together */
.erq-estimate-full .erq-estimate-discount,
.erq-estimate-full .erq-estimate-total {
	page-break-before: avoid !important;
	break-before: avoid !important;
}

/* Ensure category background prints */
.erq-estimate-full .erq-estimate-category td {
	background: #F5F3EE !important;
	-webkit-print-color-adjust: exact !important;
	print-color-adjust: exact !important;
}

