/**
 * Split hero — copy on the left, product compositions on the right.
 *
 * Loaded by hifocus_hero_media_assets() (inc/hero-media.php) only on a target
 * page that has hero images set. Every class is new (.hf-hero…); nothing here
 * restyles .sw-hero, .pos-hero or .net-hero, so a page without images keeps
 * its original hero exactly.
 *
 * Grid areas, desktop:      (spacer) | visual
 *                           intro    | visual
 *                           cta      | visual
 *                           (spacer) | visual
 * Stacked (≤1080px):        intro / visual / cta
 *
 * Crossfade is CSS only. The stack carries --hf-n (image count), each image and
 * dot carries --hf-i (its index). All share one keyframe cycle of n × 6s, and
 * each is offset by (i − n) × 6s, a negative delay, so image 1 is fully shown
 * on first paint and the others wait their turn.
 *
 * @package HiFOCUS_Modern_2026
 */

/* -------------------------------------------------- *
 * 1. Tokens and band
 * -------------------------------------------------- */

.hf-hero {
	/* --navy-700 (#111c33) is within a shade of the #0A1A33 brief. */
	--hf-bg: var(--navy-700);
	--hf-ink: #0a1a33;
	--hf-lead: #c9d6e8;
	--hf-crumb: #9fb3cf;
	--hf-circle: #12294d;
	--hf-floor: #071327;
	--hf-accent: #38bdf8;
	--hf-slot: 6s;

	position: relative;
	overflow: hidden;
	background-color: var(--hf-bg);
	color: var(--color-inverse);
	padding-block: clamp(2.5rem, 5vw, 4rem);
}

