/* ==========================================================================
   Lightbox des galeries (ap-lightbox.js) : photo en grand sur fond encre.
   ========================================================================== */
a[data-ap-lightbox] {
  border-radius: 12px;
  cursor: zoom-in;
  display: block;
}
a[data-ap-lightbox]:focus-visible {
  outline: 3px solid var(--ap-ink);
  outline-offset: 3px;
}
a[data-ap-lightbox] img {
  pointer-events: none;
}
.ap-lb-open {
  overflow: hidden;
}
.ap-lb {
  align-items: center;
  bottom: 0;
  display: flex;
  font-family: var(--ap-font);
  justify-content: center;
  left: 0;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 1000;
}
.ap-lb[hidden] {
  display: none !important;
}
.ap-lb__backdrop {
  animation: ap-lb-fade 0.2s ease;
  backdrop-filter: blur(6px);
  background: rgba(37, 2, 18, 0.9);
  bottom: 0;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}
.ap-lb__figure {
  animation: ap-lb-in 0.25s ease;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  display: flex;
  flex-direction: column;
  margin: 0;
  max-height: calc(100vh - 120px);
  max-width: min(92vw, 1320px);
  padding: 10px;
  position: relative;
  z-index: 1;
}
.ap-lb__img {
  background: var(--ap-soft);
  border-radius: 10px;
  display: block;
  height: auto;
  max-height: calc(100vh - 176px);
  max-width: calc(92vw - 20px);
  min-height: 160px;
  min-width: 240px;
  object-fit: contain;
  transition: opacity 0.2s ease;
  width: auto;
}
.ap-lb.is-loading .ap-lb__img {
  opacity: 0.4;
}
.ap-lb__caption {
  color: var(--ap-ink);
  font-size: 14px;
  line-height: 1.4;
  padding: 10px 6px 2px;
  text-align: center;
}
.ap-lb__caption:empty {
  display: none;
}
.ap-lb__btn {
  align-items: center;
  background: rgba(37, 2, 18, 0.35);
  border: 2px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  box-shadow: none;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  height: 52px;
  justify-content: center;
  letter-spacing: 0;
  line-height: 1;
  margin: 0;
  min-height: 0;
  padding: 0;
  text-transform: none;
  transition: background 0.2s ease, color 0.2s ease;
  width: 52px;
  z-index: 2;
}
.ap-lb__btn:hover {
  background: #fff;
  color: var(--ap-ink);
}
.ap-lb__btn:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}
.ap-lb__close {
  position: absolute;
  right: 20px;
  top: 20px;
}
.ap-lb__nav {
  align-items: center;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  left: 0;
  padding: 0 20px;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 0;
}
.ap-lb__nav .ap-lb__btn {
  pointer-events: auto;
}
.ap-lb__count {
  bottom: 18px;
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  font-weight: 700;
  left: 50%;
  margin: 0;
  position: absolute;
  transform: translateX(-50%);
}
.ap-lb--single .ap-lb__nav {
  display: none;
}
@keyframes ap-lb-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes ap-lb-in {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ap-lb__backdrop,
  .ap-lb__figure {
    animation: none;
  }
}
@media (max-width: 767px) {
  .ap-lb__figure {
    max-height: calc(100vh - 150px);
    max-width: calc(100vw - 24px);
    padding: 6px;
  }
  .ap-lb__img {
    max-height: calc(100vh - 200px);
    max-width: calc(100vw - 36px);
    min-width: 0;
  }
  .ap-lb__btn {
    height: 46px;
    width: 46px;
  }
  .ap-lb__close {
    right: 12px;
    top: 12px;
  }
  /* Flèches en bas, sous la photo, avec le compteur entre les deux. */
  .ap-lb__nav {
    align-items: flex-end;
    padding: 0 16px 16px;
  }
  .ap-lb__count {
    bottom: 30px;
  }
}
