/* =====================================================================
   JE Digital · visionneuse des réalisations (voir assets/js/visionneuse.js)
   ===================================================================== */

/* ---------- Visuels du carrousel : cliquables pour agrandir ---------- */
.projet-agrandir {
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.projet-agrandir img { transition: transform .6s var(--ease-sortie); }
.projet-agrandir:hover img { transform: scale(1.02); }
.projet-agrandir:focus-visible { outline-offset: -4px; }   /* le cadre rogne ce qui dépasse */

/* pastille « agrandir », en bas à droite : les visuels n'y portent pas de texte */
.projet-agrandir-icone {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: rgba(16, 30, 51, .85);
  color: var(--ivoire);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .25s, transform .35s var(--ease-sortie);
}
.projet-agrandir:hover .projet-agrandir-icone,
.projet-agrandir:focus-visible .projet-agrandir-icone { opacity: 1; transform: none; }
@media (hover: none) {   /* écrans tactiles : pas de survol, la pastille reste visible */
  .projet-agrandir-icone { right: 8px; bottom: 8px; width: 34px; height: 34px; opacity: 1; transform: none; }
}

/* ---------- La fenêtre ---------- */
.visionneuse {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: clamp(64px, 8vh, 96px) max(88px, 7vw);
  border: 0;
  background: transparent;
  color: var(--ivoire);
  overflow: hidden;
}
.visionneuse[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  animation: visionneuse-ouverture .35s var(--ease-sortie);
}
.visionneuse::backdrop { background: rgba(16, 30, 51, .97); }
@keyframes visionneuse-ouverture {
  from { opacity: 0; transform: scale(.97); }
  to { opacity: 1; transform: none; }
}

.visionneuse-cadre { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 100%; margin: 0; }
.visionneuse-image {
  display: block;
  width: auto;
  height: auto;
  max-width: min(1600px, 100%);
  max-height: calc(100vh - 2 * clamp(64px, 8vh, 96px) - 44px);
  max-height: calc(100dvh - 2 * clamp(64px, 8vh, 96px) - 44px);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .45);
}
.visionneuse-legende { display: flex; align-items: baseline; gap: 14px; }
.visionneuse-titre { font-family: var(--f-titre); font-size: 18px; font-weight: 600; letter-spacing: -.02em; }
.visionneuse-compteur { color: var(--brume); font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }

/* boutons : les mêmes parallélogrammes que le carrousel */
.visionneuse .projets-bouton { position: absolute; }
.visionneuse .visionneuse-fermer { top: max(16px, env(safe-area-inset-top, 0px)); right: 16px; }
.visionneuse .visionneuse-precedent,
.visionneuse .visionneuse-suivant { top: 50%; margin-top: -24px; }
.visionneuse .visionneuse-precedent { left: 16px; }
.visionneuse .visionneuse-suivant { right: 16px; }
.visionneuse :focus-visible { outline: 3px solid var(--ambre); outline-offset: 3px; }

/* téléphone : l'image prend toute la largeur, les flèches passent dessous */
@media (max-width: 700px) {
  .visionneuse { padding: 76px 12px 104px; }
  .visionneuse-image {
    max-height: calc(100vh - 76px - 104px - 44px);
    max-height: calc(100dvh - 76px - 104px - 44px);
  }
  .visionneuse .visionneuse-precedent,
  .visionneuse .visionneuse-suivant { top: auto; bottom: max(24px, env(safe-area-inset-bottom, 0px)); margin-top: 0; }
  .visionneuse .visionneuse-precedent { left: calc(50% - 66px); }
  .visionneuse .visionneuse-suivant { right: calc(50% - 66px); }
}

/* téléphone à l'horizontale : marges réduites, l'image prend toute la hauteur disponible */
@media (max-height: 520px) and (min-width: 701px) {
  .visionneuse { padding: 10px 80px; }
  .visionneuse-cadre { gap: 6px; }
  .visionneuse-image {
    max-height: calc(100vh - 20px - 32px);
    max-height: calc(100dvh - 20px - 32px);
  }
  .visionneuse-titre { font-size: 15px; }
  .visionneuse .visionneuse-fermer { top: 10px; }
}
