/* Une photo en grand (agrandir.js ; demande de Nick Provencher, pilote de 4 Impasse Hongrie, 21 octobre 2026) : sur fond sombre,
   DANS la page. « Fermer » toujours visible en haut, les flèches au milieu des côtés, la légende en bas ; tout tient compte de
   l'encoche (env(safe-area-inset-*)) et chaque bouton fait au moins 48 px. Le préfixe « agrandie » : « .visionneuse » est aux plans. */
html.agrandie-ouverte, html.agrandie-ouverte body { overflow: hidden; }
.agrandie { position: fixed; inset: 0; z-index: 100; background: #0d0e10; color: #fff; touch-action: none; overscroll-behavior: contain;
  -webkit-user-select: none; user-select: none; -webkit-tap-highlight-color: transparent; }
/* Les doigts sont pour la photo (agrandir.js), jamais pour la page derrière : sur chaque élément, pas seulement le fond (le navigateur
   s'arrête au cadre qui coupe la photo, et zoomait toute la page au téléphone couché, essai du 21 octobre 2026) */
.agrandie, .agrandie * { touch-action: none; }
.agrandie-scene { position: absolute; inset: 0; overflow: hidden; overflow: clip; cursor: zoom-in; }
.agrandie.zoomee .agrandie-scene { cursor: grab; }
.agrandie.zoomee .agrandie-scene:active { cursor: grabbing; }
.agrandie-image { position: absolute; left: 0; top: 0; width: 100%; height: 100%; object-fit: contain; transform-origin: 0 0;
  -webkit-user-drag: none; -webkit-touch-callout: none; }
.agrandie-image:not([src]) { visibility: hidden; }
.agrandie-image.anime { transition: transform .2s ease-out; }

.agrandie button { min-height: 48px; min-width: 48px; border: 1px solid rgba(255, 255, 255, .4); background: rgba(21, 23, 26, .72); color: #fff;
  font: 600 1rem/1 var(--sans, system-ui, sans-serif); border-radius: 999px; cursor: pointer; }
.agrandie button:hover { background: rgba(21, 23, 26, .92); border-color: #fff; color: #fff; }
.agrandie button:focus-visible { outline: 3px solid #d8b98a; outline-offset: 2px; }

.agrandie-haut { position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: calc(.5rem + env(safe-area-inset-top, 0px)) calc(.75rem + env(safe-area-inset-right, 0px)) 1.25rem calc(1rem + env(safe-area-inset-left, 0px));
  background: linear-gradient(rgba(0, 0, 0, .6), rgba(0, 0, 0, 0)); pointer-events: none; }
.agrandie-haut > * { pointer-events: auto; }
.agrandie-compte { font-size: .9rem; font-weight: 600; text-shadow: 0 1px 2px rgba(0, 0, 0, .8); }
.agrandie-fermer { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; padding: 0 1.1rem; margin-left: auto; }
.agrandie-fermer span { font-size: 1.1rem; }

.agrandie-fleche { position: absolute; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; padding: 0; display: inline-flex;
  align-items: center; justify-content: center; }
.agrandie-fleche svg { display: block; }
.agrandie-precedente { left: calc(.5rem + env(safe-area-inset-left, 0px)); }
.agrandie-suivante { right: calc(.5rem + env(safe-area-inset-right, 0px)); }

.agrandie-legende { position: absolute; left: 0; right: 0; bottom: 0; margin: 0; max-height: 35%; overflow: hidden;
  padding: 1.75rem calc(1rem + env(safe-area-inset-right, 0px)) calc(.85rem + env(safe-area-inset-bottom, 0px)) calc(1rem + env(safe-area-inset-left, 0px));
  background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, .7)); font-size: .92rem; line-height: 1.35; text-align: center; white-space: pre-line;
  overflow-wrap: anywhere; text-shadow: 0 1px 2px rgba(0, 0, 0, .8); pointer-events: none; }
.agrandie.zoomee .agrandie-legende { opacity: 0; }  /* zoomée, la photo prend tout l'écran ; la légende revient à la photo entière */

.agrandie-attente { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: max-content; max-width: calc(100% - 8rem);
  display: grid; justify-items: center; gap: .75rem; padding: .75rem 1rem; border-radius: 6px; background: rgba(21, 23, 26, .85); text-align: center;
  pointer-events: none; }  /* « Chargement… » au milieu n'arrête pas les doigts : on zoome déjà la vignette */
.agrandie-attente p { margin: 0; font-size: .95rem; line-height: 1.35; }
.agrandie-reessayer { padding: 0 1.25rem; pointer-events: auto; }
/* « Me reconnecter », « Voir pourquoi » : la page qui explique, dans la même fenêtre ; l'allure des boutons de la visionneuse */
.agrandie-page { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 1.25rem; border: 1px solid #fff;
  border-radius: 999px; background: #fff; color: #15171a; font: 600 1rem/1 var(--sans, system-ui, sans-serif); text-decoration: none; pointer-events: auto; }
.agrandie-page:hover { background: #e9e6e1; color: #15171a; }
.agrandie-page:focus-visible { outline: 3px solid #d8b98a; outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) { .agrandie-image.anime { transition: none; } }
