/**
 * Hero slider.
 *
 * Under 768px the photo sits above the text with the slider controls in a
 * row under it. From 768px up the text overlays the photo, following the
 * 2000px artboard scaled by --hm-u, with the arrows at the left and right
 * edges and the dots along the bottom.
 *
 * --hm-hero-space-* come from Customize → Hero Section → Text spacing
 * (inc/customizer/spacing.php); the fallbacks below are the defaults.
 */

/* ---------------------------------------------------------------------
 * Hero – phones & tablets (stacked)
 * ------------------------------------------------------------------ */

.hm-hero {
	--hm-hero-focus: 66%;
	--hm-hero-overlay: 0;
	--hm-hero-tagline-color: #0a3d9c;

	position: relative;
	overflow: hidden;
	background: linear-gradient(180deg, #e4f1fc 0%, #f4f9fe 100%);
}

/* Slides share one grid cell and cross-fade. */
.hm-hero__slides {
	display: grid;
}

.hm-hero__slide {
	position: relative;
	display: flex;
	flex-direction: column;
	grid-area: 1 / 1;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.8s ease, visibility 0s linear 0.8s;
}

.hm-hero__slide.is-active {
	z-index: 1;
	opacity: 1;
	visibility: visible;
	transition: opacity 0.8s ease, visibility 0s;
}

.hm-hero__slide.is-active .hm-hero__content > * {
	animation: hm-hero-rise 0.8s ease both;
}

.hm-hero__slide.is-active .hm-hero__content > :nth-child(2) { animation-delay: 0.08s; }
.hm-hero__slide.is-active .hm-hero__content > :nth-child(3) { animation-delay: 0.16s; }
.hm-hero__slide.is-active .hm-hero__content > :nth-child(4) { animation-delay: 0.24s; }
.hm-hero__slide.is-active .hm-hero__content > :nth-child(5) { animation-delay: 0.32s; }

@keyframes hm-hero-rise {
	from {
		opacity: 0;
		transform: translateY(14px);
	}
}

/* Controls: dots with prev/next arrows. */
.hm-hero__controls {
	position: relative;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 14px;
	padding: 14px 0 18px;
}

.hm-hero__arrow {
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1.5px solid color-mix(in srgb, var(--hm-color-button) 30%, transparent);
	border-radius: 50%;
	background: rgb(255 255 255 / 0.85);
	color: var(--hm-color-button);
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.hm-hero__arrow:hover {
	background: var(--hm-color-button);
	color: var(--hm-color-white);
}

.hm-hero__arrow svg {
	width: 16px;
	height: auto;
}

.hm-hero__arrow--prev svg {
	transform: rotate(180deg);
}

.hm-hero__dots {
	display: flex;
	gap: 8px;
}

.hm-hero__dot {
	width: 10px;
	height: 10px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: color-mix(in srgb, var(--hm-color-button) 25%, transparent);
	cursor: pointer;
	transition: width 0.3s ease, background-color 0.3s ease;
}

.hm-hero__dot.is-active {
	width: 28px;
	background: var(--hm-color-button);
}

.hm-hero__arrow:focus-visible,
.hm-hero__dot:focus-visible {
	outline: 2px solid var(--hm-color-highlight);
	outline-offset: 3px;
}

.hm-hero__media {
	position: relative;
	order: 2;
	display: block;
	aspect-ratio: 4 / 3;
}

.hm-hero__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: var(--hm-hero-focus) 50%;
}

.hm-hero__media::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: linear-gradient(90deg, rgb(255 255 255 / var(--hm-hero-overlay)) 0%, rgb(255 255 255 / calc(var(--hm-hero-overlay) * 0.75)) 35%, rgb(255 255 255 / 0) 62%);
}

.hm-hero__inner {
	position: relative;
	order: 1;
	padding-top: var(--hm-hero-space-top, 40px);
	padding-bottom: var(--hm-hero-space-bottom, 32px);
}

.hm-hero__eyebrow {
	margin: 0 0 var(--hm-hero-space-eyebrow, 8px);
	font-size: 13px;
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--hm-color-text);
}

.hm-hero__title {
	margin: 0;
	font-family: var(--hm-font-heading);
	font-size: clamp(34px, 4.2vw + 18px, 58px);
	font-weight: 700;
	line-height: 1.08;
	letter-spacing: -0.005em;
	color: var(--hm-color-primary);
}

.hm-hero__title-line {
	display: block;
}

.hm-hero__title-line--accent {
	font-size: 0.94em;
	color: var(--hm-color-accent);
}

.hm-hero__text {
	max-width: 30em;
	margin: var(--hm-hero-space-title, 12px) 0 0;
	font-size: clamp(16px, 0.5vw + 14px, 20px);
	line-height: 1.5;
	color: var(--hm-color-text);
}

