/**
 * Finewerk Client Slider
 *
 * Scoped, BEM-style styles for the multi-row infinite logo marquee widget.
 * All custom properties are namespaced with --fw-cs- to avoid collisions.
 *
 * Layout: one widget root holds a text column and a stack of independent
 * rows. Every row owns its own viewport, track and animation, so direction,
 * speed and spacing can differ per row.
 */

/* ------------------------------------------------------------------
 * Typography defaults (see assets/css/fonts.css)
 *
 * Hubot Sans for headings/titles/stat numbers, Archivo for everything
 * else. Declared at single-class specificity — the tag group through a
 * zero-specificity :where() — so an explicit Elementor Typography
 * control (which Elementor writes at element-id specificity) always
 * overrides it. No !important anywhere.
 * ---------------------------------------------------------------- */

.finewerk-client-slider {
	font-family: var(--fw-font-body);
}

.finewerk-client-slider :where(h1, h2, h3, h4, h5, h6) {
	font-family: var(--fw-font-title);
}

/* Form controls do not inherit the document font: the UA sheet gives
   button/input/select/textarea their own `font: 400 13.33px Arial`.
   Opt them back into the component's face. */
.finewerk-client-slider :where(button, input, select, textarea, optgroup) {
	font-family: inherit;
}

.finewerk-client-slider {
	--fw-cs-text-width: 25%;
	--fw-cs-column-gap: 40px;
	--fw-cs-rows-gap: 24px;
	/*
	 * Every logo box is fixed, identical across rows and items. The logo is
	 * scaled to fit inside it, so image dimensions never feed back into layout.
	 *
	 * The box IS the logo's fit area now (no padding): logos render bare, at
	 * half the display size they had inside the old 260×104 white pill (whose
	 * padded content box was 180×60).
	 */
	--fw-cs-pill-width: 90px;
	--fw-cs-pill-height: 30px;
	--fw-cs-pill-padding: 0px;
	display: block;
	width: 100%;
}

.finewerk-client-slider__inner {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	column-gap: var(--fw-cs-column-gap);
	width: 100%;
}

/* ---------- Text column ---------- */

.finewerk-client-slider__text {
	flex: 0 0 var(--fw-cs-text-width);
	max-width: var(--fw-cs-text-width);
	min-width: 0;
}

.finewerk-client-slider__eyebrow {
	display: block;
	margin: 0 0 0.35em;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	line-height: 1.3;
}

.finewerk-client-slider__heading {
	margin: 0;
	font-family: var(--fw-font-title);
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.35;
}

.finewerk-client-slider__description {
	margin: 0.5em 0 0;
	font-size: 0.85rem;
	line-height: 1.5;
}

.finewerk-client-slider__description p:last-child {
	margin-bottom: 0;
}

/* ---------- Row stack ---------- */

.finewerk-client-slider__rows {
	display: flex;
	flex-direction: column;
	row-gap: var(--fw-cs-rows-gap);
	flex: 1 1 auto;
	min-width: 0;
}

/* Each row is self-contained: its own spacing, duration and phase. */
.finewerk-client-slider__row {
	--fw-cs-gap: 40px;
	/* Duration, phase offset and shift distance are set inline by the JS. */
	--fw-cs-duration: 30s;
	--fw-cs-delay: 0s;
	--fw-cs-shift: 0px;
	min-width: 0;
}

/* ---------- Viewport ---------- */

.finewerk-client-slider__viewport {
	position: relative;
	min-width: 0;
	overflow: hidden;
	/*
	 * A little symmetric breathing room around the bare logos (the old
	 * asymmetric padding existed for the pill drop shadow, which is gone).
	 * Elementor's "Viewport padding" control overrides this.
	 */
	padding: 6px 0;
	/* Keep the browser default focus ring visible for keyboard users. */
}

.finewerk-client-slider__viewport:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* Optional soft edge fade. */
.finewerk-cs-edge-fade--yes .finewerk-client-slider__viewport {
	-webkit-mask-image: linear-gradient(
		to right,
		transparent 0,
		#000 8%,
		#000 92%,
		transparent 100%
	);
	mask-image: linear-gradient(
		to right,
		transparent 0,
		#000 8%,
		#000 92%,
		transparent 100%
	);
}

