/*
 * Page — default WordPress page template (page.php).
 * Hero featured image, heritage-green title strip, centred prose column.
 *
 * Depends on foundation.css. Reuses .project-hero-image and
 * .project-title-strip from project.css when the page-main element opts
 * in via the .page-default class — those are loaded alongside via
 * the same enqueue path on page.php.
 */

/* When no featured image is set the title strip sits flush at the top;
 * add a small top margin so it doesn't collide with the site header. */
.page-default .page-title-strip:first-child {
	margin-top: 0;
}

/* Content column — narrower than the container for comfortable line length. */
.page-body {
	padding: 4rem 0 5rem;
}

.page-body__content {
	/* Full column width — the body fills the container from the same left edge
	 * as the page title. (Long measures like this trade some readability for
	 * the client's preferred full-width look.) */
	max-width: none;
	margin: 0;
	font-size: 1.05rem;
	line-height: 1.8;
	color: var(--colour-text);
}

/* Typography inside the page body. */
.page-body__content h2,
.page-body__content h3,
.page-body__content h4 {
	color: var(--heritage-green);
	margin: 2rem 0 0.75rem;
	line-height: 1.2;
}

.page-body__content h2 { font-size: clamp(1.35rem, 2.4vw, 1.75rem); }
.page-body__content h3 { font-size: clamp(1.1rem,  1.9vw, 1.35rem); }
.page-body__content h4 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.06em; }

.page-body__content p { margin-bottom: 1.25rem; }
.page-body__content p:last-child { margin-bottom: 0; }

.page-body__content ul,
.page-body__content ol {
	padding-left: 1.5rem;
	margin-bottom: 1.25rem;
}

.page-body__content li { margin-bottom: 0.4rem; }

.page-body__content a {
	color: var(--heritage-green);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.page-body__content a:hover {
	color: var(--heritage-green-deep);
}

.page-body__content blockquote {
	border-left: 3px solid var(--heritage-green);
	margin: 2rem 0;
	padding: 0.75rem 0 0.75rem 1.5rem;
	color: var(--urban-grey);
	font-style: italic;
}

.page-body__content hr {
	border: none;
	border-top: 1px solid var(--colour-border);
	margin: 2.5rem 0;
}

/* WordPress-generated figure / image alignment. */
.page-body__content figure { margin: 2rem 0; }
.page-body__content figure img { max-width: 100%; height: auto; border-radius: 4px; }
.page-body__content figcaption {
	font-size: 0.8rem;
	color: var(--colour-text-light);
	margin-top: 0.5rem;
	text-align: center;
}

.page-body__content .wp-block-image { margin: 2rem 0; }

@media (max-width: 768px) {
	.page-body { padding: 2.5rem 0 3.5rem; }
}

/* ── FAQ page template ── */
.faq-page__body { position: relative; overflow: hidden; }
.faq-page__body > .container { position: relative; z-index: 1; }

/* Keep the readable content to the left so the watermark breathes on the right. */
.faq-page__intro { max-width: 820px; margin-bottom: 2.5rem; }
.faq-page__accordion { max-width: 820px; }

/* Big emblem watermark, right side, behind the boxes — mirrors the project
 * single intro watermark. Parallax handled by js-emblem-parallax. */
.faq-page__watermark {
	position: absolute;
	right: -6%;
	top: 50%;
	width: min(70vw, 620px);
	transform: translateY(-50%) rotate(-12deg);
	pointer-events: none;
	z-index: 0;
}

.faq-page__watermark-parallax { will-change: transform; }

.faq-page__watermark-img {
	width: 100%;
	height: auto;
	display: block;
	filter: brightness(0);
	opacity: 0.05;
}

@media (max-width: 900px) {
	.faq-page__watermark {
		right: -18%;
		width: min(95vw, 460px);
		transform: translateY(-46%) rotate(-10deg);
	}
	.faq-page__watermark-img { opacity: 0.04; }
}

/* ── Feefo reviews template ────────────────────────────────────────
 * Spacing wrapper around the Feefo service-review widget. Feefo ships
 * its own widget styling; this just gives the section room to breathe. */
.reviews-widget {
	padding: 3rem 0 4.5rem;
}
.reviews-widget .feefo-review-widget-service {
	max-width: 1000px;
	margin: 0 auto;
}

/* ──────────────────────────────────────────────────────────────────
 * 404 — page not found.
 * Reuses the page body column; adds a lead line, a row of quick links
 * and a search box beneath.
 * ────────────────────────────────────────────────────────────────── */
.error-404__content {
	text-align: center;
}

.error-404__lead {
	font-size: 1.15rem;
	line-height: 1.6;
	max-width: 85ch;
	margin: 0 auto 2rem;
}

.error-404__links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.65rem 0.9rem;
	margin-bottom: 2rem;
}

