/**
 * Landing hero.
 *
 * Desktop: Colabs-style cut-out (media + tray + corner fills).
 * Tablet/mobile: stacked media + buttons, no corners.
 *
 * Frame / tray colour comes from the block background setting
 * (pattern default: yellow-400).
 *
 * Each CTA is a Group: text Button + native Icon. The button link
 * stretches across the CTA on the front end so one click covers both.
 * Hover (fine pointer): white circle expands from the icon using D012
 * card-highlight motion tokens; label switches to text-primary.
 */

.ya-hero-landing {
	--ya-hero-landing-radius: 2.5rem;
	--ya-hero-landing-curve: 1.5rem;
	--ya-hero-landing-strip: 1.5rem;
	--ya-hero-landing-wide: var(--wp--style--global--wide-size, 1440px);
	--ya-hero-landing-gap: clamp(0.75rem, 0.376rem + 1.25vi, 1.5rem);
	--ya-hero-landing-media-width: min(
		calc(100% - (var(--ya-hero-landing-strip) * 2)),
		var(--ya-hero-landing-wide)
	);
	/* Inverse quarter-circle mask — fill follows the hero frame colour. */
	--ya-hero-landing-corner: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='m100,0H0v100C0,44.77,44.77,0,100,0Z' fill='%23000'/%3E%3C/svg%3E");

	position: relative;
	box-sizing: border-box;
	margin-block: 0;
	min-height: 716px;
	padding: 0;
}

.ya-hero-landing__media {
	margin: 0 !important;
	width: 100%;
	max-width: var(--ya-hero-landing-wide);
}

.ya-hero-landing__media .wp-block-cover__inner-container {
	width: 100%;
	max-width: none;
	padding-inline: 1.5rem;
}

/* Cover uses constrained layout → theme contentSize (720px); title should span the media. */
.ya-hero-landing__media .wp-block-cover__inner-container > *,
.ya-hero-landing__title {
	max-width: none;
}

.ya-hero-landing__title {
	text-wrap: balance;
	text-align: center;
}

.ya-hero-landing__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--ya-hero-landing-gap);
	margin: 0;
	width: 100%;
}

.ya-hero-landing__cta {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	box-sizing: border-box;
	display: flex;
	flex: 1 1 0;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-width: 0;
	min-height: 80px;
	max-height: 86px;
	height: clamp(80px, calc(59.354px + 2.083vw), 86px);
	margin: 0;
	padding: var(--ya-spacing-20);
	border: 0.5rem solid transparent;
	border-radius: 12px;
	font-family: var(--wp--preset--font-family--figtree, inherit);
	font-size: var(--wp--preset--font-size--heading-xs, 1rem);
	font-weight: 700;
	line-height: 1.2;
}


