/*
 * Section builder refinements (page imports, Nov 2026).
 * Loaded after styles.css, so these rules win where they overlap.
 */

/* ---------- links inside editor text (same treatment as .global-estimate__intro a) ---------- */
:is(.free-text__content, .two-column__paragraph, .services__intro, .card__text) a:not(.btn) {
	text-decoration: underline;
	text-decoration-color: var(--red);
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
	transition: color .2s;
}

:is(.free-text__content, .two-column__paragraph, .services__intro, .card__text) a:not(.btn):hover {
	color: var(--red);
}

/* ---------- two column: text ---------- */
.two-column__paragraph :is(h3, h4) {
	margin-top: 1.25em;
	margin-bottom: .35em;
	color: var(--ink);
}

.two-column__paragraph> :is(h3, h4):first-child {
	margin-top: 0;
}

:is(.two-column__paragraph, .free-text__content) :is(ul, ol) {
	padding-left: 1.4em;
}

:is(.two-column__paragraph, .free-text__content) ul {
	list-style: disc;
}

/* Lists keep paragraph spacing above and below. */
.two-column__paragraph :is(ul, ol) {
	margin: .75em 0;
}

/* Block, not flex: multi-paragraph answers would otherwise sit side by side. */
.two-column__accordion .faq__a {
	display: block;
}

/* ---------- two column: "Keep original shape" images ---------- */
.two-column__image--natural {
	width: fit-content;
	max-width: 100%;
	background: none;
}

.two-column__image--natural img {
	display: block;
	width: auto;
	max-width: 100%;
	aspect-ratio: var(--image-ratio, auto);
	object-fit: initial;
}

/* ---------- free text ---------- */
/* Headings written inside the Free Text editor. */
.free-text__content :is(h1, h2, h3) {
	font-family: var(--font-display);
	line-height: 1.1;
	color: var(--ink);
}

.free-text__content :is(h1, h2) {
	font-size: clamp(38px, 4vw, 52px);
}

.free-text__content h3 {
	font-size: clamp(26px, 2.6vw, 32px);
}

/* <em> in headings = red emphasis, matching .h2 em */
.free-text__content :is(h1, h2, h3) em {
	font-style: normal;
	font-weight: 700;
	color: var(--red);
}

.free-text__content :is(h1, h2, h3)+* {
	margin-top: 24px;
}

/* Testimonial quotes: matches .default-page__content blockquote. */
.free-text__content blockquote {
	padding: 24px 28px;
	border-left: 5px solid var(--red);
	border-radius: 0 12px 12px 0;
	background: var(--panel);
	color: var(--ink);
}

.section-bg--light .free-text__content blockquote {
	background: #fff;
}

.free-text__content blockquote cite {
	display: block;
	margin-top: 12px;
	font-family: var(--font-display);
	font-size: 18px;
	font-style: normal;
	font-weight: 700;
	color: var(--red);
}

/* Free Text followed by a Two Column on the same background reads as one block
   (e.g. a centered heading above two text columns). */
.free-text.section-bg--light:has(+ .two-column.section-bg--light) .free-text__inner,
.free-text.section-bg--white:has(+ .two-column.section-bg--white) .free-text__inner {
	padding-bottom: 40px;
}

.free-text.section-bg--light+.two-column.section-bg--light>.container,
.free-text.section-bg--white+.two-column.section-bg--white>.container,
/* Stacked Two Column rows on one background (alternating text/image rows). */
.two-column.section-bg--light+.two-column.section-bg--light>.container,
.two-column.section-bg--white+.two-column.section-bg--white>.container {
	padding-top: 0;
}

/* ---------- cards ---------- */
/* Same type as .brands__intro, but full container width. */
.services__intro {
	text-align: center;
	font-size: 18px;
	line-height: 1.38;
	color: var(--body);
}

/* Long titles and full-width intros stretch the head, so centre its text. */
.services .section-head {
	text-align: center;
}

.services__intro p+p {
	margin-top: .75em;
}

