/**
 * Shared section blocks.
 *
 * Extracted from templates/home.css, which inc/enqueue.php loads ONLY on the
 * front page. Every one of these blocks is used by other templates — the
 * process steps on /process/ and the What We Make pages, the FAQ accordion
 * almost everywhere, the CTA band on nearly every page, pillars, quotes,
 * the service band, the press line and the text/image split on flexible
 * pages — so off the home page they rendered with no styling at all.
 *
 * /process/ was the clearest case: thirteen process steps that should sit in
 * a grid under large serif numerals rendered as a plain indented list in
 * 16px body text.
 *
 * C-HERO and C-PATHS stay behind: both are home-page furniture.
 */

/* ---------------------------------------------------------------------------
 * C-TEXTIMAGE
 * ------------------------------------------------------------------------- */

/*
 * 18px, not a step on the 8px scale.
 *
 * The design sets `display:flex; flex-direction:column; gap:18px` on this
 * column with `margin:0` on every child, so the eyebrow, heading, paragraph
 * and link are all exactly 18px apart. 16px is the nearest scale step and is
 * visibly tighter over three gaps, so the design's own number is used here.
 */
.cmn-split__copy {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

/*
 * The children carry their own margins from base.css — a heading has a
 * margin-bottom, a paragraph has one too — and inside a flex column those add
 * to the gap instead of collapsing into it. Zeroing them is what makes the
 * 18px above the true distance between every pair.
 */
.cmn-split__copy > * {
	margin: 0;
}

.cmn-split__text {
	max-width: var(--cmn-measure);
	color: var(--cmn-body-muted);
}

.cmn-split__media {
	overflow: hidden;
}

.cmn-split__image {
	width: 100%;
	height: 100%;
	max-height: 620px;
	object-fit: cover;
	aspect-ratio: 4 / 5;
}

/* Image aspect options (editable per section): landscape 3:2, square 1:1. */
.cmn-split__image--landscape {
	aspect-ratio: 3 / 2;
}

.cmn-split__image--square {
	aspect-ratio: 1 / 1;
}

/*
 * A "whole sheet" image: shown uncropped at its natural ratio in a white card,
 * not the portrait photo crop every other text_image uses. The Trade "See our
 * drawings" technical drawing — a cover/contain box would slice off or shrink
 * the detail views and finish schedule. The block serves it at an uncropped size
 * (text-image.php), so width:100% + height:auto shows the full sheet and it
 * fills the column at any column split, never cropped.
 */
.cmn-split__image--whole {
	width: 100%;
	height: auto;
	max-height: none;
	/* aspect-ratio is pinned inline from the file's real dimensions (text-image.php);
	   a CSS aspect-ratio:auto would not resolve under WP's sizes="auto" lazy images. */
}

/*
 * Optional background card behind the image (toggle + colour in the block
 * settings). The colour comes through as --cmn-frame-bg, defaulting to white.
 * The design frames the Trade sample drawing this way; it is off everywhere else
 * unless an editor turns it on.
 */
.cmn-split__figure--frame {
	background: var(--cmn-frame-bg, #fff);
	border: 1px solid var(--cmn-line);
	padding: 16px;
	box-shadow: 0 18px 40px rgba(42, 42, 39, 0.1);
}

/* The media clips its children (overflow:hidden) for the photo crops; the card's
   drop shadow has to show, so stop clipping when the image is framed. */
.cmn-split__media--frame {
	overflow: visible;
}

/* Two captioned photos in the media column — Process's "Built around the
   building" shows "During installation" and "Complete" side by side. */
.cmn-split__figure {
	margin: 0;
}

.cmn-split__media--pair {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--cmn-space-2);
}

.cmn-split__figcaption {
	margin-top: 6px;
	font-size: var(--cmn-eyebrow);
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--cmn-walnut);
}

/*
 * A pull-quote in the side column instead of a photo — The Studio's "A small
 * shop, by choice" sets a large italic line beside the copy, with a rule above.
 */
.cmn-split__media--quote {
	display: flex;
	align-items: flex-start;
	align-self: flex-start;
}

.cmn-split__pullquote {
	margin: 0;
	padding-top: var(--cmn-space-3);
	/* Walnut rule, as the design draws it — not the light hairline. */
	border-top: 1px solid var(--cmn-walnut);
	font-family: var(--cmn-font-display);
	font-size: clamp(26px, 3vw, 32px);
	font-style: italic;
	font-weight: 300;
	line-height: 1.3;
	color: var(--cmn-charcoal);
}

