/* stats.css v1.0.4 — multiple card styles; size & base color from CMS Stats Head */

/* ---------- Section & container ---------- */

.stats-section {
  position: relative;
  background: #fafafa;
}

.stats-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.25rem; /* fallback when head doesn't set padding */
}

/* Optional title wrapper */
.stats-head { margin-bottom: 1.5rem; }

.stats-title {
  margin: 0;
  font-size: 2rem;
  line-height: 1.2;
  font-weight: 800;
  text-align: center; /* overridden inline if head.title_align is set */
}

/* ---------- Grid layout ---------- */

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.25rem;
  justify-items: center;
}

/* ---------- Base card, shared by all styles ---------- */

.stats-card {
  width: 100%;
  max-width: 320px;          /* overridden inline by Head.card_width */
  border-radius: 16px;
  padding: 1.5rem;
  text-align: center;
  box-sizing: border-box;
  position: relative;
  transition:
    transform .18s ease,
    box-shadow .18s ease,
    background .18s ease,
    border-color .18s ease;
}

/* Label & value shared defaults (child overrides via inline) */
.stats-label  {
  margin: .25rem 0 0 0;
  font-size: 1.3rem;
  line-height: 1.4;
  font-weight: 800;
  color: #111827;
}

.stats-value {
  margin: .75rem 0 0 0;
  font-size: 1.2rem;
  line-height: 1.4;
  font-weight: 500;
  color: #374151;
  opacity: .95;
}

/* ---------- STYLE: simple ---------- */

.stats-card--simple {
  background: #ffffff;                   /* Head.card_bg_color overrides if set */
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}

.stats-card--simple:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 18px rgba(0,0,0,0.12);
}

/* ---------- STYLE: glass ---------- */

.stats-card--glass {
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.40);
  box-shadow: 0 18px 45px rgba(15, 23, 42, 0.30);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.stats-card--glass:hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 24px 55px rgba(15, 23, 42, 0.40);
}

/* ---------- STYLE: gradient ---------- */

.stats-card--gradient {
  background-image: linear-gradient(135deg, #2563eb, #1e40af);
  border: 1px solid rgba(15, 23, 42, 0.25);
  box-shadow: 0 18px 38px rgba(37, 99, 235, 0.45);
  color: #ffffff;
}

.stats-card--gradient .stats-label,
.stats-card--gradient .stats-value {
  color: #ffffff !important;
}

.stats-card--gradient:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 60px rgba(30, 64, 175, 0.60);
}

/* ---------- STYLE: neumorph ---------- */

.stats-card--neumorph {
  background: #e8eff5;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.7);
  box-shadow:
    7px 7px 15px rgba(15, 23, 42, 0.20),
    -7px -7px 15px rgba(255, 255, 255, 0.90);
}

.stats-card--neumorph:hover {
  transform: translateY(-2px);
  box-shadow:
    4px 4px 10px rgba(15, 23, 42, 0.25),
    -4px -4px 10px rgba(255, 255, 255, 0.95);
}

.stats-card--neumorph .stats-label {
  font-weight: 700;
}
.stats-card--neumorph .stats-value {
  font-weight: 600;
}

/* ---------- STYLE: flip ---------- */

.stats-card--flip {
  padding: 0;
  border-radius: 18px;
  background: transparent;
  border: none;
  perspective: 1000px;
  box-shadow: none;
}

.stats-card--flip:hover {
  transform: none; /* flip handled by inner element */
}

.stats-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 140px;
  transform-style: preserve-3d;
  transition: transform 0.6s ease;
  border-radius: inherit;
}

.stats-card--flip:hover .stats-card-inner {
  transform: rotateY(180deg);
}

.stats-card-face {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  backface-visibility: hidden;
  box-sizing: border-box;
}

/* front = label */
.stats-card-front {
  background: #1d4ed8;
  color: #ffffff;
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.45);
}

/* back = value */
.stats-card-back {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.25);
  transform: rotateY(180deg);
}

.stats-card-front .stats-label {
  margin: 0;
  color: #ffffff;
}

.stats-card-back .stats-value {
  margin: 0;
}

/* ---------- Mobile niceties ---------- */

@media (max-width: 640px) {
  .stats-container { padding: 2rem 1rem; }
  .stats-title { font-size: 1.75rem; }
  .stats-value { font-size: 1.75rem; }
}
