/* By the Numbers section styling */
.by-the-numbers-section {
  position: relative;
  width: 100%;
  background: none; /* Removed background color to show the SVG properly */
  padding: 0 0 2rem;
  overflow: hidden;
  margin-top: -40px;
}

/* Remove curved bottom edge */
.by-the-numbers-section::after {
  display: none; /* Hide the curved bottom edge */
}

/* Hide the original wedge SVG approach */
.wedge-top {
  display: none;
}

/* Header styling with unified SVG */
.by-the-numbers-header {
  position: relative;
  margin-bottom: 0; /* Removed margin */
  padding-top: 200px; /* Space for the header SVG */
  text-align: center;
  z-index: 10; /* Send header behind content */
}

.by-the-numbers-header-svg {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 1729px; /* Match the SVG width from Figma */
  height: auto;
  z-index: 1;
}

.by-the-numbers-title {
  font-family: 'Red Hat Text', sans-serif; /* Theme font */
  font-style: normal;
  font-weight: 600;
  font-size: 18px; /* Reduced from 24px to 18px */
  line-height: 24px; /* Reduced from 32px to 24px */
  color: #062E61;
  white-space: nowrap;
  text-align: center;
  display: inline-block;
  width: auto;
  position: absolute;
  z-index: 2;
  margin: 0;
  padding: 0 20px;
  top: 120px; /* Moved up by 30px from original 150px */
  left: 50%;
  transform: translateX(-50%);
}

/* Hide the original line containers */
.right-line-container,
.left-line-container {
  display: none;
}

/* Center icon circle */
.center-icon-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
}

.center-icon-circle {
  width: 127px;
  height: 127px;
  background-color: #155197;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.center-icon-circle svg {
  width: 127px;
  height: 100px;
}

/* Stats styling */
.stats-row {
  margin-top: 20px; /* Reduced since we're handling spacing in the header */
  margin-bottom: 20px;
}

.stat-circle {
  width: 200px; /* Reduced from 314px */
  height: 200px; /* Reduced from 314px */
  background-color: #062E61 !important; /* Enforced blue background */
  border-radius: 50%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2); /* Added shadow for depth */
}

/* Stat icons */
.stat-icon {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  top: 50px; /* Increased from 30px to maintain proper spacing */
}

.stat-icon img {
  width: 128px; /* Fixed width instead of max-width */
  height: 100px; /* Fixed height instead of max-height */
  object-fit: contain; /* Maintain aspect ratio while fitting within dimensions */
  z-index: 1;
}

/* Specific icon adjustments to ensure consistent visual weight */
.healthcare-coalitions-icon img {
  width: 128px;
  height: 100px;
}

.ndms-missions-icon img {
  width: 128px;
  height: 100px;
}

/* Special handling for the 300,000 stat which has two icons that should be treated as one */
.mrc-volunteers-icon img {
  width: 128px;
  height: 100px;
  /* Ensure the combined icon is properly positioned */
  object-position: center;
}

.stat-number {
  font-family: 'Open Sans','Prata', serif;
  font-weight: bold;
  font-size: 36px; /* Reduced from 50px */
  line-height: 48px; /* Reduced from 68px */
  color: #FFFFFF;
  letter-spacing: 0.05em;
  text-align: center;
  display: block;
  align-items: center;
  justify-content: center;
  z-index: 2;
  position: relative;
  width: 100%;
  margin-top: -70px; /* Increased from -60px to position numbers higher */
}

.stat-number span {
  display: block;
  font-size: 18px;
  line-height: 1;
  width: 100%;
  text-align: center;
  padding: 0 10px;
}

.stat-description {
  font-family: 'Red Hat Text', sans-serif; /* Theme font */
  font-style: normal;
  font-weight: 400;
  font-size: 16px; /* Reduced from 18px */
  line-height: 20px; /* Reduced from 24px for tighter spacing */
  text-align: center;
  color: #000000;
  margin-top: 1rem;
  padding: 0 1rem;
  /* get rid of the ellipsis */
  /* max-height: 80px; /* Adjusted for new line height (20px * 4)
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  line-clamp: 4; Standard property for compatibility */
  -webkit-box-orient: vertical;
  max-width: 350px; /* Limit width to ensure text wraps properly */
  margin-left: auto;
  margin-right: auto;
}

.learn-more-link {
  text-align: right; /* Changed from center to right */
  margin-top: 0.5rem; /* Reduced from 1rem to 0.5rem (approximately 15px less) */
  padding-right: 1rem; /* Added padding to prevent text from touching the edge */
  margin-bottom: 0.5rem; /* Added to maintain overall spacing */
}

.learn-more-link a {
  font-family: 'Red Hat Text', sans-serif; /* Theme font */
  font-style: normal;
  font-weight: 600;
  font-size: 16px; /* Reduced from 18px */
  line-height: 22px; /* Reduced from 24px */
  color: #005ea2; /* Changed from #062E61 to #005ea2 */
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.learn-more-link a:hover {
  text-decoration: underline;
}

.double-arrow-icon {
  margin-left: 0.5rem;
  width: 18px;
  height: 15px;
  vertical-align: middle;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .stat-circle {
    width: 250px;
    height: 250px;
  }

  .stat-number {
    font-size: 40px;
    line-height: 54px;
  }

  .stat-icon img {
    max-width: 100px;
    max-height: 80px;
  }

  .stat-description {
    font-size: 16px;
    line-height: 20px;
  }
}

@media (max-width: 768px) {
  .by-the-numbers-header {
    flex-direction: column;
  }

  .right-line-container,
  .left-line-container {
    width: 80%;
    max-width: none;
    margin: 1rem 0;
  }

  .by-the-numbers-title {
    margin: 1rem 0;
  }

  .stats-row {
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .tablet\:grid-col-4 {
    margin-bottom: 2rem;
    width: 100%;
    max-width: 100%;
  }
}