.cmn-split__pullquote p {
	margin: 0;
}

/* Centred rich-text callout, e.g. Process's "When to call us". */
.cmn-section--center {
	text-align: center;
}

.cmn-section--center .cmn-prose {
	margin-inline: auto;
}

/* ---------------------------------------------------------------------------
 * C-PILLARS + C-QUOTE
 * ------------------------------------------------------------------------- */
/*
 * Heading on top, the pillars in a row of columns beneath it — the design's
 * layout on both The Studio ("What sets the shop apart", 3 columns) and Careers
 * ("Craft first…", 4). It was a two-column grid with the heading on the left and
 * the pillars stacked down the right, which matched neither.
 */
.cmn-pillars__inner {
	display: block;
}

.cmn-pillars__heading {
	margin-bottom: var(--cmn-space-4);
}

/* Warm-grey band — Careers' "why work here" pillars sit on #ede8e0, a shade
   between the linen page and white, as the design draws it. */
.cmn-section--grey {
	background: #ede8e0;
}

.cmn-pillars__list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: var(--cmn-space-5) var(--cmn-space-4);
}

/*
 * Heading-left variant (Home's "Why design teams choose us"): the heading sits
 * in a 4fr column with the pillars filling the 8fr column beside it.
 */
.cmn-pillars--heading-left .cmn-pillars__inner {
	display: grid;
	grid-template-columns: 4fr 8fr;
	gap: var(--cmn-space-6);
	align-items: start;
}

.cmn-pillars--heading-left .cmn-pillars__heading {
	margin-bottom: 0;
}

@media (max-width: 991px) {
	.cmn-pillars--heading-left .cmn-pillars__inner {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--cmn-space-4);
	}
}

.cmn-pillar {
	padding-top: var(--cmn-space-2);
	border-top: 1px solid var(--cmn-moss);
}

.cmn-pillar h3 {
	margin-bottom: var(--cmn-space-1);
}

.cmn-pillar p {
	margin: 0;
	color: var(--cmn-body-muted);
}

.cmn-quote {
	grid-column: 1 / -1;
	display: grid;
	grid-template-columns: 3fr 1fr;
	gap: var(--cmn-space-4);
	margin: var(--cmn-space-1) 0 0;
	padding-top: 22px;
	border-top: 1px solid var(--cmn-walnut);
}

.cmn-quote__text {
	margin: 0;
	font-family: var(--cmn-font-display);
	font-size: var(--cmn-h3);
	font-style: italic;
	line-height: 1.3;
}

.cmn-quote__source {
	display: flex;
	flex-direction: column;
	gap: 4px;
	font-size: var(--cmn-small);
	line-height: 1.55;
	color: var(--cmn-body-muted);
}

.cmn-quote__firm {
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--cmn-walnut);
}

@media (max-width: 991px) {
	.cmn-pillars__inner,
	.cmn-quote {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--cmn-space-3);
	}
}

/* ---------------------------------------------------------------------------
 * C-BAND
 * ------------------------------------------------------------------------- */
.cmn-band {
	background: var(--cmn-charcoal);
	color: var(--cmn-linen);
}

.cmn-band__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: var(--cmn-space-2) var(--cmn-space-4);
	padding-block: var(--cmn-space-4);
}

.cmn-band__inner .cmn-eyebrow {
	margin: 0;
	color: var(--cmn-moss);
}

.cmn-band__places {
	margin: 0;
	font-family: var(--cmn-font-display);
	font-size: 22px;
	/* No weight in the design either — Cormorant regular, not light. */
	font-weight: 400;
}

/* ---------------------------------------------------------------------------
 * C-STEPS
 * ------------------------------------------------------------------------- */
