/**
 * Блок «Наш опыт в цифрах»
 * Адаптив без обрезки: без overflow-x на сетке, карточки переносятся по ширине экрана.
 */

.wp-block-acf-experience-stats {
	margin: 0;
	max-width: none !important;
	width: 100%;
	min-width: 0;
}

.amsi-experience-stats {
	--es-navy: #0b132b;
	--es-blue: #0019ff;
	--es-cyan-dot: #48cae4;
	--es-icon-bg: rgba(72, 202, 228, 0.1);
	--es-label: rgba(11, 19, 43, 0.6);
	--es-pad-x: 24px;

	--es-badge-h: 31.982px;
	--es-badge-fs: 12px;
	--es-badge-lh: 16px;
	--es-badge-track: 2.4px;
	--es-badge-dot: 7.996px;
	--es-badge-gap-badge-title: 32px;

	--es-title-fs: 56px;
	--es-title-lh: 70px;
	--es-title-track: -2px;

	--es-header-grid-gap: 63.999px;

	--es-card-w: 227.2px;
	--es-card-min-h: 257.473px;
	--es-card-radius: 24px;
	--es-card-border-w: 0.749px;
	--es-card-border: rgba(11, 19, 43, 0.04);
	--es-card-shadow: 0 8px 30px rgba(0, 0, 0, 0.04);

	--es-icon-wrap: 63.999px;
	--es-icon-inner: 31.994px;
	--es-icon-radius: 16px;
	--es-card-pt: 31.99px;
	--es-icon-mb: 24px;
	--es-metric-mb: 8px;

	--es-metric-fs: 50px;
	--es-metric-lh: 56px;

	--es-label-fs: 14px;
	--es-label-lh: 20px;
	--es-label-track: 0.7px;

	--es-grid-gap: 24px;
	--es-grid-max-w: 1232px;

	position: relative;
	overflow-x: visible;
	overflow-y: visible;
	width: 100%;
	max-width: none;
	min-width: 0;
	background: #fff;
	color: var(--es-navy);
	font-family: var(--amsi-font, "Montserrat", system-ui, sans-serif);
	padding-top: 95.99px;
	padding-bottom: 95.99px;
}

.amsi-experience-stats::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	width: min(384px, 100vw);
	height: min(384px, 100vw);
	max-width: 100%;
	border-radius: 50%;
	background: rgba(72, 202, 228, 0.05);
	filter: blur(100px);
	pointer-events: none;
	z-index: 0;
}

.amsi-experience-stats__inner {
	position: relative;
	z-index: 1;
	box-sizing: border-box;
	width: 100%;
	max-width: none;
	min-width: 0;
	margin-left: auto;
	margin-right: auto;
	padding-left: var(--es-pad-x);
	padding-right: var(--es-pad-x);
}

.amsi-experience-stats__header {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	margin-bottom: var(--es-header-grid-gap);
	max-width: 100%;
	min-width: 0;
}

.amsi-experience-stats__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	box-sizing: border-box;
	width: max-content;
	max-width: 100%;
	min-height: var(--es-badge-h);
	height: auto;
	margin: 0 0 var(--es-badge-gap-badge-title);
	padding: 0.35rem 1.5rem;
	border-radius: 9999px;
	background: var(--es-blue);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.1);
	font-size: var(--es-badge-fs);
	font-weight: 700;
	line-height: var(--es-badge-lh);
	letter-spacing: var(--es-badge-track);
	text-transform: uppercase;
	color: #fff;
	white-space: normal;
	text-align: center;
}

.amsi-experience-stats__badge-dot {
	flex-shrink: 0;
	width: var(--es-badge-dot);
	height: var(--es-badge-dot);
	border-radius: 50%;
	background: var(--es-cyan-dot);
}

.amsi-experience-stats__badge-text {
	min-width: 0;
	max-width: 100%;
	white-space: normal;
	text-wrap: balance;
}

.amsi-experience-stats__title {
	margin: 0;
	padding: 0;
	max-width: 100%;
	min-width: 0;
	width: 100%;
	font-size: var(--es-title-fs);
	font-weight: 700;
	line-height: var(--es-title-lh);
	letter-spacing: var(--es-title-track);
	color: var(--es-navy);
	text-align: center;
	text-wrap: balance;
}

/* Ряд карточек: ≥640px — grid (одинаковая высота в строке), мобилка — flex (центр неполного ряда) */
.amsi-experience-stats__grid {
	--es-m-gap: 12px;

	list-style: none;
	margin: 0 auto;
	padding: 0;
	gap: var(--es-m-gap);
	width: 100%;
	max-width: var(--es-grid-max-w);
	min-width: 0;
	box-sizing: border-box;
}

@media (min-width: 640px) {
	.amsi-experience-stats__grid {
		display: grid;
		align-items: stretch;
		grid-template-columns: repeat(auto-fit, minmax(min(100%, var(--es-card-w)), 1fr));
	}
}

@media (max-width: 639px) {
	.amsi-experience-stats__grid {
		display: flex;
		flex-wrap: wrap;
		justify-content: center;
		align-items: stretch;
	}
}

@media (min-width: 640px) and (max-width: 1279px) {
	.amsi-experience-stats__grid {
		gap: clamp(16px, 2.5vw, 24px);
	}
}

@media (min-width: 1280px) {
	.amsi-experience-stats__grid {
		gap: var(--es-grid-gap);
	}
}

