/**
 * Our Factory page styles.
 *
 * @package Zenova_Child
 */

.zenova-factory {
	padding-block-end: var(--zenova-space-xl);
}

.zenova-factory__intro {
	padding-block: var(--zenova-breadcrumb-header-gap) var(--zenova-space-lg);
	max-width: 820px;
}

.zenova-factory__title {
	margin: 0 0 var(--zenova-space-md);
	color: var(--zenova-color-text);
}

.zenova-factory__lead {
	font-size: 1.125rem;
	line-height: 1.6;
	color: var(--zenova-color-muted);
}

.zenova-factory__lead p {
	margin: 0 0 var(--zenova-space-sm);
}

.zenova-factory__lead p:last-child {
	margin-bottom: 0;
}

.zenova-factory__hero {
	margin: 0;
}

/*
 * The hero IS cropped, deliberately — but only once the container gets wide.
 * `max-height` caps the box and `cover` fills it, so the crop grows with the
 * viewport instead of being a fixed property of the image: with the current
 * 16:9 hero it is 0% up to about 924px of container width, 5% at 977px, and
 * 23% at the full 1200px. On a phone the cap never engages at all. A full-bleed
 * hero is meant to read as a band, and the source is landscape with its subject
 * mid-frame, so what `cover` takes comes off the top and bottom edges rather
 * than out of the subject.
 * `.zenova-factory__step-image` below must not copy this: that batch contains a
 * 3:4 portrait shot, and cropping it to a shared ratio cuts the people out of
 * it — which is why the step images size by `max-height` with `width: auto`
 * instead. The two rules look similar and mean opposite things.
 * The percentages assume a 16:9 hero; a squarer source is cropped harder (the
 * same cap took 42% off a 4:3 stand-in). The mechanism does not change.
 */
.zenova-factory__hero-image {
	display: block;
	width: 100%;
	height: auto;
	max-height: 520px;
	object-fit: cover;
	border-radius: var(--zenova-radius);
}

.zenova-factory__section {
	padding-block: var(--zenova-space-lg);
	border-top: 1px solid var(--zenova-color-border);
	margin-top: var(--zenova-space-lg);
}

.zenova-factory__heading {
	margin: 0 0 var(--zenova-space-lg);
	color: var(--zenova-color-text);
}

/* Process steps */
.zenova-factory__steps-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: var(--zenova-space-xl);
}

.zenova-factory__step {
	display: grid;
	grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
	gap: var(--zenova-space-lg);
	align-items: center;
}

.zenova-factory__step:nth-child(even) .zenova-factory__step-media {
	order: 2;
}

.zenova-factory__step-media {
	display: flex;
	justify-content: center;
}

/*
 * Contain, never cover: the trial-assembly shot is 3:4 portrait while the rest
 * are 4:3, and cropping it to a shared ratio cuts roughly 44% of its height —
 * the heads and feet of the two people in it. Rows therefore differ in height,
 * which is the intended behaviour, not a layout bug to "fix" with a fixed
 * aspect-ratio box.
 */
.zenova-factory__step-image {
	display: block;
	max-width: 100%;
	max-height: 460px;
	width: auto;
	height: auto;
	border-radius: var(--zenova-radius);
}

.zenova-factory__step-number {
	display: block;
	font-size: 0.9375rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	color: var(--zenova-color-accent);
}

.zenova-factory__step-title {
	margin: var(--zenova-space-xs) 0 var(--zenova-space-sm);
	font-size: clamp(1.25rem, 2.2vw, 1.5rem);
	color: var(--zenova-color-text);
}

.zenova-factory__step-body {
	margin: 0;
	max-width: 60ch;
	line-height: 1.7;
	color: var(--zenova-color-muted);
}

/* Workshop gallery — three native 1:1 shots, so a square crop takes nothing. */
.zenova-factory__gallery {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: var(--zenova-space-md);
}

.zenova-factory__gallery-item {
	margin: 0;
}

.zenova-factory__gallery-image {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: var(--zenova-radius);
}

/* Closing CTA band */
.zenova-factory__cta {
	margin-top: var(--zenova-space-xl);
	padding-block: var(--zenova-space-xl);
	background: var(--zenova-color-text);
}

.zenova-factory__cta-heading {
	margin: 0 0 var(--zenova-space-sm);
	font-size: clamp(1.5rem, 2.4vw, 2rem);
	color: var(--zenova-color-surface);
}

.zenova-factory__cta-body {
	margin: 0 0 var(--zenova-space-md);
	max-width: 60ch;
	line-height: 1.7;
	color: var(--zenova-color-border);
}

.zenova-factory__cta-body p {
	margin: 0 0 var(--zenova-space-sm);
}

.zenova-factory__cta-body p:last-child {
	margin-bottom: 0;
}

/*
 * Same control as the site-wide Request a Quote button, inverted for this band:
 * --zenova-color-button is #111 and would all but disappear on a #1a1a1a
 * background. Both values here are existing tokens, so nothing new enters the
 * palette. The focus ring is flipped for the same reason — the accent navy is
 * barely visible against this background.
 */
.zenova-factory__cta .zenova-button--primary {
	background: var(--zenova-color-surface);
	color: var(--zenova-color-text);
}

.zenova-factory__cta .zenova-button--primary:hover,
.zenova-factory__cta .zenova-button--primary:focus-visible {
	background: var(--zenova-color-border);
	color: var(--zenova-color-text);
}

.zenova-factory__cta .zenova-button:focus-visible {
	outline-color: var(--zenova-color-surface);
}

@media (max-width: 820px) {
	.zenova-factory__step {
		grid-template-columns: 1fr;
		gap: var(--zenova-space-md);
	}

	/*
	 * Reset the alternation: without this the even steps keep their media in
	 * source-order slot 2 and put the photo *below* its text, while the odd ones
	 * keep it above — the same page reading two different ways as you scroll.
	 */
	.zenova-factory__step:nth-child(even) .zenova-factory__step-media {
		order: 0;
	}
}

@media (max-width: 640px) {
	.zenova-factory__hero-image {
		max-height: 320px;
	}

	.zenova-factory__step-image {
		max-height: 380px;
	}
}