.cmn-steps__list {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 28px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/*
 * Process's phases each hold a different number of steps and the design fits
 * each phase's steps in a single row (Phase 1 is five across). auto-fit sizes
 * the row to the step count. Scoped to Process so Trade's single eight-step
 * "How we work" phase keeps its fixed 4-up, 2-row grid.
 */
/*
 * Process's steps fill their phase's width. In a full-width phase that is five
 * columns (Phase 1) or three (Phase 2); in the half-width phases below it is
 * two — auto-fit does this from the container width, which is exactly what the
 * design draws.
 */
.page-id-19 .cmn-steps__list {
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

/*
 * Phases are stacked full-width rows by default (Trade's single "How we work"
 * phase, Process's Phases 1 and 2). Process then pairs its last two phases —
 * 3 and 4 — side by side at half width, as the design lays them out.
 */
.cmn-steps__phases {
	display: flex;
	flex-wrap: wrap;
	column-gap: var(--cmn-space-4);
}

.cmn-steps__phase {
	flex: 1 1 100%;
	min-width: 0;
}

.page-id-19 .cmn-steps__phase:nth-of-type(3),
.page-id-19 .cmn-steps__phase:nth-of-type(4) {
	flex-basis: calc(50% - (var(--cmn-space-4) / 2));
}

@media (max-width: 767px) {
	.page-id-19 .cmn-steps__phase:nth-of-type(3),
	.page-id-19 .cmn-steps__phase:nth-of-type(4) {
		flex-basis: 100%;
	}
}

.cmn-step {
	padding-top: var(--cmn-space-2);
	border-top: 1px solid var(--cmn-line);
}

.cmn-step__number {
	display: block;
	font-family: var(--cmn-font-display);
	font-size: var(--cmn-step);
	/*
	 * The design sets no weight on the numeral, so it renders at Cormorant's
	 * regular 400. 300 made every step number visibly lighter than drawn.
	 */
	font-weight: 400;
	line-height: 1;
	color: var(--cmn-walnut);
}

.cmn-step__title {
	margin: var(--cmn-space-1) 0 4px;
	font-family: var(--cmn-font-text);
	font-size: var(--cmn-body);
	font-weight: 700;
	/*
	 * The design's step title is a plain <span> inheriting the page's 1.65.
	 * Here it is an <h3> — correct for the outline — which picked up the
	 * tight display line-height meant for Cormorant headings. On a two-line
	 * step title that is a visibly cramped pair of lines.
	 */
	line-height: 1.65;
}

/*
 * For the Trade's "How we work with design teams" is the one place the design
 * gives step titles a larger display treatment — 26px Cormorant at weight 500,
 * where Home's and the Process page's steps stay 16px Manrope. Scoped to that
 * page so the shared step component is unchanged everywhere else.
 */
.page-id-20 .cmn-step__title {
	font-family: var(--cmn-font-display);
	font-size: var(--cmn-h3);
	font-weight: 500;
}

/*
 * Careers (page-id-23) design specifics: a larger 66px hero title, 44px section
 * headings, and lighter 28px/400 "why work here" pillar titles — all a step off
 * the site defaults, matching the design for that page only.
 */
.page-id-23 .cmn-h1 {
	font-size: var(--cmn-h1-hero);
}

.page-id-23 .cmn-h2 {
	font-size: 44px;
	line-height: 1.05;
}

.page-id-23 .cmn-pillar .cmn-h3 {
	font-size: 28px;
	font-weight: 400;
	line-height: 1.15;
}

.cmn-step__text {
	margin: 0;
	/* 16px in the design, same size as the title above it — not --cmn-small. */
	font-size: var(--cmn-body);
	color: var(--cmn-body-muted);
}

/*
 * 14px once the steps are grouped into phases.
 *
 * The design uses two densities for the same block: 16px in the flat
 * four-step row on the What We Make pages, 14px on Process where thirteen
 * steps sit under three phase headings. Same markup, different setting.
 */
.cmn-steps__phase .cmn-step__text {
	font-size: var(--cmn-small);
}

.cmn-steps__note {
	margin-top: var(--cmn-space-4);
	font-size: var(--cmn-small);
	color: var(--cmn-caption);
}

@media (max-width: 991px) {
	.cmn-steps__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 575px) {
	.cmn-steps__list {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ---------------------------------------------------------------------------
 * C-PRESS
 * ------------------------------------------------------------------------- */
.cmn-press {
	border-top: 1px solid var(--cmn-line);
}

.cmn-press__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: var(--cmn-space-2) var(--cmn-space-3);
	padding-block: var(--cmn-space-4);
}

.cmn-press__inner .cmn-eyebrow {
	margin: 0;
}

.cmn-press__list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--cmn-space-3);
	margin: 0;
	padding: 0;
	list-style: none;
}

.cmn-press__item {
	font-family: var(--cmn-font-display);
	font-size: 22px;
	font-style: italic;
}

/* ---------------------------------------------------------------------------
 * C-FAQ
 * ------------------------------------------------------------------------- */
/*
 * A rule above each question and none below the last, which is what the
 * design does — every <details> carries its own border-top. A border-top on
 * the list plus a border-bottom on each item draws one extra line, under the
 * final answer, that the design does not have.
 */
.cmn-faq__item {
	border-top: 1px solid var(--cmn-field-border);
}

.cmn-faq__question {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--cmn-space-3);
	/*
	 * content-box, and 44px rather than the button height.
	 *
	 * The design gives this summary `min-height: 44px; padding: 20px 0` with
	 * no box-sizing reset anywhere in the package, so the 44px is the CONTENT
	 * height and a closed row stands 85px tall (44 + 40 padding + 1 border).
	 * Read as border-box the same declaration leaves only 4px for content, the
	 * padding and text decide the height, and a closed row came out 71px —
	 * fourteen pixels short on every question, on six pages.
	 */
	box-sizing: content-box;
	min-height: 44px;
	padding: 20px 0;
	font-family: var(--cmn-font-display);
	/*
	 * 24px/500, which is the design's own value for an FAQ question — not
	 * --cmn-h3 (26px/400). Borrowing the h3 token made every question on the
	 * home page, the FAQ page and the What We Make pages two pixels large and
	 * a weight light.
	 */
	font-size: 24px;
	font-weight: 500;
	line-height: 1.25;
	cursor: pointer;
	list-style: none;
}

