/* ******************************************* */
/* *	                Legend.                * */
/* ******************************************* */

.illustration {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.illustration img {
  width: 400px;
  max-width: 100%;
  height: auto;
}

.legend {
  width: 300px;
  text-align: center;
  font-style: italic;
}


/* ******************************************* */
/* *	             Galleries               * */
/* ******************************************* */

.gallery {
  width: auto;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 2vmin;
  padding: 30px 15px;
  align-content: space-around;

}

.gallery img {
  display: flex;
  flex : 1 auto;
  width: 100%;
  height: 100%;
  object-fit: contain;
  align-content: middle;
  align-items: center;
  justify-content: center;
}


.gallery li {
  list-style-type: none;
  height: 350px;
  flex-grow: 1;
  justify-content: center;
}


/* ******************************************* */
/* *	          Gallery Masonry              * */
/* ******************************************* */

.gallery-masonry {
  display: flex;
  justify-content: center;
  gap: 16px;
  width: 90%;
  margin: 0 auto;
}

.masonry-column {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 50%;
}

/* Responsive layout - makes the two columns stack on top of each other instead of next to each other */
@media screen and (max-width: 800px) {
.masonry-column {
    width: 100%;
  }

}

/* ******************************************* */
/* *	        Gallery Carrousel              * */
/* ******************************************* */


.gallery-carrousel {
  --gap: 1rem;
  position: relative;
  width: calc(100% - 2rem);
  max-width: 900px;
  margin-inline: auto;
  box-sizing: border-box;
}


  .gallery-carrousel__track {
    display: flex;
    gap: var(--gap);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    scrollbar-width: none;
  }

  .gallery-carrousel__track::-webkit-scrollbar {
    display: none;
  }

.gallery-carrousel__slide {
  flex: 0 0 100%;
  min-width: 0;
  margin: 0;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  scroll-snap-align: center;
}

.gallery-carrousel__slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 12px;
}
  .gallery-carrousel__button {
    position: absolute;
    z-index: 1;
    top: 50%;
    transform: translateY(-50%);
    width: 2.75rem;
    height: 2.75rem;
    border: 0;
    border-radius: 50%;
    background: rgb(0 0 0 / 60%);
    color: white;
    font-size: 1.8rem;
    cursor: pointer;
  }

  .gallery-carrousel__prev { left: 0.75rem; }
  .gallery-carrousel__next { right: 0.75rem; }

.gallery-carrousel__slide.img-card {
  width: auto;
}

@media (min-width: 700px) {
  .gallery-carrousel__slide {
    flex-basis: calc((100% - var(--gap)) / 2);
  }
}

@media (min-width: 1000px) {
  .gallery-carrousel__slide {
    flex-basis: calc((100% - 2 * var(--gap)) / 3);
  }
  .gallery-carrousel__slide.img-card {
    flex: 0 0 calc((100% - 2 * var(--gap)) / 3);
  }
}
/* ******************************************* */
/* *	             Lightbox                * */
/* ******************************************* */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;

  display: none;
  align-items: center;
  justify-content: center;

  padding: 30px;
  background: rgba(0, 0, 0, 0.9);
}

.lightbox.is-visible {
  display: flex;
}

.lightbox-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-width: 95vw;
  max-height: 95vh;
  margin: 0;
}

.lightbox img {
  display: block;
  max-width: 95vw;
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
}

.lightbox-caption {
  max-width: 90vw;
  margin-top: 12px;
  color: white;
  font-size: 1rem;
  text-align: center;
}


.lightbox-close {
  position: fixed;
  top: 15px;
  right: 25px;
  z-index: 1001;

  border: 0;
  background: transparent;
  color: white;
  font-size: 42px;
  line-height: 1;
  cursor: pointer;
}

.lightbox-close:hover {
  color: #ccc;
}


/* ******************************************* */
/* *	          Gallery Grid               * */
/* ******************************************* */

.header {
  text-align: center;
  padding: 32px;
}

.gallery-grid {
  display: flex;
  flex-wrap: wrap;
/*  padding: 0 4px; */
  justify-content: center;
/*  width: 100%; */
/*  padding: 0; */
}

/* Create four equal columns that sits next to each other */
.column3 {
  flex: 33%;
  max-width: 33%;
  padding: 0 4px;
}

.column2 {
  flex: 0 1 45%;
  max-width: 45%;
  padding: 0;
  gap: 16px;

}

.img-card {
  position: relative;
/*  width: 100%; */
/*  margin-top: 8px; */
/*  overflow: hidden;  */
}

.img-card .overlay {
  position: absolute;
  inset: auto 0 0;
  padding: 0.75rem;
  color: white;
  background: linear-gradient(transparent, rgb(0 0 0 / 70%));
  pointer-events: none;
}

.img-card img {
  display: block;
  width: 100%;
  height: auto;
  cursor: zoom-in;  /* ajout */
}

/* Overlay */
.overlay {
  position:absolute;
  bottom: 0;
  left: 0;
  background: rgb(0, 0, 0);
  background: rgba(0, 0, 0, 0.5); /* Black see-through */
  color: #f1f1f1; 
  width: 100%;
  box-sizing: border-box;  /* ajout */
  transition: .5s ease;
  opacity:0;
  color: white;
  font-size: 20px;
  padding: 20px;
  text-align: center;
}

/* Show overlay on hover */
.img-card:hover .overlay {
  opacity: 1;
}

/* Responsive layout - makes a two column-layout instead of four columns */
@media screen and (max-width: 800px) {
  .column2 {
    flex-basis: 100%;
    max-width: 100%;
  }  
  .column3 {
    flex: 50%;
    max-width: 50%;
  }
}

/* Responsive layout - makes the two columns stack on top of each other instead of next to each other */
@media screen and (max-width: 600px) {
  .column2 {
    flex: 100%;
    max-width: 100%;
  }

  .column3 {
    flex: 100%;
    max-width: 100%;
  }
}