/* ---------- Track + animation ---------- */

.finewerk-client-slider__track {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	width: max-content;
	will-change: transform;
}

/* Animation is only applied once JS has measured and marked the row ready. */
.finewerk-client-slider__row.is-fw-cs-ready .finewerk-client-slider__track {
	animation-name: finewerk-client-slider-marquee;
	animation-duration: var(--fw-cs-duration);
	animation-delay: var(--fw-cs-delay);
	animation-timing-function: linear;
	animation-iteration-count: infinite;
	animation-fill-mode: both;
	animation-play-state: running;
}

/* Right-moving direction simply reverses the same keyframes. */
.finewerk-client-slider__row[data-fw-cs-direction="right"].is-fw-cs-ready .finewerk-client-slider__track {
	animation-direction: reverse;
}

@keyframes finewerk-client-slider-marquee {
	from {
		transform: translate3d(0, 0, 0);
	}
	to {
		transform: translate3d(var(--fw-cs-shift), 0, 0);
	}
}

/* Pause on hover (only when enabled) and always on keyboard focus. */
.finewerk-client-slider__row--pause-hover.is-fw-cs-ready .finewerk-client-slider__viewport:hover .finewerk-client-slider__track,
.finewerk-client-slider__row.is-fw-cs-ready .finewerk-client-slider__viewport:focus-within .finewerk-client-slider__track {
	animation-play-state: paused;
}

.finewerk-client-slider__group {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	column-gap: var(--fw-cs-gap);
	/* Keep a gap between the end of one group and the start of the next. */
	padding-right: var(--fw-cs-gap);
}

/* ---------- Logo item ---------- */

/*
 * The item is sized only by --fw-cs-pill-width / --fw-cs-pill-height, never by
 * its contents: flex-basis is fixed and shrinking is disabled, so a wide or a
 * tall logo produces exactly the same box as any other.
 *
 * No surface of its own any more — no background, radius or shadow — so the
 * logos appear cleanly on their own rather than inside white pills. The
 * Elementor "Logo Pill" controls can still add a surface back per instance.
 */
.finewerk-client-slider__item {
	box-sizing: border-box;
	flex: 0 0 var(--fw-cs-pill-width);
	width: var(--fw-cs-pill-width);
	height: var(--fw-cs-pill-height);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--fw-cs-pill-padding);
	overflow: hidden;
}

/* The link spans the pill's content box so the image has a fixed area to fit into. */
.finewerk-client-slider__link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	min-width: 0;
}

/*
 * The image fills that content box and `object-fit` does the scaling, so the
 * logo keeps its aspect ratio, is never cropped, and sits centred in the pill.
 */
.finewerk-client-slider__image {
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	object-position: center;
	transition: opacity 0.2s ease, filter 0.2s ease;
}

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

@media (prefers-reduced-motion: reduce) {
	.finewerk-client-slider__row.is-fw-cs-ready .finewerk-client-slider__track {
		animation: none !important;
		transform: none !important;
	}

	/* Allow manual horizontal scanning without page overflow. */
	.finewerk-client-slider__viewport {
		overflow-x: auto;
	}
}

/* ---------- Responsive ---------- */

/* Tablet: half of the old padded content box (200−60 × 84−36 → 140×48). */
@media (max-width: 1024px) {
	.finewerk-client-slider {
		--fw-cs-column-gap: 28px;
		--fw-cs-pill-width: 70px;
		--fw-cs-pill-height: 24px;
	}

	.finewerk-client-slider__viewport {
		padding: 5px 0;
	}
}

/* Mobile: stack text above the rows. Box is half of the old 106×38 content. */
@media (max-width: 767px) {
	.finewerk-client-slider {
		--fw-cs-pill-width: 53px;
		--fw-cs-pill-height: 19px;
	}

	.finewerk-client-slider__inner {
		flex-direction: column;
		align-items: stretch;
		row-gap: var(--fw-cs-column-gap);
	}

	.finewerk-client-slider__text {
		flex-basis: auto;
		max-width: 100%;
	}

	.finewerk-client-slider__rows {
		width: 100%;
	}

	.finewerk-client-slider__viewport {
		padding: 4px 0;
	}
}
