/**
 * Секция «Нам довіряють» #trusted — две колонки + бегущие ленты клиентов (2026-10-30).
 * Разметка: template-parts/blocks/trusted.php. Макет: reports/new-design-tasks/Trusted task (TrustedTwoCol.dc.html).
 * Начальное состояние — статичное (без JS / prefers-reduced-motion): плашки в ряд с горизонтальным скроллом и scroll-snap.
 * JS (assets/js/wa-trust.js) клонирует плашки и ставит .wa-trust--anim → ленты едут (translateX 0 → -50%), длительность — --wa-trust-dur.
 */

.wa-trust {
	--wa-tr-ink: #14233a;
	--wa-tr-muted: #4b5563;
	--wa-tr-blue: #1a72a8;
	--wa-tr-head: Montserrat, Arial, sans-serif;
	--wa-tr-gap: 16px;
	padding: 80px 0;
	background: #f5f8fb;
	font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	color: #1d2433;
}
.wa-trust *,
.wa-trust *::before,
.wa-trust *::after { box-sizing: border-box; }

.wa-trust__wrap {
	width: 1400px;
	max-width: 100%;
	margin: 0 auto;
	display: grid;
	grid-template-columns: 440px minmax(0, 1fr);
	gap: 56px;
	align-items: center;
}

