/**
 * "Give with confidence" — the bits theme.json can't express: the circular
 * badge icons (one filled "98%" variant), the hairline-divided badge row, the
 * endorsement card and its carousel dots. Loaded only when the section is on
 * the page.
 *
 * Greys/blues here are neutral shades taken from the comp; kept as scoped
 * component tokens rather than polluting the global palette.
 */
.ab-trust-badges {
	--ab-fig: #52525b;        /* badge title */
	--ab-label: #6b6b73;      /* small uppercase label */
	--ab-badge-line: #e4ded5; /* dividers between badges (warm) */
	--ab-card-line: #e9e9eb;  /* endorsement card border */
	--ab-icon-bg: #e6f1f9;    /* light-blue icon disc */
	--ab-quote: #6d6d6d;      /* endorsement quote */
	--ab-name: #2c2c33;       /* endorsement name */
}

/* ---- Badge row: 4 across, hairline between, no card chrome ---------------- */
.ab-trust-row {
	margin-top: clamp(2rem, 4vw, 3.25rem);
}

.ab-trust-badge {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.85rem;
	padding: 0.25rem 0.75rem;
	text-align: center;
}

.ab-trust-badge + .ab-trust-badge {
	border-left: 1px solid var(--ab-badge-line);
}

.ab-trust-badge__icon {
	flex: 0 0 auto;
	width: 52px;
	height: 52px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--ab-icon-bg);
	color: var(--wp--preset--color--ab-blue);
}

.ab-trust-badge__icon svg {
	width: 26px;
	height: 26px;
}

/* The "98%" disc: solid blue with white figure instead of an icon. */
.ab-trust-badge__icon--fill {
	background: var(--wp--preset--color--ab-blue);
	color: #fff;
	font-family: var(--wp--preset--font-family--sans);
	font-weight: 700;
	font-size: 1rem;
	letter-spacing: -0.01em;
}

.ab-trust-badge__title {
	margin: 0;
	color: var(--ab-fig);
	font-weight: 600;
	font-size: 1rem;
	line-height: 1.25;
}

.ab-trust-badge__label {
	margin: 0;
	color: var(--ab-label);
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* ---- Endorsement card + slider ------------------------------------------- */
.ab-endorse {
	background: #fff;
	border: 1px solid var(--ab-card-line);
	border-radius: 16px;
	padding: clamp(1.5rem, 2.6vw, 2.25rem);
	box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

/* One slide wide; the rest are clipped until the script (or a swipe) advances
   the track. Default (pre-JS) state already shows just the first slide. */
.ab-endorse__viewport {
	overflow: hidden;
}

.ab-endorse__track {
	display: flex;
}

.ab-endorse-slider.is-ready .ab-endorse__track {
	transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.ab-endorse__slide {
	flex: 0 0 100%;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--40);
}

.ab-endorse__person {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
}

.ab-endorse__avatar {
	display: block;
	width: 84px;
	height: 84px;
	border-radius: 50%;
	background-color: var(--wp--preset--color--ab-surface);
	background-size: cover;
	background-position: center;
	/* A border (inside the box) rather than a box-shadow ring, so an off-screen
	   slide's avatar can't bleed past the clipped viewport edge. */
	border: 1px solid var(--ab-card-line);
}

.ab-endorse__quote {
	margin: 0;
	color: var(--ab-quote);
	font-family: var(--wp--preset--font-family--serif);
	font-style: italic;
	font-size: 1.0625rem;
	line-height: 1.55;
}

.ab-endorse__name {
	margin: 0;
	color: var(--ab-name);
	font-weight: 700;
	font-size: 1.0625rem;
}

.ab-endorse__role {
	margin: 0;
	color: var(--wp--preset--color--ab-muted);
	font-size: 0.875rem;
}

.ab-endorse__dots {
	display: flex;
	align-items: center;
	gap: 7px;
	margin-top: 1.75rem;
}

/* Dots are <button>s built by the script — reset the native chrome. */
.ab-endorse__dot {
	appearance: none;
	-webkit-appearance: none;
	border: 0;
	padding: 0;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #d4d4d8;
	cursor: pointer;
	transition: width 0.25s ease, background 0.25s ease;
}

.ab-endorse__dot:hover {
	background: #b9bac0;
}

.ab-endorse__dot:focus-visible {
	outline: 2px solid var(--wp--preset--color--ab-blue);
	outline-offset: 2px;
}

.ab-endorse__dot.is-active {
	width: 22px;
	border-radius: 4px;
	background: var(--wp--preset--color--ab-blue);
}

/* Visually-hidden live region announcing the current slide. */
.ab-endorse__live {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* ---- Responsive ---------------------------------------------------------- */
@media (max-width: 600px) {
	.ab-trust-row {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
	}
	.ab-trust-badge {
		border-left: none;
		padding: 1.25rem 0.5rem;
	}
	.ab-trust-badge:nth-child(even) {
		border-left: 1px solid var(--ab-badge-line);
	}
	.ab-trust-badge:nth-child(n + 3) {
		border-top: 1px solid var(--ab-badge-line);
	}
}
