/*
 * Mission Hero Slider
 * Mirrors the original homepage hero: white section, 57/43 split, Commissioner
 * headline, square brand buttons, circular photo, dot artwork bottom-right.
 * Colours and fonts read the Elementor kit globals with hard fallbacks.
 */

.mhs {
	--mhs-max-width: 1500px;
	--mhs-text-col: 57%;
	--mhs-photo-size: 385px;
	--mhs-pattern-size: 30%;
	--mhs-speed: 900ms;
	--mhs-interval: 6500ms;
	--mhs-ease: cubic-bezier(0.22, 0.7, 0.2, 1);

	--mhs-green: var(--e-global-color-accent, #87c66f);
	--mhs-dark-green: var(--e-global-color-primary, #3d8140);
	--mhs-blue: var(--e-global-color-96ca6c3, #0ba4d2);
	--mhs-purple: var(--e-global-color-6005d22, #642b85);
	--mhs-yellow: var(--e-global-color-7c1bb9e, #f5bf24);
	--mhs-charcoal: var(--e-global-color-cf9c74e, #2c2c2c);
	--mhs-ink: var(--e-global-color-text, #000);

	position: relative;
	isolation: isolate;
	overflow: hidden;
	padding: 0 5% 2%;
	background-color: var(--e-global-color-d6cea4e, #fff);
}

.mhs__pattern {
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background-repeat: no-repeat;
	background-position: right bottom;
	background-size: var(--mhs-pattern-size) auto;
}

.mhs__inner {
	display: grid;
	grid-template-columns: minmax(0, var(--mhs-text-col)) minmax(0, 1fr);
	align-items: center;
	max-width: var(--mhs-max-width);
	margin-inline: auto;
}

/* ---------- Text column ---------- */

.mhs__copy {
	min-width: 0;
	padding-top: clamp(16px, 2.6vw, 40px);
}

/* Panels stack in one grid cell, so the column is as tall as the longest slide
   and nothing below it shifts. Bottom-aligned so the buttons never jump. */
.mhs__content {
	display: grid;
}

.mhs__panel {
	grid-area: 1 / 1;
	align-self: end;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	min-width: 0;
	visibility: hidden;
	opacity: 0;
	transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}

.mhs__panel.is-active {
	visibility: visible;
	opacity: 1;
	transition: none;
}

.mhs__panel.is-entering > * {
	animation: mhs-rise 0.75s var(--mhs-ease) both;
}

.mhs__panel.is-entering > :nth-child(1) { animation-delay: 0.18s; }
.mhs__panel.is-entering > :nth-child(2) { animation-delay: 0.26s; }
.mhs__panel.is-entering > :nth-child(3) { animation-delay: 0.34s; }
.mhs__panel.is-entering > :nth-child(4) { animation-delay: 0.42s; }

.mhs .mhs__eyebrow {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0 0 14px;
	font-family: var(--e-global-typography-primary-font-family, "Commissioner"), sans-serif;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.5;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var(--mhs-dark-green);
}

.mhs--eyebrow-line .mhs__eyebrow::before {
	content: "";
	flex: none;
	width: 28px;
	height: 2px;
	background-color: currentColor;
}

.mhs .mhs__heading {
	margin: 0;
	padding: 0;
	font-family: var(--e-global-typography-primary-font-family, "Commissioner"), sans-serif;
	font-size: 45px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0;
	text-transform: none;
	color: var(--mhs-ink);
	text-wrap: balance;
}

.mhs .mhs__text {
	max-width: 36em;
	margin: 18px 0 0;
	font-family: var(--e-global-typography-text-font-family, "Open Sans"), sans-serif;
	font-size: 18px;
	line-height: 1.5;
	color: var(--mhs-charcoal);
}

.mhs__buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 40px;
}

/* Buttons match the existing hero exactly: square, black label, charcoal hover. */
.mhs .mhs__btn,
.mhs .mhs__btn:visited {
	--mhs-btn-bg: var(--mhs-green);
	--mhs-btn-fg: var(--mhs-ink);
	--mhs-btn-ring: transparent;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 15px 45px;
	border: 0;
	border-radius: 0;
	box-shadow: inset 0 0 0 2px var(--mhs-btn-ring);
	background-color: var(--mhs-btn-bg);
	color: var(--mhs-btn-fg);
	font-family: var(--e-global-typography-primary-font-family, "Commissioner"), sans-serif;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	transition: background-color 0.3s, color 0.3s, box-shadow 0.3s;
}

.mhs .mhs__btn--blue { --mhs-btn-bg: var(--mhs-blue); }
.mhs .mhs__btn--yellow { --mhs-btn-bg: var(--mhs-yellow); }
.mhs .mhs__btn--dark-green { --mhs-btn-bg: var(--mhs-dark-green); --mhs-btn-fg: #fff; }
.mhs .mhs__btn--purple { --mhs-btn-bg: var(--mhs-purple); --mhs-btn-fg: #fff; }
.mhs .mhs__btn--outline { --mhs-btn-bg: transparent; --mhs-btn-ring: var(--mhs-charcoal); }

.mhs .mhs__btn:hover,
.mhs .mhs__btn:focus-visible {
	--mhs-btn-ring: var(--mhs-charcoal);
	background-color: var(--mhs-charcoal);
	color: #fff;
}

.mhs .mhs__btn:focus-visible {
	outline: 3px solid var(--mhs-dark-green);
	outline-offset: 3px;
}

/* ---------- Photo column ---------- */

.mhs__media {
	display: flex;
	flex-direction: column;
	align-items: center;
	padding-block: 24px;
}

.mhs__frame {
	position: relative;
	width: min(var(--mhs-photo-size), 100%);
	aspect-ratio: 1;
	border-radius: 50%;
	overflow: hidden;
	clip-path: circle(50% at 50% 50%);
	background-color: var(--e-global-color-secondary, #f3f5f8);
	touch-action: pan-y;
}

.mhs .mhs__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	object-fit: cover;
	opacity: 0;
	transition: opacity var(--mhs-speed) ease;
	user-select: none;
	-webkit-user-drag: none;
}

.mhs .mhs__img.is-active {
	z-index: 2;
	opacity: 1;
}

/* The outgoing photo stays opaque underneath while the new one fades in. */
.mhs .mhs__img.is-leaving {
	z-index: 1;
	opacity: 1;
	transition: none;
}

.mhs--zoom .mhs__img.is-active,
.mhs--zoom .mhs__img.is-leaving {
	animation: mhs-zoom calc(var(--mhs-interval) + var(--mhs-speed)) linear both;
}

.mhs.is-held .mhs__img,
.mhs.is-ready:not(.is-playing) .mhs__img {
	animation-play-state: paused;
}

/* ---------- Controls ---------- */

.mhs__controls {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 12px;
	margin-top: 28px;
}

.mhs:not(.is-ready) .mhs__controls {
	visibility: hidden;
}

.mhs__dots {
	display: flex;
	align-items: center;
	gap: 2px;
}

/* Reset theme + kit button styles (Hello: pink border; kit: purple fill). */
.mhs .mhs__dot,
.mhs .mhs__dot:hover,
.mhs .mhs__dot:focus {
	position: relative;
	display: block;
	width: 24px;
	height: 24px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	box-shadow: none;
	color: var(--mhs-dot, var(--mhs-dark-green));
	font-size: 0;
	cursor: pointer;
	transition: width 0.45s var(--mhs-ease);
}

/* Dot colours echo the multicolour artwork. All pass 3:1 against white. */
.mhs .mhs__dot:nth-child(5n + 1) { --mhs-dot: var(--e-global-color-56f4cb0, #3d8140); }
.mhs .mhs__dot:nth-child(5n + 2) { --mhs-dot: var(--e-global-color-edda45e, #9356a1); }
.mhs .mhs__dot:nth-child(5n + 3) { --mhs-dot: var(--e-global-color-ea30e0d, #f05f2a); }
.mhs .mhs__dot:nth-child(5n + 4) { --mhs-dot: var(--e-global-color-9532bfc, #234392); }
.mhs .mhs__dot:nth-child(5n + 5) { --mhs-dot: var(--e-global-color-ef4de73, #f06785); }

.mhs .mhs__dot::before,
.mhs .mhs__dot::after {
	content: "";
	position: absolute;
	inset: 6px;
	border-radius: inherit;
	background-color: currentColor;
	transition: transform 0.3s var(--mhs-ease), opacity 0.3s;
}

.mhs .mhs__dot:hover::before {
	transform: scale(1.2);
}

.mhs .mhs__dot::after {
	opacity: 0;
	transform: scaleX(0);
	transform-origin: left center;
}

.mhs .mhs__dot.is-active {
	width: 48px;
}

.mhs .mhs__dot.is-active::before {
	opacity: 0.25;
	transform: none;
}

.mhs .mhs__dot.is-active::after {
	opacity: 1;
	transform: none;
}

/* While autoplaying, the active pill fills up as a countdown to the next slide. */
.mhs.is-playing .mhs__dot.is-active::after {
	animation: mhs-progress var(--mhs-interval) linear both;
}

.mhs.is-held .mhs__dot.is-active::after {
	animation-play-state: paused;
}

.mhs .mhs__dot:focus-visible,
.mhs .mhs__toggle:focus-visible {
	outline: 3px solid var(--mhs-charcoal);
	outline-offset: 2px;
}

.mhs .mhs__toggle,
.mhs .mhs__toggle:focus {
	display: inline-grid;
	place-items: center;
	flex: none;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	border: 2px solid var(--mhs-charcoal);
	border-radius: 50%;
	background-color: #fff;
	color: var(--mhs-charcoal);
	box-shadow: none;
	cursor: pointer;
	transition: background-color 0.3s, color 0.3s;
}

.mhs .mhs__toggle:hover {
	border-color: var(--mhs-charcoal);
	background-color: var(--mhs-charcoal);
	color: #fff;
}

.mhs__icon {
	width: 14px;
	height: 14px;
	fill: currentColor;
}

.mhs.is-playing .mhs__icon--play,
.mhs:not(.is-playing) .mhs__icon--pause {
	display: none;
}

/* ---------- Keyframes ---------- */

@keyframes mhs-rise {
	from {
		opacity: 0;
		transform: translateY(14px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

@keyframes mhs-zoom {
	from { transform: scale(1.07); }
	to { transform: scale(1); }
}

@keyframes mhs-progress {
	from { transform: scaleX(0); }
	to { transform: scaleX(1); }
}

/* ---------- Breakpoints (match Elementor: 1024 / 767) ---------- */

@media (max-width: 1024px) {
	.mhs {
		--mhs-photo-size: 320px;
		padding: 0 5% 3%;
	}

	.mhs .mhs__heading {
		font-size: 30px;
	}

	.mhs .mhs__btn {
		font-size: 16px;
	}

	.mhs__buttons {
		margin-top: 32px;
	}
}

@media (max-width: 767px) {
	.mhs {
		--mhs-photo-size: 300px;
		--mhs-pattern-size: 60%;
		padding: 8% 6% 12%;
	}

	.mhs__inner {
		grid-template-columns: minmax(0, 1fr);
	}

	/* Phones: photo, then dots, then text. Unwrapping .mhs__copy lets the
	   controls sit under the photo in a fixed spot whatever the headline length. */
	.mhs__copy {
		display: contents;
	}

	.mhs__media {
		order: -2;
		padding-block: 0 20px;
	}

	.mhs__controls {
		order: -1;
		justify-content: center;
		margin: 0 0 24px;
	}

	.mhs__panel {
		align-self: start;
		align-items: center;
		text-align: center;
	}

	.mhs .mhs__eyebrow {
		font-size: 14px;
	}

	.mhs .mhs__heading {
		font-size: 28px;
		line-height: 1.1;
	}

	.mhs .mhs__text {
		font-size: 16px;
	}

	.mhs__buttons {
		justify-content: center;
		margin-top: 28px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.mhs .mhs__img {
		transition-duration: 0.2s;
	}

	.mhs--zoom .mhs__img.is-active,
	.mhs--zoom .mhs__img.is-leaving,
	.mhs__panel.is-entering > * {
		animation: none;
	}

	.mhs .mhs__dot {
		transition: none;
	}
}
