.flip-container {
  perspective: 1000px;
  width: 100%;
  aspect-ratio: 4 / 3;
  position: relative;
}

.flip-inner {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  animation: none;
 /* animation: autoFlip 6s infinite; */
}

.flip-inner.start-flip {
  animation: autoFlip 6s infinite;
}

.flip-front, .flip-back {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  backface-visibility: hidden;
}

.flip-front {
  z-index: 2;
}

.flip-back {
  transform: rotateY(180deg);
}

.flip-content {
  width: 100%;
  height: 100%;
  position: relative;
}

.flip-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.flip-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  text-align: center;
  font-weight: bold;
  font-size: 1rem;
  z-index: 10;
}

/* Only mobile: counter-rotate content inside flip-back */
@media (max-width: 768px) {
  .flip-back .flip-image {
    transform: rotateY(180deg); /* only flip image */
  }

  .flip-back .flip-label {
    transform: none !important; /* cancel mirror effect on text */
  }
}

@keyframes autoFlip {
  0%, 49.9% {
    transform: rotateY(0deg);
  }
  50%, 100% {
    transform: rotateY(180deg);
  }
}

/* when you hover (or tap-and-hold on mobile), the flip will freeze. */


.flip-inner {
  animation: autoFlip 6s infinite;
  animation-play-state: running;
}

.flip-container:hover .flip-inner {
  animation-play-state: paused;
}