/*
 * Homepage hero + sections.
 *
 * Rebuilt 2026-07 to replace landing-pages.css (landing pages retired in the
 * single-catalog refactor). Uses the design tokens from global.css.
 */

/* Hero ------------------------------------------------------------------ */

.zenova-hero {
	position: relative;
	overflow: hidden;
	background: var(--zenova-color-text);
	color: var(--zenova-color-surface);
}

.zenova-hero__media {
	position: absolute;
	inset: 0;
}

/* <picture> is an inline box by default; make it a full-size block so the
   img's width/height 100% keep resolving against the media wrapper. */
.zenova-hero__media picture {
	display: block;
	width: 100%;
	height: 100%;
}

.zenova-hero__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.zenova-hero--has-image .zenova-hero__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.25) 60%, rgba(0, 0, 0, 0.1) 100%);
}

.zenova-hero__inner {
	position: relative;
	display: flex;
	align-items: center;
	min-height: clamp(320px, 45vw, 560px);
	padding-block: var(--zenova-space-xl);
}

.zenova-hero__content {
	max-width: 34rem;
}

.zenova-hero__title {
	margin: 0 0 var(--zenova-space-sm);
	font-size: clamp(1.75rem, 4vw, 2.75rem);
	line-height: 1.15;
	color: inherit;
}

.zenova-hero__text {
	margin: 0 0 var(--zenova-space-md);
	font-size: 1.05rem;
	line-height: 1.6;
	color: inherit;
}

.zenova-hero__text p {
	margin: 0 0 var(--zenova-space-xs);
	color: inherit;
}

.zenova-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: var(--zenova-space-sm);
	margin: 0;
}

/* No-image fallback keeps text readable on dark background. */
.zenova-hero:not(.zenova-hero--has-image) {
	background: var(--zenova-color-accent);
}

/*
 * The hero sits on a dark scrim (or the accent fallback), so the black
 * primary button would sink into it. Invert to solid white here, matching
 * how the header quote button inverts over the transparent header.
 */
.zenova-hero .zenova-button--primary {
	background: #ffffff;
	border-color: #ffffff;
	color: var(--zenova-color-button);
}

.zenova-hero .zenova-button--primary:hover,
.zenova-hero .zenova-button--primary:focus-visible {
	background: rgba(255, 255, 255, 0.85);
	border-color: rgba(255, 255, 255, 0.85);
	color: var(--zenova-color-button);
}

/*
 * The secondary hero button sets no colour of its own, so it inherits — except
 * Astra ships a global `a { color: #111111 }` that beats the white inherited
 * from .zenova-hero__content. That left near-black text on a dark hero:
 * 1.08:1 over the image overlay, 2.18:1 over the no-image brand blue.
 */
.zenova-hero .zenova-button:not(.zenova-button--primary) {
	border-color: rgba(255, 255, 255, 0.7);
	color: #ffffff;
}

.zenova-hero .zenova-button:not(.zenova-button--primary):hover,
.zenova-hero .zenova-button:not(.zenova-button--primary):focus-visible {
	background: rgba(255, 255, 255, 0.15);
	border-color: #ffffff;
	color: #ffffff;
}

/*
 * The shared focus ring is --zenova-color-accent, which is also the hero's
 * no-image background — the ring scored 1.00:1 there, i.e. invisible, and only
 * 2.01:1 over the image overlay. White clears 8.66:1 on both.
 */
.zenova-hero .zenova-button:focus-visible {
	outline-color: #ffffff;
}

/* Flush hero: pull the hero up against the site header edge-to-edge. */
.zenova-page-hero-flush .site-main > .zenova-hero:first-child,
.zenova-homepage-page.zenova-page-hero-flush .zenova-hero--home {
	margin-top: 0;
}

.zenova-page-hero-flush .site-main {
	padding-top: 0;
}

/* Header overlay mode: hero runs under the transparent fixed header. */
body.zenova-header-overlay .zenova-hero--home .zenova-hero__inner {
	min-height: clamp(420px, 62vh, 680px);
	padding-top: calc(var(--zenova-site-top-offset, 7rem) + var(--zenova-space-lg));
}

/* Top scrim keeps white header text readable over any hero image. */
body.zenova-header-overlay .zenova-hero--has-image .zenova-hero__media::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: calc(var(--zenova-site-top-offset, 7rem) + 3rem);
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.45) 0%, rgba(0, 0, 0, 0) 100%);
	z-index: 1;
}

/* Shared homepage section headings ---------------------------------------- */

.zenova-home-section__title {
	margin: 0 0 var(--zenova-space-md);
	color: var(--zenova-color-text);
}

