
/*
 * Home (Figma: desktop "Home V3" 199:1243 · mobile "Home" 386:1987). Scale unit --s and shared sections:
 * sections.css. Art: composites built by scripts/build-images.py (assets/img/home/), decorative → CSS backgrounds.
 */

/* Spacing of the shared sections on this page */
.zain-why { margin-top: calc(160 * var(--s)); }
.zain-experience,
.zain-fees { margin-top: calc(180 * var(--s)); }
.zain-book { margin-top: calc(160 * var(--s)); }

/* ------------------------------------------------------------------ Hero */

.zain-hero {
	isolation: isolate;
	width: calc(1628 * var(--s));
	min-height: calc(858 * var(--s)); /* grows with longer text instead of running into the intro */
	padding: calc(245 * var(--s)) 0 calc(80 * var(--s)) calc(180 * var(--s));
}

.zain-hero::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -2;
	border-radius: calc(40 * var(--s));
	/* Under the art: a 32px blurred copy of it, inline, so the box shows the art's colours at once instead of Figma's
	   blue frame fill while the art loads (AVIF 247 KB, WebP 476 KB). Rebuild it when the art changes (HANDOFF Decisions 2026-10-22) */
	background:
		url(../../img/home/hero-bg.webp) center / cover no-repeat,
		url("data:image/webp;base64,UklGRngAAABXRUJQVlA4IGwAAADQBACdASogABEAPt1WpE2opKOiN/qoARAbiWgAnTLQf/glA/9d61OVSfO7zJTxgAD8cefZDE5feh44v/UdcMNWrxLbG1XP11pEei5T9CGtF2lbdLhBOI5X2RYeaUyhZoFOhs5zaIn9W5hAAAA=") center / cover no-repeat;
	/* AVIF first (under half the bytes, same grain); browsers without image-set type() keep the declaration above */
	background:
		image-set(url(../../img/home/hero-bg.avif) type("image/avif"), url(../../img/home/hero-bg.webp) type("image/webp")) center / cover no-repeat,
		url("data:image/webp;base64,UklGRngAAABXRUJQVlA4IGwAAADQBACdASogABEAPt1WpE2opKOiN/qoARAbiWgAnTLQf/glA/9d61OVSfO7zJTxgAD8cefZDE5feh44v/UdcMNWrxLbG1XP11pEei5T9CGtF2lbdLhBOI5X2RYeaUyhZoFOhs5zaIn9W5hAAAA=") center / cover no-repeat;
}

/* People: the couple 882:1172 + its ground shadow 882:1188 (40%), one image (Figma "Home V3" 882:876, 2026-11-11) */
.zain-hero::after {
	content: "";
	position: absolute;
	top: calc(177 * var(--s));
	left: calc(494 * var(--s));
	z-index: -1;
	width: calc(1191 * var(--s));
	aspect-ratio: 1191 / 814;
	background: image-set(url(../../img/home/hero-people-1x.webp) 1x, url(../../img/home/hero-people.webp) 2x) center / contain no-repeat;
	/* AVIF first; browsers without image-set type() keep the line above */
	background: image-set(url(../../img/home/hero-people-1x.avif) type("image/avif") 1x, url(../../img/home/hero-people.avif) type("image/avif") 2x, url(../../img/home/hero-people-1x.webp) type("image/webp") 1x, url(../../img/home/hero-people.webp) type("image/webp") 2x) center / contain no-repeat;
	pointer-events: none;
}

.zain-hero__title {
	width: calc(526 * var(--s));
	min-width: min(12ch, 100%); /* never wider than the hero on 320px phones */
	margin-bottom: calc(64 * var(--s));
	color: var(--wp--preset--color--white);
	font-size: var(--wp--preset--font-size--hero);
	line-height: var(--wp--custom--line-height--hero);
}

.zain-hero__cta {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	width: 240px;
	padding: 8px;
	border-radius: 12px;
	background: var(--wp--preset--color--white);
}

.zain-hero__cta .wp-block-buttons,
.zain-hero__book {
	width: 100%;
	margin: 0;
}

