/* =================================================================
   AFMedia – Stats Counter Widget (WPBakery)
   ================================================================= */

/* ---------- CSS Variables (fallback) ---------- */
.afm-stats-section {
	--afm-accent:      #f07d00;
	--afm-card-bg:     #1f2937;
	--afm-card-border: #374151;
	--afm-title:       #ffffff;
	--afm-subtitle:    #9ca3af;
	--afm-label:       #ffffff;
	--afm-desc:        #6b7280;
}

/* ---------- Sekcja ---------- */
.afm-stats-section {
	background-color: #111827;
	width: 100%;
	box-sizing: border-box;
	padding: 80px 40px;
}

.afm-stats-inner {
	max-width: 1200px;
	margin: 0 auto;
	width: 100%;
}

/* ---------- Nagłówek ---------- */
.afm-stats-header {
	text-align: center;
	margin-bottom: 56px;
}

/* H2 i H4 dziedziczą styl z motywu Kudos – kolor ustawiony inline przez span */
.afm-stats-header h2 {
	margin: 0 0 16px;
}

.afm-stats-header h4 {
	margin: 40px auto 40px;
	font-weight: 400;
}

.afm-stats-title-divider {
	width: 56px;
	height: 4px;
	background: linear-gradient(90deg, var(--afm-accent), #fbb040);
	border-radius: 2px;
	margin: 0 auto;
}

/* ---------- Grid ---------- */
.afm-stats-grid {
	display: grid;
	gap: 24px;
}

.afm-grid-2 { grid-template-columns: repeat(2, 1fr); }
.afm-grid-3 { grid-template-columns: repeat(3, 1fr); }
.afm-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* ---------- Karta – domyślnie WIDOCZNA ---------- */
.afm-stat-card {
	background-color: var(--afm-card-bg);
	border: 1px solid var(--afm-card-border);
	border-radius: 12px;
	padding: 36px 28px;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	position: relative;
	overflow: hidden;
	opacity: 1;
	transform: translateY(0);
	transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

/* Pseudo-element hover glow */
.afm-stat-card::before {
	content: '';
	position: absolute;
	inset: 0;
	background: radial-gradient(ellipse at 50% 0%, rgba(240,125,0,.09) 0%, transparent 70%);
	opacity: 0;
	transition: opacity 0.4s ease;
	pointer-events: none;
}

/* ---------- Animacja – TYLKO gdy JS załadował (klasa na gridzie) ---------- */
.afm-stats-grid.afm-js-ready .afm-stat-card {
	opacity: 0;
	transform: translateY(24px);
}

.afm-stat-card.afm-animated {
	animation: afmFadeUp 0.55s ease forwards;
}

@keyframes afmFadeUp {
	to { opacity: 1; transform: translateY(0); }
}

.afm-stat-card:nth-child(1) { animation-delay: .05s; }
.afm-stat-card:nth-child(2) { animation-delay: .12s; }
.afm-stat-card:nth-child(3) { animation-delay: .19s; }
.afm-stat-card:nth-child(4) { animation-delay: .26s; }
.afm-stat-card:nth-child(5) { animation-delay: .33s; }
.afm-stat-card:nth-child(6) { animation-delay: .40s; }
.afm-stat-card:nth-child(7) { animation-delay: .47s; }
.afm-stat-card:nth-child(8) { animation-delay: .54s; }

/* ---------- Hover ---------- */
.afm-hover-lift:hover {
	transform: translateY(-6px);
	box-shadow: 0 20px 40px rgba(0,0,0,.35);
	border-color: rgba(240,125,0,.4);
}
.afm-hover-lift:hover::before { opacity: 1; }

/* ---------- Ikona ---------- */
.afm-stat-icon {
	margin-bottom: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 64px;
	height: 64px;
	background: rgba(240,125,0,.1);
	border-radius: 50%;
	flex-shrink: 0;
}

.afm-stat-icon i {
	color: var(--afm-accent);
	font-size: 28px;
	line-height: 1;
}

/* ---------- Liczba ---------- */
.afm-stat-number-wrap {
	display: flex;
	align-items: baseline;
	justify-content: center;
	gap: 2px;
	margin-bottom: 16px;
}

.afm-stat-number {
	color: var(--afm-accent);
	font-size: 52px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: -0.03em;
	font-variant-numeric: tabular-nums;
}

.afm-stat-prefix,
.afm-stat-suffix {
	//font-size: 1em;
	font-weight: 800;
}

/* ---------- Separator ---------- */
.afm-stat-divider {
	width: 36px;
	height: 3px;
	background-color: var(--afm-accent);
	border-radius: 2px;
	margin: 0 auto 14px;
	flex-shrink: 0;
}

/* ---------- Etykieta i opis ---------- */
.afm-stat-label {
	color: var(--afm-label);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .04em;
	font-size: .85rem;
	line-height: 1.4;
	margin: 0 0 6px;
}

.afm-stat-desc {
	color: var(--afm-desc);
	font-size: .82rem;
	line-height: 1.5;
	margin: 0;
}

/* ---------- Responsywność ---------- */
@media (max-width: 1024px) {
	.afm-grid-4 { grid-template-columns: repeat(2, 1fr); }
	.afm-stats-title { font-size: 1.9rem; }
}

@media (max-width: 768px) {
	.afm-stats-section { padding: 60px 24px; }
	.afm-grid-3,
	.afm-grid-4 { grid-template-columns: repeat(2, 1fr); }
	.afm-stat-number { font-size: 42px; }
	.afm-stats-title { font-size: 1.6rem; }
}

@media (max-width: 480px) {
	.afm-stats-section { padding: 48px 16px; }
	.afm-grid-2,
	.afm-grid-3,
	.afm-grid-4 { grid-template-columns: 1fr 1fr; }
	.afm-stat-card { padding: 24px 16px; }
	.afm-stat-number { font-size: 34px; }
	.afm-stats-title { font-size: 1.4rem; }
}

@media (max-width: 360px) {
	.afm-grid-2,
	.afm-grid-3,
	.afm-grid-4 { grid-template-columns: 1fr; }
}
