/* =========================================================================
   Brentwood — Global print stylesheet
   -------------------------------------------------------------------------
   Loaded site-wide with media="print" (see kadence_child_enqueue_styles in
   functions.php), so it costs nothing on screen and is the single source of
   truth for how pages print.

   APPROACH: clean *document* print, not a pixel-faithful brochure. The site
   is built from full-bleed CSS background-image sections, Kadence row layouts
   with large vertical padding / min-heights, and a CSS-grid blog using an
   aspect-ratio padding hack with absolutely-positioned images. None of that
   survives paper:
     - background-images don't print and leave tall empty blocks (blank pages),
     - big min-heights/padding waste whole pages of whitespace,
     - grid + absolute images overlap and clip across page breaks.
   So for print we strip decoration + chrome, collapse reserved empty space,
   and let the real *content* (headings, text, content images) flow cleanly.

   Component-scoped @media print rules still live next to their components
   (page-hero.css, bw-curve.css, brentwood-subnav.php); this is the global layer.
   ========================================================================= */

@media print {

	/* ---- Page box ------------------------------------------------------- */
	@page {
		margin: 1.6cm;
	}

	/* ---- Colour reset: black ink on white, no backgrounds/shadows ------- *
	 * Backgrounds (incl. decorative background-images) are dropped on purpose. */
	*,
	*::before,
	*::after {
		background: transparent !important;
		box-shadow: none !important;
		text-shadow: none !important;
		color: #000 !important;
		/* Kill the large reserved heights that otherwise print as blank space. */
		min-height: 0 !important;
	}

	html,
	body {
		width: auto !important;
		margin: 0 !important;
		padding: 0 !important;
		background: #fff !important;
		font-size: 11pt;
		line-height: 1.45;
	}

	/* ---- Full-width, single flow (kills the mobile-in-print layout) ----- */
	.site,
	.site-container,
	.content-container,
	.content-area,
	.site-main,
	.entry-content,
	.entry-content-wrap,
	.content-bg,
	.kadence-wrap,
	.wp-site-blocks,
	.single-content {
		width: 100% !important;
		max-width: 100% !important;
		margin: 0 !important;
		padding: 0 !important;
		float: none !important;
		display: block !important;
		grid-template-columns: none !important;
	}

	/* Single blog post: cancel the 67% right-column offset + the red rule. */
	.single .entry-content,
	.single .entry-content-wrap {
		margin-left: 0 !important;
		width: 100% !important;
	}
	.border-primary-line {
		display: none !important;
	}

	/* Kadence rows: stop mobile stacking, strip the big section padding that
	   prints as whitespace, never clip. (External !important beats Kadence's
	   non-important generated padding, incl. inline.) */
	.kb-row-layout-wrap,
	.wp-block-kadence-rowlayout,
	.kt-row-column-wrap,
	.kt-row-layout-inner,
	.kt-inside-inner-col,
	.wp-block-columns,
	.wp-block-column {
		display: block !important;
		width: 100% !important;
		max-width: 100% !important;
		padding-top: 0.25cm !important;
		padding-bottom: 0.25cm !important;
		margin: 0 !important;
		overflow: visible !important;
	}

	/* ---- Hide on-screen chrome & decoration ---------------------------- */
	#masthead,
	.site-header,
	.site-header-wrap,
	.site-top-header-wrap,
	.site-main-header-wrap,
	.mobile-toggle-open-container,
	#mobile-drawer,
	.mobile-navigation,
	.main-navigation,
	.header-navigation,
	nav.navigation,
	.bw-subnav,
	#colophon,
	.site-footer,
	.site-footer-wrap,
	.bw-footer,                       /* custom content-area footer block */
	.kadence-scroll-to-top,
	.kt-scroll-up-reader,
	.bw-print,
	.skip-link,
	.bw-curve,
	/* hero decoration: the media is a background-image (won't print) whose
	   container reserves a whole blank page — drop the whole media + chrome. */
	.bw-phero__media,
	.bw-phero__loader,
	.bw-phero__dots,
	.bw-phero__progress,
	.bw-phero__dash,
	/* blog block interactive chrome */
	.bw-blog__search,
	.bw-blog__search-toggle,
	.bw-blog__pagination,
	/* comments / author box */
	.entry-author-style-normal,
	.content-bg.entry-author,
	.comment-respond,
	#comments {
		display: none !important;
	}

	/* ---- Hero: keep just the text card, flowing normally --------------- */
	.bw-phero,
	.bw-phero--bleed,
	.bw-phero--frame {
		min-height: 0 !important;
		height: auto !important;
		padding: 0 !important;
		margin: 0 0 0.5cm !important;
	}
	.bw-phero__cardwrap {
		margin-top: 0 !important;
	}
	.bw-phero__card {
		margin: 0 !important;
		padding: 0 !important;
	}
	.bw-phero__body {
		text-align: left !important;
	}

	/* ---- Blog: grid → clean wrapping 2-up that breaks across pages ----- */
	.bw-blog__grid {
		display: flex !important;
		flex-wrap: wrap !important;
		gap: 0.4cm !important;
		grid-template-columns: none !important;
	}
	.bw-blog-card {
		display: block !important;
		width: 48% !important;
		overflow: visible !important;
		border-bottom: 1px solid #ccc !important;
		page-break-inside: avoid;
		break-inside: avoid;
	}
	/* Neutralise the aspect-ratio padding hack + absolute image so the photo
	   flows in normal document order (the cause of the overlap/clipping). */
	.bw-blog-card__media {
		position: static !important;
		padding-bottom: 0 !important;
		height: auto !important;
		overflow: visible !important;
	}
	.bw-blog-card__media img {
		position: static !important;
		width: 100% !important;
		height: auto !important;
		max-height: 4.5cm !important;
		object-fit: cover !important;
	}
	.bw-blog-card__noimg {
		display: none !important;
	}
	.bw-blog-card__title {
		min-height: 0 !important;
		display: block !important;
		padding: 0.15cm 0 !important;
	}
	.bw-blog-card__excerpt {
		padding: 0 !important;
	}

	/* ---- Images & embeds: nothing dominates a page -------------------- */
	img,
	svg,
	figure,
	table,
	pre,
	blockquote {
		max-width: 100% !important;
	}
	/* Cap stray content images / logos (e.g. the centennial graphic + the
	   accreditation badge strip) so they don't each eat a full page. */
	.entry-content img,
	.wp-block-image img,
	.kb-image,
	figure img {
		max-height: 6cm !important;
		width: auto !important;
		height: auto !important;
		object-fit: contain !important;
	}
	img {
		page-break-inside: avoid;
	}

	/* ---- Page-break hygiene ------------------------------------------- */
	h1, h2, h3, h4, h5, h6 {
		page-break-after: avoid;
		break-after: avoid;
		page-break-inside: avoid;
	}
	p, li, blockquote {
		orphans: 3;
		widows: 3;
	}
	table, figure, .kadence-blocks-gallery-item, .wp-block-image {
		page-break-inside: avoid;
	}

	/* Links: keep readable, don't expand URLs inline (too noisy here). */
	a, a:visited {
		color: #000 !important;
		text-decoration: underline;
	}
}