.zain-hero__book .wp-block-button__link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 50px;
	padding: 0;
	border-radius: 12px;
	background: var(--wp--preset--color--forest);
	color: var(--wp--preset--color--white);
	font-size: var(--wp--preset--font-size--regular);
	font-weight: 600;
	line-height: var(--wp--custom--line-height--regular);
	text-decoration: none;
	transition: background-color 0.15s, color 0.15s; /* the calendar day's fade */
}

/* Hover and keyboard focus: green button → light green, green text (feedback 2026-11-02, "Unify button hover states") */
.zain-hero__book .wp-block-button__link:is(:hover, :focus-visible) {
	background: var(--wp--custom--color--forest-pale);
	color: var(--wp--preset--color--forest);
}

.zain-hero__note {
	color: rgb(0 0 0 / 0.76);
	font-size: var(--wp--preset--font-size--small);
	line-height: var(--wp--custom--line-height--small);
	opacity: 0.7;
}

/* ------------------------------------------------------------------ Intro */

.zain-intro {
	display: grid;
	margin-top: calc(160 * var(--s));
}

/* The photo sits under the text and rises behind it by Figma's overlap (desktop 235, mobile 110 — the top fifth of
   the photo, inside its white fade). Placed from the text's end, so a text that wraps to more lines (320px) pushes
   the photo down instead of running over the woman, and a short one (tablets) leaves no gap (pre-launch 2026-11-03). */
.zain-intro__text {
	grid-area: 1 / 1;
}

.zain-intro__photo {
	grid-area: 2 / 1;
}

.zain-intro__text {
	z-index: 1;
	align-self: start;
	justify-self: center;
	width: calc(1327 * var(--s));
	color: var(--wp--custom--color--strong);
	font-family: var(--wp--preset--font-family--hanken-grotesk);
	font-size: var(--wp--preset--font-size--statement);
	font-weight: 300;
	line-height: var(--wp--custom--line-height--statement);
	text-align: center;
}

.zain-intro__photo {
	position: relative;
	width: calc(1628 * var(--s));
	height: calc(1130 * var(--s));
	margin: calc(-235 * var(--s)) auto 0;
	isolation: isolate; /* the fade (::after) stays over the photo, under the text */
	border-radius: calc(30 * var(--s));
	/* Media-library photo (Home intro: Zain at his desk, 891:1898 in 891:1893, 2026-11-11); its Figma place in the box */
	--zw: 122.60%;
	--zh: 113.10%;
	--zx: -11.30%;
	--zy: -0.62%;
}

/* Figma: two white rectangles with a 392px layer blur over the photo's top (882:929 + 882:1240 since 2026-11-11 —
   the fade below is the single one's, applied twice: 1 − (1 − a)²) */
.zain-intro__photo::after {
	content: "";
	position: absolute;
	z-index: 1; /* over the photo */
	inset: 0;
	border-radius: inherit;
	background: linear-gradient(rgb(255 255 255 / 1) 0%, rgb(255 255 255 / 0.97) 14%, rgb(255 255 255 / 0.75) 31%, rgb(255 255 255 / 0.29) 48%, rgb(255 255 255 / 0.04) 66%, rgb(255 255 255 / 0) 75%);
}

/* ------------------------------------------------------------------ Therapy services */

.zain-services {
	width: calc(1628 * var(--s));
	margin-top: calc(50 * var(--s));
	padding: calc(120 * var(--s)) calc(180.5 * var(--s));
	overflow: clip; /* not hidden: a scroll container would stop the runner's scroll-linked motion (motion.css) */
	border-radius: calc(30 * var(--s));
	background: var(--wp--custom--color--sand);
}

.zain-services__title {
	margin-bottom: calc(100 * var(--s));
	color: var(--wp--preset--color--black);
	font-size: var(--wp--preset--font-size--heading-1);
	line-height: var(--wp--custom--line-height--heading-1);
	text-align: center;
}

.zain-services__grid {
	position: relative;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: calc(24 * var(--s));
}