/* ---------- левая колонка ---------- */
.wa-trust__eyebrow {
	display: inline-flex;
	align-items: center;
	height: 30px;
	padding: 0 12px;
	border-radius: 999px;
	background: #eaf4fa;
	color: #1a5f8c;
	font-size: 13px;
	font-weight: 600;
	line-height: 1;
}
.wa-trust .wa-trust__title {
	margin: 16px 0 0;
	padding: 0;
	font-family: var(--wa-tr-head);
	font-weight: 700;
	font-size: 40px;
	line-height: 1.15;
	letter-spacing: -.01em;
	color: var(--wa-tr-ink);
	text-align: left;
	text-transform: none;
}
.wa-trust .wa-trust__lead {
	margin: 14px 0 0;
	font-size: 17px;
	line-height: 1.6;
	color: var(--wa-tr-muted);
}
.wa-trust__stats {
	margin-top: 28px;
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 12px;
}
.wa-trust__stat {
	padding: 18px 20px;
	background: #fff;
	border-radius: 16px;
}
.wa-trust__stat-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.wa-trust__num {
	font-family: var(--wa-tr-head);
	font-weight: 700;
	font-size: 30px;
	line-height: 1.2;
	color: var(--wa-tr-blue);
}
.wa-trust__stat-text { font-size: 14px; line-height: 1.4; color: var(--wa-tr-muted); }
.wa-trust__stat--wide {
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 20px;
	background: #f4faee;
}
.wa-trust__stat--wide .wa-trust__stat-main { flex-direction: row; flex-wrap: wrap; align-items: baseline; column-gap: 10px; }
.wa-trust__stat--wide .wa-trust__num { font-size: 22px; color: #3f7a0a; }
.wa-trust__tags { display: flex; gap: 6px; flex: none; }
.wa-trust__tag {
	display: flex;
	align-items: center;
	height: 28px;
	padding: 0 10px;
	border-radius: 999px;
	background: #fff;
	font-size: 12px;
	font-weight: 700;
	color: var(--wa-tr-ink);
}

/* ---------- ленты: статичное состояние (без JS) ---------- */
.wa-trust__rows { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.wa-trust__row {
	position: relative;
	overflow-x: auto;
	overflow-y: hidden;
	padding: 6px 0 10px;
	scroll-snap-type: x mandatory;
	scrollbar-width: thin;
}
.wa-trust .wa-trust__track {
	display: flex;
	gap: var(--wa-tr-gap);
	width: max-content;
	margin: 0;
	padding: 0;
	list-style: none;
}
.wa-trust .wa-trust__item {
	flex: none;
	margin: 0;
	padding: 0;
	list-style: none;
	scroll-snap-align: start;
}
.wa-trust .wa-trust__item::before { content: none; }

/* ---------- анимация (JS ставит .wa-trust--anim) ---------- */
.wa-trust--anim .wa-trust__row {
	overflow: hidden;
	scroll-snap-type: none;
	-webkit-mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
	mask-image: linear-gradient(90deg, transparent 0, #000 7%, #000 93%, transparent 100%);
}
/* gap → margin у каждой плашки: тогда половина трека = ровно один набор, -50% без скачка */
.wa-trust--anim .wa-trust__track {
	gap: 0;
	animation: wa-trust-run var(--wa-trust-dur, 40s) linear infinite;
	will-change: transform;
}
.wa-trust--anim .wa-trust__item { margin-right: var(--wa-tr-gap); }
.wa-trust--anim .wa-trust__row--rev .wa-trust__track { animation-direction: reverse; }
.wa-trust--anim .wa-trust__row:hover .wa-trust__track,
.wa-trust--anim .wa-trust__row:focus-within .wa-trust__track,
.wa-trust--paused .wa-trust__track { animation-play-state: paused; }
@keyframes wa-trust-run {
	from { transform: translateX(0); }
	to { transform: translateX(-50%); }
}

/* ---------- плашка клиента ---------- */
.wa-trust .wa-trust__card {
	width: 380px;
	height: 124px;
	display: flex;
	align-items: center;
	gap: 18px;
	padding: 14px 20px 14px 14px;
	background: #fff;
	border: 1px solid #e3e9ef;
	border-radius: 20px;
	box-shadow: 0 4px 14px rgba(15, 23, 42, .04);
	color: #1d2433;
	text-decoration: none;
	transition: border-color .25s, box-shadow .25s, transform .25s;
}
.wa-trust a.wa-trust__card:focus-visible { outline: 2px solid var(--wa-tr-blue); outline-offset: 2px; }
@media (hover: hover) {
	.wa-trust .wa-trust__card:hover {
		color: #1d2433;
		border-color: #cfe1ee;
		box-shadow: 0 16px 34px rgba(15, 23, 42, .10);
		transform: translateY(-3px);
	}
}
.wa-trust__logo {
	flex: none;
	width: 150px;
	height: 96px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 10px;
	border-radius: 14px;
	background: #f6f9fb;
	border: 1px solid #edf2f6;
	overflow: hidden;
}
/* WebP Express оборачивает img в <picture> — растягиваем его на бокс, иначе img не сжимается */
.wa-trust .wa-trust__logo picture {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	min-width: 0;
}
.wa-trust .wa-trust__logo img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 76px;
	object-fit: contain;
	mix-blend-mode: multiply;
}
.wa-trust__txt { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.wa-trust__name {
	font-family: var(--wa-tr-head);
	font-weight: 700;
	font-size: 16px;
	line-height: 1.25;
	color: var(--wa-tr-ink);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.wa-trust__desc {
	font-size: 13px;
	line-height: 1.4;
	color: #5b6472;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.wa-trust__geo {
	align-self: flex-start;
	display: flex;
	align-items: center;
	height: 22px;
	padding: 0 8px;
	border-radius: 999px;
	background: #eaf4fa;
	color: #1a5f8c;
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
}
.wa-trust__geo--us { background: #f4faee; color: #3f7a0a; }

/* ---------- ширина: 1400 + поля 20px ниже 1440 ---------- */
@media (max-width: 1439px) {
	.wa-trust__wrap { width: calc(100% - 40px); }
}
@media (max-width: 1199px) {
	.wa-trust__wrap { grid-template-columns: 380px minmax(0, 1fr); gap: 40px; }
	.wa-trust .wa-trust__title { font-size: 34px; }
}

/* ---------- мобилка/планшет ≤1023: одна колонка, ленты на всю ширину экрана ---------- */
@media (max-width: 1023px) {
	.wa-trust { padding: 48px 0; }
	.wa-trust__wrap {
		width: calc(100% - 32px);
		grid-template-columns: minmax(0, 1fr);
		gap: 28px;
	}
	.wa-trust .wa-trust__title { font-size: 28px; line-height: 1.2; }
	.wa-trust .wa-trust__lead { font-size: 15px; line-height: 1.5; }
	.wa-trust__stats { margin-top: 22px; }
	.wa-trust__rows { margin: 0 -16px; }
	.wa-trust__row { scroll-padding-left: 16px; }
	.wa-trust:not(.wa-trust--anim) .wa-trust__track { padding: 0 16px; }
	.wa-trust .wa-trust__card { width: 300px; height: 108px; gap: 14px; padding: 12px 14px 12px 12px; border-radius: 18px; }
	.wa-trust__logo { width: 110px; height: 80px; padding: 8px; border-radius: 12px; }
	.wa-trust .wa-trust__logo img { max-height: 62px; }
	.wa-trust__name { font-size: 15px; }
	.wa-trust__desc { font-size: 12px; }
}
@media (max-width: 374px) {
	.wa-trust__stat { padding: 14px 16px; }
	.wa-trust__stat--wide { padding: 14px 16px; }
	.wa-trust .wa-trust__card { width: 280px; }
}

@media (prefers-reduced-motion: reduce) {
	.wa-trust .wa-trust__card { transition: none; }
	.wa-trust--anim .wa-trust__track { animation: none; }
}