.hm-hero__actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px;
	margin-top: var(--hm-hero-space-text, 24px);
}

/* Buttons */

.hm-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 52px;
	padding: 0 26px;
	border: 2px solid transparent;
	border-radius: var(--hm-radius-pill);
	font-family: var(--hm-font-heading);
	font-size: 17px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.hm-btn:focus-visible,
.hm-hero__link:focus-visible {
	outline: none;
	box-shadow: var(--hm-focus-ring);
}

.hm-btn__icon {
	flex: none;
	width: 22px;
	height: auto;
}

.hm-btn__icon.hm-icon--users {
	width: 28px;
}

.hm-btn__arrow,
.hm-hero__link-arrow {
	flex: none;
	width: 16px;
	height: auto;
	transition: transform 0.2s ease;
}

.hm-btn:hover .hm-btn__arrow,
.hm-hero__link:hover .hm-hero__link-arrow {
	transform: translateX(3px);
}

.hm-btn--primary {
	background: var(--hm-color-button);
	color: var(--hm-color-white);
	box-shadow: 0 0 0 2px rgb(255 255 255 / 0.6), 0 8px 18px -8px rgb(0 40 90 / 0.45);
}

.hm-btn--primary:hover {
	background: var(--hm-color-button-hover);
	color: var(--hm-color-white);
	transform: translateY(-1px);
}

.hm-btn--outline {
	border-color: var(--hm-color-button);
	background: var(--hm-color-white);
	color: var(--hm-color-button);
}

.hm-btn--outline:hover {
	border-color: var(--hm-color-button);
	background: var(--hm-color-button);
	color: var(--hm-color-white);
	transform: translateY(-1px);
}

.hm-hero__link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 6px 2px;
	border-radius: 4px;
	font-family: var(--hm-font-heading);
	font-size: 16px;
	font-weight: 500;
	color: var(--hm-color-button);
	text-decoration: none;
}

.hm-hero__link:hover span {
	text-decoration: underline;
	text-underline-offset: 4px;
}

/*
 * Social icons under the buttons: solid circles in the primary colour that
 * take each network's own colour on hover. Size: --hm-social-size, set
 * from the Customizer on the hero.
 */
.hm-hero__social {
	--hm-social-icon: var(--hm-social-size, 44px);

	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 18px;
	margin-top: var(--hm-hero-space-social, 28px);
}

.hm-hero__social-label {
	display: inline-flex;
	align-items: center;
	gap: 14px;
	font-family: var(--hm-font-heading);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--hm-color-button);
}

.hm-hero__social-label::after {
	content: "";
	width: 32px;
	height: 2px;
	border-radius: 2px;
	background: currentColor;
	opacity: 0.35;
}

.hm-hero__social-list {
	display: flex;
	flex-wrap: wrap;
	gap: calc(var(--hm-social-icon) * 0.27);
	margin: 0;
	padding: 0;
	list-style: none;
}

