.jr-lightbox {
  position: fixed;
  inset: 0;
  z-index: 2147483646;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 56px 72px 64px;
  background: rgba(8, 10, 14, 0);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: background 0.35s ease, opacity 0.35s ease, visibility 0.35s ease;
  backdrop-filter: blur(0);
  -webkit-backdrop-filter: blur(0);
}

.jr-lightbox.is-open {
  background: rgba(8, 10, 14, 0.88);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.jr-lightbox__stage {
  position: relative;
  z-index: 1;
  max-width: min(96vw, 1400px);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  opacity: 0;
  transform: translateY(18px) scale(0.96);
  transition: opacity 0.4s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.jr-lightbox.is-open .jr-lightbox__stage {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.jr-lightbox__image {
  display: block;
  max-width: min(92vw, 1400px);
  max-height: calc(88vh - 52px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.4);
  user-select: none;
  -webkit-user-drag: none;
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 0.28s ease, transform 0.28s ease;
}

.jr-lightbox__image.is-ready {
  opacity: 1;
  transform: scale(1);
}

.jr-lightbox__caption {
  margin: 0;
  color: #f3f4f6;
  font: 14px/1.4 system-ui, -apple-system, Segoe UI, sans-serif;
  text-align: center;
  max-width: 90vw;
}

.jr-lightbox__counter {
  position: absolute;
  top: max(12px, env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  color: #e5e7eb;
  font: 13px/1 system-ui, sans-serif;
  pointer-events: none;
}

.jr-lightbox__btn {
  position: absolute;
  z-index: 4;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  line-height: 1;
  transition: background 0.15s ease, transform 0.15s ease;
}

.jr-lightbox__btn:hover,
.jr-lightbox__btn:focus-visible {
  background: rgba(255, 255, 255, 0.32);
  outline: none;
}

.jr-lightbox__close {
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
}

.jr-lightbox__prev,
.jr-lightbox__next {
  top: 50%;
  transform: translateY(-50%);
}

.jr-lightbox__prev {
  left: max(12px, env(safe-area-inset-left));
}

.jr-lightbox__next {
  right: max(12px, env(safe-area-inset-right));
}

.jr-lightbox.is-single .jr-lightbox__prev,
.jr-lightbox.is-single .jr-lightbox__next {
  display: none;
}

.jr-lightbox-scope img,
.entry-content img,
.wp-block-post-content img,
.elementor img {
  cursor: zoom-in;
}

@media (max-width: 900px) {
  .jr-lightbox {
    padding: 52px 12px 88px;
  }

  .jr-lightbox__prev,
  .jr-lightbox__next {
    top: auto;
    bottom: max(18px, env(safe-area-inset-bottom));
    transform: none;
    width: 52px;
    height: 52px;
    background: #fff;
    color: #111;
    font-size: 24px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
  }

  .jr-lightbox__prev {
    left: max(16px, env(safe-area-inset-left));
  }

  .jr-lightbox__next {
    right: max(16px, env(safe-area-inset-right));
  }

  .jr-lightbox__close {
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.92);
    color: #111;
  }
}

body.jr-lightbox-lock {
  overflow: hidden;
}
