/* Galeri lightbox — native dialog */

.gallery-main .slider-container,
.gallery-thumb-btn {
  cursor: zoom-in;
}

html.gallery-lightbox-open {
  overflow: hidden;
}

.gallery-lightbox {
  z-index: 10001;
  padding: 0;
  border: none;
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  background: transparent;
}

.gallery-lightbox::backdrop {
  background: rgba(0, 0, 0, 0.85);
}

.gallery-lightbox__inner {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    max(16px, env(safe-area-inset-top))
    max(16px, env(safe-area-inset-right))
    max(16px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
  box-sizing: border-box;
  pointer-events: none;
}

.gallery-lightbox__inner > * {
  pointer-events: auto;
}

.gallery-lightbox__stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 92vw;
  max-height: 85vh;
  margin: 0;
  touch-action: pan-y pinch-zoom;
}

.gallery-lightbox__img {
  display: block;
  max-width: min(92vw, 1200px);
  max-height: 85vh;
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.gallery-lightbox__counter {
  margin-top: 12px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
}

.gallery-lightbox__close,
.gallery-lightbox__nav {
  position: fixed;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s ease, transform 0.2s ease;
}

.gallery-lightbox__close {
  top: max(12px, env(safe-area-inset-top));
  right: max(12px, env(safe-area-inset-right));
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
}

.gallery-lightbox__close:hover {
  background: rgba(227, 30, 36, 0.9);
}

.gallery-lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 32px;
  line-height: 1;
}

.gallery-lightbox__nav:hover {
  background: rgba(227, 30, 36, 0.9);
}

.gallery-lightbox__nav--prev {
  left: max(8px, env(safe-area-inset-left));
}

.gallery-lightbox__nav--next {
  right: max(8px, env(safe-area-inset-right));
}

.gallery-lightbox__nav:disabled,
.gallery-lightbox--single .gallery-lightbox__nav {
  display: none;
}

.gallery-lightbox--single .gallery-lightbox__counter {
  display: none;
}

.gallery-lightbox__close:focus-visible,
.gallery-lightbox__nav:focus-visible {
  outline: 2px solid #e31e24;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .gallery-lightbox,
  .gallery-lightbox::backdrop {
    animation: none;
  }

  .gallery-lightbox__close,
  .gallery-lightbox__nav,
  .gallery-lightbox__img {
    transition: none;
  }
}

@media (max-width: 768px) {
  .gallery-lightbox__nav {
    display: none;
  }
}
