:root{
    --overlay-dark: rgba(15, 23, 42, 0.6); /* fond semi-transparent sombre */
  --overlay-light: rgba(255, 255, 255, 0.4);
  --text-on-dark: #ffffff;
  --text-on-light: #0f172a;
  --bgtest: #f0f9ff;
  --brand: #0ea5e9;
}

body {
  background-color: var(--bg);
  color: var(--ink);
  margin: 0;
  padding: 0;
}

/* Centrage vertical et horizontal du module */
main {
    min-height: 100vh; /* prend toute la hauteur visible */
    display: flex;
    justify-content: center; /* centre horizontalement */
    align-items: center;     /* centre verticalement */
    flex-wrap: wrap;
}
/* padding: 2rem; */


.feature-gallery {
    background:none;
  display: flex;
  width: 80%;
  height: 65vh;
  overflow: hidden;
  border-radius: 1.5rem;
  box-shadow: 0 0 20px rgba(0,0,0,0.1);
  align-content: center;
}
/* background: var(--bg); */

/* 0% = bord gauche, 100% = bord droit */
/* Image de gauche (1re) : centre du 1/3 gauche ≈ 16.67% */
.feature-gallery .gallery-item:nth-child(1) img {
  object-position: 16.67% 50%;
}

/* Image de droite (3e) : centre du 1/3 droit ≈ 83.33% */
.feature-gallery .gallery-item:nth-child(3) img {
  object-position: 83.33% 50%;
}

.gallery-item {
  flex: 1;
  position: relative;
  transition: flex 0.6s ease, transform 0.4s ease;
  overflow: hidden;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.overlay {
  position: absolute;
  inset: 0;
  background: var(--overlay-dark);
  color: var(--text-on-dark);
  opacity: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 1.5rem;
  transition: opacity 0.4s ease;
}

.gallery-item.active .overlay {
  opacity: 1;
} 

/* .gallery-item {
  position: relative;
  display: block;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
} */

/* .gallery-item img {
  width: 100%;
  height: auto;
  display: block;
} */

/* Overlay desktop */
/* .overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.5);
  color: white;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  text-align: center;
  transition: opacity 0.3s ease;
}

.gallery-item:hover .overlay {
  opacity: 1;
} */

/* Mobile title */
.mobile-title {
  display: none;
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  color: var(--brand);
  font-size: 1.2rem;
  font-weight: 600;
}

.mobile-title h3{
  background: rgba(255, 255, 255, 0.85);
  padding: 7px 12px;
  border-radius: 14px;
}

/* Responsive */
@media (max-width: 768px) {

  .desktop-only {
    display: none;
  }

  .mobile-title {
    display: block;
  }

}

.overlay h3 {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.overlay p {
  font-size: 1rem;
  max-width: 80%;
  margin-bottom: 1rem;
  color: var(--ring);
}

.btn {
  background-color: var(--brand);
  color: var(--text-on-dark);
  padding: 0.6rem 1.2rem;
  border-radius: 0.5rem;
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.3s ease, transform 0.2s ease;
}

.btn:hover {
  background-color: var(--brand-ink);
  transform: translateY(-2px);
}

/* --- Responsive --- */
/* @media (max-width: 768px) {
  .feature-gallery {
    flex-direction: column;
    height: auto;
  }

  .gallery-item {
    flex: 2;
    height: 45vh;
  }

  .overlay {
    background: var(--overlay-dark);
    opacity: 1;
    padding: 2rem 1rem;
  }

  .overlay h3 {
    font-size: 1.4rem;
  }

  .overlay p {
    font-size: 0.95rem;
  }

  .btn {
    font-size: 0.9rem;
  }

  .gallery-item:hover {
    flex: none;
  }

  .gallery-item img {
    transform: none !important;
  }
} */

@media (max-width: 768px) {
  .feature-gallery{
    flex-direction: column;
    height: auto;
    gap: 1rem;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
  }

  .gallery-item{
    height: auto;
    border-radius: 1.25rem;
    overflow: hidden;
    background: none;
    /* box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08); */
    border: 1px solid rgba(15, 23, 42, 0.06);
  }

  /* Image en haut, ratio propre */
  .gallery-item img{
    display: block;
    width: 100%;
    height: 220px;               /* ajuste 200–260 selon ton style */
    object-fit: cover;
    transform: none !important;
    object-position: 50% 35%;     /* recadrage plus flatteur par défaut */
    background: none;      /* si image transparente, évite blanc brutal */
  }

  /* Dégradé vertical par-dessus l'image */
  .gallery-item::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
      to bottom,
      rgba(0, 0, 0, 0) 40%,
      rgba(58, 58, 58, 0.35) 100%
    );
    pointer-events: none;
  }

  /* L’overlay devient un bloc de contenu */
  .overlay{
    position: static;
    opacity: 1;
    background: none;
    color: var(--ink);
    padding: 1rem 1rem 1.1rem;
    align-items: flex-start;
    text-align: left;
  }

  .overlay h3{
    margin: 0 0 .35rem 0;
    font-size: 1.2rem;
    color: var(--brand-ink);
  }

  .overlay p{
    margin: 0 0 .9rem 0;
    font-size: .95rem;
    color: var(--muted);
    max-width: 100%;
  }

  .overlay .btn{
    background: var(--brand);
    color: var(--text-on-dark);
    border-radius: .8rem;
    padding: .65rem 1rem;
  }

  /* hover off */
  .gallery-item:hover { flex: none; }
}

.gallery-item.active {
  flex: 2;
}

.gallery-item.active img {
  transform: scale(1.05);
}