.media-grid {
  display: grid;
  grid-template-columns: repeat(1, 1fr);
  gap: 20px;
  max-width: 100%;
  margin: 3% auto;
  padding: 0 10px;
}
a {
  color: white;
  text-decoration: none;
}

.media-card {
  position: relative;
  width: 395px;
  height: 320px;
  border: 1px solid black;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  margin: auto;
}

.media-card.folder {
  cursor: pointer;
  box-shadow: 5px 5px 4px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s, box-shadow 0.2s;
}

.media-card.folder:hover {
  transform: scale(1.05);
  box-shadow: 8px 8px 6px rgba(0, 0, 0, 0.25);
}

.media-card-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-position: center;
  background-size: cover;
  z-index: 1;
}

.media-card-image::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.25) 64%, rgba(0,0,0,1) 100%);
  color-scheme: light;
}
.media-card-image2 {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-position: center;
  background-size: cover;
  z-index: 1;
}

.media-card-image2::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,0.25) 64%, rgba(0,0,0,1) 100%);
  color-scheme: light;
}

.media-card-footer {
  position: relative;
  z-index: 2;
  height: 79px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(to top, rgba(0,0,0,0.8), rgba(0,0,0,0.25) 82%, rgba(102,102,102,0) 100%);
}

.media-card-footer h3 {
  color: white;
  font-size: 24px;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
}

.media-card-footer p {
  color: white;
  font-size: 15px;
  font-weight: 500;
  text-align: center;
}
/* Lightbox styles */
.lightbox {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8); /* Fond semi-transparent */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000; /* Assurez-vous qu'il est au-dessus des autres éléments */
}

.lightbox-content {
  max-width: 90%;
  max-height: 90%;
  border-radius: 10px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  color: white;
  font-size: 30px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1001; /* Au-dessus de l'image */
}

.lightbox img {
  display: block;
  max-width: 100%;
  max-height: 100%;
}
/* Responsive Grid */
@media (min-width: 830px) {
  .media-grid {
      grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 410px) {
  .media-card {
      width: 100%;
  }
}

@media (min-width: 1350px) {
  .media-grid {
      grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1660px) {
  .media-grid {
      grid-template-columns: repeat(4, 1fr);
  }
}