@font-face {
  font-family: 'LoRes';
  src: url('fonts/Clarendon-Bold-webfont.woff2') format('woff2');
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: 'LoRes';
  src: url('fonts/BancoStd.woff2') format('woff2');
  font-weight: normal;
  font-style: italic;
}

/* ==========================================================================
   1. CONFIGURATION GLOBALE
   ========================================================================== */

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

body {
  font-family: 'LoRes', serif;
  background-color:rgb(4, 59, 35);
  color: lightcyan;
  margin: 0;
  padding: 0;
}

.title-container {
  width: 90%;
  margin: 40px auto 20px auto;
  padding-left: 10px;
}

#intro {
  margin: 0;
  font-size: 3rem;
  font-weight: bold;
}

span {background-color: white;}

/* ==========================================================================
   2. GRILLE DE CONTENEURS (MOBILE FIRST)
   ========================================================================== */

.refs {
  position: relative;
  width: 90%;
  margin: 0 auto 50px auto;
}

.refs1, .refs2, .refs3 {
  position: relative;
  width: 100%;
}

/* Le conteneur s'adapte désormais strictement à l'élément du flux (l'image) */
.image-container {
  background-color: darkgray;
  display: block;
  position: relative;
  width: 100%;
  margin-bottom: 40px; 
}

.image-container .img-hover{
  display: block;
  position: relative;
  width: auto;
  height: 100%;
  text-decoration: none;
}

/* MODIFICATION : L'image par défaut est dans le flux et dicte la taille exacte du bloc */
.image-container img.img-default {
  display: block;
  width: 100%;
  height: auto;
  opacity: 1;
  position: relative;
  z-index: 1;
  transition: opacity 0.3s ease-in-out;
}

/* MODIFICATION : Le texte s'adapte à la taille de l'image et se superpose par-dessus */
.image-container span.img-default {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  padding: 1.5rem;
  color: rgb(43, 43, 43);
  font-size: 1.1rem;
  text-align: left;
  line-height: 1.4;
  overflow: hidden; /* Évite que le texte ne dépasse si l'image sous-jacente est trop petite */
  opacity: 1;
  z-index: 2;
  transition: opacity 0.3s ease-in-out;
}

/* L'image de survol est également calée au millimètre */
.image-container .img-hover {
  display: block;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  z-index: 3;
  transition: opacity 0.3s ease-in-out;
}

/* ==========================================================================
   EFFETS AU SURVOL (HOVER)
   ========================================================================== */

.image-container:hover .img-default {
  opacity: 0;
}

.image-container:hover .img-hover {
  opacity: 1;
}

/* ==========================================================================
   3. RESPONSIVE DESIGN (AFFICHAGE SUR 3 COLONNES > 800PX)
   ========================================================================== */

@media screen and (min-width: 800px) {
  .refs {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
  }

  .refs1, .refs2, .refs3 {
    width: 31%;
  }

  .image-container {
    width: 100%;
    margin-bottom: 60px; 
  }
}