/**
 * Gallery Lightbox Styles
 * Lightbox for videos and image galleries
 * Mobile-first approach
 */

/* ===== BASE LIGHTBOX ===== */

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.gallery-lightbox--active {
  opacity: 1;
  visibility: visible;
}

/* Overlay */
.gallery-lightbox__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* Container - mobile first */
.gallery-lightbox__container {
  position: relative;
  width: 95%;
  max-width: 1200px;
  max-height: 90vh;
  z-index: 1;
  transform: scale(0.95);
  transition: transform 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-lightbox--active .gallery-lightbox__container {
  transform: scale(1);
}

/* ===== CLOSE BUTTON ===== */

.gallery-lightbox__close {
  position: absolute;
  top: -50px;
  right: 0;
  width: 44px;
  height: 44px;
  padding: 0;
  border: none;
  background: transparent;
  color: #fff;
  font-size: 36px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
  opacity: 0.8;
  transition: opacity 0.2s ease;
  z-index: 10;
}

.gallery-lightbox__close:hover {
  opacity: 1;
}

.gallery-lightbox__close:focus {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

/* ===== CONTENT AREA ===== */

.gallery-lightbox__content {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Video (iframe) */
.gallery-lightbox__video {
  width: 100%;
  max-width: 900px;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* Image - mobile first */
.gallery-lightbox__image {
  max-width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

/* ===== NAVIGATION - mobile first ===== */

.gallery-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  background: var(--green);
  color: #000000;
  border-radius: 50%;
  cursor: pointer;
  opacity: 1;
  transition: opacity 0.2s ease, background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.gallery-lightbox__nav:hover,.gallery-lightbox__nav:focus {
  opacity: 1;
  background: var(--btn-hover-bg);
  color:var(--green);
  outline:2px solid var(--green);
}

.gallery-lightbox__nav svg {
  width: 20px;
  height: 20px;
}

.gallery-lightbox__nav--prev {
  left: 10px;
}

.gallery-lightbox__nav--next {
  right: 10px;
}

/* ===== COUNTER - mobile first ===== */

.gallery-lightbox__counter {
  position: absolute;
  bottom: -35px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
}

/* ===== GALLERY IMAGE INDICATOR (Magnifying glass) - mobile first ===== */

.gallery-wrapper {
  /* Ensure positioning context for children if needed */
  display: flex;
  align-items: stretch;
  justify-content: flex-start;
  gap:10px;
}
.editor-styles-wrapper .gallery-wrapper{
  display:flex;
  flex-wrap:wrap;
}
.editor-styles-wrapper .gallery-wrapper .swiper-slide{
  width:23%;
  height:60px;
  overflow:hidden;
}
.gallery-lightbox-image {
  position: relative;
  height:100%;
  width:100%;
  max-height:250px;
}
.editor-styles-wrapper .gallery-lightbox-image{
  height:100px;
  object-fit: cover;
}  
.editor-styles-wrapper .gallery-lightbox-image{
  width:23%;
}
/* Wrapper for the indicator - we need a parent with position relative */
.gallery-wrapper figure {
  position: relative;
}

/* Magnifying glass indicator - mobile first (smaller) */
.gallery-wrapper figure::after {
  content: '';
  position: absolute;
  bottom: 8px;
  right: 8px;
  width: 14px;
  height: 14px;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 50%;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease;
  z-index: 5;
  /* Magnifying glass icon using CSS */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
  background-size: 8px 8px;
  background-position: center;
  background-repeat: no-repeat;
}
.editor-styles-wrapper .gallery-wrapper figure::after{
  display:none;
}
/* Show on hover (desktop) */
.gallery-wrapper figure:hover::after {
  opacity: 1;
}

/* Always show on touch devices */
@media (hover: none) {
  .gallery-wrapper figure::after {
    opacity: 0.8;
  }
}

/* ===== TABLET/DESKTOP (min-width: 769px) ===== */

@media (min-width: 769px) {
  .gallery-lightbox-image{
    height:260px;
  }
  .gallery-lightbox__container {
    width: 90%;
  }

  .gallery-lightbox__nav {
    width: 50px;
    height: 50px;
  }

  .gallery-lightbox__nav--prev {
    left: 20px;
  }

  .gallery-lightbox__nav--next {
    right: 20px;
  }

  .gallery-lightbox__nav svg {
    width: 24px;
    height: 24px;
  }

  .gallery-lightbox__image {
    max-height: 80vh;
  }

  .gallery-lightbox__counter {
    bottom: -40px;
    font-size: 14px;
  }

  /* Larger indicator on desktop */
  .gallery-wrapper figure::after {
    width: 32px;
    height: 32px;
    bottom: 12px;
    right: 12px;
    background-size: 18px 18px;
  }
}

/* ===== REDUCED MOTION ===== */

@media (prefers-reduced-motion: reduce) {
  .gallery-lightbox,
  .gallery-lightbox__container,
  .gallery-lightbox__nav,
  .gallery-lightbox-image {
    transition: none;
  }
}
