/* === TNG Media Gallery Pro v0.7.1 === */

/* Grille standard */
.tng-media-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    justify-items: center;
    align-items: start;
    margin-top: 20px;
}

/* Masonry */
.tng-media-gallery-masonry {
    column-count: 3;
    column-gap: 20px;
}

.tng-media-gallery-masonry .tng-media-item {
    break-inside: avoid;
    margin-bottom: 20px;
}

/* Galerie élégante (auto-fit) */
.tng-media-gallery-elegant {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(var(--tng-min-width, 260px), 1fr));
    gap: 25px;
    margin-top: 20px;
}

/* Bloc */
.tng-media-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px;
    text-align: center;
    min-height: 260px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: all .25s ease;
}

.tng-media-item:hover {
    filter: brightness(1.08);
    transform: translateY(-3px);
}

/* Image */
.tng-media-item img {
    display: block;
    margin: 0 auto 8px auto;
    border-radius: 4px;
    object-fit: contain;
}

/* Texte */
.tng-media-meta {
    font-size: 13px;
    color: #333;
}

.tng-media-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.tng-media-person {
    font-style: italic;
    color: #666;
}
/* Titre de la galerie */
.tng-media-gallery-title {
    font-size: 1.6rem;          /* Taille confortable */
    font-weight: 700;           /* Gras */
    text-decoration: underline; /* Souligné */
    text-underline-offset: 4px; /* Décalage du soulignement pour un rendu plus élégant */
    margin: 20px 0 10px 0;      /* Espacement autour */
    color: #333;                /* Couleur sobre */
    font-family: "Georgia", "Times New Roman", serif; /* Look plus raffiné */
}
/* === Vue Fit harmonisée avec espace horizontal === */
.tng-media-gallery-fit {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px; /* espace horizontal ET vertical */
  justify-content: center; /* centre la grille et garde l’espace entre les colonnes */
  justify-items: center; /* empêche les cartes de s’étirer */
  align-items: start;
}

.tng-media-gallery-fit .tng-media-item {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 6px;
  padding: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
  max-width: 220px; /* largeur fixe pour garder l’espace entre les cartes */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tng-media-gallery-fit .tng-media-item:hover {
  transform: scale(1.02);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.tng-media-gallery-fit img {
  max-width: 100%;
  height: auto;
  border-radius: 4px;
  margin-bottom: 6px;
  align-self: center;
}

.tng-media-gallery-fit .tng-media-title {
  font-size: 0.85rem;
  margin-top: auto;
  text-align: center;
  color: #333;
  line-height: 1.3;
  min-height: 2.6em;
}
/* === Vue Masonry 2 (moderne et fluide) === */
.tng-media-gallery-masonry2 {
  column-count: 4;
  column-gap: 20px;
  padding: 10px;
  width: 100%;
}

@media (max-width: 1200px) {
  .tng-media-gallery-masonry2 {
    column-count: 3;
  }
}

@media (max-width: 900px) {
  .tng-media-gallery-masonry2 {
    column-count: 2;
  }
}

@media (max-width: 600px) {
  .tng-media-gallery-masonry2 {
    column-count: 1;
  }
}

.tng-media-gallery-masonry2 .tng-media-item {
  display: inline-block;
  width: 100%;
  margin: 0 0 20px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  break-inside: avoid; /* clé du vrai Masonry */
}

.tng-media-gallery-masonry2 .tng-media-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.tng-media-gallery-masonry2 img {
  width: 100%;
  height: auto;
  display: block;
  border-bottom: 1px solid #eee;
}

.tng-media-gallery-masonry2 .tng-media-title {
  font-size: 0.9rem;
  font-weight: 500;
  color: #333;
  padding: 10px 12px;
  text-align: center;
  line-height: 1.3;
}
