/* Grille responsive */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 150px)); /* largeur fixe max 150px */
  gap: 20px;                /* espace entre les vignettes */
  padding: 20px;            /* espace intérieur (haut/bas/gauche/droite) */
  margin: 0 auto;           /* centre la grille */
  max-width: 1200px;        /* optionnel : largeur max */
  justify-content: center; /* centre les colonnes si moins d'images */
}

/* Carte */
.thumb-card {
  position: relative;
  aspect-ratio: 1 / 1;           /* carré; remplace par 4/3 si tu préfères */
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
  width: 150px; /* largeur fixe pour garantir une taille max */
  border: 1px solid rgb(0, 211, 255, 80%);
  border-radius: 20px 20px 20px 20px;
  box-shadow: inset 0px 0px 20px 1px #3efdeb;
  backdrop-filter: blur(2px);
}

/* Lien qui prend toute la surface */
.thumb-link {
  display: flex;
  position: relative;
  width: 100%;
  height: 100%;
  align-items: center;
}

/* Image plein cadre */
.thumb-img {
  width: 100%;
  /*height: 100%;*/
  object-fit: cover;             /* clé pour remplir sans déformer */
  display: block;
  transition: transform .4s ease;
}

/* Zoom léger au hover */
.thumb-card:hover .thumb-img {
  transform: scale(1.08);
}

/* Overlay masqué par défaut */
.thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  color: #fff;
  opacity: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0px;          /* plus d’espace pour éviter que le texte touche les bords */
  box-sizing: border-box;  /* inclut le padding dans les dimensions */
  transition: opacity .3s ease;
}

/* Typo overlay */
.thumb-overlay h2 {
  font-size: 1rem;
  font-weight: bold;
  margin: 0 0 8px;        /* plus d’espace sous le titre */
  line-height: 1.3;       /* augmente l’espacement des lignes */
  max-height: 2.6em;      /* 2 lignes avec line-height 1.3 */
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  max-width: 90%
}


/* Affichage overlay au hover */
.thumb-card:hover .thumb-overlay {
  opacity: 1;
}



.thumb-overlay h6 {
  margin: 0 0 10px 0;
  font-size: .85rem;
  font-weight: 600;
  opacity: .9;
}

/* Liste des meta (date, likes, commentaires) */
.meta {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: .85rem;
  line-height: 1.3;
}
.meta li { margin: 3px 0; }

/* Petites largeurs : cartes un peu plus grandes */
@media (max-width: 480px) {
  .gallery { grid-template-columns: repeat(auto-fill, minmax(150px, 150px)); }
}
