
h1 {
  text-align: center;
  font-family: 'Montserrat', sans-serif;
  margin: 80px 80px;
  font-size: 2.4rem;
  color: var(--text);
  font-weight: 900;
}

.grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 50px 70px;
  margin: 60px auto;
  max-width: 900px;
}

/* Cartes */
.card {
  width: 250px;
  height: 340px;
  perspective: 1000px;
  margin: 0px auto;
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  background: none;
}

.card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 26px rgba(11,18,32,0.12);
}

/* Contenu interne */
.card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.8s ease;
  background: none; /* ✅ Empêche la teinte grise */
  will-change: transform; /*améliore le rendu pendant le flip de la vignette */
  
}

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

/* Faces */
.card-front, .card-back {
position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden; /* ✅ pour Safari */
  border-radius: 16px;
  overflow: hidden;
  transform: rotateY(0deg);
  box-shadow: 0 10px 30px rgba(0,0,0,0.1);
  background-color: #fff; /* ✅ fond blanc propre sur chaque face */
}

/* --- Recto --- */
.card-front {
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

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

.card-front h3 {
  position: absolute;
  bottom: 10px;
  left: 0;
  right: 0;
  text-align: center;
  color: #fff;
  font-size: 1.2em;
  text-shadow: 0 2px 6px rgba(0,0,0,0.4);
  background: rgba(0,0,0,0.3);
  padding: 6px 0;
}

/* --- Verso --- */
.card-back {
  background: linear-gradient(180deg, #fff, #fef6f3);
  transform: rotateY(180deg);
  padding: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.card-back h3 {
  color: #f35b04;
  margin-bottom: 10px;
}

.card-back p {
  font-size: 0.95em;
  color: #4B5563;
  line-height: 1.4em;
}

.card-inner,
.card-front,
.card-back {
  width: 100%;
  height: 100%;
  min-height: 340px; /* force la même hauteur sur toutes les faces */
  box-sizing: border-box;
}

footer{
  margin-top: 160px;
}

/* --- Responsive --- */
@media screen and (max-width: 900px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media screen and (max-width: 600px) {
  .grid {
    grid-template-columns: 1fr;
  }
}