.amsi-experience-stats__card {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: center;
	width: 100%;
	min-width: 0;
	max-width: min(var(--es-card-w), 100%);
	min-height: var(--es-card-min-h);
	padding: var(--es-card-pt) 8px 53px;
	border: var(--es-card-border-w) solid var(--es-card-border);
	border-radius: var(--es-card-radius);
	background: #fff;
	box-shadow: var(--es-card-shadow);
	text-align: center;
}

@media (min-width: 640px) {
	.amsi-experience-stats__card {
		margin-left: auto;
		margin-right: auto;
	}
}

.amsi-experience-stats__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: var(--es-icon-wrap);
	height: var(--es-icon-wrap);
	max-width: 100%;
	margin: 0 0 var(--es-icon-mb);
	padding: 0;
	border-radius: var(--es-icon-radius);
	background: var(--es-icon-bg);
}

.amsi-experience-stats__icon-img {
	display: block;
	width: var(--es-icon-inner);
	height: var(--es-icon-inner);
	max-width: 100%;
	object-fit: contain;
	object-position: center;
}

.amsi-experience-stats__metric {
	margin: 0;
	padding: 0;
	font-size: var(--es-metric-fs);
	font-weight: 700;
	line-height: var(--es-metric-lh);
	color: var(--es-blue);
	flex-shrink: 0;
	max-width: 100%;
	word-break: break-word;
}

/* WYSIWYG: без сброса <p> внутри metric даёт лишний отступ до label */
.amsi-experience-stats__metric p,
.amsi-experience-stats__label p {
	margin: 0;
}

.amsi-experience-stats__label {
	margin: 0;
	margin-top: auto;
	padding-top: var(--es-metric-mb);
	max-width: 100%;
	font-size: var(--es-label-fs);
	font-weight: 600;
	line-height: var(--es-label-lh);
	letter-spacing: var(--es-label-track);
	text-transform: uppercase;
	color: var(--es-label);
	flex-shrink: 0;
	overflow-wrap: normal;
	word-break: normal;
	hyphens: none;
}

/* ---------- Общие правки <1280 ---------- */
@media (max-width: 1279px) {
	.amsi-experience-stats {
		padding-top: clamp(56px, 10vw, 96px);
		padding-bottom: clamp(56px, 10vw, 96px);
	}

	.amsi-experience-stats::before {
		width: min(280px, 90vw);
		height: min(280px, 90vw);
		filter: blur(80px);
	}

	.amsi-experience-stats__header {
		margin-bottom: clamp(36px, 7vw, 64px);
	}
}

/* Заголовок: узкие экраны — перенос; планшет/десктоп — одна строка + плавный clamp */
@media (max-width: 899px) {
	.amsi-experience-stats__title {
		font-size: clamp(22px, 5vw + 12px, 36px);
		line-height: 1.25;
		letter-spacing: -0.02em;
		white-space: normal;
	}
}

@media (min-width: 900px) and (max-width: 1279px) {
	.amsi-experience-stats__title {
		white-space: nowrap;
		font-size: clamp(36px, 3.2vw + 14px, 56px);
		line-height: 1.2;
		letter-spacing: var(--es-title-track);
		max-width: 100%;
	}
}

@media (min-width: 1280px) {
	.amsi-experience-stats__title {
		white-space: nowrap;
		font-size: var(--es-title-fs);
		line-height: var(--es-title-lh);
		letter-spacing: var(--es-title-track);
	}
}

@media (min-width: 768px) and (max-width: 1279px) {
	.amsi-experience-stats {
		--es-pad-x: 20px;
	}

	.amsi-experience-stats__card {
		min-height: clamp(220px, 36vw, var(--es-card-min-h));
		padding-top: clamp(24px, 3.5vw, 32px);
		padding-bottom: clamp(36px, 5vw, 53px);
	}

	.amsi-experience-stats__metric {
		font-size: clamp(34px, 4vw, 50px);
		line-height: 1.12;
	}
}

/* Мобилка ≤639: 2 в ряд, лишние строки по центру */
@media (max-width: 639px) {
	.amsi-experience-stats {
		--es-pad-x: 16px;
		padding-top: 48px;
		padding-bottom: 48px;
	}

	.amsi-experience-stats__header {
		margin-bottom: 32px;
	}

	.amsi-experience-stats__badge {
		margin-bottom: 24px;
		padding: 8px 16px;
		white-space: normal;
		text-align: center;
		font-size: 11px;
		line-height: 1.35;
		letter-spacing: 0.18em;
		min-height: 0;
	}

	.amsi-experience-stats__badge-dot {
		width: 6px;
		height: 6px;
	}

	.amsi-experience-stats__title {
		font-size: clamp(22px, 6.5vw, 30px);
		line-height: 1.2;
		letter-spacing: -0.03em;
	}

	.amsi-experience-stats__card {
		flex: 1 1 calc((100% - var(--es-m-gap)) / 2);
		max-width: calc((100% - var(--es-m-gap)) / 2);
		min-height: 0;
		align-self: stretch;
		padding: 24px 12px 28px;
		border-radius: 20px;
	}

	.amsi-experience-stats__icon {
		width: 56px;
		height: 56px;
		margin-bottom: 20px;
		border-radius: 14px;
	}

	.amsi-experience-stats__icon-img {
		width: 28px;
		height: 28px;
	}

	.amsi-experience-stats__metric {
		font-size: clamp(28px, 8vw, 44px);
		line-height: 1.1;
	}

	.amsi-experience-stats__label {
		font-size: 12px;
		line-height: 1.4;
		letter-spacing: 0.06em;
		padding-top: 8px;
	}
}

@media (max-width: 380px) {
	.amsi-experience-stats__title {
		font-size: 20px;
	}
}