/* Light panel scheme (lost from styles.css in the 3 Nov overwrite). */
.services__panel--light {
	border: 1px solid #e5e5e5;
	background: var(--panel);
}

.section-bg--light .services__panel--light {
	background: #fff;
}

.services__panel--light .card {
	box-shadow: inset 0 1px 0 #d6d6d6;
}

.services__panel--light .card__title span {
	color: var(--ink);
}

.services__panel--light .card__arrow {
	background-color: var(--red);
}

.services__panel--light .card__text {
	border-color: #e5e5e5;
	background: #fff;
	backdrop-filter: none;
	color: #4a4a4a;
}

.section-bg--light .services__panel--light .card__text {
	background: var(--panel);
}

.card__text p+p {
	margin-top: .75em;
}

/* Flex instead of grid so an incomplete last row stays centred. */
.services__grid {
	--cols: 3;
	--col-gap: 24px;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 40px var(--col-gap);
}

.services__grid>.card {
	flex: 0 1 calc((100% - (var(--cols) - 1) * var(--col-gap)) / var(--cols));
	min-width: 0;
}

.services__grid--4 {
	--cols: 4;
	--col-gap: 20px;
}

@media (max-width: 1200px) {
	.services__grid {
		--cols: 2;
	}
}

@media (max-width: 640px) {
	.services__grid {
		--cols: 1;
		row-gap: 32px;
	}
}

/* ---------- image gallery ---------- */
.gallery>.container {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 40px;
	padding-top: 80px;
	padding-bottom: 80px;
}

.gallery__head {
	width: 760px;
	text-align: center;
}

.gallery__intro {
	font-size: 18px;
	line-height: 1.5;
	color: var(--body);
}

.gallery__intro p+p {
	margin-top: 1em;
}

/* Flex instead of grid so an incomplete last row stays centred. */
.gallery__grid {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 24px;
	align-self: stretch;
	list-style: none;
}

.gallery__grid>li {
	flex: 0 1 calc((100% - 48px) / 3);
	min-width: 0;
}

.gallery__grid--4>li {
	flex-basis: calc((100% - 72px) / 4);
}

.gallery__item {
	height: 100%;
	overflow: hidden;
	border: 1px solid #e2e2e2;
	border-radius: 16px;
	background: #fff;
}

.gallery__item img {
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.gallery__item figcaption {
	padding: 16px 20px;
	font-size: 16px;
	line-height: 1.4;
	color: var(--ink);
}

/* Linked tiles (e.g. Service Areas). */
.gallery__item--link {
	display: flex;
	flex-direction: column;
	color: inherit;
	transition: border-color .2s, box-shadow .2s;
}

.gallery__item--link img {
	transition: transform .3s;
}

.gallery__item--link:hover,
.gallery__item--link:focus-visible {
	border-color: var(--red);
	box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
}

.gallery__item--link:hover img {
	transform: scale(1.03);
}

.gallery__item--link:focus-visible {
	outline: 3px solid var(--red);
	outline-offset: 2px;
}

.gallery__caption {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 20px;
}

.gallery__title {
	font-family: var(--font-display);
	font-size: 24px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--ink);
}

.gallery__more {
	flex-shrink: 0;
	font-size: 14px;
	font-weight: 600;
	color: var(--red);
}

.gallery__more::after {
	content: " \2192";
}

@media (max-width: 1200px) {
	.gallery__grid--4>li {
		flex-basis: calc((100% - 48px) / 3);
	}
}

@media (max-width: 991px) {
	.gallery>.container {
		padding-top: 64px;
		padding-bottom: 64px;
	}

	.gallery__grid>li,
	.gallery__grid--4>li {
		flex-basis: calc((100% - 24px) / 2);
	}
}

@media (max-width: 640px) {
	.gallery>.container {
		gap: 32px;
		padding-top: 48px;
		padding-bottom: 48px;
	}

	.gallery__grid {
		gap: 16px;
	}

	.gallery__grid>li,
	.gallery__grid--4>li {
		flex-basis: 100%;
	}
}