/* Runner overlaps the Mood card and its bottom edge (Frame 149 292:341, not clipped by the card) */
.zain-services__grid::after {
	content: "";
	position: absolute;
	top: calc(443 * var(--s));
	left: calc(138 * var(--s));
	width: calc(694 * var(--s));
	aspect-ratio: 694 / 614;
	background: image-set(url(../../img/home/service-runner-1x.webp) 1x, url(../../img/home/service-runner.webp) 2x) center / contain no-repeat;
	pointer-events: none;
}

.zain-service {
	min-height: calc(440 * var(--s));
	padding: calc(64 * var(--s));
	overflow: hidden;
	border-radius: calc(25 * var(--s));
	background-position: right bottom;
	background-repeat: no-repeat;
	background-size: cover;
}

.zain-service--cbt {
	grid-column: 1 / -1;
	min-height: calc(441 * var(--s));
	background-image: image-set(url(../../img/home/service-cbt-1x.webp) 1x, url(../../img/home/service-cbt.webp) 2x);
}

.zain-service--mood {
	background-image: image-set(url(../../img/home/service-mood-1x.webp) 1x, url(../../img/home/service-mood.webp) 2x);
}

.zain-service--anxiety {
	background-image: image-set(url(../../img/home/service-anxiety-1x.webp) 1x, url(../../img/home/service-anxiety.webp) 2x);
}

/*
 * Card art loads when the services come near the screen (performance pass 2026-11-12): on a phone the hero art then
 * downloads alone first. html.zain-lazy-art comes from the head script (zain_preload_hero), .is-near from header.js
 * half a screen ahead — in place by the time the cards scroll in. No JS → no class → the art loads as usual.
 * Mobile cards keep their flat colour layer meanwhile.
 */
html.zain-lazy-art .zain-services:not(.is-near) :is(.zain-service, .zain-services__grid)::after,
html.zain-lazy-art .zain-services:not(.is-near) .zain-service {
	background-image: none;
}

.zain-service__title {
	max-width: calc(513 * var(--s));
	margin-bottom: calc(24 * var(--s));
	color: var(--wp--preset--color--black);
	font-size: var(--wp--preset--font-size--heading-2);
	line-height: var(--wp--custom--line-height--heading-2);
}

.zain-service__text {
	max-width: calc(471 * var(--s));
	color: var(--wp--preset--color--ink);
	font-size: var(--wp--preset--font-size--copy);
	line-height: var(--wp--custom--line-height--copy);
}

.zain-service--mood .zain-service__title,
.zain-service--mood .zain-service__text {
	max-width: calc(342 * var(--s));
}

.zain-service--anxiety .zain-service__title,
.zain-service--anxiety .zain-service__text {
	max-width: calc(338 * var(--s));
}

.zain-services__more {
	margin-top: calc(100 * var(--s));
}

.zain-services__more .wp-block-button__link {
	padding: 13px 24px;
	font-size: var(--wp--preset--font-size--regular);
}

/* ------------------------------------------------------------------ Mobile (Figma 440 frame) */

