/*
 * Home hero slides [hero_carousel] (inc/slides/render.php, assets/js/slider.js).
 * The placement of 2026: full-width colour bands, two side by side from 768 px and one below, each with
 * the heading and text at the top left, the button at the bottom left and the logo at the bottom right,
 * the arrows at the screen's edges. Sizes follow the slide's own width (container units), so the bands
 * scale smoothly between the old steps; the band grows rather than clip a longer text.
 */
.hero-carousel {
	--nx-per: 1;
	--nx-step: 1;
	position: relative;
	width: 100vw;
	margin-inline: calc(50% - 50vw);
}
@media (min-width: 768px) {
	.hero-carousel { --nx-per: 2; }
}

.hero-carousel .nx-track {
	position: relative;
	display: flex;
	min-height: 280px; /* Reserved before the slides and their logos load. */
	overflow-x: auto;
	overflow-y: hidden;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}
.hero-carousel .nx-track::-webkit-scrollbar { display: none; }
.hero-carousel.nx-still .nx-clone { display: none; }

.hero-slide {
	flex: 0 0 calc(100% / var(--nx-per));
	min-width: 0;
	min-height: 280px;
	box-sizing: border-box;
	display: flex;
	padding: 0 10px;
	background: var(--nx-slide-bg, transparent);
	scroll-snap-align: start;
	scroll-snap-stop: always;
	container-type: inline-size;
}

.hero-inner {
	/* The slide's content width runs 300 px (a 320 phone) to 940 px (1920, two up); 364 px is a
	   768 screen's half, 492 px a 1024 screen's half: the logo and button grow between the two. */
	--nx-grow: clamp(0px, 100cqi - 364px, 128px);
	--nx-logo-w: calc(110px + var(--nx-grow) * 0.703125);
	--nx-logo-h: calc(45px + var(--nx-grow) * 0.1953125);
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 30px;
}

.hero-content { min-width: 0; }
.hero-content h2 {
	margin: 0 0 10px;
	font-size: clamp(1.375rem, 3vw + 0.5rem, 1.75rem);
	overflow-wrap: anywhere;
}
.hero-content h3 {
	margin-top: 0;
	font-size: clamp(1rem, 2vw + 0.5rem, 1.25rem);
	overflow-wrap: anywhere;
}
.hero-content p {
	max-width: min(400px, 100%);
	margin: 0 0 20px;
	font-weight: 100;
	line-height: calc(22.4px + var(--nx-grow) * 0.0125);
	overflow-wrap: anywhere;
}

/* The button row keeps its room at the bottom; the last paragraph needs no margin under it. */
.hero-description > :last-child { margin-bottom: 0; }

.hero-bottom {
	display: flex;
	flex-wrap: wrap; /* A long button text puts the logo on its own line instead of over it. */
	justify-content: space-between;
	align-items: flex-end;
	row-gap: 10px;
}

.hero-btn {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	max-width: 100%;
	padding: 12px 22px;
	background: #000;
	color: #fff;
	font-size: calc(11px + var(--nx-grow) * 0.0390625);
	font-weight: 700;
	text-decoration: none;
	text-transform: uppercase;
}
.hero-btn:hover,
.hero-btn:focus { color: #ececec; }
.hero-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 4px #000; }
.hero-btn .arrow { transition: transform 0.3s ease; }
.hero-btn:hover .arrow { transform: translateX(5px); }

.hero-logo {
	display: flex;
	justify-content: flex-end;
	align-items: flex-end;
	margin-left: auto;
}
/* Every logo sits centred in the same box, whatever its shape. */
.hero-logo img {
	display: block;
	width: var(--nx-logo-w);
	height: var(--nx-logo-h);
	object-fit: contain;
}
.hero-logo:empty::after {
	content: "";
	display: block;
	width: var(--nx-logo-w);
	height: var(--nx-logo-h);
}

.hero-prev,
.hero-next {
	position: absolute;
	top: 50%;
	z-index: 9; /* Below the sticky nav (Shoptimizer's .col-full-nav is 10). */
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	color: #444;
	font: inherit;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	transform: translateY(-50%);
}
.hero-prev { left: 0; }
.hero-next { right: 0; }
.hero-prev[hidden],
.hero-next[hidden] { display: none; }
.hero-prev:focus-visible,
.hero-next:focus-visible { outline: 2px solid #000; outline-offset: -2px; box-shadow: inset 0 0 0 4px #fff; }

@media (prefers-reduced-motion: reduce) {
	.hero-btn .arrow { transition: none; }
}
