/* Front page sections (template-parts/home/*). Loaded only on is_front_page(). */

/* Hero: headline + pill, large rounded media. */
.home-hero {
	padding: clamp(1.25rem, 3vw, 2.25rem) 0 clamp(2.5rem, 4vw, 3rem);
}

.home-hero__head {
	display: grid;
	gap: 1.5rem 2rem;
	align-items: end;
}

.home-hero__title {
	margin: 0;
	font-size: clamp(2.125rem, 4.4vw, 4rem);
	line-height: 1.12;
}

.home-hero__cta {
	justify-self: start;
	min-height: 4.375rem;
	padding-left: 1.75rem;
	font-size: 1.125rem;
}

.home-hero__cta .myco-pill__icon {
	width: 3.5rem;
	height: 3.5rem;
}

.home-hero__media {
	position: relative;
	margin-top: clamp(1.75rem, 3vw, 2.5rem);
	overflow: hidden;
	border-radius: var(--myco-radius-xl);
	aspect-ratio: 4 / 3;
	background: var(--myco-color-navy-line);
}

/* Hero slider (template-parts/home/hero.php, home.js [data-hero-slider]): crossfading
   slides, the active image slowly zooms; caption bottom left, controls bottom right. */
.home-slider {
	--myco-slide-duration: 7s;
	isolation: isolate;
}

.home-slider__slide {
	position: absolute;
	inset: 0;
	margin: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity 900ms ease, visibility 0s linear 900ms;
}

.home-slider__slide.is-active {
	z-index: 1;
	opacity: 1;
	visibility: visible;
	transition: opacity 900ms ease, visibility 0s;
}

.home-slider__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	transform-origin: 60% 60%;
}

.home-slider__slide.is-active .home-slider__img {
	animation: myco-hero-pan 14s ease-out both;
}

@keyframes myco-hero-pan {
	from {
		transform: scale(1);
	}

	to {
		transform: scale(1.08) translateX(-1.5%);
	}
}

/* Shade under the caption and controls. */
.home-slider__slide::after {
	content: "";
	position: absolute;
	inset: auto 0 0;
	height: 55%;
	background: linear-gradient(to top, color-mix(in srgb, var(--myco-color-primary) 78%, transparent) 0%, color-mix(in srgb, var(--myco-color-primary) 30%, transparent) 55%, transparent 100%);
	pointer-events: none;
}

.home-slider__caption {
	position: absolute;
	left: clamp(1.25rem, 3vw, 2.5rem);
	bottom: 4.75rem;
	z-index: 2;
	max-width: min(32rem, calc(100% - 2.5rem));
	opacity: 0;
	transform: translateY(0.75rem);
	transition: opacity 250ms ease, transform 250ms ease;
}

.home-slider__slide.is-active .home-slider__caption {
	opacity: 1;
	transform: none;
	transition: opacity 600ms ease 500ms, transform 600ms ease 500ms;
}

.home-slider .home-slider__link {
	display: inline-flex;
	align-items: center;
	gap: 1rem;
	color: var(--myco-color-white);
	text-decoration: none;
}

.home-slider__text {
	display: grid;
	gap: 0.25rem;
	padding-left: 0.875rem;
	border-left: 3px solid var(--myco-accent, var(--myco-color-white));
}

