
/*
 * Looters Hero Slider — Cinematic 3D.
 *
 * The 3D recipe is load-bearing and was arrived at empirically (see the plugin
 * readme "Why the structure is the way it is"). The rules that MUST hold:
 *
 *   1. `perspective` lives on .ls-stage — the DIRECT parent of the rotated
 *      .ls-slide elements. Perspective only reaches direct children; put it on
 *      an ancestor and every rotateY is silently flattened.
 *   2. The rotated element (.ls-slide) has NO overflow / filter / clip-path.
 *      Any of those forces the browser to rasterise it as a flat 2D plane —
 *      the matrix3d is still computed but drawn without depth.
 *   3. Clipping (rounded corners, hiding the off-stage slides) lives on
 *      .ls-rig, an ancestor that is never itself transformed.
 *   4. Only transform / opacity are ever animated: GPU compositor only, no
 *      layout, no paint.
 */

.ls-rig {
	--ls-dur: 1400ms;
	--ls-ease: cubic-bezier(0.5, 0.02, 0.2, 1);
	--ls-ink: #0c0e12;

	position: relative;
	width: 100%;
	overflow: hidden;            /* clip lives HERE, never on the slide */
	background: var(--ls-ink);
	border-radius: 0;            /* square corners */
	isolation: isolate;
}

/*
 * Elementor places the shortcode inside wrappers that can become zero-width
 * flex items — the slider then has no width to derive its aspect-ratio height
 * from and collapses to 0px. Force the shortcode wrapper (and its immediate
 * Elementor parent) to fill the available width when they contain our slider.
 * Scoped via :has() so we never touch unrelated Elementor widgets.
 */
.elementor-widget-shortcode:has(.ls-rig),
.elementor-shortcode:has(.ls-rig),
.elementor-element:has(.ls-rig) {
	width: 100%;
	flex: 1 1 100%;
	min-width: 0;
}

/* Reserves the exact banner box before any image decodes → zero CLS. */
.ls-stage {
	position: relative;
	width: 100%;
	aspect-ratio: var(--ls-ar, 1920 / 560);
	perspective: 900px;          /* near enough to read as real depth */
	perspective-origin: 50% 50%;
}

.ls-slide {
	position: absolute;
	inset: 0;
	transform-style: preserve-3d;
	backface-visibility: hidden;
	opacity: 0;
	/* will-change is toggled by JS only during a transition, not left on. */
}

.ls-slide.is-active {
	opacity: 1;
	z-index: 2;
}

/*
 * No-JS / late-render fallback. If the controller never runs — Elementor
 * editor re-rendering the widget, a script error, WP Rocket delaying JS — the
 * first slide must still be visible instead of a blank box.
 *
 * Gated on the rig NOT yet having data-ls-ready: the moment JS initialises it
 * sets that flag, this rule stops matching, and normal .is-active logic drives
 * the slideshow. So it only ever fills the pre-JS gap and never fights the
 * transition.
 */
.ls-rig:not([data-ls-ready]) .ls-slide:first-child {
	opacity: 1;
	z-index: 2;
}

.ls-media {
	position: absolute;
	inset: 0;
	overflow: hidden;            /* image over-scale is clipped here, safely */
	border-radius: inherit;
}

.ls-img {
	/* Always fill the whole frame, top to bottom, even for images that are
	   shorter than the 1920×560 target (e.g. a 1920×512 banner). `cover`
	   guarantees no letterbox gap; the min-width/height belt-and-braces stop
	   sub-pixel rounding from leaving a sliver. The image may crop or stretch
	   slightly rather than ever showing a gap. */
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	min-width: 100%;
	min-height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
	transform: scale(1.04);
}

/* ---- copy (only drawn when a slide actually has text) ------------------- */

.ls-slide::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	opacity: 0;
	background: linear-gradient(
		96deg,
		rgba(6, 8, 12, 0.60) 0%,
		rgba(6, 8, 12, 0.26) 30%,
		rgba(6, 8, 12, 0) 55%
	);
	transition: opacity 700ms var(--ls-ease);
}

.ls-slide.has-copy::after {
	opacity: 1;
}

.ls-copy {
	position: absolute;
	z-index: 2;
	inset-block: 0;
	inset-inline-start: clamp(20px, 6vw, 96px);
	inline-size: min(52%, 620px);
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	gap: 0.7em;
	color: #fff;
	pointer-events: none;
}

.ls-heading {
	margin: 0;
	font-size: clamp(1.6rem, 3.1vw, 3.4rem);
	line-height: 1.04;
	font-weight: 800;
	letter-spacing: -0.02em;
	text-wrap: balance;
	text-shadow: 0 2px 30px rgba(0, 0, 0, 0.35);
}

.ls-subhead {
	margin: 0;
	font-size: clamp(0.95rem, 1.15vw, 1.2rem);
	line-height: 1.45;
	opacity: 0.92;
	max-inline-size: 46ch;
	text-wrap: pretty;
}

.ls-cta {
	display: inline-block;
	margin-top: 0.5em;
	padding: 0.78em 1.9em;
	border-radius: 999px;
	background: #fff;
	color: var(--ls-ink);
	font-weight: 700;
	font-size: clamp(0.85rem, 0.95vw, 1rem);
	white-space: nowrap;
	box-shadow: 0 6px 26px -8px rgba(0, 0, 0, 0.55);
	transition: transform 380ms var(--ls-ease), box-shadow 380ms var(--ls-ease);
}

