/**
 * Custom page templates: Homepage, Blog, Contact, About.
 */

:root {
	--boorsuc-template-pad-x: var(--boorsuc-container-padding, 24px);
	--boorsuc-template-pad-y: 2rem;
	/* Fallback when JS has not set --boorsuc-fixed-header-offset yet */
	--boorsuc-template-header-clearance: 5.5rem;
}

/*
 * Transparent + fixed disables the spacer — push template content below header.
 * Opaque fixed uses .site-header-stack-spacer instead (avoid double offset).
 */
body.has-transparent-header.header-position-fixed .site-main--contact,
body.has-transparent-header.header-position-fixed .site-main--about,
body.has-transparent-header.header-position-fixed .site-main--blog,
body.has-transparent-header.header-position-fixed.boorsuc-template-contact .site-main,
body.has-transparent-header.header-position-fixed.boorsuc-template-about .site-main,
body.has-transparent-header.header-position-fixed.boorsuc-template-blog .site-main {
	padding-top: calc(
		var(--boorsuc-fixed-header-offset, var(--boorsuc-template-header-clearance))
		+ var(--boorsuc-template-pad-y)
	);
}

/*
 * Contact / About / Blog: always keep comfortable top spacing under a fixed header
 * (spacer clears the bar; this is extra content breathing room).
 */
body.header-position-fixed:not(.has-transparent-header) .site-main--contact,
body.header-position-fixed:not(.has-transparent-header) .site-main--about,
body.header-position-fixed:not(.has-transparent-header) .site-main--blog {
	margin-top: 0.5rem;
}

/* Homepage – full width, flush under fixed/transparent header */
.boorsuc-template-homepage .site-main--homepage,
.site-main--homepage,
body.has-transparent-header.header-position-fixed .site-main--homepage,
body.has-transparent-header.header-position-fixed.boorsuc-template-homepage .site-main,
body.header-position-fixed .site-main--homepage {
	width: 100%;
	box-sizing: border-box;
	padding-top: 0;
	margin-top: 0;
}

.boorsuc-template-homepage .homepage-entry .entry-content {
	margin-top: 0;
}

/* Contact */
.boorsuc-template-contact .site-main--contact,
.site-main--contact {
	max-width: var(--boorsuc-width-boxed, 1200px);
	margin: 0 auto;
	padding: var(--boorsuc-template-pad-y) var(--boorsuc-template-pad-x) 3rem;
	box-sizing: border-box;
	width: 100%;
}

.boorsuc-template-about .site-main--about,
.site-main--about {
	max-width: var(--boorsuc-width-boxed, 1200px);
	margin: 0 auto;
	padding: var(--boorsuc-template-pad-y) var(--boorsuc-template-pad-x) 3rem;
	box-sizing: border-box;
	width: 100%;
}

.contact-page {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
	width: 100%;
	padding-top: 60px;
}

.contact-page__info {
	box-sizing: border-box;
	min-width: 0;
}

.contact-page__content {
	min-width: 0;
	overflow-wrap: anywhere;
	word-wrap: break-word;
}

/* WPForms label color is handled in aicarlogapp.css (contact design). */

@media screen and (min-width: 48em) {

	.contact-page {
		grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
		align-items: start;
		gap: 2.5rem;
	}
}

.contact-page__info-title {
	margin: 0 0 1rem;
	font-size: 1.125rem;
}

.contact-page__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.contact-page__item {
	margin-bottom: 1.25rem;
}

.contact-page__item strong {
	display: block;
	margin-bottom: 0.25rem;
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	opacity: 0.7;
}

.contact-page__item a {
	text-decoration: none;
	word-break: break-word;
}

/* Blog */
.boorsuc-template-blog .site-main--blog,
.site-main--blog {
	max-width: var(--boorsuc-width-boxed, 1200px);
	margin: 0 auto;
	padding: var(--boorsuc-template-pad-y) var(--boorsuc-template-pad-x) 3rem;
	box-sizing: border-box;
	width: 100%;
}

.boorsuc-template-blog .page-header,
.site-main--blog .page-header {
	margin-bottom: 2rem;
}

.boorsuc-template-blog .page-header .page-title,
.site-main--blog .page-header .page-title {
	margin: 0;
}

/* Blog list layout */
.blog-posts--list > article {
	margin-bottom: 2.5rem;
	padding-bottom: 2.5rem;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.blog-posts--list > article:last-child {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}

/* Blog grid layout */
.blog-posts--grid {
	display: grid;
	grid-template-columns: repeat( var( --boorsuc-blog-columns, 3 ), minmax( 0, 1fr ) );
	gap: 1rem;
}

@media screen and (max-width: 47.99em) {

	.blog-posts--grid {
		grid-template-columns: 1fr;
	}
}

@media screen and (min-width: 48em) and (max-width: 63.99em) {

	.boorsuc-blog-cols-4 .blog-posts--grid,
	.boorsuc-blog-cols-5 .blog-posts--grid,
	.boorsuc-blog-cols-6 .blog-posts--grid {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
	}
}

/* Blog pagination */
.boorsuc-blog-pagination {
	margin-top: 2.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.boorsuc-blog-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.25rem;
	height: 2.25rem;
	margin: 0 0.2rem 0.4rem 0;
	padding: 0 0.5rem;
	border: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 4px;
	text-decoration: none;
	line-height: 1;
}

.boorsuc-blog-pagination .page-numbers.current {
	font-weight: 600;
	background: rgba(0, 0, 0, 0.06);
}

.boorsuc-blog-pagination ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.boorsuc-blog-pagination li {
	margin: 0;
	padding: 0;
	list-style: none;
}

.flex-sidebar__content {
	flex: 1;
	min-width: 0;
}

.blog-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	border: 1px solid rgba(0, 0, 0, 0.08);
	border-radius: 8px;
	overflow: hidden;
	background: #fff;
}

