/* Image CTA Banner — photo with a coloured CTA card. Figma 1:274 / 1:356 (+ variants). */

.hs-image-cta-banner {
	--icb-card: var(--tone-300);
	--icb-radius: var(--hs-radius-lg);
	--icb-window-h: clamp(220px, 30vw, 431px);
	position: relative;
	color: var(--hs-navy);
}

.hs-image-cta-banner__inner {
	padding-bottom: var(--hs-gutter);
}

/* Figma only leaves the 24px gutter under the banner when it sits on top of the footer. */
.hs-image-cta-banner:not(:last-child) .hs-image-cta-banner__inner {
	padding-bottom: 0;
}

/* Card colours as used in the design: green/blue 300, yellow/pink 500. */
.hs-image-cta-banner.hs-tone--lemon,
.hs-image-cta-banner.hs-tone--lilac {
	--icb-card: var(--tone-500);
}

.hs-image-cta-banner--window .hs-image-cta-banner__inner {
	padding-top: var(--hs-gutter);
}

.hs-image-cta-banner--bleed {
	--icb-frame-radius: 0;
}

.hs-image-cta-banner--bleed .hs-image-cta-banner__inner {
	padding: 0;
}

/* ---------- Frame + photo ---------- */

.hs-image-cta-banner__frame {
	position: relative;
	display: flex;
	align-items: flex-end;
	box-sizing: border-box;
	min-height: clamp(560px, 69.5vw, 1000px);
	padding: var(--hs-gutter);
	overflow: hidden;
	border-radius: var(--icb-frame-radius, var(--icb-radius));
	isolation: isolate;
}

.hs-image-cta-banner--bleed .hs-image-cta-banner__frame {
	max-width: var(--hs-max);
	margin-inline: auto;
	overflow: visible;
}

.hs-image-cta-banner__media {
	position: absolute;
	inset: 0;
	z-index: -1;
	overflow: hidden;
	border-radius: inherit;
	background: var(--wp--preset--color--stone, #e9e4d8);
}

.hs-image-cta-banner--bleed .hs-image-cta-banner__media {
	left: 50%;
	width: 100vw;
	transform: translateX(-50%);
}

.hs-image-cta-banner__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: rgba(204, 179, 113, 0.2);
	pointer-events: none;
}

.hs-image-cta-banner__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transform: scale(var(--icb-zoom, 1));
	transform-origin: var(--icb-anchor, center);
}

/* ---------- Card ---------- */

.hs-image-cta-banner__card {
	position: relative;
	flex: 1 1 auto;
	box-sizing: border-box;
	min-width: 0;
	padding: 64px;
	overflow: hidden;
	border-radius: var(--icb-radius);
	background: var(--icb-card);
}

.hs-image-cta-banner__body {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	max-width: 904px;
}

.hs-image-cta-banner .hs-image-cta-banner__heading {
	font-size: clamp(40px, 4.45vw, 64px);
	line-height: 1;
	text-box: trim-both cap alphabetic; /* Figma trims the heading to cap height */
}

.hs-image-cta-banner .hs-image-cta-banner__text {
	max-width: 645px;
	margin-top: 31px; /* Figma 14:1567: 31px from the trimmed heading */
}

.hs-image-cta-banner .hs-image-cta-banner__buttons {
	margin-top: 48px;
}

/* ---------- Doodles (desktop positions measured from the card's top-right) ---------- */

.hs-image-cta-banner__doodle {
	position: absolute;
	z-index: 0;
	max-width: none;
	pointer-events: none;
}

/* Sparkle as in Figma 14:1028: 346px star (352.5px with stroke) rotated -25.46deg, centred
   ~67px in from the card's right edge, so the card clips its right-hand points. */
.hs-image-cta-banner__doodle--sparkle {
	top: 80px;
	right: -109px;
	width: 352.5px;
	transform: rotate(-25.46deg);
}

/* Star as in Figma 14:1833: 425px rotated 12.99deg, centred ~177px in from the card's right
   edge and just under its top, so the card clips its right-hand points. */
.hs-image-cta-banner__doodle--star {
	top: 4px;
	right: -36px;
	width: 425.2px;
	transform: rotate(12.99deg);
}

/* Pencil as in Figma 14:1556: full 728px artwork running off the card's top and right edges. */
.hs-image-cta-banner__doodle--pencil {
	top: -107px;
	right: -58px;
	width: 728.1px;
}

.hs-image-cta-banner__script {
	position: absolute;
	z-index: 1;
	right: 48px;
	bottom: 93px;
	margin: 0;
	font-family: var(--hs-script);
	font-size: 43.44px;
	line-height: 36px;
	color: var(--hs-navy);
	white-space: nowrap;
	transform: rotate(-19.59deg);
}

.hs-image-cta-banner__script span {
	display: block;
}

.hs-image-cta-banner__script span + span {
	margin-left: 66px;
}

/* ---------- Window layout (card centred, photo shows through the top) ---------- */

.hs-image-cta-banner--window .hs-image-cta-banner__frame {
	align-items: center;
	justify-content: center;
	min-height: clamp(560px, 59.2vw, 852px);
	padding: 18px var(--hs-gutter);
}

.hs-image-cta-banner--window .hs-image-cta-banner__card {
	flex: 0 1 963px;
	padding: 18px;
	border-radius: var(--hs-radius-md);
	background: transparent;
}