.ls-rig:hover .ls-cta {
	transform: translateY(-2px);
	box-shadow: 0 14px 34px -10px rgba(0, 0, 0, 0.6);
}

/* Staged entrance — released when the slide becomes active. */
.ls-copy > * {
	opacity: 0;
	transform: translate3d(0, 26px, 0);
	transition:
		opacity 720ms var(--ls-ease) var(--d, 0ms),
		transform 720ms var(--ls-ease) var(--d, 0ms);
}

.ls-slide.is-active .ls-copy > * {
	opacity: 1;
	transform: none;
}

.ls-copy > :nth-child(1) { --d: 260ms; }
.ls-copy > :nth-child(2) { --d: 360ms; }
.ls-copy > :nth-child(3) { --d: 460ms; }

/* ---- whole-slide link --------------------------------------------------- */

.ls-link {
	position: absolute;
	inset: 0;
	z-index: 3;
	display: block;
}

.ls-link:focus-visible {
	outline: 3px solid #fff;
	outline-offset: -6px;
	border-radius: 12px;
}

/* Button reset. Our dots and arrows are <button>s; without this they keep the
   native OS button appearance, which renders speckled/dotted chrome over the
   blurred backdrop. We reset ONLY the native-chrome properties here — the
   specific .ls-dot / .ls-nav rules below still set their own background/border. */
.ls-dot,
.ls-nav {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	font: inherit;
}

/* ---- navigation --------------------------------------------------------- */

.ls-nav {
	position: absolute;
	z-index: 4;
	top: 50%;
	inline-size: 46px;
	block-size: 46px;
	translate: 0 -50%;
	display: grid;
	place-items: center;
	padding: 0;
	cursor: pointer;
	border: 0;
	border-radius: 50%;
	/* Solid translucent fill instead of backdrop-filter:blur — the blur
	   produced a grainy/speckled dither over the moving slide (GPU-dependent,
	   worse in real browsers than headless). A plain rgba background is clean. */
	background: rgba(20, 24, 30, 0.42);
	color: #fff;
	opacity: 0;
	transition: opacity 320ms ease, background 320ms ease, scale 320ms var(--ls-ease);
}

.ls-prev { inset-inline-start: 18px; }
.ls-next { inset-inline-end: 18px; }

.ls-rig:hover .ls-nav,
.ls-nav:focus-visible { opacity: 1; }

.ls-nav:hover { background: rgba(255, 255, 255, 0.26); scale: 1.07; }

.ls-nav svg {
	inline-size: 20px;
	block-size: 20px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

/* ---- dots / progress ---------------------------------------------------- */

.ls-dots {
	position: absolute;
	z-index: 4;
	inset-block-end: 20px;
	inset-inline-start: 50%;
	translate: -50% 0;
	display: flex;
	gap: 9px;
	padding: 7px 11px;
	border-radius: 999px;
	/* Solid fill, no backdrop-filter:blur (see .ls-nav) — the blur was the
	   source of the grainy dots over the moving slide. */
	background: rgba(10, 12, 16, 0.5);
}

.ls-dot {
	position: relative;
	inline-size: 26px;
	block-size: 4px;
	padding: 0;
	border: 0;
	cursor: pointer;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.34);
	overflow: hidden;
	transition: inline-size 460ms var(--ls-ease), background 300ms ease;
}

.ls-dot[aria-selected="true"] {
	inline-size: 46px;
	background: rgba(255, 255, 255, 0.28);
}

.ls-dot:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

/*
 * Progress fill on the active dot. Animated purely in CSS via a composited
 * transform (scaleX), NOT by changing width per-frame from JS — that was what
 * made the edge shimmer as a dotted line. `will-change` + backface-visibility
 * pin it to its own GPU layer so the edge is rasterised ONCE and only
 * transformed, giving a smooth clean fill.
 */
.ls-dot-fill {
	position: absolute;
	inset: 0;
	background: #fff;
	border-radius: inherit;
	transform: scaleX(0);
	transform-origin: left center;
	will-change: transform;
	backface-visibility: hidden;
}

/* Only the active dot's fill runs, and it restarts each time a dot becomes
   active because the element is re-rendered active (animation re-triggers). */
.ls-dot[aria-selected="true"] .ls-dot-fill {
	animation: ls-fill var(--ls-autoplay, 6000ms) linear forwards;
}

@keyframes ls-fill {
	from { transform: scaleX(0); }
	to   { transform: scaleX(1); }
}

/* ---- utility ------------------------------------------------------------ */

.ls-rig .screen-reader-text {
	position: absolute !important;
	inline-size: 1px;
	block-size: 1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

/* ---- responsive --------------------------------------------------------- */

@media (max-width: 782px) {
	.ls-stage { perspective: 1200px; } /* flatten the depth a touch on mobile */
	.ls-copy {
		inline-size: min(84%, 520px);
		inset-inline-start: clamp(16px, 5vw, 32px);
	}
	.ls-nav { display: none; } /* touch users swipe */
}

/* ---- motion ------------------------------------------------------------- */

/*
 * The 3D transition intentionally plays even when the visitor's OS has
 * "reduce motion" enabled (product decision).
 *
 * This block is REQUIRED, not optional: browsers globally clamp transition
 * durations to 0s under prefers-reduced-motion, which makes our slides jump
 * instead of animating. We reassert real durations for our own elements only,
 * with !important, so the effect survives that clamp. Everything else on the
 * page still honours the user's setting.
 */
/* (Durations are set inline with !important by the controller during a
   transition, which is what actually defeats the browser's reduced-motion
   clamp. No CSS duration override is needed or wanted here.) */
