/* Overlay */
.snh-lightbox[hidden]{display:none}
.snh-lightbox{
  position:fixed; inset:0; background:rgba(0,0,0,.8);
  z-index: 9999;
  display:flex; align-items:center; justify-content:center;
  opacity:1;
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))){
  .snh-lightbox{ -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }
}
@keyframes eig-lb-backdrop-in { from{opacity:0} to{opacity:1} }

/* Dialog */
.snh-lb-dialog{
  display:flex; gap:20px;
  max-width:calc(100vw - 80px);
  max-height:calc(100vh - 80px);
  align-items:stretch;
  will-change: transform, opacity;
}
@keyframes eig-lb-dialog-in { from{opacity:0; transform:translateY(6px)} to{opacity:1; transform:translateY(0)} }

/* Panneau gauche (fiche blanche) */
.snh-lb-panel{
  width:340px; background:#fff; color:#111; border-radius:14px; padding:16px;
  display:flex; flex-direction:column; gap:10px; overflow:auto;
  will-change: transform;
  transform-origin: bottom center;
}
/* Entrée depuis le bas — fluide, sans fade, avec sur-élan doux */
@keyframes eig-lb-panel-rise {
  0%   { transform: translateY(64px) scale(.985); }  /* démarre plus bas */
  45%  { transform: translateY(6px)  scale(1.000); } /* approche */
  70%  { transform: translateY(-2px) scale(1.000); } /* léger dépassement */
  100% { transform: translateY(0)    scale(1.000); }
}

/* Stagger interne (translation uniquement) */
@keyframes eig-lb-child-rise {
  from { transform:translateY(10px); }
  to   { transform:translateY(0); }
}

.snh-lb-badge-new{
  display:inline-block;background:#ffd65a;color:#111;
  font-weight:700;font-size:.78rem;padding:6px 10px;border-radius:999px
}

/* Titre plus gras (matching grille) */
.snh-lb-title{font-size:1.2rem;margin:0; font-weight:800}

.snh-lb-meta{font-size:.95rem;opacity:.8}
.snh-lb-caption{font-size:1rem;line-height:1.4}
.snh-lb-actions{display:flex;align-items:center;gap:14px;margin-top:auto}
.snh-lb-actions .snh-like,.snh-lb-actions .snh-download{cursor:pointer}

