/* ─── Stats — Themeable via CSS variables ─────────────────────────────────────
   Variables are set by JS on the root container element.
   ─────────────────────────────────────────────────────────────────────────── */

/* ─── Container ──────────────────────────────────────────────────────────── */

[data-stats] {
  font-family: var(--stats-font, system-ui, -apple-system, 'Segoe UI', sans-serif);
  color: var(--stats-text, #1a1a1a);
}

.stats-wrap {
  width: 100%;
}

/* ─── Grid ───────────────────────────────────────────────────────────────── */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(var(--stats-cols, 4), 1fr);
  gap: 24px;
}

/* ─── Item ───────────────────────────────────────────────────────────────── */

.stats-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 36px 24px;
  background: var(--stats-surface, #fff);
  border-radius: 16px;
  gap: 8px;
  border: 2.5px solid rgba(27, 77, 110, 0.15);
  transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.stats-item:hover {
  border-color: rgba(27, 77, 110, 0.35);
  box-shadow: 0 12px 32px -6px rgba(27, 77, 110, 0.18), 0 0 20px rgba(27, 77, 110, 0.06);
  transform: translateY(-5px);
}

/* ─── Value ──────────────────────────────────────────────────────────────── */

.stats-value-wrap {
  line-height: 1;
}

.stats-value {
  font-size: clamp(40px, 6vw, 60px);
  font-weight: 800;
  color: var(--stats-primary, #1a1a1a);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  transition: none;
  /* JS handles animation */
}

/* ─── Label ──────────────────────────────────────────────────────────────── */

.stats-label {
  font-size: 15px;
  font-weight: 600;
  color: var(--stats-text, #1a1a1a);
  line-height: 1.35;
}

/* ─── Optional description ───────────────────────────────────────────────── */

.stats-description {
  font-size: 13px;
  color: var(--stats-muted, #666);
  line-height: 1.5;
}

/* ─── Responsive ─────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 400px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 14px;
  }

  .stats-item {
    padding: 22px 14px;
  }

  .stats-value {
    font-size: 32px;
  }
}