/*
 * O2 home hero (patterns/section-hero-home.php), Figma 2928:419–2928:451.
 * A full-width Cover holds the flattened background (photo, sphere and fade).
 * Inside it: title, lead, haloed button, then the three-card row, with the
 * side cards centred on the taller image card (47 px lower, as in Figma) and
 * the blurred violet-to-blue glow (2928:451) behind them.
 */

/* Let the glow spill past the bottom of the hero, as in Figma, but never sideways. */
.wp-block-cover.meckup-hero-home {
	overflow-x: clip;
	overflow-y: visible;
}

.meckup-hero-home__cards.is-layout-grid {
	position: relative;
	isolation: isolate;
	align-items: center;
}

/* Glow: ellipse 895 × 363, 80% opacity, 153 px blur, starting 182 px into the 488 px row. */
.meckup-hero-home__cards::before {
	content: "";
	position: absolute;
	z-index: -1;
	top: 37%;
	left: 50%;
	width: 70%;
	aspect-ratio: 895 / 363;
	border-radius: 50%;
	background: var(--wp--custom--gradient--glow);
	opacity: 0.8;
	filter: blur(153px);
	transform: translateX(-50%);
	pointer-events: none;
}

@media (max-width: 781px) {
	/*
	 * The stacked cards make the hero tall; keep the sphere at the top instead of cropping into the black fade.
	 * R-EXP-1: at 200% width the image's height can pass the hero's bottom (768 px: 100 px over the next
	 * section's eyebrow), so cap it at the hero and crop from the bottom. Clipping the whole cover instead
	 * would cut the card glow off in a hard line.
	 */
	.wp-block-cover.meckup-hero-home > .wp-block-cover__image-background {
		inset: 0 auto auto 50%;
		width: 200%;
		height: auto;
		max-height: 100%;
		object-fit: cover;
		object-position: top center;
		transform: translateX(-50%);
	}

	.meckup-hero-home__cards::before {
		top: 50%;
		width: 100%;
		filter: blur(80px);
	}

	/*
	 * R-EXP-3 (interim): as core's grid (18rem minimum, so two per row from
	 * ~710 px), but each card at most 400 px wide and the row centred. The image
	 * card keeps its 488 px height, so at 400 px its photo (338 × 400 source) is
	 * barely cropped or upscaled (it was 505 × 488 at 600).
	 */
	.meckup-hero-home__cards.is-layout-grid > * {
		justify-self: center;
		width: 100%;
		max-width: 25rem;
	}
}

/*
 * R-EXP-4: the overlay header is shorter below 1100 (84 px below 520, 107 to
 * 599, 148 from 600; see CLAUDE.md "Smaller widths"), so the hero's top padding
 * (inline: var(--meckup-hero-home-padding-top, 13rem)) follows it: header height
 * plus spacing-60. From 1100 it stays 13rem (208).
 */
@media (max-width: 1099px) {
	.wp-block-cover.meckup-hero-home {
		--meckup-hero-home-padding-top: calc(9.25rem + var(--wp--preset--spacing--60));
	}
}

@media (max-width: 599px) {
	.wp-block-cover.meckup-hero-home {
		--meckup-hero-home-padding-top: calc(6.6875rem + var(--wp--preset--spacing--60));
	}
}

@media (max-width: 519px) {
	.wp-block-cover.meckup-hero-home {
		--meckup-hero-home-padding-top: calc(5.25rem + var(--wp--preset--spacing--60));
	}
}

/*
 * Figma's title lines are 92.6 px apart: a 96 px space run sets the line box,
 * not 86 × 0.965. Matching it keeps the lead and button where Figma has them.
 */
.meckup-hero-home h1.is-style-display {
	line-height: calc(var(--wp--custom--line-height--display) * 96 / 86);
}

/*
 * Two cards (the testimonial is out until consent is on file, Notion E9): keep
 * each card at its three-card width and centre the pair, so the row stays
 * symmetric under the title and the glow. With three cards nothing changes.
 */
@media (min-width: 1280px) {
	.meckup-hero-home__cards.is-layout-grid:not(:has(> :nth-child(3))) {
		grid-template-columns: repeat(2, calc((100% - 2 * var(--wp--preset--spacing--40)) / 3));
		justify-content: center;
	}
}

/*
 * R-EXP-2 (interim): below 1280 a third of the row is too narrow for a card
 * (124 px at 782), so the pair gets two equal columns, at most 400 px each,
 * centred.
 */
@media (min-width: 782px) and (max-width: 1279px) {
	.meckup-hero-home__cards.is-layout-grid:not(:has(> :nth-child(3))) {
		grid-template-columns: repeat(2, minmax(0, 25rem));
		justify-content: center;
	}
}
