/*
 * About, Our Story and Sustainability. Measured from the Framer build at 1440 / 810 / 390.
 * Framer's header floats over the page, so its top paddings include the header; here the header
 * takes up space, so each top padding is Framer's value minus the header height.
 */

.fh-about-page main.wp-block-group > *,
.fh-about-page .wp-block-post-content > * {
	margin-block: 0;
}

.fh-page-head > * {
	margin: 0;
}

/* ---------- Shared pieces ---------- */

/* Image areas: a Cover block the client can put a photo in; Image Placeholder until then. */
.fh-photo.wp-block-cover {
	min-height: 0;
	padding: 0;
	background: var(--wp--preset--color--image-placeholder);
}

.fh-photo .wp-block-cover__background {
	display: none;
}

.fh-label {
	color: var(--wp--preset--color--muted);
	font-family: var(--wp--preset--font-family--helvetica-neue);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 400;
	line-height: 1.4;
	letter-spacing: normal;
}

/* ---------- About ---------- */

/* The page title is kept for screen readers and search engines only; the lead and the cards
   sit centred in the first screen, so the cards stay at eye level. */
.fh-page--about .fh-page-head {
	padding: 0;
}

.fh-page--about .fh-page-head h1 {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.fh-page--about .wp-block-post-content {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-height: calc(100svh - var(--wp--custom--header-height));
	padding-block: clamp(36px, min(19.2857px + 4.2857vw, 30.8571px + 2.8571vw), 72px);
}

.fh-page--about .wp-block-post-content > * {
	width: 100%;
}

.fh-subpages .fh-cards {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 28px;
}

.fh-subpages .fh-card__media {
	height: 336px;
}

.fh-subpages .fh-card .fh-card__title {
	margin-top: 16px;
}

@media (min-width: 810px) {
	.fh-subpages .fh-cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 20px;
	}

	.fh-subpages .fh-card__media {
		height: 448px;
	}
}

/* Desktop: the two cards run edge to edge with a 20px gap at the sides and between them, and
   sit centred in the screen. The photos are 80% of the full-screen height, which makes them
   landscape. Each card is its photo plus the title underneath. */
@media (min-width: 1200px) {
	.fh-page--about .wp-block-post-content {
		padding-block: 0;
	}

	.fh-page--about .wp-block-post-content > .fh-subpages {
		box-sizing: border-box;
		width: 100vw;
		max-width: 100vw !important;
		margin-left: calc(50% - 50vw) !important;
		margin-right: calc(50% - 50vw) !important;
		padding: 20px;
	}

	.fh-subpages .fh-card__media {
		/* 80% of: window − header − 20 above − 20 below − 16 to the title − the title line */
		height: calc(0.8 * (100svh - var(--wp--custom--header-height) - 40px - 16px - 1.15 * var(--wp--preset--font-size--subheading)));
		min-height: 270px;
	}
}

/* ---------- Our Story and Sustainability ----------
 * The same layout on both: "← Back" and the title, the copy (640 wide, starting 150px left of
 * the centre line on desktop), the photo, then the enquiry prompt.
 */

.fh-page--our-story .fh-page-head,
.fh-page--sustainability .fh-page-head {
	padding-top: calc(var(--wp--preset--spacing--section-200) - var(--wp--custom--header-height));
	padding-bottom: clamp(44.5px, min(23.8393px + 5.2976vw, 38.1429px + 3.5317vw), 89px);
}

/* The back link sits above the title, like "← Back to services" on the service pages. */
.fh-page-head > .fh-back + * {
	margin-top: 28px;
}

.is-layout-constrained > .fh-story-copy {
	padding-bottom: var(--wp--preset--spacing--section-200);
}

.fh-story-copy > * {
	margin-block: 0;
}

.fh-story-copy > * + * {
	margin-block-start: 20px;
}

.fh-story-copy p {
	font-size: var(--wp--preset--font-size--body-large);
	line-height: 1.55;
	letter-spacing: -0.005em;
}

@media (min-width: 810px) {
	.is-layout-constrained > .fh-story-copy {
		max-width: min(640px, var(--fh-content-w)) !important;
		margin-left: calc((100% - var(--fh-content-w)) / 2) !important;
	}
}

/* Desktop: the copy column starts 150px left of the centre line (x = 570 at 1440). */
@media (min-width: 1200px) {
	.is-layout-constrained > .fh-story-copy {
		margin-left: calc((100% - var(--fh-content-w)) / 2 + var(--fh-content-w) / 2 - 150px) !important;
	}
}

/* Photos: 4:5 on phones; 3:2 from tablet up, never taller than the screen below the header
   (less the 20px frame above and below), so a whole photo fits in view. */
.fh-story-photo.wp-block-cover,
.fh-sust-photo.wp-block-cover {
	height: calc(var(--fh-content-w) * 1.25);
}

@media (min-width: 810px) {
	.fh-story-photo.wp-block-cover,
	.fh-sust-photo.wp-block-cover {
		height: min(var(--fh-content-w) / 1.5, 100svh - var(--wp--custom--header-height) - 40px);
	}
}

.is-layout-constrained > .fh-story-photo,
.is-layout-constrained > .fh-sust-photo {
	margin-bottom: var(--wp--preset--spacing--section-200) !important;
}

.fh-page--our-story .fh-cta,
.fh-page--sustainability .fh-cta {
	padding-top: 0;
	padding-bottom: var(--wp--preset--spacing--section-240);
}