.cmn-faq__question::-webkit-details-marker {
	display: none;
}

.cmn-faq__question:hover {
	color: var(--cmn-forest);
}

.cmn-faq__plus {
	flex: 0 0 auto;
	transition: transform 0.2s ease;
}

.cmn-faq__item[open] .cmn-faq__plus {
	transform: rotate(45deg);
}

@media (prefers-reduced-motion: reduce) {
	.cmn-faq__plus {
		transition: none;
	}
}

.cmn-faq__answer {
	/*
	 * 700px, which is what the design sets on an answer — slightly wider than
	 * the 680px reading measure used for running prose.
	 */
	max-width: 700px;
	/*
	 * margin, not padding — the 24px was always the right amount, on the
	 * wrong property.
	 *
	 * The design's answer is a <p> with margin-bottom:24px. Because the
	 * <details> around it has a border-top only, that margin collapses out of
	 * the bottom of the box and shows up as a 24px gap BETWEEN items: the open
	 * item measures 191px and the next one starts at 215px.
	 *
	 * As padding it stayed inside instead, making the open item 215px tall
	 * with the next item flush against it — the same ink in the wrong place,
	 * and the separating rule drawn 24px off.
	 */
	padding-bottom: 0;
	margin-bottom: 24px;
	color: var(--cmn-body-muted);
}

/* ---------------------------------------------------------------------------
 * C-CTA
 * ------------------------------------------------------------------------- */
/*
 * 72px, not the 80px every other section uses.
 *
 * The design does not run one section rhythm throughout — measured across six
 * pages it uses 80px most often (35 sections), then 72px (29), then 96 and 64.
 * The closing CTA band is one of the 72s: its section stands 229px tall around
 * an 85px block of copy, where 80px padding gives 245.
 */
.cmn-section.cmn-cta {
	padding-block: 72px;
}

/*
 * One left-aligned column: copy, then the buttons below it, then the note —
 * the design's layout on every CTA band (Home, Trade, Process, …). It was a
 * two-column space-between row that pushed the buttons to the far right, which
 * is not where any of the designed pages put them.
 */
.cmn-cta__inner {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--cmn-space-4);
}

.cmn-cta__copy {
	flex: 0 0 auto;
}

/*
 * "Beside the text" variant (fx_cta_layout = right): copy on the left, buttons
 * on the right, as The Studio's "Planning a residence?" band sets them. Stacks
 * on phones.
 */
.cmn-cta--actions-right .cmn-cta__inner {
	flex-direction: row;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
}

.cmn-cta--actions-right .cmn-cta__copy {
	flex: 1 1 420px;
}

@media (max-width: 767px) {
	.cmn-cta--actions-right .cmn-cta__inner {
		flex-direction: column;
		align-items: flex-start;
		/* No space-between in a column, or the copy and button spread to fill. */
		justify-content: flex-start;
	}

	/*
	 * Reset the copy's flex basis. In the desktop row it means "420px wide";
	 * stacked into a column it would mean "420px TALL", ballooning the band and
	 * dropping the button to the bottom.
	 */
	.cmn-cta--actions-right .cmn-cta__copy {
		flex: 0 0 auto;
	}
}

