/* ===== Layout ===== */
 
.cards-wrapper {
  display: grid;
  gap: 24px;
  padding: 40px;
  justify-content: center;
  place-items: center;
  grid-template-columns: repeat(4, minmax(260px, 320px));
}

@media (max-width: 1024px) {
  .cards-wrapper {
    grid-template-columns: repeat(2, minmax(260px, 320px));
  }
}

@media (max-width: 640px) {
  .cards-wrapper {
    grid-template-columns: 1fr;
  }
}

/* ===== Flip card ===== */

.flip-container {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 600 / 350;
  perspective: 1000px;
  cursor: pointer;
}

.flipper {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flip-container.flipped .flipper {
  transform: rotateY(180deg);
}

/* Desktop hover flip */
@media (hover: hover) {
  .flip-container:hover .flipper {
    transform: rotateY(180deg);
  }
}

.front,
.back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  
}

/* Front style */
.front {
  background: linear-gradient(135deg, var(--button-bg), var(--card-bg));
  color: var(--text-color);
  border-radius: 12px;
  border: var(--border-color) solid 1px; 


  flex-direction: column;
  text-align: center;
}

.front h1 {
  margin: 0 0 8px;
  font-size: 20px;
}

.front p {
  margin: 0;
  font-size: 14px;
}

.front small {
  margin: 0;
  font-size: 14px;
}


/* Back style */
.back {
  background: var(--text-color);
  color: var(--bg-color);
  transform: rotateY(180deg);
  flex-direction: column;
  text-align: center;
}

.back h1 {
  margin: 0 0 8px;
  font-size: 20px;
}

.back p {
  margin: 0;
  font-size: 14px;
}

.back a {
      color: var(--bg-color);
     text-decoration: underline;
     background-color: var(--text-color);
}