.page-body__content .error-404__link,
.error-404__link {
	display: inline-block;
	padding: 0.5rem 1.1rem;
	border: 1px solid var(--heritage-green);
	border-radius: 999px;
	color: var(--heritage-green);
	font-family: var(--font-heading);
	font-size: 0.85rem;
	font-weight: 600;
	letter-spacing: 0.02em;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.page-body__content .error-404__link:hover,
.page-body__content .error-404__link:focus,
.error-404__link:hover,
.error-404__link:focus {
	background: var(--heritage-green);
	color: var(--colour-white);
	text-decoration: none;
}

.sfs-search-form {
	display: flex;
	justify-content: center;
	gap: 0.6rem;
	max-width: 460px;
	margin: 0 auto 2rem;
}

.sfs-search-form input[type="search"] {
	flex: 1 1 auto;
	min-width: 0;
	padding: 0.7rem 1rem;
	border: 1px solid var(--colour-border, #d5d5d5);
	border-radius: 4px;
	font-size: 1rem;
}

.sfs-search-form input[type="search"]:focus {
	outline: none;
	border-color: var(--heritage-green);
}

.error-404__home {
	margin: 0;
}

@media (max-width: 560px) {
	.sfs-search-form {
		flex-direction: column;
	}
	.sfs-search-form .btn {
		width: 100%;
	}
}

/* ──────────────────────────────────────────────────────────────────
 * Search results (search.php).
 * Shares the green emblem title strip with the 404 page. Results are
 * horizontal cards built from the same tokens as the news cards
 * (.post-card in news.css): white, 1px border, 8px radius, cream media
 * well, uppercase micro-label, green title, hover lift. Pagination
 * inherits from .news-list in news.css.
 * ────────────────────────────────────────────────────────────────── */
.search-results .container {
	max-width: 1000px;
}

.search-results__form {
	margin: 0 0 2.5rem;
	max-width: 560px;
}

.search-results__form .sfs-search-form {
	max-width: none;
	margin: 0;
}

.search-results__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.search-result {
	display: flex;
	gap: 0;
	background: var(--colour-white);
	border: 1px solid var(--colour-border);
	border-radius: 8px;
	overflow: hidden;
	transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.search-result:hover {
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
	transform: translateY(-2px);
}

.search-result__media {
	flex: 0 0 220px;
	display: block;
	background: var(--colour-cream);
	overflow: hidden;
}

.search-result__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.4s ease;
}

.search-result:hover .search-result__media img {
	transform: scale(1.04);
}

/* No featured image: cream tile with the emblem, so the card keeps the
 * same silhouette as its neighbours instead of collapsing to text-only. */
.search-result__media--emblem {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--colour-cream);
}

.search-result__media--emblem .search-result__emblem {
	width: 46%;
	height: auto;
	object-fit: contain;
	opacity: 0.22;
	filter: none;
}

.search-result:hover .search-result__media--emblem .search-result__emblem {
	transform: scale(1.06);
	opacity: 0.3;
}

.search-result__body {
	flex: 1 1 auto;
	min-width: 0;
	padding: 1.5rem 1.75rem;
}

.search-result__type {
	display: block;
	font-family: var(--font-heading);
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--heritage-green);
	margin-bottom: 0.6rem;
}

.search-result__title {
	font-family: var(--font-heading);
	font-size: 1.25rem;
	line-height: 1.3;
	margin: 0 0 0.6rem;
}

.search-result__title a {
	color: var(--heritage-green);
	text-decoration: none;
}

.search-result__title a:hover {
	color: var(--heritage-green-deep);
}

.search-result__snippet {
	font-size: 0.95rem;
	line-height: 1.65;
	color: var(--colour-text-light);
	margin: 0;
}

/* Match highlight — emphasis, not a highlighter pen. */
mark.search-hit {
	background: transparent;
	color: inherit;
	font-weight: 600;
	padding: 0;
}

.search-result__snippet mark.search-hit {
	color: var(--colour-text);
}

.search-results__empty {
	text-align: center;
	padding: 1rem 0 2rem;
}

.search-results__empty-lead {
	font-size: 1.1rem;
	line-height: 1.6;
	max-width: 60ch;
	margin: 0 auto 1.75rem;
}

@media (max-width: 640px) {
	.search-result {
		flex-direction: column;
	}
	.search-result__media {
		flex-basis: auto;
		aspect-ratio: 16 / 10;
	}
	.search-result__body {
		padding: 1.25rem 1.25rem 1.5rem;
	}
}
