.services {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
  list-style: none;
  padding: 0;
}


.services li {
  display: block;
  width: 100%;
}


.center-caption {
  display: block;
  width: 100%;
  height: 100%; /* If parent has height, otherwise omit */
  margin: 0;
}

.flip-card {
  background-color: transparent;
  width: 45vw;
  aspect-ratio: 4/3;
  perspective: 1000px;
  margin: 0 auto; /* Remove extra margin if needed */
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem;
}




.flip-text {
  font-size: 1rem;
  text-align: center;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  
  transition: transform 0.6s cubic-bezier(0.3, 0.6, 0.7, 1.4);
  transform-style: preserve-3d;
  will-change: transform;
}

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

.flip-card-front, .flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 10px;
  overflow: hidden;
}

.flip-card:hover .flip-card-front {
  opacity: 0; /* Hide the front on hover (fallback) */
}

.flip-card:not(:hover) .flip-card-inner {
  transition-delay: 0.1s; /* Optional: slight delay on hover-ot */
}

.flip-card:hover .flip-card-back {
  
  opacity: 1; /* Show the back on hover (fallback) */
}


.flip-card-front {
  
  background-color: var(--BGCOLOR);
  color: black;
}

.flip-card-front img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  
}

.flip-card-back {
  background-color: var(--BGCOLOR);
  color: white;
  transform: rotateY(180deg);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1rem;
  box-sizing: border-box;

}

.flip-card-caption {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  background: rgba(0,0,0,0.7);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  font-size: 1.5rem;
  z-index: 1;
}

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

  .services li:last-child {
    grid-column: auto; /* Reset to normal behavior on mobile */
  }

  .flip-card {
    background-color: transparent;
    width: 90vw;
    aspect-ratio: 4/3;
    perspective: 1000px;
    margin: 5vw; /* Remove extra margin if needed */
}

}