.home-slider__group {
	color: var(--myco-color-on-dark-muted);
	font-size: var(--myco-font-size-xs);
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.home-slider__title {
	font-family: var(--myco-font-heading);
	font-size: clamp(1.25rem, 2.2vw, 1.75rem);
	font-weight: 700;
	line-height: 1.15;
}

.home-slider__go {
	display: inline-grid;
	flex: none;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	border: 1px solid currentColor;
	border-radius: 50%;
	transition: background-color var(--myco-transition), color var(--myco-transition);
}

.home-slider__go .myco-icon {
	width: 1.25rem;
	height: 1.25rem;
}

.home-slider .home-slider__link:hover .home-slider__go,
.home-slider .home-slider__link:focus-visible .home-slider__go {
	background: var(--myco-color-white);
	color: var(--myco-color-primary);
}

.home-slider__controls {
	position: absolute;
	right: clamp(1rem, 2.5vw, 2.25rem);
	bottom: clamp(1rem, 2.5vw, 2.25rem);
	z-index: 3;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	color: var(--myco-color-white);
}

.home-slider__button {
	display: inline-grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	min-height: 0;
	padding: 0;
	border: 1px solid color-mix(in srgb, var(--myco-color-white) 55%, transparent);
	border-radius: 50%;
	background: color-mix(in srgb, var(--myco-color-primary) 35%, transparent);
	color: inherit;
	cursor: pointer;
	transition: background-color var(--myco-transition), color var(--myco-transition), border-color var(--myco-transition);
}

.home-slider__button:hover,
.home-slider__button:focus-visible {
	border-color: var(--myco-color-white);
	background: var(--myco-color-white);
	color: var(--myco-color-primary);
}

.home-slider__button .myco-icon {
	width: 1.25rem;
	height: 1.25rem;
}

.home-slider__button .myco-icon--play {
	fill: currentColor;
	stroke-width: 1;
}

.home-slider__button .myco-icon--play,
.home-slider.is-paused .home-slider__button .myco-icon--pause {
	display: none;
}

.home-slider.is-paused .home-slider__button .myco-icon--play {
	display: block;
}

.home-slider__count {
	min-width: 3.25rem;
	font-size: var(--myco-font-size-sm);
	font-variant-numeric: tabular-nums;
	text-align: center;
}

/* Progress: one bar per slide; the active bar fills over --myco-slide-duration. */
.home-slider__progress {
	position: absolute;
	left: clamp(1.25rem, 3vw, 2.5rem);
	right: clamp(1.25rem, 3vw, 2.5rem);
	bottom: 0.875rem;
	z-index: 3;
	display: flex;
	gap: 0.375rem;
	pointer-events: none;
}

.home-slider__bar {
	flex: 1;
	height: 3px;
	overflow: hidden;
	border-radius: 3px;
	background: color-mix(in srgb, var(--myco-color-white) 30%, transparent);
}

.home-slider__bar > span {
	display: block;
	height: 100%;
	background: var(--myco-color-white);
	transform: scaleX(0);
	transform-origin: left center;
}

.home-slider__bar.is-done > span {
	transform: scaleX(1);
}

.home-slider.is-playing .home-slider__bar.is-active > span {
	animation: myco-slide-progress var(--myco-slide-duration) linear both;
}

.home-slider.is-playing:hover .home-slider__bar.is-active > span,
.home-slider.is-playing:focus-within .home-slider__bar.is-active > span {
	animation-play-state: paused;
}

@keyframes myco-slide-progress {
	from {
		transform: scaleX(0);
	}

	to {
		transform: scaleX(1);
	}
}

/* Phones: title only, smaller controls. */
@media (max-width: 37.49rem) {
	.home-slider__caption {
		left: 1rem;
		bottom: 3.75rem;
	}

	.home-slider__group,
	.home-slider__go {
		display: none;
	}

	.home-slider__title {
		font-size: 1.125rem;
	}

	.home-slider__controls {
		right: 0.75rem;
		bottom: 1.125rem;
		gap: 0.25rem;
	}

	.home-slider__button {
		width: 2.25rem;
		height: 2.25rem;
	}

	.home-slider__button .myco-icon {
		width: 1rem;
		height: 1rem;
	}

	.home-slider__count {
		min-width: 2.5rem;
		font-size: var(--myco-font-size-xs);
	}

	.home-slider__progress {
		left: 1rem;
		right: 1rem;
		bottom: 0.5rem;
	}
}

/* No JavaScript: first slide only, no controls. */
html:not(.js) .home-slider__controls,
html:not(.js) .home-slider__progress {
	display: none;
}

/* About: text slider + brand line and image strips. */
.home-about {
	padding: clamp(4rem, 9vw, 8.5rem) 0 clamp(3rem, 6vw, 6rem);
}

.home-about__grid {
	display: grid;
	gap: 3rem 4rem;
	align-items: center;
}

.about-slider__slide h2 {
	color: var(--myco-color-primary);
	font-family: var(--myco-font-sans);
	font-stretch: normal;
	font-size: clamp(1.875rem, 3.3vw, 3.125rem);
	line-height: 1.22;
	letter-spacing: -0.015em;
}

.about-slider__slide h3 {
	margin-top: 1.75rem;
	font-size: clamp(1.125rem, 1.5vw, 1.375rem);
	line-height: 1.3;
}

.about-slider__slide p {
	font-size: 1.125rem;
	line-height: 1.6;
}

.about-slider__slide strong {
	color: var(--myco-color-body);
}

/* Slides share one grid cell, so the block keeps the height of the tallest slide. */
.js .about-slider__slides {
	display: grid;
}

.js .about-slider__slide {
	grid-area: 1 / 1;
}

.js .about-slider__slide:not(.is-active) {
	visibility: hidden;
	opacity: 0;
}

.js .about-slider__slide.is-active {
	animation: myco-fade-in 400ms ease;
}

html:not(.js) .about-slider__slide + .about-slider__slide {
	margin-top: 3rem;
}

@keyframes myco-fade-in {
	from {
		opacity: 0;
		transform: translateY(0.5rem);
	}

	to {
		opacity: 1;
		transform: none;
	}
}

.about-brand {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem 1.5rem;
	margin-bottom: 2rem;
}

.about-brand img {
	width: auto;
	height: clamp(2rem, 2.8vw, 2.5rem);
}

.about-brand span {
	padding: 1rem 0 1rem 1.5rem;
	border-left: 1px solid var(--myco-color-primary);
	color: var(--myco-color-primary);
	font-size: clamp(1.25rem, 1.9vw, 1.875rem);
	font-weight: 400;
	line-height: 1.2;
	white-space: nowrap;
}

/* One photo cut into three staggered, right-aligned strips. */
.about-strips {
	--myco-strip-gap: 0.875rem;
	--myco-strip-height: calc((100cqw * 0.6 - 2 * var(--myco-strip-gap)) / 3);
	display: grid;
	gap: var(--myco-strip-gap);
	container-type: inline-size;
}

.about-strips__slice {
	justify-self: end;
	width: 100%;
	height: var(--myco-strip-height);
	border-radius: var(--myco-radius-lg);
	background-image: url("../images/home/about.webp");
	background-repeat: no-repeat;
	background-size: auto calc(3 * var(--myco-strip-height) + 2 * var(--myco-strip-gap));
	background-position: right 0;
}

.about-strips__slice:nth-child(1) {
	width: 95%;
}

.about-strips__slice:nth-child(2) {
	width: 86%;
	background-position: right calc(-1 * (var(--myco-strip-height) + var(--myco-strip-gap)));
}

.about-strips__slice:nth-child(3) {
	background-position: right calc(-2 * (var(--myco-strip-height) + var(--myco-strip-gap)));
}

/* Products: white cards over a navy band. */
.home-products h2 {
	color: var(--myco-color-on-dark);
}

.home-products {
	padding: clamp(4rem, 8vw, 7rem) 0 clamp(3rem, 6vw, 5rem);
	background: linear-gradient(var(--myco-color-primary) 0 62%, var(--myco-color-bg) 62%);
}

.home-products .myco-carousel {
	--myco-carousel-gap: 3rem;
	--myco-carousel-item: 82%;
}

/* Inquiry: navy, headline + phone, rounded image. */
.home-inquiry {
	padding: clamp(3rem, 5vw, 3.5rem) 0;
}

.home-inquiry__grid {
	display: grid;
	gap: 2.5rem 4rem;
	align-items: center;
}

.home-inquiry h2 {
	font-size: clamp(2.25rem, 4.3vw, 4.25rem);
	line-height: 1.15;
}

.home-inquiry__lead {
	font-size: clamp(1.25rem, 2vw, 1.75rem);
	line-height: 1.45;
}

.home-inquiry__media {
	margin: 0;
	overflow: hidden;
	border-radius: var(--myco-radius-xl);
	aspect-ratio: 656 / 500;
}

.home-inquiry__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* News: post cards in a carousel. */
.home-news {
	padding: clamp(4rem, 8vw, 6.5rem) 0;
}

.home-news h2 {
	color: var(--myco-color-primary);
}

.home-news .myco-carousel {
	--myco-carousel-gap: 4rem;
	--myco-carousel-item: 84%;
	--myco-carousel-item-md: 60%;
	--myco-carousel-item-lg: 40%;
}

/* The track runs out to the right edge of the window, like the reference design. */
.home-news .myco-carousel__track {
	margin-right: calc((100% - 100vw) / 2);
	padding-right: 2.5rem;
}

.home-news .card-post__go {
	margin-right: -3.25rem;
}

@media (min-width: 37.5rem) {
	.home-hero__media {
		aspect-ratio: 16 / 9;
	}

	.home-products .myco-carousel {
		--myco-carousel-item-md: calc((100% - 3rem) / 2);
	}
}

@media (min-width: 56.25rem) {
	.home-about__grid,
	.home-inquiry__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

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

@media (min-width: 62.5rem) {
	.home-hero__head {
		grid-template-columns: minmax(0, 1fr) auto;
	}

	.home-hero__cta {
		justify-self: end;
	}

	.home-hero__media {
		aspect-ratio: 1296 / 505;
	}

	.home-slider__caption {
		bottom: clamp(2rem, 3vw, 2.75rem);
		max-width: min(34rem, calc(100% - 20rem));
	}

	.home-products .myco-carousel {
		--myco-carousel-item-lg: calc((100% - 6rem) / 3);
	}
}

@media (max-width: 29.99rem) {
	.about-brand {
		flex-direction: column;
		align-items: flex-start;
		gap: 0.5rem;
	}

	.about-brand span {
		padding: 0;
		border-left: 0;
	}
}
