/* Corps de page */
body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background: linear-gradient(to bottom, #ff9a8b, #ff6a88, #ff99ac); /* Dégradé lever de soleil */
  color: #ffffff; /* Blanc pur */
  min-height: 100vh;
  padding-top: 70px; /* Espace pour la navbar */
  padding-bottom: 50px; /* Espace pour le footer */
}

/* Titre principal */
#gallery-title {
  text-align: center;
  font-size: 2.5rem;
  color: #ffffff;
  margin-bottom: 30px;
}

/* Formulaire de tri */
.form-tri {
  text-align: center;
  margin-bottom: 30px;
}

.form-tri label {
  font-weight: bold;
  color: #ffffff;
}

.form-tri select,
.form-tri button {
  padding: 10px 15px;
  margin-left: 10px;
  border: 2px solid #ff9a8b;
  border-radius: 12px;
  font-size: 1rem;
  background-color: #ffffff;
  color: #ff6a88;
  cursor: pointer;
  transition: background-color 0.3s ease, color 0.3s ease;
}

.form-tri select:hover,
.form-tri button:hover {
  background-color: #ff6a88;
  color: #ffffff;
}

/* Galerie en grid responsive */
.galerie {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 32px;
  padding: 40px 8vw 30px 8vw;
  justify-items: center;
}

.cartes {
  background: linear-gradient(135deg, #fff 80%, #ff99ac22 100%);
  border: 2px solid #ff9a8b;
  border-radius: 18px;
  width: 100%;
  max-width: 320px;
  min-width: 220px;
  box-shadow: 0 4px 12px rgba(255, 105, 135, 0.13);
  transition: transform 0.25s cubic-bezier(.4,0,.2,1), box-shadow 0.25s cubic-bezier(.4,0,.2,1);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.cartes:hover {
  transform: translateY(-7px) scale(1.03);
  box-shadow: 0 10px 24px rgba(255, 105, 135, 0.22);
  border-color: #ff6a88;
}

/* Image projet : ratio fixe, image centrée, jamais coupée */
.cartes-img-wrapper {
  width: 100%;
  aspect-ratio: 4/3;
  background: #fff0f5;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}


@media (min-width: 1101px) {
  .galerie {
    grid-template-columns: repeat(3, 1fr);
  }
}

.cartes img {
  width: 100%;
  height: 100%;

  object-position: center;
  border-top-left-radius: 18px;
  border-top-right-radius: 18px;
 
  transition: filter 0.3s;
  display: block;
  object-fit: contain;
  padding: 10px;
  background: #fff0f5;
}

.cartes:hover img {
  filter: brightness(0.97) saturate(1.1);
}

.cartes h3 {
  text-align: center;
  color: white;
  padding: 12px 8px 6px 8px;
  font-size: 1.13rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.cartes p {
  color: #ff6a88;
  font-size: 1rem;
  padding: 0 14px 12px 14px;
  margin: 0;
  text-align: center;
}

.cartes a {
  display: block;
  margin: 0 18px 18px 18px;
  padding: 10px 0;
  background: linear-gradient(90deg, #ff9a8b 0%, #ff6a88 100%);
  color: #fff;
  border-radius: 8px;
  text-align: center;
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  box-shadow: 0 2px 8px rgba(255, 105, 135, 0.10);
  transition: background 0.2s, transform 0.2s;
}
.cartes a:hover {
  background: linear-gradient(90deg, #ff6a88 0%, #ff9a8b 100%);
  transform: translateY(-2px) scale(1.04);
}

/* Responsive */
@media (max-width: 1100px) {
  .galerie {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 22px;
    padding: 30px 5vw 18px 5vw;
  }
  .cartes {
    max-width: 340px;
    min-width: 180px;
  }
}

@media (max-width: 700px) {
  .galerie {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 18px 5vw 12px 5vw;
  }
  .cartes {
    max-width: 98vw;
    min-width: unset;
    border-radius: 14px;
  }
  .cartes-img-wrapper {
    aspect-ratio: 16/9;
  }
  .cartes h3 {
    font-size: 1.05rem;
    padding: 8px;
  }
}