.zenova-home-section__intro {
	margin: 0 0 var(--zenova-space-lg);
	max-width: 720px;
	color: var(--zenova-color-muted);
	line-height: 1.6;
}

/* Products showcase ------------------------------------------------------- */

/*
 * 100vw counts the vertical scrollbar but the content box does not, so the
 * full-bleed child below overhangs by exactly the scrollbar width and the page
 * grows a horizontal scrollbar. Clipping here absorbs that.
 *
 * `clip` rather than `hidden` on purpose: hidden would make this a scroll
 * container and break position: sticky for anything inside it.
 */
.zenova-home-products {
	overflow-x: clip;
}

/*
 * Full-bleed: only the track escapes the container, so the heading and intro
 * stay aligned with the rest of the page. Applied here rather than on __track
 * so the absolutely positioned arrows still measure against the visible edges.
 */
.zenova-home-products__carousel {
	position: relative;
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}

/*
 * Horizontal carousel: 4 slides, 3 visible on desktop. Scroll-snap does the
 * work so it stays usable with touch/trackpad even if the arrow script never
 * runs.
 *
 * grid-auto-columns and gap are a matched pair — the column maths subtracts
 * exactly two gaps, so changing one without the other pushes the third card
 * out of view.
 */
.zenova-home-products__track {
	list-style: none;
	margin: 0;
	padding: 0 0 var(--zenova-space-xs);
	/*
	 * Full-bleed would otherwise run the first card's image and label straight
	 * into the viewport edge. scroll-padding must match, or scroll-snap parks
	 * cards against the edge again and the gutter only appears at rest.
	 *
	 * Safe for the 3-across maths above: grid's 100% is the content box, which
	 * already excludes this padding.
	 */
	padding-inline: var(--zenova-space-lg);
	scroll-padding-inline: var(--zenova-space-lg);
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - (2 * var(--zenova-space-lg))) / 3);
	gap: var(--zenova-space-lg);
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	overscroll-behavior-x: contain;
	/* Hide the scrollbar without disabling touch, trackpad or keyboard scroll. */
	scrollbar-width: none;
}

.zenova-home-products__track::-webkit-scrollbar {
	display: none;
}

.zenova-home-products__slide {
	scroll-snap-align: start;
}

.zenova-home-products__card {
	display: block;
	text-decoration: none;
	color: inherit;
}

.zenova-home-products__card:focus-visible {
	outline: 2px solid var(--zenova-color-accent);
	outline-offset: 2px;
}

.zenova-home-products__figure {
	display: block;
	overflow: hidden;
	border-radius: var(--zenova-radius);
	background: var(--zenova-color-surface);
	transition: background-color 0.2s ease;
}

.zenova-home-products__image {
	display: block;
	width: 100%;
	height: auto;
	/* Square rather than 4/3: with full-bleed width the card would be very
	   wide and short otherwise. Height is driven by the ratio, never fixed. */
	aspect-ratio: 1 / 1;
	object-fit: cover;
	transition: transform 0.2s ease;
}

.zenova-home-products__label {
	display: block;
	margin-top: var(--zenova-space-md);
	/* Card-sized, not body-sized: at ~450px wide the label reads as a heading. */
	font-size: clamp(1.25rem, 1.6vw, 1.625rem);
	font-weight: 700;
	line-height: 1.4;
	color: var(--zenova-color-text);
	transition: color 0.2s ease;
}

/*
 * Keyboard focus, which must work on touch devices too — kept outside the
 * hover query below.
 */
a.zenova-home-products__card:focus-visible .zenova-home-products__figure {
	background: #ededed;
}

a.zenova-home-products__card:focus-visible .zenova-home-products__image {
	transform: scale(1.03);
}

a.zenova-home-products__card:focus-visible .zenova-home-products__label {
	color: var(--zenova-color-accent);
}

/*
 * Hover only where hovering is real. A touch tap leaves :hover latched on the
 * card until the next tap elsewhere, which left the label stuck accent-blue.
 */
@media (hover: hover) {
	a.zenova-home-products__card:hover .zenova-home-products__figure {
		background: #ededed;
	}

	a.zenova-home-products__card:hover .zenova-home-products__image {
		transform: scale(1.03);
	}

	a.zenova-home-products__card:hover .zenova-home-products__label {
		color: var(--zenova-color-accent);
	}
}