.hm-hero__social-link {
	--hm-social-brand: var(--hm-color-button-hover);

	display: grid;
	place-items: center;
	width: var(--hm-social-icon);
	height: var(--hm-social-icon);
	border-radius: 50%;
	background: var(--hm-color-button);
	color: var(--hm-color-white);
	box-shadow: 0 0 0 2px rgb(255 255 255 / 0.7), 0 8px 18px -10px rgb(0 40 90 / 0.6);
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.hm-hero__social-link--facebook { --hm-social-brand: #1877f2; }
.hm-hero__social-link--instagram { --hm-social-brand: #e1306c; }
.hm-hero__social-link--youtube { --hm-social-brand: #ff0000; }
.hm-hero__social-link--linkedin { --hm-social-brand: #0a66c2; }
.hm-hero__social-link--x { --hm-social-brand: #000; }

.hm-hero__social-link:hover {
	background: var(--hm-social-brand);
	color: var(--hm-color-white);
	transform: translateY(-2px);
}

.hm-hero__social-link:focus-visible {
	outline: none;
	box-shadow: var(--hm-focus-ring);
}

.hm-hero__social-link svg {
	width: 42%;
	height: 42%;
}

/* Handwritten tagline: large screens only. */
.hm-hero__tagline {
	display: none;
}

/*
 * Phones: photo first (height: Customize → Hero Section → Photo height on
 * phones), the arrows and dots in a row under it, then the text.
 */
@media (max-width: 767px) {
	.hm-hero {
		--hm-hero-media-h: 62.5cqi;
		--hm-hero-controls-h: 0px;
	}

	.hm-hero--carousel {
		--hm-hero-controls-h: 52px;
	}

	.hm-hero__media {
		order: 1;
		height: var(--hm-hero-media-h);
		aspect-ratio: auto;
	}

	.hm-hero__inner {
		order: 2;
		padding-top: calc(var(--hm-hero-controls-h) + var(--hm-hero-space-top, 20px));
		padding-bottom: var(--hm-hero-space-bottom, 36px);
	}

	/* Centred, like the buttons and icons under it. */
	.hm-hero__content {
		text-align: center;
	}

	.hm-hero__text {
		margin-inline: auto;
	}

	.hm-hero__eyebrow {
		font-size: 12px;
		letter-spacing: 0.14em;
	}

	.hm-hero__title {
		font-size: clamp(28px, 7.4vw, 40px);
		line-height: 1.15;
		text-wrap: balance;
	}

	.hm-hero__text {
		max-width: 26em;
		font-size: 15.5px;
		line-height: 1.55;
		text-wrap: pretty;
	}

	.hm-hero__actions {
		display: grid;
		grid-template-columns: 1fr 1fr;
		gap: 10px;
	}

	.hm-btn {
		min-height: 48px;
		padding: 0 12px;
		gap: 8px;
		font-size: 15px;
	}

	.hm-btn__arrow {
		display: none;
	}

	.hm-btn__icon {
		width: 18px;
	}

	.hm-btn__icon.hm-icon--users {
		width: 22px;
	}

	.hm-hero__link {
		grid-column: 1 / -1;
		justify-self: center;
		font-size: 15px;
	}

	/* Capped so five icons still fit on one line. */
	.hm-hero__social {
		--hm-social-icon: min(var(--hm-social-size, 44px), 46px);

		justify-content: center;
	}

	/* Laid over the top of the text area, straight under the photo. */
	.hm-hero__controls {
		position: absolute;
		top: var(--hm-hero-media-h);
		right: 0;
		left: 0;
		height: var(--hm-hero-controls-h);
		padding: 14px 0 0;
		gap: 16px;
	}

	.hm-hero__arrow {
		width: 38px;
		height: 38px;
		background: var(--hm-color-white);
		box-shadow: 0 6px 14px -8px rgb(0 40 90 / 0.45);
	}
}

@media (max-width: 359px) {
	.hm-hero__actions {
		grid-template-columns: 1fr;
	}
}

@media (min-width: 768px) {
	.hm-hero__media {
		aspect-ratio: 12 / 5;
	}

	.hm-hero__inner {
		padding-top: var(--hm-hero-space-top, 56px);
		padding-bottom: var(--hm-hero-space-bottom, 44px);
	}

	.hm-hero__eyebrow {
		font-size: 14px;
	}
}

/* ---------------------------------------------------------------------
 * Hero – desktop (artboard layout)
 * ------------------------------------------------------------------ */

@media (min-width: 768px) {
	.hm-hero {
		--hm-hero-arrow-size: max(40px, calc(56 * var(--hm-u)));
		--hm-hero-arrow-inset: max(12px, calc(28 * var(--hm-u)));

		background: #d6e9f8;
	}

	.hm-hero__slide {
		display: block;
	}

	/* Covers the hero; only the arrows and dots take clicks. */
	.hm-hero__controls {
		position: absolute;
		inset: 0;
		display: block;
		padding: 0;
		pointer-events: none;
	}

	.hm-hero__arrow,
	.hm-hero__dots {
		position: absolute;
		pointer-events: auto;
	}

	.hm-hero__arrow {
		top: 50%;
		width: var(--hm-hero-arrow-size);
		height: var(--hm-hero-arrow-size);
		border-color: rgb(255 255 255 / 0.9);
		background: rgb(255 255 255 / 0.8);
		box-shadow: 0 8px 20px -10px rgb(0 30 70 / 0.55);
		transform: translateY(-50%);
	}

	.hm-hero__arrow--prev {
		left: var(--hm-hero-arrow-inset);
	}

	.hm-hero__arrow--next {
		right: var(--hm-hero-arrow-inset);
	}

	.hm-hero__arrow svg {
		width: 38%;
	}

	.hm-hero__dots {
		bottom: calc(30 * var(--hm-u));
		left: 50%;
		transform: translateX(-50%);
	}

	/* Keep the text clear of the left arrow. */
	.hm-hero--carousel .hm-hero__inner {
		padding-inline: max(calc(103 * var(--hm-u)), calc(var(--hm-hero-arrow-inset) + var(--hm-hero-arrow-size) + 20px));
	}

	.hm-hero__dot {
		background: rgb(255 255 255 / 0.75);
		box-shadow: 0 1px 4px rgb(0 0 0 / 0.25);
	}

	.hm-hero__dot.is-active {
		background: var(--hm-color-button);
	}

	.hm-hero__media {
		position: absolute;
		inset: 0;
		aspect-ratio: auto;
	}

	.hm-hero__image {
		object-position: var(--hm-hero-focus) 50%;
	}

	.hm-hero__inner {
		display: flex;
		flex-direction: column;
		justify-content: center;
		min-height: calc(880 * var(--hm-u));
		padding-block: var(--hm-hero-space-top, calc(80 * var(--hm-u))) var(--hm-hero-space-bottom, calc(80 * var(--hm-u)));
	}

	.hm-hero__content {
		position: relative;
		z-index: 1;
		max-width: calc(1100 * var(--hm-u));
	}

	.hm-hero__eyebrow {
		font-size: max(12px, calc(19 * var(--hm-u)));
		line-height: calc(24 * var(--hm-u));
		letter-spacing: 0.1em;
	}

	/* Narrow enough that the second line wraps: three lines in total. */
	.hm-hero__title {
		max-width: calc(640 * var(--hm-u));
		font-size: calc(69 * var(--hm-u));
		line-height: calc(71 * var(--hm-u));
		letter-spacing: 0;
	}

	.hm-hero__title-line--accent {
		font-size: calc(64.3 * var(--hm-u));
	}

	.hm-hero__text {
		font-size: max(15px, calc(24.4 * var(--hm-u)));
		line-height: calc(33 * var(--hm-u));
	}

	.hm-hero__actions {
		gap: calc(23 * var(--hm-u));
	}

	.hm-btn {
		gap: calc(11 * var(--hm-u));
		min-width: calc(270 * var(--hm-u));
		min-height: max(40px, calc(62 * var(--hm-u)));
		padding-inline: max(16px, calc(30 * var(--hm-u)));
		border-width: max(1.5px, calc(2 * var(--hm-u)));
		font-size: max(14px, calc(20 * var(--hm-u)));
	}

	.hm-btn__icon {
		width: max(16px, calc(27 * var(--hm-u)));
	}

	.hm-btn__icon.hm-icon--users {
		width: max(20px, calc(33 * var(--hm-u)));
	}

	.hm-btn__arrow {
		width: max(12px, calc(18 * var(--hm-u)));
	}

	.hm-hero__link {
		gap: calc(9 * var(--hm-u));
		margin-left: calc(11 * var(--hm-u));
		font-size: max(13px, calc(17.5 * var(--hm-u)));
	}

	.hm-hero__link-arrow {
		width: max(12px, calc(15 * var(--hm-u)));
	}

	.hm-hero__social {
		gap: 12px max(16px, calc(24 * var(--hm-u)));
	}

	.hm-hero__social-label {
		font-size: max(12px, calc(16 * var(--hm-u)));
	}

	/*
	 * skewY tilts the baselines while keeping letters upright, skewX adds
	 * the handwritten lean, and each line steps right like the artwork.
	 */
	.hm-hero__tagline {
		position: absolute;
		top: calc(170 * var(--hm-u));
		left: calc(1682 * var(--hm-u));
		display: block;
		color: var(--hm-hero-tagline-color);
		transform: skewY(-16.5deg) skewX(-10deg);
		transform-origin: 0 0;
		pointer-events: none;
		z-index: 2;
	}

	.hm-hero__tagline-text {
		margin: 0;
		font-family: var(--hm-font-script);
		font-size: calc(42 * var(--hm-u));
		font-weight: 400;
		line-height: calc(53.5 * var(--hm-u));
		white-space: nowrap;
		-webkit-text-stroke: calc(0.7 * var(--hm-u)) currentColor;
	}

	.hm-hero__tagline-line {
		display: block;
		margin-left: calc(var(--hm-line, 0) * 26.4 * var(--hm-u));
	}

	.hm-hero__flourish {
		display: block;
		width: calc(220 * var(--hm-u));
		height: auto;
		margin-top: calc(-17 * var(--hm-u));
		margin-left: calc(((var(--hm-lines, 1) - 1) * 26.4 + 16) * var(--hm-u));
		overflow: visible;
	}

	.hm-hero__swoosh,
	.hm-hero__heart {
		fill: none;
		stroke: currentColor;
		stroke-width: 3;
		stroke-linecap: round;
		stroke-linejoin: round;
	}

	.hm-hero__swoosh {
		stroke-width: 4;
	}
}

/* Tablets & small laptops: keep the desktop overlay and shift the photo so
 * the children sit right of the text. */
@media (min-width: 768px) and (max-width: 1199px) {
	.hm-hero__image {
		object-position: var(--hm-hero-focus-tablet, 50%) 50%;
	}

	.hm-hero__media::after {
		background: linear-gradient(90deg, rgb(255 255 255 / 0.7) 0%, rgb(255 255 255 / 0.45) 38%, rgb(255 255 255 / 0) 62%);
	}

	.hm-hero__inner {
		min-height: calc(760 * var(--hm-u));
	}

	.hm-hero__content {
		max-width: 66%;
	}

	/* No room beside the children's faces at these widths. */
	.hm-hero__tagline {
		display: none;
	}
}
