/**
 * Stats Section — index.html
 */

.stats-section {
  padding: 100px 0;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
}

.stats-section *,
.stats-section *::before,
.stats-section *::after {
  box-sizing: inherit;
}

.stats-section.vsw-stats-section--width-boxed {
  width: 100%;
  max-width: var(--vsw-stats-max-width, 1200px);
  margin-left: auto;
  margin-right: auto;
}

.stats-section.vsw-stats-section--width-full {
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
}

.stats-section .vsw-stats-inner {
  width: 100%;
  max-width: var(--vsw-stats-max-width, 1200px);
  margin: 0 auto;
  padding-left: var(--vsw-stats-padding-x, 20px);
  padding-right: var(--vsw-stats-padding-x, 20px);
}

.stats-section.vsw-stats-section--width-boxed .vsw-stats-inner {
  max-width: 100%;
}

.stats-section .stats-bg {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--vsw-stats-bg-start, #e63946) 0%, var(--vsw-stats-bg-end, #c1121f) 100%);
  z-index: 0;
}

.stats-section .stats-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 50%, rgba(0, 0, 0, 0.2) 0%, transparent 50%);
  pointer-events: none;
}

.stats-section.vsw-stats-section--no-overlay .stats-bg::after {
  display: none;
}

.stats-section.vsw-stats-section--no-bg {
  background: transparent;
}

.stats-section .stats-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(var(--vsw-stats-cols, 4), minmax(0, 1fr));
  gap: var(--vsw-stats-gap, 32px);
  text-align: center;
}

.stats-section .stat-item-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.stats-section .stat-item .num {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 900;
  color: #fff;
  line-height: 1;
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}

.stats-section .stat-item .num-prefix,
.stats-section .stat-item .num-value,
.stats-section .stat-item .num-suffix {
  display: inline;
}

.stats-section .stat-item .num-prefix,
.stats-section .stat-item .num-suffix {
  font-weight: inherit;
  line-height: inherit;
}

.stats-section .stat-item .label {
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 500;
}

.stats-section .stat-item .divider {
  width: 40px;
  height: 3px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 2px;
  margin: 16px auto 0;
}

/* Vertical dividers between columns (opt-in) */
.stats-section.vsw-stats-section--between-dividers .stats-grid > .stat-item,
.stats-section.vsw-stats-section--between-dividers .stats-grid > .stat-item-link {
  position: relative;
}

.stats-section.vsw-stats-section--between-dividers .stats-grid > .stat-item:not(:last-child)::after,
.stats-section.vsw-stats-section--between-dividers .stats-grid > .stat-item-link:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 50%;
  right: calc(var(--vsw-stats-gap, 32px) / -2);
  transform: translate(50%, -50%);
  width: var(--vsw-stats-between-divider-w, 1px);
  height: var(--vsw-stats-between-divider-h, 60%);
  background: var(--vsw-stats-between-divider-color, rgba(255, 255, 255, 0.3));
  pointer-events: none;
  z-index: 1;
}

/* Hide line at end of each row (default 4-col desktop / 2-col tablet+) */
.stats-section.vsw-stats-section--between-dividers .stats-grid > .stat-item:nth-child(4n)::after,
.stats-section.vsw-stats-section--between-dividers .stats-grid > .stat-item-link:nth-child(4n)::after {
  display: none;
}

@media (max-width: 1024px) {
  .stats-section.vsw-stats-section--between-dividers .stats-grid > .stat-item:nth-child(4n)::after,
  .stats-section.vsw-stats-section--between-dividers .stats-grid > .stat-item-link:nth-child(4n)::after {
    display: block;
  }

  .stats-section.vsw-stats-section--between-dividers .stats-grid > .stat-item:nth-child(even)::after,
  .stats-section.vsw-stats-section--between-dividers .stats-grid > .stat-item-link:nth-child(even)::after {
    display: none;
  }
}

/* Optional icon (above number) */
.stats-section .stat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--vsw-stats-icon-size, 64px);
  height: var(--vsw-stats-icon-size, 64px);
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: var(--vsw-stats-icon-font, 28px);
  line-height: 1;
}

.stats-section .stat-icon svg {
  width: 1em;
  height: 1em;
  display: block;
}

.stats-section .stat-icon img {
  width: 1.2em;
  height: 1.2em;
  object-fit: contain;
  display: block;
}

/* Scroll reveal — index.html */
.stats-section .reveal {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.stats-section .reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.stats-section .reveal-delay-1 { transition-delay: 0.1s; }
.stats-section .reveal-delay-2 { transition-delay: 0.2s; }
.stats-section .reveal-delay-3 { transition-delay: 0.3s; }
.stats-section .reveal-delay-4 { transition-delay: 0.4s; }

@media (max-width: 1024px) {
  .stats-section .stats-grid {
    grid-template-columns: repeat(var(--vsw-stats-cols-tablet, 2), minmax(0, 1fr));
    gap: var(--vsw-stats-gap-tablet, 40px);
  }
}

@media (max-width: 767px) {
  .stats-section .stats-grid {
    grid-template-columns: repeat(var(--vsw-stats-cols-mobile, 2), minmax(0, 1fr));
  }
}

@media (prefers-reduced-motion: reduce) {
  .stats-section .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
