/* EspaceLibertin 2.97.1 — galleries uniformes sur PC et smartphone.
   CSS scoped: aucune modification des autorisations ni du chargement des médias. */

/* Grille de visionnage : toutes les vignettes ont exactement le même format 4:5. */
body .galpage .galgrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  min-width: 0;
}
body .galpage .galgrid > .galth {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  border: 1px solid rgba(244, 172, 209, .22);
  border-radius: 15px;
  overflow: hidden;
  background: #1b111f;
  position: relative;
}
body .galpage .galgrid > .galth > img,
body .galpage .galgrid > .galth > video {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  border-radius: 0;
  pointer-events: none;
}
body .galpage .galgrid > .galth[hidden] { display: none !important; }
body .galpage .galgrid > .galth:focus-visible { outline: 3px solid #f8d5e8; outline-offset: 3px; }

/* Gestion de fichiers du propriétaire : même taille de vignettes en PC/mobile. */
body .eg-galleries .eg-library-details .grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
body .eg-galleries .eg-library-details .grid > figure { min-width: 0; }
body .eg-galleries .eg-library-details .grid figure img,
body .eg-galleries .eg-library-details .grid figure video {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 12px;
}

/* Visionneuse : photo entière visible, sans déformation ni taille démesurée. */
body .gv .gv-stage { padding: 4.3rem 4.5rem 4.6rem; }
body .gv .gv-stage .gv-media {
  box-sizing: border-box;
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, 960px);
  max-height: min(calc(100dvh - 9rem), 780px);
  object-fit: contain;
  object-position: center;
  border-radius: 7px;
}
body .gv .gv-stage video.gv-media {
  width: auto;
  max-width: min(100%, 960px);
  max-height: min(calc(100dvh - 9rem), 780px);
}

@media (max-width: 949px) {
  body .galpage .galgrid,
  body .eg-galleries .eg-library-details .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
}
@media (max-width: 599px) {
  body .galpage .galgrid,
  body .eg-galleries .eg-library-details .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  body .galpage .galgrid > .galth { border-radius: 11px; }
  body .gv .gv-stage { padding: 3.6rem 8px 4.5rem; }
  body .gv .gv-stage .gv-media,
  body .gv .gv-stage video.gv-media {
    max-width: 100%;
    max-height: calc(100dvh - 8.3rem);
    border-radius: 4px;
  }
}