@media (max-width: 1199px) {
	.zain-why,
	.zain-experience,
	.zain-fees,
	.zain-book {
		margin-top: calc(80 * var(--s));
	}

	/*
	 * Below 440 the title and button stop shrinking while the art keeps scaling, so nothing is placed at a fixed
	 * height: the hero grows with its content, reserves the frame's 433px under the button and pins the people to
	 * its bottom — the button never covers their faces.
	 */
	.zain-hero {
		width: calc(416 * var(--s));
		height: auto;
		min-height: calc(734 * var(--s));
		padding: calc(67 * var(--s)) 0 calc(433 * var(--s));
		text-align: center;
	}

	.zain-hero::before {
		border-radius: calc(20 * var(--s));
		background-image:
			image-set(url(../../img/home/hero-bg-m-1x.webp) 1x, url(../../img/home/hero-bg-m.webp) 2x),
			url("data:image/webp;base64,UklGRngAAABXRUJQVlA4IGwAAABwBACdASogADgAPu1mqU2ppaQiMBv6ATAdiWIAv+wg2YPyqc6om5Di553DwAD+6KBJd7dLCFo2p56b9HfiiCFSf1dX940evnOo6fX3cclqjHU3kOJB730uqlWPcKoaaPWfsvukvVVFX2Kt4AA=");
		/* AVIF first, as on desktop */
		background-image:
			image-set(url(../../img/home/hero-bg-m-1x.avif) type("image/avif") 1x, url(../../img/home/hero-bg-m.avif) type("image/avif") 2x, url(../../img/home/hero-bg-m-1x.webp) type("image/webp") 1x, url(../../img/home/hero-bg-m.webp) type("image/webp") 2x),
			url("data:image/webp;base64,UklGRngAAABXRUJQVlA4IGwAAABwBACdASogADgAPu1mqU2ppaQiMBv6ATAdiWIAv+wg2YPyqc6om5Di553DwAD+6KBJd7dLCFo2p56b9HfiiCFSf1dX940evnOo6fX3cclqjHU3kOJB730uqlWPcKoaaPWfsvukvVVFX2Kt4AA=");
	}

	/* Mobile couple 882:1550 on its own (its shadow layer 882:1548 is empty) */
	.zain-hero::after {
		top: auto;
		bottom: calc(-71 * var(--s));
		left: calc(-71 * var(--s));
		width: calc(543 * var(--s));
		aspect-ratio: 543 / 496;
		background-image: image-set(url(../../img/home/hero-people-m-1x.webp) 1x, url(../../img/home/hero-people-m.webp) 2x);
		/* AVIF first; browsers without image-set type() keep the line above */
		background-image: image-set(url(../../img/home/hero-people-m-1x.avif) type("image/avif") 1x, url(../../img/home/hero-people-m.avif) type("image/avif") 2x, url(../../img/home/hero-people-m-1x.webp) type("image/webp") 1x, url(../../img/home/hero-people-m.webp) type("image/webp") 2x);
	}

	.zain-hero__title {
		width: calc(350 * var(--s));
		margin: 0 auto 32px;
	}

	.zain-hero__cta {
		width: 218px;
		margin-inline: auto;
	}

	.zain-intro {
		margin-top: calc(134 * var(--s));
	}

	/* Mobile Home draws the Fees title black (386:2586); every other Fees title is forest */
	.zain-page-home .zain-fees__title {
		color: var(--wp--preset--color--black);
	}

	.zain-intro__text {
		width: calc(393 * var(--s));
	}

	.zain-intro__photo {
		width: calc(416 * var(--s));
		height: calc(592 * var(--s));
		margin-top: calc(-110 * var(--s));
		border-radius: calc(20 * var(--s));
		/* 894:6: the same photo filling the box (cover, centred) */
		--zw: 222.31%;
		--zh: 100%;
		--zx: -61.15%;
		--zy: 0;
	}

	/* Mobile blur: 1023px-wide rectangle, 162px blur (386:2094) */
	.zain-intro__photo::after {
		background: linear-gradient(rgb(255 255 255 / 0.97) 0%, rgb(255 255 255 / 0.84) 13%, rgb(255 255 255 / 0.5) 26%, rgb(255 255 255 / 0.16) 40%, rgb(255 255 255 / 0.02) 54%, rgb(255 255 255 / 0) 60%);
	}

	.zain-services {
		width: calc(416 * var(--s));
		margin-top: calc(13 * var(--s));
		padding: calc(50 * var(--s)) calc(12 * var(--s));
		border-radius: calc(20 * var(--s));
		background: var(--wp--custom--color--shell);
	}

	.zain-services__title {
		margin-bottom: calc(40 * var(--s));
	}

	.zain-services__grid {
		grid-template-columns: 1fr;
	}

	.zain-services__grid::after {
		content: none;
		background: none; /* else phones still download the desktop runner */
	}

	/*
	 * Cards: the text keeps its size below 440 while the art scales down, so each card reserves the frame's space
	 * under its text (CBT 248, Mood / Anxiety 302) and pins its art (392×452) to the bottom; if the text needs more
	 * room the card grows and a strip of the card's Figma fill (Anxiety: its 57% blue over the section, made opaque)
	 * covers the space above — laid over the art's plain top 12px so the join never shows and the rounded corners
	 * baked into the CBT art are hidden. The person stays below the text.
	 */
	.zain-service {
		--zain-card-art: calc(452 * var(--s));
		min-height: var(--zain-card-art);
		padding: calc(40 * var(--s)) calc(32 * var(--s)) calc(302 * var(--s));
		border-radius: calc(12 * var(--s));
		background-position: top, center bottom;
		background-size: 100% calc(100% - var(--zain-card-art) + 12 * var(--s)), 100% auto;
	}

	.zain-service--cbt {
		grid-column: auto;
		min-height: var(--zain-card-art);
		padding-bottom: calc(248 * var(--s));
		background-image:
			linear-gradient(var(--wp--custom--color--service-cbt), var(--wp--custom--color--service-cbt)),
			image-set(url(../../img/home/service-cbt-m-1x.webp) 1x, url(../../img/home/service-cbt-m.webp) 2x);
	}

	/* The runner (386:2482) belongs to the Mood card: pinned to its bottom, overlapping the gap below as in Figma */
	.zain-service--mood {
		position: relative;
		z-index: 1;
		overflow: visible;
		background-image:
			linear-gradient(var(--wp--custom--color--service-mood), var(--wp--custom--color--service-mood)),
			image-set(url(../../img/home/service-mood-m-1x.webp) 1x, url(../../img/home/service-mood-m.webp) 2x);
	}

	.zain-service--mood::after {
		content: "";
		position: absolute;
		bottom: calc(-121 * var(--s));
		left: calc(-46 * var(--s));
		width: calc(592 * var(--s));
		aspect-ratio: 592 / 524;
		background: image-set(url(../../img/home/service-runner-m-1x.webp) 1x, url(../../img/home/service-runner-m.webp) 2x) center / contain no-repeat;
		pointer-events: none;
	}

	.zain-service--anxiety {
		background-image:
			linear-gradient(var(--wp--custom--color--service-anxiety), var(--wp--custom--color--service-anxiety)),
			image-set(url(../../img/home/service-anxiety-m-1x.webp) 1x, url(../../img/home/service-anxiety-m.webp) 2x);
	}

	html.zain-lazy-art .zain-services:not(.is-near) .zain-service--cbt {
		background-image: linear-gradient(var(--wp--custom--color--service-cbt), var(--wp--custom--color--service-cbt));
	}

	html.zain-lazy-art .zain-services:not(.is-near) .zain-service--mood {
		background-image: linear-gradient(var(--wp--custom--color--service-mood), var(--wp--custom--color--service-mood));
	}

	html.zain-lazy-art .zain-services:not(.is-near) .zain-service--anxiety {
		background-image: linear-gradient(var(--wp--custom--color--service-anxiety), var(--wp--custom--color--service-anxiety));
	}

	.zain-service__title,
	.zain-service__text,
	.zain-service--mood .zain-service__title,
	.zain-service--mood .zain-service__text,
	.zain-service--anxiety .zain-service__title,
	.zain-service--anxiety .zain-service__text {
		max-width: calc(328 * var(--s));
	}

	.zain-service__title {
		margin-bottom: 16px;
	}

	/*
	 * Narrower than the 440 frame the text wraps onto longer lines and would reach the heads that sit beside the
	 * last line in Figma: reserve from each head down (head tops in the art: CBT 193, Mood runner 153.5, Anxiety
	 * 153.5) plus 16px, so the text always ends above the person. 440 and up stay as the frame.
	 */
	@media (max-width: 439px) {
		.zain-service {
			padding-bottom: calc(315 * var(--s));
		}

		.zain-service--cbt {
			padding-bottom: calc(275 * var(--s));
		}
	}

	.zain-services__more {
		margin-top: calc(40 * var(--s));
	}

	/* Mobile: solid button (386:2194) */
	.zain-services__more .wp-block-button__link {
		min-height: 50px;
		border: 0;
		background: var(--wp--preset--color--forest);
		color: var(--wp--preset--color--white);
	}

	.zain-services__more .wp-block-button__link:is(:hover, :focus-visible) {
		background: var(--wp--custom--color--forest-pale);
		color: var(--wp--preset--color--forest);
	}

}
