/* Listing Page Gallery — slider + lightbox */

body.ra-lightbox-open {
  overflow: hidden;
}

.ra-gallery-main .splide__pagination {
  position: relative;
  margin-top: 12px;
  padding: 0;
}

.ra-gallery-main .splide__pagination__page {
  background: var(--ra-gallery-bullet-color, #272726);
  opacity: 0.35;
}

.ra-gallery-main .splide__pagination__page.is-active {
  opacity: 1;
}

.ra-gallery-main .splide__arrow {
  background: transparent;
}

.ra-gallery-main .splide__arrow:disabled {
  opacity: 0.35;
}

/* Lightbox */
.ra-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ra-gallery-lightbox[hidden] {
  display: none !important;
}

.ra-gallery-lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: var(--ra-gallery-lightbox-bg, rgba(0, 0, 0, 0.95));
  -webkit-backdrop-filter: blur(var(--ra-gallery-lightbox-blur, 0px));
  backdrop-filter: blur(var(--ra-gallery-lightbox-blur, 0px));
}

.ra-gallery-lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 3;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.ra-gallery-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.25);
}

.ra-gallery-lightbox__inner {
  position: relative;
  z-index: 2;
  width: min(1200px, 92vw);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ra-gallery-lightbox__main {
  flex: 1;
  min-height: 0;
}

.ra-gallery-lightbox__main .splide__slide {
  display: flex;
  align-items: center;
  justify-content: center;
}

.ra-gallery-lightbox__main img {
  max-width: 100%;
  max-height: calc(92vh - 120px);
  width: auto;
  height: auto;
  object-fit: contain;
  margin: 0 auto;
}

.ra-gallery-lightbox__arrows {
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  justify-content: space-between;
  padding: 0 8px;
  pointer-events: none;
}

.ra-gallery-lightbox__arrows .splide__arrow {
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  width: 44px;
  height: 44px;
  opacity: 1;
}

.ra-gallery-lightbox__arrows .splide__arrow:hover {
  background: rgba(255, 255, 255, 0.3);
}

.ra-gallery-lightbox__arrows .splide__arrow img {
  filter: brightness(0) invert(1);
}

.ra-gallery-lightbox__thumbs {
  flex-shrink: 0;
}

.ra-gallery-lightbox__thumbs .splide__slide {
  opacity: 0.5;
  cursor: pointer;
  border: 2px solid transparent;
  overflow: hidden;
}

.ra-gallery-lightbox__thumbs .splide__slide.is-active {
  opacity: 1;
  border-color: #fff;
}

.ra-gallery-lightbox__thumbs img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 767px) {
  .ra-gallery-lightbox__inner {
    width: 96vw;
  }

  .ra-gallery-lightbox__main img {
    max-height: calc(92vh - 100px);
  }
}
