:root {
  --couleur: #E6457A;
  --fond: #16121c;
  --surface: #241d2e;
  --texte: #f6f1fa;
  --texte-doux: #b9adc7;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, color-mix(in srgb, var(--couleur) 25%, transparent), transparent 45%),
    var(--fond);
  color: var(--texte);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
}

main { max-width: 1100px; margin: 0 auto; padding: 0 16px 48px; }

.entete { text-align: center; padding: 28px 16px 12px; }
.entete h1 { margin: 0; font-size: clamp(1.6rem, 6vw, 2.6rem); line-height: 1.15; }
.entete h1::after {
  content: ""; display: block; width: 64px; height: 4px; margin: 12px auto 0;
  border-radius: 2px; background: var(--couleur);
}
.sous-titre { margin: 8px 0 0; color: var(--texte-doux); }

.bouton {
  display: inline-block; padding: 12px 22px; border-radius: 999px; border: 2px solid var(--couleur);
  background: transparent; color: var(--texte); font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.bouton.principal { background: var(--couleur); color: #fff; }
.bouton:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* Page d'une prise */
.prise { display: flex; flex-direction: column; align-items: center; gap: 16px; margin-top: 12px; }
.prise img, .prise video {
  width: auto; max-width: min(100%, 900px); max-height: 78vh; border-radius: 16px; background: #000;
  box-shadow: 0 10px 40px rgb(0 0 0 / 0.5);
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.astuce { margin: 0; color: var(--texte-doux); font-size: 0.9rem; text-align: center; }
.astuce.ios { display: none; }
.est-ios .astuce.ios { display: block; }

.lien-galerie { text-align: center; margin-top: 28px; }
.lien-galerie a { color: var(--texte); font-weight: 600; }

.message { text-align: center; padding: 48px 16px; }
.message h2 { margin: 0 0 8px; }
.message p { color: var(--texte-doux); margin: 0; }
.sablier { font-size: 3rem; animation: tourne 2s ease-in-out infinite; }
@keyframes tourne { 50% { transform: rotate(180deg); } }

/* Galerie */
.compteur { text-align: center; color: var(--texte-doux); margin: 0 0 16px; }
.grille {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 6px; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}
.vignette { position: relative; display: block; aspect-ratio: 1; overflow: hidden; border-radius: 8px; background: var(--surface); }
.vignette img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .2s; }
.vignette:hover img { transform: scale(1.04); }
.vignette.video::after {
  content: "▶\FE0E"; position: absolute; inset: auto 8px 8px auto; width: 32px; height: 32px;
  display: grid; place-items: center; border-radius: 50%;
  background: rgb(0 0 0 / 0.6); color: #fff; font-size: 0.9rem;
}

.vignette .prenom {
  position: absolute; left: 6px; bottom: 6px; max-width: calc(100% - 50px);
  padding: 2px 8px; border-radius: 999px; background: rgb(0 0 0 / 0.6);
  font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.auteur { margin: -4px 0 0; color: var(--texte-doux); font-weight: 600; }

.pagination { display: flex; gap: 12px; justify-content: center; align-items: center; margin-top: 24px; flex-wrap: wrap; }

/* Visionneuse plein écran */
.visionneuse {
  position: fixed; inset: 0; z-index: 10; background: rgb(0 0 0 / 0.94);
  display: grid; grid-template-columns: 48px 1fr 48px; grid-template-rows: 1fr auto;
  align-items: center; padding: 48px 8px 16px;
}
.visionneuse[hidden] { display: none; }
.visionneuse .contenu { grid-column: 2; grid-row: 1; display: grid; place-items: center; height: 100%; min-height: 0; }
.visionneuse .contenu img, .visionneuse .contenu video { max-width: 100%; max-height: 100%; border-radius: 8px; }
.visionneuse button {
  background: none; border: 0; color: #fff; font-size: 2.5rem; cursor: pointer; padding: 8px;
}
.visionneuse .fermer { position: absolute; top: 4px; right: 8px; font-size: 1.8rem; }
.visionneuse .precedent { grid-column: 1; grid-row: 1; }
.visionneuse .suivant { grid-column: 3; grid-row: 1; }
.visionneuse .telecharger { grid-column: 1 / -1; grid-row: 2; justify-self: center; margin-top: 12px; }
