/* CSS for Statistics grid section */
.acf-layout-statistics-grid-section {
  color: var(--color-white);
  position: relative;
  overflow-x: clip;
  overflow-y: visible;
}

.acf-layout-statistics-grid-section::before {
  content: "";
  position: absolute;
  width: 802px;
  height: 802px;
  background-color: #5c489c;
  opacity: 0.35;
  filter: blur(160px);
  top: 60%;
  left: 90%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
}

.acf-layout-statistics-grid-section .container {
  position: relative;
  z-index: 2;
}

.statistics-grid-header {
  margin-bottom: 50px;
}

.statistics-grid-heading {
  margin-bottom: 50px;
  padding: 0 9%;
}

.statistics-grid-content {
  padding: 0 3%;
}

@media (max-width: 768px) {
  .statistics-grid-header {
    margin-bottom: 40px;
  }

  .statistics-grid-heading {
    margin-bottom: 16px;
	  padding: 0;
  }
}

/* Statistics Grid Layout */
.statistics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  position: relative;
  width: 100%;
}

.statistics-grid-item {
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Item 1: Divider borders and highlights */
.statistics-grid-item:nth-child(1) {
  border-right: 1px solid #ffffff40;
  border-bottom: 1px solid #ffffff40;
}
.statistics-grid-item:nth-child(1)::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 50%;
  height: 50%;
  width: 1px;
  background: rgba(255, 255, 255, 0.35);
  z-index: 2;
}
.statistics-grid-item:nth-child(1)::before {
  content: "";
  position: absolute;
  bottom: -1px;
  left: auto;
  right: 0;
  width: 30%;
  height: 1px;
  background: rgba(255, 255, 255, 0.35);
  z-index: 2;
}

/* Item 2: Divider borders and highlights */
.statistics-grid-item:nth-child(2) {
  border-right: 1px solid #ffffff40;
  border-bottom: 1px solid #ffffff40;
}
.statistics-grid-item:nth-child(2)::after {
  content: "";
  position: absolute;
  bottom: -1px;
  top: auto;
  height: 1px;
  left: 0;
  width: 30%;
  background: rgba(255, 255, 255, 0.35);
  z-index: 2;
}
.statistics-grid-item:nth-child(2)::before {
  content: "";
  position: absolute;
  bottom: -1px;
  top: auto;
  height: 1px;
  right: 0;
  width: 30%;
  background: rgba(255, 255, 255, 0.35);
  z-index: 2;
}

/* Item 3: Divider borders and highlights */
.statistics-grid-item:nth-child(3) {
  border-bottom: 1px solid rgb(255 255 255 / 23%);
}
.statistics-grid-item:nth-child(3)::before {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 30%;
  height: 1px;
  background: rgba(255, 255, 255, 0.35);
  z-index: 2;
}

.statistics-grid-item:nth-child(3)::after {
  content: "";
  position: absolute;
  left: -1px;
  top: 50%;
  height: 50%;
  width: 1px;
  background: rgba(255, 255, 255, 0.35);
  z-index: 2;
}

/* Item 4: Divider borders and highlights */
.statistics-grid-item:nth-child(4) {
  border-right: 1px solid rgb(255 255 255 / 23%);
}
.statistics-grid-item:nth-child(4)::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 0;
  height: 50%;
  width: 1px;
  background: rgba(255, 255, 255, 0.35);
  z-index: 2;
}

/* Item 5: Divider borders and highlights */
.statistics-grid-item:nth-child(5) {
  border-right: 1px solid rgb(255 255 255 / 23%);
}
.statistics-grid-item:nth-child(5)::after {
  content: "";
  position: absolute;
  right: -1px;
  top: 0;
  height: 50%;
  width: 1px;
  background: rgba(255, 255, 255, 0.35);
  z-index: 2;
}

/* Item 6: Divider borders and highlights */
.statistics-grid-item:nth-child(6) {
  /* No right or bottom borders on desktop */
}

.statistics-grid-item-text {
  padding: 50px 0;
  margin: 0;
  color: var(--color-white);
  line-height: 1.35;
}
.statistics-grid-item-text p {
  margin: 0;
}