.ya-hero-landing__cta::before {
	content: "";
	position: absolute;
	z-index: 0;
	top: 50%;
	right: var(--ya-spacing-20);
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 50%;
	background: var(--wp--custom--color--layer-background, #fff);
	transform: translateY(-50%) scale(1);
	transition: transform 0.28s cubic-bezier(0.23, 1, 0.32, 1);
	pointer-events: none;
}

/* White CTAs: gray fill so the hover reads against the button surface. */
.ya-hero-landing__cta--secondary::before,
.ya-hero-landing__cta.has-neutrals-white-background-color::before,
.ya-hero-landing__cta.has-gray-white-background-color::before {
	background: var(--wp--preset--color--gray-300, #e8e6de);
}


.ya-hero-landing__cta > * {
	z-index: 1;
}

.ya-hero-landing__cta .wp-block-buttons,
.ya-hero-landing__cta .wp-block-button {
	margin: 0;
	min-width: 0;
}

.ya-hero-landing__cta .wp-block-button__link {
	display: inline;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent !important;
	box-shadow: none;
	font: inherit;
	font-weight: inherit;
	line-height: inherit;
	text-align: left;
	text-decoration: none;
	white-space: normal;
	overflow-wrap: anywhere;
	transition: color 0.28s cubic-bezier(0.23, 1, 0.32, 1);
}

/* One native link covers the whole CTA (label + icon) on the front end. */
.ya-hero-landing__cta .wp-block-button__link::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: 12px;
	z-index: 2;
}

@media (hover: hover) and (pointer: fine) {
	.ya-hero-landing__cta:hover:not(:has(.wp-block-button__link:focus-visible))::before {
		transform: translateY(-50%) scale(var(--wp--custom--card-highlight--fill-scale, 20));
		transition: transform var(--wp--custom--card-highlight--hover-duration, 0.5s)
			var(--wp--custom--card-highlight--hover-easing, cubic-bezier(0.9, 0, 0.15, 1));
	}

	.ya-hero-landing__cta:hover:not(:has(.wp-block-button__link:focus-visible)),
	.ya-hero-landing__cta:hover:not(:has(.wp-block-button__link:focus-visible)) .wp-block-button__link {
		/* Override WordPress's !important text presets so copy stays readable on the white fill. */
		color: var(--wp--custom--color--text-primary, #000) !important;
		transition: color var(--wp--custom--card-highlight--hover-duration, 0.5s)
			var(--wp--custom--card-highlight--hover-easing, cubic-bezier(0.9, 0, 0.15, 1));
	}
}

@media (prefers-reduced-motion: reduce) {
	.ya-hero-landing__cta::before,
	.ya-hero-landing__cta .wp-block-button__link {
		transition: none;
	}
}

.ya-hero-landing__cta:has(.wp-block-button__link:focus-visible) {
	outline: var(--wp--custom--focus--width, 3px) solid var(--wp--custom--color--focus-border, #283583);
	outline-offset: 2px;
}

@media (forced-colors: active) {
	.ya-hero-landing__cta:has(.wp-block-button__link:focus-visible) {
		outline-color: Highlight;
	}
}

/* Leave label and icon controls selectable; no hover fill in the editor. */
.editor-styles-wrapper .ya-hero-landing__cta::before {
	content: none;
}

.editor-styles-wrapper .ya-hero-landing__cta .wp-block-button__link::after {
	content: none;
}

.ya-hero-landing__cta-icon.wp-block-icon,
.ya-hero-landing__cta-icon {
	display: inline-flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 2.5rem;
	height: 2.5rem;
	margin: 0;
	padding: 0;
	border-radius: 999px;
	background-color: var(--wp--preset--color--neutrals-white, #fff);
	color: var(--wp--custom--color--text-primary, #000000);
	line-height: 0;
}

.ya-hero-landing__cta-icon svg {
	display: block;
	width: 1.25rem;
	height: 1.25rem;
	fill: currentColor;
}

.ya-hero-landing__cta-icon svg path {
	fill: currentColor;
}

.ya-hero-landing__cta--primary .ya-hero-landing__cta-icon {
	color: var(--wp--preset--color--brand-900, #283583);
}

.ya-hero-landing__cta--secondary .ya-hero-landing__cta-icon {
	box-shadow: inset 0 0 0 1px var(--wp--preset--color--neutrals-300, #e8e6de);
}

/* —— Desktop —— */
@media (min-width: 992px) {
	.ya-hero-landing__media {
		position: absolute;
		top: var(--wp--custom--header--height);
		bottom: 2.5rem;
		left: 50%;
		width: var(--ya-hero-landing-media-width);
		transform: translateX(-50%);
		height: 600px;
		min-height: 0 !important;
		overflow: hidden;
		/* Sharp bottom-left — tray + corners own that join */
		border-radius: var(--ya-hero-landing-radius) var(--ya-hero-landing-radius) var(--ya-hero-landing-radius) 0;
	}

	.ya-hero-landing__tray {
		position: absolute;
		z-index: 2;
		box-sizing: border-box;
		/* Align with centered media’s left edge */
		left: max(
			var(--ya-hero-landing-strip),
			calc(50% - (var(--ya-hero-landing-media-width) / 2))
		);
		bottom: 2.5rem;
		/* Two CTAs: half the media. One CTA: hug the button. */
		width: calc(var(--ya-hero-landing-media-width) * 0.5);
		min-height: calc(var(--ya-hero-landing-curve) * 2 + 3.5rem);
		padding: var(--ya-hero-landing-gap) var(--ya-hero-landing-gap) 0 0;
		display: flex;
		align-items: center;
		background-color: inherit;
		border-radius: 0 var(--ya-hero-landing-curve) 0 0;
	}

	.ya-hero-landing__tray:has(.ya-hero-landing__cta:only-child) {
		width: fit-content;
	}

	.ya-hero-landing__actions {
		width: 100%;
	}

	.ya-hero-landing__tray:has(.ya-hero-landing__cta:only-child) .ya-hero-landing__actions {
		width: max-content;
	}

	.ya-hero-landing__cta:only-child {
		flex: 0 0 auto;
	}

	/* Shared corner fill (left cradle + right concave S) */
	.ya-hero-landing__tray::before,
	.ya-hero-landing__tray::after {
		content: "";
		position: absolute;
		width: var(--ya-hero-landing-curve);
		height: var(--ya-hero-landing-curve);
		background-color: inherit;
		-webkit-mask: var(--ya-hero-landing-corner) center / 100% 100% no-repeat;
		mask: var(--ya-hero-landing-corner) center / 100% 100% no-repeat;
		transform: rotate(270deg);
		pointer-events: none;
	}

	.ya-hero-landing__tray::before {
		top: calc(var(--ya-hero-landing-curve) * -1);
		left: 0;
	}

	.ya-hero-landing__tray::after {
		bottom: 0;
		left: 100%;
	}
}

/* —— Tablet / mobile —— */
@media (max-width: 991px) {
	.ya-hero-landing {
		display: flex;
		flex-direction: column;
		gap: var(--ya-hero-landing-gap);
		min-height: 0;
		height: auto;
		padding: 4.75rem 1.25rem 1.25rem;
	}

	.ya-hero-landing__media {
		flex: 0 0 auto;
		overflow: hidden;
		border-radius: var(--ya-hero-landing-radius);
		min-height: 420px !important;
		aspect-ratio: 4 / 5;
		max-height: 70svh;
	}

	.ya-hero-landing__actions {
		flex-wrap: nowrap;
		align-items: stretch;
	}

	.ya-hero-landing__cta {
		width: 100%;
	}
}

@media (max-width: 479px) {
	.ya-hero-landing {
		--ya-hero-landing-radius: 1.5rem;
		--ya-hero-landing-curve: 1rem;
		--ya-hero-landing-strip: 1rem;
		padding: 4.75rem 1rem 1rem;
	}

	.ya-hero-landing__media {
		min-height: 18rem !important;
	}

	.ya-hero-landing__actions {
		flex-direction: column;
	}
}