/* The window's spread shadow paints the card colour around a transparent opening. */
.hs-image-cta-banner__window {
	position: relative;
	height: var(--icb-window-h);
	border-radius: var(--hs-radius-md);
	box-shadow: 0 0 0 200vmax var(--icb-card);
}

.hs-image-cta-banner--window .hs-image-cta-banner__body {
	padding: 36px 12px 24px; /* Figma 14:1102: heading 505px, buttons end 42px above the card edge */
}

.hs-image-cta-banner--window .hs-image-cta-banner__buttons {
	margin-top: 31px;
}

/* ---------- Responsive ---------- */

@media (max-width: 1023px) {
	.hs-image-cta-banner__card {
		padding: 48px 40px;
	}

	.hs-image-cta-banner__doodle {
		opacity: 0.35;
	}

	.hs-image-cta-banner__doodle--sparkle { width: 240px; right: -74px; top: 40px; }
	.hs-image-cta-banner__doodle--star { width: 240px; right: -20px; top: 4px; }
	.hs-image-cta-banner__doodle--pencil { width: 400px; right: -32px; top: -58px; }

	.hs-image-cta-banner__script {
		position: static;
		margin: 32px 0 0 12px;
		font-size: 36px;
		line-height: 30px;
		transform: rotate(-8deg);
		transform-origin: left center;
	}

	.hs-image-cta-banner--bottom .hs-image-cta-banner__script {
		margin-left: 40px;
	}
}

@media (max-width: 768px) {
	.hs-image-cta-banner__frame {
		min-height: 0;
		padding: 240px 12px 12px;
	}

	.hs-image-cta-banner .hs-image-cta-banner__heading {
		font-size: 34px;
	}

	/* Photo only behind the window; the rest of the frame takes the card colour. */
	.hs-image-cta-banner--window .hs-image-cta-banner__frame {
		background: var(--icb-card);
	}

	.hs-image-cta-banner--window .hs-image-cta-banner__media {
		bottom: auto;
		height: calc(var(--icb-window-h) + 24px);
	}

	.hs-image-cta-banner--window .hs-image-cta-banner__img {
		object-position: 44% 30%;
	}

	.hs-image-cta-banner--window .hs-image-cta-banner__frame {
		min-height: 0;
		padding: 12px;
	}

	.hs-image-cta-banner__card {
		padding: 32px 24px;
	}

	.hs-image-cta-banner--window .hs-image-cta-banner__card {
		padding: 12px;
	}

	.hs-image-cta-banner--window .hs-image-cta-banner__body {
		padding: 24px 12px 16px;
	}

	.hs-image-cta-banner--bottom .hs-image-cta-banner__script {
		margin-left: 24px;
	}

	.hs-image-cta-banner__doodle {
		display: none;
	}

	.hs-image-cta-banner .hs-image-cta-banner__text {
		margin-top: 24px; /* heading is trimmed, so add back the space it used to take */
		font-size: 17px;
	}

	.hs-image-cta-banner .hs-image-cta-banner__buttons {
		margin-top: 32px;
	}
}

@media (max-width: 768px) {
	/* Desktop line breaks make awkward wraps on phones. */
	.hs-image-cta-banner__heading br,
	.hs-image-cta-banner__text br {
		display: none;
	}
}

/* Green banner ("Let's build your preschool plan"): first button hovers light blue, the rest pink. Navy label. */
.hs-image-cta-banner.hs-tone--green .hs-image-cta-banner__buttons {
	--hs-btn-hover: var(--wp--preset--color--lilac-500);
}

.hs-image-cta-banner.hs-tone--green .hs-image-cta-banner__buttons > .hs-btn:nth-child(1) {
	--hs-btn-hover: var(--wp--preset--color--sky-500);
}

/* Yellow banner ("Let's find the right fit"): second button ("Get a quote") hovers pink. */
.hs-image-cta-banner.hs-tone--lemon .hs-image-cta-banner__buttons > .hs-btn:nth-child(2) {
	--hs-btn-hover: var(--wp--preset--color--lilac-500);
}

/* Infants and Toddlers ("Let's build your infant-toddler plan"): first button hovers light blue, second yellow. */
.page-infants-and-toddlers .hs-image-cta-banner__buttons > .hs-btn:nth-child(1) {
	--hs-btn-hover: var(--wp--preset--color--sky-500);
}

.page-infants-and-toddlers .hs-image-cta-banner__buttons > .hs-btn:nth-child(2) {
	--hs-btn-hover: var(--hs-accent-yellow);
}

/* Connect ("A new standard for preschool."): green banner's button hovers pink. */
.page-connect .hs-image-cta-banner.hs-tone--green .hs-image-cta-banner__buttons > .hs-btn {
	--hs-btn-hover: var(--wp--preset--color--lilac-500);
}

/* NAEYC ("Let's find the right fit for your program"): first button hovers yellow, second pink. */
.page-naeyc .hs-image-cta-banner__buttons > .hs-btn:nth-child(1) {
	--hs-btn-hover: var(--hs-accent-yellow);
}

.page-naeyc .hs-image-cta-banner__buttons > .hs-btn:nth-child(2) {
	--hs-btn-hover: var(--wp--preset--color--lilac-500);
}
