/* Fenêtre d'image (lightbox) : les liens vers une image s'ouvrent par-dessus la page. */
html.sc-lb-open { overflow: hidden; }

.sc-lb {
  position: fixed; inset: 0; z-index: 300;
  display: grid; place-items: center; padding: clamp(16px, 4vw, 48px);
  background: rgba(40, 10, 12, .82);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; visibility: hidden;
  transition: opacity 300ms ease, visibility 0s 300ms;
}
.sc-lb.is-open { opacity: 1; visibility: visible; transition: opacity 300ms ease; }

.sc-lb-figure {
  position: relative; margin: 0; max-width: min(1100px, 100%); max-height: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  transform: scale(.92) translateY(14px); opacity: 0;
  transition: transform 450ms cubic-bezier(.2, .8, .2, 1), opacity 300ms ease;
}
.sc-lb.is-open .sc-lb-figure { transform: none; opacity: 1; }
.sc-lb-img {
  display: block; max-width: 100%; max-height: calc(100vh - 150px); width: auto; height: auto;
  border-radius: 20px; background: #fff;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
  transition: opacity 250ms ease;
}
.sc-lb-img.is-loading { opacity: 0; }
.sc-lb-caption {
  margin: 0; max-width: 680px; text-align: center; color: #FBF5EC;
  font: 600 15px/1.45 Montserrat, sans-serif;
}
.sc-lb-count { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 500; opacity: .7; }

.sc-lb-btn {
  position: absolute; z-index: 1; border: none; cursor: pointer; border-radius: 50%;
  display: grid; place-items: center; color: #521214; background: #FBF5EC;
  box-shadow: 0 10px 26px rgba(0, 0, 0, .3);
  transition: transform 250ms cubic-bezier(.2, .8, .2, 1), background 250ms, color 250ms;
}
.sc-lb-btn:hover { background: #F3B916; transform: scale(1.08); }
.sc-lb-btn:focus-visible { outline: 3px solid #F3B916; outline-offset: 3px; }
.sc-lb-btn span {
  width: 22px; height: 22px; background: currentColor;
  -webkit-mask: var(--i) center/contain no-repeat; mask: var(--i) center/contain no-repeat;
}
.sc-lb-close { top: clamp(14px, 3vw, 28px); right: clamp(14px, 3vw, 28px); width: 50px; height: 50px; }
.sc-lb-close span { --i: url(https://cdn.jsdelivr.net/npm/lucide-static@0.460.0/icons/x.svg); }
.sc-lb-prev, .sc-lb-next { top: 50%; width: 52px; height: 52px; margin-top: -26px; }
.sc-lb-prev { left: clamp(10px, 2.5vw, 28px); }
.sc-lb-next { right: clamp(10px, 2.5vw, 28px); }
.sc-lb-prev span { --i: url(https://cdn.jsdelivr.net/npm/lucide-static@0.460.0/icons/chevron-left.svg); }
.sc-lb-next span { --i: url(https://cdn.jsdelivr.net/npm/lucide-static@0.460.0/icons/chevron-right.svg); }
.sc-lb-prev:hover { transform: translateX(-3px) scale(1.06); }
.sc-lb-next:hover { transform: translateX(3px) scale(1.06); }
.sc-lb.is-single .sc-lb-prev, .sc-lb.is-single .sc-lb-next, .sc-lb.is-single .sc-lb-count { display: none; }

@media (max-width: 640px) {
  .sc-lb-img { max-height: calc(100vh - 190px); border-radius: 14px; }
  .sc-lb-prev, .sc-lb-next { top: auto; bottom: 18px; margin-top: 0; width: 46px; height: 46px; }
  .sc-lb-prev { left: calc(50% - 56px); }
  .sc-lb-next { right: calc(50% - 56px); }
}
@media (prefers-reduced-motion: reduce) {
  .sc-lb, .sc-lb-figure, .sc-lb-img { transition: none !important; }
}