.hf-hero--pos { --hf-accent: #f5a524; }
.hf-hero--cctv { --hf-accent: #38bdf8; }
.hf-hero--net { --hf-accent: #34d399; }

.hf-hero__inner {
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
	/* The two empty 1fr rows centre the copy block however tall it runs. */
	grid-template-rows: 1fr auto auto 1fr;
	grid-template-areas:
		".     visual"
		"intro visual"
		"cta   visual"
		".     visual";
	column-gap: var(--space-lg);
	min-height: 620px;
}

.hf-hero__intro {
	grid-area: intro;
}

.hf-hero__cta {
	grid-area: cta;
}

.hf-hero__visual {
	grid-area: visual;
	align-self: center;
}

.hf-hero :focus-visible {
	outline: 2px solid var(--hf-accent);
	outline-offset: 3px;
}

/* -------------------------------------------------- *
 * 2. Copy column
 * -------------------------------------------------- */

.hf-hero .sw-crumbs {
	color: var(--hf-crumb);
}

.hf-hero .sw-crumbs a,
.hf-hero .sw-crumbs__sep,
.hf-hero .sw-crumbs__current {
	color: var(--hf-crumb);
}

.hf-hero .sw-crumbs a:hover {
	color: var(--color-inverse);
}

.hf-hero__eyebrow {
	margin-top: var(--space-md);
	color: var(--hf-accent);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.hf-hero__title {
	margin-top: 0.75rem;
	font-size: clamp(2.25rem, 1.3rem + 2.7vw, 3.5rem);
	line-height: 1.08;
	letter-spacing: -0.035em;
}

.hf-hero__lead {
	max-width: 540px;
	margin-top: var(--space-md);
	color: var(--hf-lead);
	font-size: 1.1875rem;
	line-height: 1.6;
}

/* ---------- Buttons ---------- */

.hf-hero__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: var(--space-lg);
}

.hf-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.6rem;
	min-height: 52px;
	padding: 0.85rem 1.6rem;
	border: 1px solid transparent;
	border-radius: 999px;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	transition: transform var(--transition), background-color var(--transition),
		border-color var(--transition), box-shadow var(--transition), color var(--transition);
}

.hf-btn svg {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
}

.hf-btn--primary {
	background-color: var(--hf-accent);
	color: var(--hf-ink);
	box-shadow: 0 10px 28px -10px var(--hf-accent);
}

.hf-btn--primary:hover,
.hf-btn--primary:focus-visible {
	color: var(--hf-ink);
	transform: translateY(-2px);
	box-shadow: 0 16px 34px -12px var(--hf-accent);
}

.hf-btn--outline {
	border-color: rgba(255, 255, 255, 0.45);
	color: var(--color-inverse);
}

.hf-btn--outline:hover,
.hf-btn--outline:focus-visible {
	border-color: var(--color-inverse);
	background-color: rgba(255, 255, 255, 0.08);
	color: var(--color-inverse);
	transform: translateY(-2px);
}

/* ---------- Tick list ---------- */

.hf-hero__ticks {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem 1.5rem;
	margin: var(--space-md) 0 0;
	padding: 0;
	list-style: none;
	color: var(--hf-lead);
	font-size: var(--fs-sm);
	font-weight: 600;
}

.hf-hero__ticks li {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
}

.hf-hero__ticks svg {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	color: var(--hf-accent);
}

/* -------------------------------------------------- *
 * 3. Composition side
 * -------------------------------------------------- */

.hf-hero__visual {
	display: grid;
	justify-items: center;
}

.hf-hero__media {
	width: 100%;
}

/*
 * Every image in one grid cell, so the stack sizes to the composition. The
 * circle and floor shadow hang off the stack, not the column, so they scale
 * with the composition and never spread over the copy when stacked.
 */
.hf-hero__stack {
	position: relative;
	isolation: isolate;
	display: grid;
	aspect-ratio: 6 / 5;
}

/* Decorative circle behind the products. */
.hf-hero__stack::before {
	content: "";
	position: absolute;
	z-index: -2;
	top: 50%;
	left: 50%;
	width: 80%;
	aspect-ratio: 1;
	border-radius: 50%;
	background-color: var(--hf-circle);
	transform: translate(-50%, -50%);
}

/* Soft floor shadow under the products. */
.hf-hero__stack::after {
	content: "";
	position: absolute;
	z-index: -1;
	bottom: 8%;
	left: 50%;
	width: 70%;
	height: 8%;
	border-radius: 50%;
	background-color: var(--hf-floor);
	filter: blur(14px);
	transform: translateX(-50%);
}

.hf-hero__img {
	grid-area: 1 / 1;
	width: 100%;
	height: 100%;
	object-fit: contain;
	background: none;
}

/* Images 2–3 are hidden until the crossfade shows them. */
.hf-hero__img:not(:first-child) {
	opacity: 0;
}

/* ---------- Crossfade ---------- */

.hf-hero__media--2 .hf-hero__img,
.hf-hero__media--3 .hf-hero__img {
	animation: hf-fade-3 calc(var(--hf-n) * var(--hf-slot)) ease-in-out infinite;
	animation-delay: calc((var(--hf-i, 0) - var(--hf-n)) * var(--hf-slot));
}

.hf-hero__media--2 .hf-hero__img {
	animation-name: hf-fade-2;
}

/*
 * Three images, 18s cycle: shown for 4.5s, then a 1.5s fade out while the next
 * fades in over the same 1.5s.
 */
@keyframes hf-fade-3 {
	0%,
	25% { opacity: 1; }
	33.333%,
	91.667% { opacity: 0; }
	100% { opacity: 1; }
}

/* Two images, 12s cycle, same 4.5s hold and 1.5s fade. */
@keyframes hf-fade-2 {
	0%,
	37.5% { opacity: 1; }
	50%,
	87.5% { opacity: 0; }
	100% { opacity: 1; }
}

.hf-hero__dots {
	display: flex;
	justify-content: center;
	gap: 0.5rem;
	margin-top: var(--space-sm);
}

.hf-hero__dot {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background-color: var(--hf-accent);
	opacity: 0.3;
	animation: hf-dot-3 calc(var(--hf-n) * var(--hf-slot)) ease-in-out infinite;
	animation-delay: calc((var(--hf-i, 0) - var(--hf-n)) * var(--hf-slot));
}

.hf-hero__media--2 .hf-hero__dot {
	animation-name: hf-dot-2;
}

@keyframes hf-dot-3 {
	0%,
	25% { opacity: 1; }
	33.333%,
	91.667% { opacity: 0.3; }
	100% { opacity: 1; }
}

@keyframes hf-dot-2 {
	0%,
	37.5% { opacity: 1; }
	50%,
	87.5% { opacity: 0.3; }
	100% { opacity: 1; }
}

/* -------------------------------------------------- *
 * 4. Responsive
 * -------------------------------------------------- */

@media (max-width: 1080px) {
	.hf-hero__inner {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: none;
		grid-template-areas:
			"intro"
			"visual"
			"cta";
		row-gap: var(--space-md);
		min-height: 0;
	}

	.hf-hero__lead {
		max-width: 62ch;
	}

	/* Composition capped at 420px tall, centred. */
	.hf-hero__media {
		width: min(100%, 504px);
	}

	.hf-hero__stack {
		max-height: 420px;
	}

	.hf-hero__actions {
		flex-direction: column;
		margin-top: 0;
	}

	.hf-btn {
		width: 100%;
	}

	.hf-hero__ticks {
		flex-direction: column;
		gap: 0.6rem;
	}
}

@media (max-width: 640px) {
	.hf-hero__title {
		font-size: 2.25rem;
	}

	.hf-hero__lead {
		font-size: 1.0625rem;
	}
}

/* Reduced motion: image 1 only, no fade, no dots, no button lift. */
@media (prefers-reduced-motion: reduce) {
	.hf-hero__media .hf-hero__img {
		animation: none;
	}

	.hf-hero__img:not(:first-child),
	.hf-hero__dots {
		display: none;
	}

	.hf-btn:hover,
	.hf-btn:focus-visible {
		transform: none;
	}
}
