/* Services — hover grid (vanilla port of feature-section-with-hover-effects) */

.services-section {
  background: var(--azul-cloud-white);
  color: var(--azul-midnight-ink);
  padding: clamp(72px, 10vw, 120px) 0;
}

.services-section__inner {
  width: min(1120px, calc(100% - (var(--gutter) * 2)));
  margin: 0 auto;
}

.services-section__headline {
  margin: 0 0 clamp(36px, 5vw, 56px);
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: clamp(2rem, 4.2vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  color: var(--azul-midnight-ink);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  position: relative;
  z-index: 1;
}

.services-item {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(28px, 3.5vw, 40px) clamp(24px, 2.8vw, 40px);
  border-right: 1px solid rgba(40, 77, 105, 0.14);
  border-bottom: 1px solid rgba(40, 77, 105, 0.14);
}

.services-item:nth-child(3n) {
  border-right: none;
}

.services-item:nth-child(n + 4) {
  border-bottom: none;
}

.services-item:nth-child(3n + 1) {
  border-left: 1px solid rgba(40, 77, 105, 0.14);
}

.services-item__wash {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.services-item:nth-child(-n + 3) .services-item__wash {
  background: linear-gradient(to top, rgba(217, 234, 244, 0.85), transparent);
}

.services-item:nth-child(n + 4) .services-item__wash {
  background: linear-gradient(to bottom, rgba(217, 234, 244, 0.85), transparent);
}

.services-item:hover .services-item__wash,
.services-item:focus-within .services-item__wash {
  opacity: 1;
}

.services-item__icon {
  position: relative;
  z-index: 1;
  width: 48px;
  height: 48px;
  margin-bottom: 1.1rem;
  color: var(--azul-deep-navy);
}

.services-item__icon img,
.services-item__icon svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.services-item__title {
  position: relative;
  z-index: 1;
  margin: 0 0 0.55em;
  padding-left: 0.85rem;
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: clamp(0.95rem, 1.1vw, 1.05rem);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--azul-signal-blue);
}

.services-item__title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 1.35em;
  border-radius: 0 999px 999px 0;
  background: rgba(40, 77, 105, 0.22);
  transition: height 0.2s ease, background-color 0.2s ease;
  transform-origin: center;
}

.services-item__title span {
  display: inline-block;
  transition: transform 0.2s ease;
}

.services-item:hover .services-item__title::before,
.services-item:focus-within .services-item__title::before {
  height: 1.85em;
  background: var(--azul-electric-cyan);
}

.services-item:hover .services-item__title span,
.services-item:focus-within .services-item__title span {
  transform: translateX(6px);
}

.services-item__body {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 22rem;
  font-family: 'Montserrat', sans-serif;
  font-weight: 400;
  font-size: clamp(0.92rem, 1.05vw, 0.98rem);
  line-height: 1.55;
  color: var(--azul-graphite);
}

@media (max-width: 900px) {
  .services-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .services-item {
    border-left: none !important;
    border-right: 1px solid rgba(40, 77, 105, 0.14);
    border-bottom: 1px solid rgba(40, 77, 105, 0.14);
  }

  .services-item:nth-child(2n) {
    border-right: none;
  }

  .services-item:nth-child(2n + 1) {
    border-left: 1px solid rgba(40, 77, 105, 0.14);
  }

  .services-item:nth-child(n + 5) {
    border-bottom: none;
  }

  .services-item:nth-child(-n + 4) .services-item__wash {
    background: linear-gradient(to top, rgba(217, 234, 244, 0.85), transparent);
  }

  .services-item:nth-child(n + 5) .services-item__wash {
    background: linear-gradient(to bottom, rgba(217, 234, 244, 0.85), transparent);
  }
}

@media (max-width: 560px) {
  .services-grid {
    grid-template-columns: 1fr;
  }

  .services-item {
    border-left: 1px solid rgba(40, 77, 105, 0.14) !important;
    border-right: 1px solid rgba(40, 77, 105, 0.14) !important;
    border-bottom: 1px solid rgba(40, 77, 105, 0.14) !important;
  }

  .services-item:last-child {
    border-bottom: 1px solid rgba(40, 77, 105, 0.14) !important;
  }

  .services-item__wash {
    background: linear-gradient(to top, rgba(217, 234, 244, 0.85), transparent) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .services-item__wash,
  .services-item__title::before,
  .services-item__title span {
    transition: none;
  }
}