.zenova-home-products__arrow {
	position: absolute;
	top: calc(50% - 1.5rem);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	padding: 0;
	border: 1px solid var(--zenova-color-border);
	border-radius: 50%;
	background: var(--zenova-color-surface);
	color: var(--zenova-color-text);
	font-size: 1.25rem;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.zenova-home-products__arrow:hover,
.zenova-home-products__arrow:focus-visible {
	background: var(--zenova-color-accent);
	color: #ffffff;
}

.zenova-home-products__arrow[disabled] {
	opacity: 0.35;
	cursor: default;
}

/*
 * Float over the track edges: full-bleed removed the container gutter the
 * arrows used to sit in.
 */
.zenova-home-products__arrow--prev {
	left: 1rem;
}

.zenova-home-products__arrow--next {
	right: 1rem;
}

.zenova-home-products__nav {
	margin-top: var(--zenova-space-lg);
}

.zenova-home-products__nav-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: var(--zenova-space-xs) var(--zenova-space-md);
}

.zenova-home-products__nav-link {
	display: inline-block;
	padding: 0.4rem 0;
	color: var(--zenova-color-text);
	text-decoration: none;
	border-bottom: 1px solid var(--zenova-color-border);
}

.zenova-home-products__nav-link:hover,
.zenova-home-products__nav-link:focus-visible {
	color: var(--zenova-color-accent);
	border-bottom-color: currentColor;
}

/* Text + image sections (OEM / About) ------------------------------------- */

.zenova-home-media__inner {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: var(--zenova-space-xl);
	align-items: center;
}

.zenova-home-media__body {
	line-height: 1.7;
	color: var(--zenova-color-text);
}

.zenova-home-media__body p {
	margin: 0 0 var(--zenova-space-sm);
}

.zenova-home-media__actions {
	margin: var(--zenova-space-md) 0 0;
}

.zenova-home-media__figure {
	margin: 0;
}

.zenova-home-media__image {
	display: block;
	width: 100%;
	height: auto;
	border-radius: var(--zenova-radius);
}

/* Alternate the image side so consecutive sections do not look identical. */
.zenova-home-media--about .zenova-home-media__content {
	order: 2;
}

.zenova-home-media--about .zenova-home-media__figure {
	order: 1;
}

/* Why Zenova ------------------------------------------------------------- */

.zenova-home-why__list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
	gap: var(--zenova-space-md);
}

.zenova-home-why__item {
	padding: var(--zenova-space-md);
	background: var(--zenova-color-surface);
	border: 1px solid var(--zenova-color-border);
	border-radius: var(--zenova-radius);
}

.zenova-home-why__item-title {
	margin: 0 0 var(--zenova-space-xs);
	font-size: 1.0625rem;
	color: var(--zenova-color-text);
}

.zenova-home-why__item-text {
	margin: 0;
	color: var(--zenova-color-muted);
	line-height: 1.6;
}

/* SEO content section ---------------------------------------------------- */

.zenova-section--seo {
	margin-block: var(--zenova-space-xl);
	padding-top: var(--zenova-space-lg);
	border-top: 1px solid var(--zenova-color-border);
}

/* Tablet: 2 slides visible, stacked media sections. */
@media (max-width: 921px) {
	/* Gap must match the track gap above, or the second card overflows. */
	.zenova-home-products__track {
		grid-auto-columns: calc((100% - var(--zenova-space-lg)) / 2);
	}

	.zenova-home-products__arrow {
		display: none;
	}

	.zenova-home-media__inner {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--zenova-space-lg);
	}

	.zenova-home-media--about .zenova-home-media__content,
	.zenova-home-media--about .zenova-home-media__figure {
		order: 0;
	}
}

@media (max-width: 640px) {
	/* Only reaches the imageless hero: with a hero image the body carries
	   .zenova-header-overlay, whose higher-specificity clamp() above wins.
	   The mobile hero image is cropped for that clamp height — do not add
	   specificity here or the tall crop gets cut to a 280px strip. */
	.zenova-hero__inner {
		min-height: 280px;
	}

	/*
	 * Peek the next slide so the strip reads as scrollable. Full-bleed would
	 * otherwise pin the first card to the viewport edge on a narrow screen;
	 * the inline padding gives it breathing room and scroll-padding keeps the
	 * snap position aligned with it.
	 */
	.zenova-home-products__track {
		grid-auto-columns: 78%;
		gap: var(--zenova-space-md);
		padding-inline: var(--zenova-space-sm);
		scroll-padding-inline: var(--zenova-space-sm);
	}
}

@media (prefers-reduced-motion: reduce) {
	.zenova-home-products__track {
		scroll-behavior: auto;
	}

	.zenova-home-products__figure,
	.zenova-home-products__image,
	.zenova-home-products__label {
		transition: none;
	}

	a.zenova-home-products__card:hover .zenova-home-products__image,
	a.zenova-home-products__card:focus-visible .zenova-home-products__image {
		transform: none;
	}
}
