/* galeries.css — Terascia, galeries statiques
   Modifier ici, puis incrémenter VERSION_ASSETS dans terascia_galeries.py (cache IONOS). */
:root {
  --fond: #f7f4ee; --carte: #ffffff; --encre: #2b2118; --doux: #6e5d4b;
  --filet: #ddd3c4; --accent: #7a4b1e; --accent-fonce: #5a3612;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--fond); color: var(--encre);
  font: 1rem/1.55 Georgia, "Times New Roman", serif; }
a { color: var(--accent); }
a:hover { color: var(--accent-fonce); }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.entete { background: var(--encre); color: #f3e9d8; padding: .8rem 1.2rem;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1rem; }
.entete .logo { color: #fff; font-size: 1.35rem; text-decoration: none; font-weight: bold; }
.entete .devise { font-size: .85rem; color: #cbb89c; }
.entete .menu { margin-left: auto; display: flex; gap: 1rem; }
.entete .menu a { color: #f3e9d8; text-decoration: none; }
.entete .menu a:hover { text-decoration: underline; }

.fil { max-width: 1200px; margin: 0 auto; padding: .8rem 1.2rem 0;
  font-size: .9rem; color: var(--doux); }
main { max-width: 1200px; margin: 0 auto; padding: .5rem 1.2rem 3rem; }
h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); line-height: 1.2; margin: .6rem 0 .4rem; }
.intro { max-width: 70ch; color: var(--doux); margin: 0 0 .4rem; }
.compte { font-size: .9rem; color: var(--doux); margin: 0 0 1.2rem; }

/* Grille : s'adapte seule à la largeur (2 colonnes mobile, 4 tablette, 6+ PC) */
.grille { list-style: none; margin: 0; padding: 0; display: grid; gap: .8rem;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
@media (min-width: 700px) { .grille { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); } }
.grille li { margin: 0; }
.vignette { display: block; background: var(--carte); border: 1px solid var(--filet);
  padding: .35rem; text-decoration: none; color: inherit; height: 100%; }
.vignette:hover { border-color: var(--accent); }
.vignette img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  background: #e9e2d6; }
.vignette .legende { display: block; font-size: .85rem; line-height: 1.3; margin-top: .4rem; }
.vignette .nb { display: block; font-size: .8rem; color: var(--doux); }

.albums .vignette .legende { font-size: .95rem; font-weight: bold; }

.voisins { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--filet); font-size: .95rem; }

.pied { border-top: 1px solid var(--filet); color: var(--doux); font-size: .85rem;
  text-align: center; padding: 1.2rem; }
@media (max-width: 480px) {
  .entete .menu { margin-left: 0; width: 100%; }
  .grille { gap: .5rem; }
}

/* ── Visionneuse plein écran ── */
.visionneuse { position: fixed; inset: 0; z-index: 1000; background: #000;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .3s ease; touch-action: pan-y; }
.visionneuse[hidden] { display: none; }
.visionneuse.ouverte { opacity: 1; }
.v-cadre { margin: 0; max-width: calc(100vw - 7rem); max-height: 100vh;
  display: flex; flex-direction: column; align-items: center; }
.v-image { display: block; max-width: 100%; max-height: calc(100vh - 6rem);
  width: auto; height: auto; opacity: 0; transition: opacity .45s ease; }
.v-image.v-visible { opacity: 1; }
.v-legende { color: #e8dfd0; font-size: .95rem; text-align: center; margin-top: .6rem;
  min-height: 1.2em; max-width: 70ch; }
.v-compteur { position: absolute; left: 1rem; top: .8rem; margin: 0;
  color: #b9ab95; font: .9rem/1 system-ui, sans-serif; }
.visionneuse button { position: absolute; background: transparent; border: 0; color: #fff;
  cursor: pointer; line-height: 1; opacity: .75; transition: opacity .2s; padding: .4rem .7rem; }
.visionneuse button:hover, .visionneuse button:focus-visible { opacity: 1; }
.visionneuse button:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.v-fermer { top: .4rem; right: .6rem; font-size: 2.6rem; }
.v-prec, .v-suiv { top: 50%; transform: translateY(-50%); font-size: 3.6rem; }
.v-prec { left: .3rem; }
.v-suiv { right: .3rem; }
.visionneuse.unique .v-prec, .visionneuse.unique .v-suiv { display: none; }
@media (max-width: 600px) {
  .v-cadre { max-width: 100vw; }
  .v-prec, .v-suiv { font-size: 2.6rem; top: auto; bottom: .4rem; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .visionneuse, .v-image { transition: none; }
}