/* ---------- gallery lightbox ---------- */
.gallery__open {
	display: block;
	cursor: zoom-in;
}

.gallery__open:focus-visible {
	outline: 3px solid var(--red);
	outline-offset: -3px;
}

.lightbox {
	max-width: min(1200px, 92vw);
	max-height: 92vh;
	margin: auto;
	padding: 0;
	border: 0;
	border-radius: 16px;
	background: #fff;
	overflow: visible;
}

.lightbox::backdrop {
	background: rgba(17, 17, 17, .85);
}

.lightbox img {
	display: block;
	max-width: 100%;
	max-height: calc(92vh - 64px);
	margin: 0 auto;
	border-radius: 16px 16px 0 0;
}

.lightbox figcaption {
	padding: 16px 20px;
	font-size: 16px;
	color: var(--ink);
}

.lightbox figcaption:empty {
	display: none;
}

.lightbox__close {
	position: absolute;
	top: -16px;
	right: -16px;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: var(--red);
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

.lightbox__nav {
	position: absolute;
	top: 50%;
	z-index: 1;
	width: 48px;
	height: 48px;
	margin-top: -24px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .92);
	box-shadow: 0 4px 16px rgba(0, 0, 0, .25);
	cursor: pointer;
}

/* Chevron drawn with borders, matching the theme's icon-free arrows. */
.lightbox__nav::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 12px;
	height: 12px;
	border-top: 3px solid var(--ink);
	border-right: 3px solid var(--ink);
}

.lightbox__nav--prev {
	left: -72px;
}

.lightbox__nav--prev::before {
	transform: translate(-30%, -50%) rotate(-135deg);
}

.lightbox__nav--next {
	right: -72px;
}

.lightbox__nav--next::before {
	transform: translate(-70%, -50%) rotate(45deg);
}

.lightbox__nav:hover::before,
.lightbox__nav:focus-visible::before {
	border-color: var(--red);
}

.lightbox--single .lightbox__nav {
	display: none;
}

/* Not enough room beside the image: sit the controls on top of it. */
@media (max-width: 767px) {
	.lightbox__nav--prev {
		left: 8px;
	}

	.lightbox__nav--next {
		right: 8px;
	}

	.lightbox__close {
		top: 8px;
		right: 8px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.gallery__item--link img {
		transition: none;
	}

	.gallery__item--link:hover img {
		transform: none;
	}
}

/* FAQ Section: centered heading, single-column accordion. */
.faq-section>.container {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 40px;
}

.faq-section .section-head {
	text-align: center;
}

/* Two Column Layout: eyebrow, title and description span both columns. */
.two-column__head {
	text-align: center;
	margin-bottom: 56px;
}

@media (max-width: 640px) {
	.two-column__head {
		margin-bottom: 40px;
	}
}

.two-column__head .two-column__paragraph {
	max-width: 780px;
}

/* Text-only sections under a full-width head: each H3 opens a ruled item (grey line + red segment, like the cards). */
.two-column__head+.two-column__inner:not(:has(.two-column__image, .two-column__accordion)) .two-column__paragraph h3 {
	position: relative;
	margin-top: 40px;
	padding-top: 20px;
	border-top: 1px solid #dcdcdc;
	font-family: var(--font-display);
	font-size: 22px;
	font-weight: 500;
	line-height: 1.15;
}

.two-column__head+.two-column__inner:not(:has(.two-column__image, .two-column__accordion)) .two-column__paragraph h3::before {
	content: "";
	position: absolute;
	top: -1px;
	left: 0;
	width: 48px;
	height: 3px;
	background: var(--red);
}

.two-column__head+.two-column__inner:not(:has(.two-column__image, .two-column__accordion)) .two-column__paragraph>h3:first-child {
	margin-top: 0;
}

.faq-section .two-column__accordion {
	width: 100%;
	max-width: 960px;
}