.blog-card__thumbnail {
	display: block;
	line-height: 0;
}

.blog-card__thumbnail img {
	width: 100%;
	height: auto;
	display: block;
}

.blog-card__body {
	display: flex;
	flex-direction: column;
	flex: 1;
	padding: 1.25rem;
}

.blog-card .entry-title {
	margin: 0 0 0.5rem;
	font-size: 1.125rem;
}

.blog-card .entry-summary {
	flex: 1;
	margin-bottom: 1rem;
}

.blog-card__more {
	font-weight: 600;
	text-decoration: none;
}

/*
 * Hero background is exclusive: solid color (wrapper) OR full-bleed image.
 * Padding and positioning live on the block wrapper so media covers the section.
 * No hardcoded green gradient — default is transparent.
 */
.rb-block--hero,
.wp-block-boorsuc-builder-hero {
	position: relative;
	padding: 8rem var(--boorsuc-container-padding, 24px);
	background-color: transparent;
	overflow: hidden;
}

/* Inner shell from theme template — no second padding / containing block. */
.rb-block--hero > .boorsuc-hero__shell {
	position: static;
	padding: 0;
	background: transparent;
	overflow: visible;
}

.boorsuc-hero__media,
.boorsuc-hero__color {
	position: absolute;
	inset: 0;
	z-index: 0;
	pointer-events: none;
}

.boorsuc-hero__media {
	opacity: 1;
}

/* Solid color is set inline (and on the section wrapper). */
.boorsuc-hero__color {
	background-color: transparent;
}

.boorsuc-hero__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

.boorsuc-hero__inner {
	position: relative;
	z-index: 1;
	max-width: var(--boorsuc-width-boxed, 1200px);
	margin: 0 auto;
}

.boorsuc-hero__title,
.boorsuc-hero__inner > .rb-text:first-child {
	margin: 0 0 0.75rem;
	font-size: clamp(2rem, 4vw, 3rem);
	line-height: 1.15;
	color: inherit;
}

.boorsuc-hero__subtitle,
.boorsuc-hero__inner p.rb-text {
	margin: 0 0 1.5rem;
	max-width: 36rem;
	font-size: 1.125rem;
}

.boorsuc-hero__actions,
.boorsuc-cta__actions {
	margin: 0;
}

/*
 * CTA section chrome on the block wrapper (.rb-block--cta).
 * Section background: rb_section_background (inline on wrapper).
 * Text colors: field styles via .rb-text inline CSS.
 */
.rb-block--cta,
.wp-block-boorsuc-builder-cta {
	padding: 3.5rem var(--boorsuc-container-padding, 24px);
	background-color: transparent;
}

.boorsuc-cta,
.boorsuc-cta__inner {
	background: transparent;
}

.boorsuc-cta__inner {
	max-width: var(--boorsuc-width-boxed, 1200px);
	margin: 0 auto;
	text-align: center;
}

.boorsuc-cta__heading,
.boorsuc-cta__inner .rb-text {
	margin: 0 0 0.75rem;
}

.boorsuc-cta__text,
.boorsuc-cta__inner p.rb-text {
	margin: 0 auto 1.5rem;
	max-width: 34rem;
}


@media screen and (max-width: 756px) {
	.rb-block--hero,
	.wp-block-boorsuc-builder-hero {
		padding: 3rem var(--boorsuc-container-padding, 24px);
	}

	.rb-block--cta,
	.wp-block-boorsuc-builder-cta {
		padding: 2.25rem var(--boorsuc-container-padding, 24px);
	}
}

/* Shared mobile refinements for all page templates */
@media screen and (max-width: 47.99em) {
	:root {
		--boorsuc-template-pad-x: 1rem;
		--boorsuc-template-pad-y: 1.5rem;
		--boorsuc-template-header-clearance: 4.75rem;
	}

	.boorsuc-template-contact .site-main--contact,
	.site-main--contact,
	.boorsuc-template-about .site-main--about,
	.site-main--about,
	.boorsuc-template-blog .site-main--blog,
	.site-main--blog {
		padding-left: var(--boorsuc-template-pad-x);
		padding-right: var(--boorsuc-template-pad-x);
		padding-bottom: 2.25rem;
	}

	body.has-transparent-header.header-position-fixed .site-main--contact,
	body.has-transparent-header.header-position-fixed .site-main--about,
	body.has-transparent-header.header-position-fixed .site-main--blog {
		padding-top: calc(
			var(--boorsuc-fixed-header-offset, var(--boorsuc-template-header-clearance))
			+ var(--boorsuc-template-pad-y)
		);
	}

	body.has-transparent-header.header-position-fixed .site-main--homepage,
	body.has-transparent-header.header-position-fixed.boorsuc-template-homepage .site-main,
	.site-main--homepage {
		padding-top: 0;
	}

	.contact-page {
		gap: 1.5rem;
	}

	.contact-page__info-title {
		font-size: 1rem;
	}

	.contact-entry .entry-header {
		margin-bottom: 1.25rem;
	}

	.contact-entry .entry-title {
		font-size: clamp(1.5rem, 6vw, 2rem);
		line-height: 1.2;
	}

	.flex-sidebar {
		flex-direction: column;
	}

	.flex-sidebar aside {
		max-width: none;
		width: 100%;
	}
}

@media screen and (max-width: 30em) {
	:root {
		--boorsuc-template-pad-x: 0.875rem;
		--boorsuc-template-header-clearance: 4.25rem;
	}

	.boorsuc-hero__subtitle,
	.boorsuc-hero__inner p.rb-text {
		font-size: 1rem;
	}
}