/* Media */
.snh-lb-media{position:relative; background:#000; border-radius:14px; padding:10px}
.snh-lb-image{
  display:block; max-width:70vw; max-height:calc(100vh - 120px);
  object-fit:contain; border-radius:8px; background:#000;
  will-change: transform, opacity;
}
@keyframes eig-lb-zoom-in { from{opacity:0; transform:scale(.975)} to{opacity:1; transform:scale(1)} }

/* Contrôles */
.snh-lb-prev,.snh-lb-next,.snh-lb-close{
  position:absolute; top:50%; transform:translateY(-50%);
  background:#fff; color:#124129; border:2px solid #124129;
  width:40px; height:40px; border-radius:999px;
  display:flex; align-items:center; justify-content:center;
  font-size:22px; cursor:pointer; opacity:.95;
  z-index: 10000;
  transition: transform .18s ease, opacity .18s ease, box-shadow .18s ease;
}
.snh-lb-prev{ left:8px; }
.snh-lb-next{ right:8px; }
.snh-lb-close{ top:8px; right:8px; transform:none; font-size:24px; }

/* Edge hover */
.snh-lb-prev,.snh-lb-next{ opacity:.0 }
.snh-lb-media:hover .snh-lb-prev, .snh-lb-media:hover .snh-lb-next{ opacity:1 }
.snh-lb-prev:hover,.snh-lb-next:hover{ transform:translateY(-50%) scale(1.06) }

/* Hover neutre */
.snh-lb-prev:hover,.snh-lb-next:hover,.snh-lb-close:hover{
  background:#124129; color:#fff; border-color:#124129;
}

/* Focus visibles */
.snh-lb-prev:focus-visible, .snh-lb-next:focus-visible, .snh-lb-close:focus-visible{
  outline:none; box-shadow:0 0 0 3px rgba(18,65,41,.25);
}

/* Mobile (image AU-DESSUS, fiche en dessous) */
@media (max-width: 900px){
  .snh-lb-dialog{flex-direction:column; align-items:center}
  .snh-lb-media{order:-1}   /* image en premier */
  .snh-lb-panel{order:1; width:100%; max-width:680px}
  .snh-lb-image{max-width:calc(100vw - 60px)}
}

/* Thème (couleur des contrôles) */
:root { --eig-accent: #124129; }
.snh-lb-prev, .snh-lb-next, .snh-lb-close {
  color: var(--eig-accent) !important; border-color: currentColor !important; background: #fff !important;
}
.snh-lb-prev:hover, .snh-lb-next:hover, .snh-lb-close:hover,
.snh-lb-prev:focus-visible, .snh-lb-next:focus-visible, .snh-lb-close:focus-visible{
  color: var(--eig-accent) !important; background: #fff !important; border-color: currentColor !important;
  box-shadow: 0 0 0 2px rgba(0,0,0,.06) inset !important; outline: none !important;
}

/* Ouverture — panneau très fluide depuis le bas */
.snh-lightbox.is-opening{ animation:eig-lb-backdrop-in .22s ease both }
.snh-lightbox.is-opening .snh-lb-dialog{ animation:eig-lb-dialog-in .26s ease both }
.snh-lightbox.is-opening .snh-lb-image{ animation:eig-lb-zoom-in .28s ease both }

/* Durée 1s, démarrage rapide après 120ms, easing très doux */
.snh-lightbox.is-opening .snh-lb-panel{
  animation: eig-lb-panel-rise 1s cubic-bezier(.16,.84,.22,1) .12s both;
}

/* Stagger interne synchronisé */
.snh-lightbox.is-opening .snh-lb-badge-new{ animation:eig-lb-child-rise .5s ease .18s both }
.snh-lightbox.is-opening .snh-lb-title    { animation:eig-lb-child-rise .5s ease .26s both }
.snh-lightbox.is-opening .snh-lb-meta     { animation:eig-lb-child-rise .5s ease .34s both }
.snh-lightbox.is-opening .snh-lb-caption  { animation:eig-lb-child-rise .5s ease .42s both }
.snh-lightbox.is-opening .snh-lb-actions  { animation:eig-lb-child-rise .5s ease .50s both }

/* Navigation directionnelle (slide léger dans le sens de la nav) */
@keyframes eig-lb-slide-next-in { from{opacity:0; transform:translateX(24px)} to{opacity:1; transform:translateX(0)} }
@keyframes eig-lb-slide-prev-in { from{opacity:0; transform:translateX(-24px)} to{opacity:1; transform:translateX(0)} }
.snh-lightbox.is-next .snh-lb-image{ animation:eig-lb-slide-next-in .22s ease both }
.snh-lightbox.is-prev .snh-lb-image{ animation:eig-lb-slide-prev-in .22s ease both }

/* Réduction des mouvements */
@media (prefers-reduced-motion: reduce){
  .snh-lightbox.is-opening,
  .snh-lightbox.is-opening .snh-lb-dialog,
  .snh-lightbox.is-opening .snh-lb-image,
  .snh-lightbox.is-opening .snh-lb-panel,
  .snh-lightbox.is-opening .snh-lb-badge-new,
  .snh-lightbox.is-opening .snh-lb-title,
  .snh-lightbox.is-opening .snh-lb-meta,
  .snh-lightbox.is-opening .snh-lb-caption,
  .snh-lightbox.is-opening .snh-lb-actions,
  .snh-lightbox.is-next .snh-lb-image,
  .snh-lightbox.is-prev .snh-lb-image{
    animation:none !important;
  }
  .snh-lb-prev,.snh-lb-next,.snh-lb-close{ transition:none !important; }
}