/**
 * Galeries photos (liste /galleries + détail /media_gallery/N).
 * Charte Scolcast/Radiobus : cartes blanches arrondies, bleu #1a2a44,
 * pastilles jaunes (#ffe66d).
 */

/* ===== Liste : grille de cartes ===== */
.galleries-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
  padding: 1rem 0 3rem;
}

.gallery-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 1rem;
  overflow: hidden;
  text-decoration: none;
  box-shadow: 0 2px 10px rgba(20, 40, 80, .08);
  transition: transform .15s ease, box-shadow .15s ease;
}

.gallery-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(20, 40, 80, .16);
  text-decoration: none;
}

.gallery-card__cover {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #e8eef7;
}

.gallery-card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .25s ease;
}

.gallery-card:hover .gallery-card__cover img {
  transform: scale(1.04);
}

.gallery-card__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding: 1rem 1.15rem 1.15rem;
}

.gallery-card__title {
  color: #1a2a44;
  font-weight: 600;
  font-size: 1.05rem;
  line-height: 1.3;
  margin: 0;
}

.gallery-card__count {
  flex: 0 0 auto;
  background: #ffe66d;
  color: #1a2a44;
  font-weight: 600;
  font-size: .8rem;
  border-radius: 999px;
  padding: .3rem .75rem;
  white-space: nowrap;
}

/* ===== Détail : bouton retour + carte + grille de photos ===== */
.gallery-back {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: #ffe66d;
  color: #1a2a44;
  font-weight: 600;
  border-radius: 999px;
  padding: .45rem 1.1rem;
  text-decoration: none;
  margin: .5rem 0 1.25rem;
  transition: background .15s ease;
}

.gallery-back:hover {
  background: #ffd84d;
  color: #1a2a44;
  text-decoration: none;
}

.gallery-detail {
  background: #fff;
  border-radius: 1rem;
  padding: 1.5rem;
  margin-bottom: 3rem;
  box-shadow: 0 2px 10px rgba(20, 40, 80, .08);
}

.gallery-detail .field--name-description {
  color: #5b6b85;
  margin-bottom: 1.25rem;
}

/* Grille des vignettes photoswipe */
.gallery-detail .photoswipe-gallery,
.gallery-detail .field--name-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: .75rem;
}

.gallery-detail .field--name-images > .field__item,
.gallery-detail .photoswipe-gallery > * {
  margin: 0;
}

.gallery-detail .field--name-images img {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: .6rem;
  transition: transform .2s ease, box-shadow .2s ease;
}

.gallery-detail .field--name-images a:hover img {
  transform: scale(1.03);
  box-shadow: 0 6px 16px rgba(20, 40, 80, .18);
}

@media (max-width: 600px) {
  .galleries-grid {
    grid-template-columns: 1fr;
  }
  .gallery-detail .photoswipe-gallery,
  .gallery-detail .field--name-images {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  }
}