@media (max-width: 991px) {
  .acf-layout-statistics-grid-section::before {
    display: none;
  }

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

  .statistics-grid-item-text {
    padding: 40px 30px;
    font-weight: 600;
    font-size: 18px;
    line-height: 120%;
    letter-spacing: 0%;
    text-align: center;
    text-transform: capitalize;
  }

  /* Reset all desktop borders and pseudo-elements */
  .statistics-grid-item,
  .statistics-grid-item:nth-child(n) {
    border-right: none;
    border-bottom: none;
  }

  .statistics-grid-item::before,
  .statistics-grid-item::after,
  .statistics-grid-item:nth-child(n)::before,
  .statistics-grid-item:nth-child(n)::after {
    content: none;
    display: none;
  }

  /* Apply mobile grid borders */
  /* Left column items get a right border */
  .statistics-grid-item:nth-child(odd) {
    border-right: 1px solid rgb(255 255 255 / 23%);
  }

  /* Rows 1 and 2 get a bottom border */
  .statistics-grid-item:nth-child(-n + 4) {
    border-bottom: 1px solid rgb(255 255 255 / 23%);
  }

  /* Apply mobile highlights */
  /* Item 1 (Row 1 Left) */
  .statistics-grid-item:nth-child(1)::before {
    content: "";
    display: block;
    position: absolute;
    bottom: -1px;
    right: 0;
    width: 20%;
    height: 2px;
    background: rgba(255, 255, 255, 0.35);
    z-index: 2;
  }
  .statistics-grid-item:nth-child(1)::after {
    content: "";
    display: block;
    position: absolute;
    right: -1px;
    top: auto;
    bottom: 0;
    height: 30%;
    width: 2px;
    background: rgba(255, 255, 255, 0.35);
    z-index: 2;
  }

  /* Item 2 (Row 1 Right) */
  .statistics-grid-item:nth-child(2)::before {
    content: "";
    display: block;
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 20%;
    height: 2px;
    background: rgba(255, 255, 255, 0.35);
    z-index: 2;
  }

  /* Item 3 (Row 2 Left) */
  .statistics-grid-item:nth-child(3)::before {
    content: "";
    display: block;
    position: absolute;
    right: -1px;
    top: 0;
    height: 30%;
    width: 2px;
    background: rgba(255, 255, 255, 0.35);
    z-index: 2;
    left: auto;
  }

  .statistics-grid-item:nth-child(4)::before {
    content: "";
    display: block;
    position: absolute;
    left: -1px;
    top: auto;
    bottom: 0;
    height: 30%;
    width: 2px;
    background: rgba(255, 255, 255, 0.35);
    z-index: 2;
  }

  .statistics-grid-item:nth-child(4)::after {
    content: "";
    display: block;
    position: absolute;
    left: -1px;
    top: auto;
    bottom: 0;
    width: 20%;
    height: 2px;
    background: rgba(255, 255, 255, 0.35);
    z-index: 2;
  }

  .statistics-grid-item:nth-child(3)::after {
    content: "";
    display: block;
    position: absolute;
    right: -1px;
    left: auto;
    top: auto;
    bottom: 0;
    width: 20%;
    height: 2px;
    background: rgba(255, 255, 255, 0.35);
    z-index: 2;
  }

  .statistics-grid-item:nth-child(5)::before {
    content: "";
    display: block;
    position: absolute;
    right: -1px;
    top: auto;
    bottom: 0;
    height: 30%;
    width: 2px;
    background: rgba(255, 255, 255, 0.35);
    z-index: 2;
  }

  .statistics-grid-item:nth-child(5)::after {
    content: "";
    display: block;
    position: absolute;
    top: auto;
    bottom: -1px;
    right: 0;
    width: 20%;
    height: 2px;
    background: rgba(255, 255, 255, 0.35);
    z-index: 2;
  }

  .statistics-grid-item:nth-child(6)::before {
    content: "";
    display: block;
    position: absolute;
    left: -1px;
    top: auto;
    bottom: -1px;
    width: 20%;
    height: 2px;
    background: rgba(255, 255, 255, 0.35);
    z-index: 2;
  }

  .statistics-grid-item:nth-child(6)::after {
    content: "";
    display: block;
    position: absolute;
    left: -1px;
    top: 0;
    bottom: auto;
    height: 20%;
    width: 2px;
    background: rgba(255, 255, 255, 0.35);
    z-index: 2;
  }

  .statistics-grid-item:nth-child(5),
  .statistics-grid-item:nth-child(6) {
    border-bottom: 1px solid rgb(255 255 255 / 23%);
  }
}