.cmn-cta__text {
	max-width: var(--cmn-measure);
	margin: var(--cmn-space-1) 0 0;
	/* The CTA intro copy is a dimmed sage over the forest band in the design,
	   not pure white (which is reserved for the brighter note line below). */
	color: rgb(220, 229, 207);
}

.cmn-cta__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--cmn-space-2);
}

/*
 * A plain underlined text link beside the button — the design's treatment for
 * the "Email us" / "Text us" contact actions (mailto:/sms:). White, 16px/400,
 * underlined at rest, not a button.
 */
.cmn-cta__link {
	color: var(--cmn-white);
	font-size: 16px;
	font-weight: 400;
	text-decoration: underline;
	text-underline-offset: var(--cmn-underline-offset);
}

.cmn-cta__link:hover {
	text-decoration-thickness: 2px;
}

/*
 * The line under the buttons ("Or email drawings for a quote to rfq@…") is
 * 16px white in the design, a touch brighter and larger than the muted intro
 * copy above the buttons.
 */
.cmn-cta__note {
	margin: var(--cmn-space-2) 0 0;
	font-size: 16px;
	line-height: 1.65;
	color: var(--cmn-white);
}

.cmn-cta__note a {
	color: inherit;
}

@media (max-width: 575px) {
	.cmn-cta__actions {
		width: 100%;
	}

	.cmn-cta__actions .cmn-btn {
		flex: 1 1 100%;
	}
}

/*
 * Light ground (tone = light): a linen band with outlined forest buttons. The
 * FAQ page sets its "Still have a question?" prompt on linen before the final
 * forest "Ready to start?" band, so heading, copy and buttons all flip to the
 * dark-on-light palette.
 */
.cmn-cta--light {
	background: var(--cmn-linen);
	color: var(--cmn-charcoal);
}

.cmn-cta--light .cmn-h2 {
	color: var(--cmn-charcoal);
}

.cmn-cta--light .cmn-cta__text,
.cmn-cta--light .cmn-cta__note {
	color: var(--cmn-body-muted);
}

.cmn-cta--light .cmn-btn--outline {
	border-color: var(--cmn-forest);
	background: transparent;
	color: var(--cmn-forest);
}

.cmn-cta--light .cmn-cta__link {
	color: var(--cmn-forest);
}

/* ---------------------------------------------------------------------------
 * FAQ — the homepage split.
 *
 * The design puts the eyebrow, heading and "All questions" link in a narrow
 * left column with the accordion beside them (1fr : 2fr, 56px apart). The
 * build used the shared .cmn-section-head instead, which lays the heading out
 * on the left and pushes the link to the far right across the full width —
 * correct for the other sections, wrong for this one.
 *
 * Scoped to .cmn-faq--split so the /faq/ page, which really is full width,
 * is unaffected.
 * ------------------------------------------------------------------------- */
@media (min-width: 900px) {
	.cmn-faq--split > .cmn-container {
		display: flex;
		flex-wrap: wrap;
		gap: 56px;
	}

	/* Left column: 1fr against the accordion's 2fr, as drawn. */
	.cmn-faq--split .cmn-section-head {
		flex: 1 1 300px;
		min-width: 0;
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		/*
		 * Both of these reset the base .cmn-section-head, which is a ROW with
		 * space-between. Turned on its side, space-between pushes the "All
		 * questions" link to the bottom of a tall column instead of sitting it
		 * under the heading.
		 */
		justify-content: flex-start;
		align-content: flex-start;
		gap: 14px;
		margin-bottom: 0;
	}

	.cmn-faq--split .cmn-section-head > div {
		display: flex;
		flex-direction: column;
		gap: 14px;
	}

	.cmn-faq--split .cmn-faq__list {
		flex: 2 1 600px;
		min-width: 0;
	}
}

/* ---------------------------------------------------------------------------
 * C-FORM — the flexible form section (Careers).
 *
 * Two columns in the design: a left sidebar carrying the heading, intro and
 * "What happens next", and the form in a white panel on the right — a 447/817
 * split, 56px apart. An earlier build stacked all of it in one white column,
 * which is why the page read as a single column rather than the design's two.
 * Stacks to one column below the 992 breakpoint.
 * ------------------------------------------------------------------------- */
.cmn-formsection__grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.8fr);
	gap: 56px;
	align-items: start;
}

.cmn-formsection__aside .cmn-formpanel__intro {
	margin-top: var(--cmn-space-2);
}

@media (max-width: 991px) {
	.cmn-formsection__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--cmn-space-4);
	}
}
