*,
*:before,
*:after {
  box-sizing: border-box;
  outline: none;
}

html {
  font-family: "Roboto", sans-serif;
  font-size: 16px;
  font-smooth: auto;
  font-weight: 300;
  line-height: 1.5;
  color: #444;
}

main{
  display:flex;
  flex:1 0 auto;
}

.cards-wrapper {
  width:100%;
  margin:auto;
  display: flex;
  flex-wrap: wrap;            /* Pass the next line if needed */
  justify-content: center;
  gap: 15px;                  /* space horizontal & vertical */
  padding: 10px;              /* internal margin arround cards */
}

figure {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 340px;
  min-width: 340px;
  height: 650px;
  border-radius: 15px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  overflow: hidden;
}
figure:hover {
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.25), 0 10px 10px rgba(0, 0, 0, 0.22);
}
figure:hover h1 {
  opacity: 0;
  transform: scale(0.7);
}
figure:hover img {
  transform: scale(1.25);
}
figure h1 {
  position: absolute;
  top: 50px;
  left: 20px;
  margin: 0;
  padding: 0;
  color: white;
  font-size: 32px;
  font-weight: 400;
  line-height: 1;
  opacity: 1;
  transform: scale(1);
  transition: 0.25s ease;
  z-index:2; 
}
figure img {
  height: 100%;
  transition: 0.25s;
}
/*  voile sombre seulement sur le haut  */
figure::before{
  content:"";
  position:absolute;
  inset:0;                         /* couvre toute la carte            */
  background:linear-gradient(
            to bottom,
            rgba(0,0,0,.55) 0%,    /* opaque en haut                   */
            rgba(0,0,0,0) 25%);    /* disparaît rapidement             */
  pointer-events:none;             /* laisse les clics passer          */
  z-index:1;                       /* sous le texte, au‑dessus de l'image */
}
figure figcaption{
  position:absolute;bottom:0;left:0;width:100%;
  transform:translateY(calc(100% - 200px));
  height:auto;
  padding:30px;
  background:rgba(0,0,0,.85);
  box-shadow:0 0 20px rgba(0,0,0,.4);
  color:#fff;
  line-height:1;
  overflow:hidden;
  transition:transform .25s ease;
}
figure:hover figcaption {
  transform:translateY(0);
}
figure figcaption h3 {
  margin: 0 0 20px;
  padding: 0;
  color: white;
}
figure figcaption p {
  font-size: 14px;
  line-height: 1.75;
  text-align:justify;
}
figure figcaption button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 0 0;
  padding: 10px 30px;
  background-color: #1abc9c;
  border: none;
  border-radius: 5px;
  color: white;
  font-size: 14px;
  cursor: pointer;
}