/* Gallery layout - overrides Avo theme `width: initial !important` on gallery items */

.dee-pearls-page-content .elementor-image-gallery .gallery {
  display: grid !important;
  gap: 6px;
  margin: 0 !important;
}

.dee-pearls-page-content .elementor-image-gallery .gallery-columns-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.dee-pearls-page-content .elementor-image-gallery .gallery-columns-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.dee-pearls-page-content .elementor-image-gallery .gallery-columns-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.dee-pearls-page-content .elementor-image-gallery .gallery-item {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  display: block !important;
}

.dee-pearls-page-content .elementor-image-gallery .gallery-icon,
.dee-pearls-page-content .elementor-image-gallery .gallery-icon a {
  display: block;
  width: 100%;
}

.dee-pearls-page-content .elementor-image-gallery .gallery-icon img {
  display: block;
  width: 100% !important;
  height: auto;
  aspect-ratio: 5 / 3;
  object-fit: cover;
}

/* Home - Our Projects image grid (individual Elementor image widgets) */
.dee-pearls-page-content .elementor-element-92d36d0 .elementor-widget-image > .elementor-widget-container {
  overflow: hidden;
}

.dee-pearls-page-content .elementor-element-92d36d0 .elementor-widget-image img {
  display: block;
  width: 100% !important;
  height: auto;
  aspect-ratio: 5 / 3;
  object-fit: cover;
}

/* Home - GALLERY carousel slide thumbnails */
.dee-pearls-page-content .elementor-element-4fd6ce6 .swiper-slide-inner {
  display: block;
  overflow: hidden;
}

.dee-pearls-page-content .elementor-element-4fd6ce6 .swiper-slide-image {
  display: block;
  width: 100% !important;
  height: auto;
  aspect-ratio: 5 / 3;
  object-fit: cover;
}

@media (max-width: 767px) {
  .dee-pearls-page-content .elementor-image-gallery .gallery-columns-3,
  .dee-pearls-page-content .elementor-image-gallery .gallery-columns-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 479px) {
  .dee-pearls-page-content .elementor-image-gallery .gallery-columns-2,
  .dee-pearls-page-content .elementor-image-gallery .gallery-columns-3,
  .dee-pearls-page-content .elementor-image-gallery .gallery-columns-4 {
    grid-template-columns: 1fr;
  }
}

.dee-pearls-page-content a[data-elementor-open-lightbox="yes"],
.dee-pearls-page-content .elementor-widget-image a[href$=".jpg"],
.dee-pearls-page-content .elementor-widget-image a[href$=".jpeg"],
.dee-pearls-page-content .elementor-widget-image a[href$=".png"],
.dee-pearls-page-content .elementor-widget-image a[href$=".webp"] {
  cursor: zoom-in;
}

/* Elementor's native lightbox conflicts with our custom controls */
body.dee-gallery-lightbox-open .elementor-lightbox,
body.dee-gallery-lightbox-open .dialog-widget.dialog-lightbox-widget,
body.dee-gallery-lightbox-open .mfp-wrap,
body.dee-gallery-lightbox-open .mfp-bg {
  display: none !important;
  pointer-events: none !important;
}

.dee-gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000005;
  display: none;
  pointer-events: none;
}

.dee-gallery-lightbox.is-open {
  display: block;
  pointer-events: auto;
}

.dee-gallery-lightbox__backdrop {
  position: fixed;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.92);
  cursor: zoom-out;
  z-index: 1000005;
  pointer-events: auto;
}

.dee-gallery-lightbox__dialog {
  position: fixed;
  inset: 0;
  z-index: 1000006;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 16px 16px;
  box-sizing: border-box;
  pointer-events: none;
}

.dee-gallery-lightbox__figure {
  margin: 0;
  width: min(100%, 1200px);
  max-width: 100%;
  max-height: calc(100vh - 72px);
  text-align: center;
  pointer-events: auto;
}

.dee-gallery-lightbox__image {
  display: block;
  max-width: min(100%, 1200px);
  max-height: calc(100vh - 96px);
  width: auto;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);
}

.dee-gallery-lightbox__caption {
  margin-top: 12px;
  color: #fff;
  font-family: "Times Now", "Times New Roman", Times, serif;
  font-size: 14px;
}

.dee-gallery-lightbox__close,
.dee-gallery-lightbox__nav {
  position: fixed;
  z-index: 1000008;
  display: flex !important;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.72);
  color: #fff !important;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  margin: 0;
  min-width: 44px;
  min-height: 44px;
  border-radius: 999px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
  -webkit-tap-highlight-color: transparent;
  font-family: Arial, sans-serif;
  font-weight: 400;
  text-shadow: none;
  opacity: 1 !important;
  visibility: visible !important;
  pointer-events: auto !important;
}

.dee-gallery-lightbox__close span,
.dee-gallery-lightbox__nav span {
  display: block;
  color: #fff !important;
  line-height: 1;
}

.dee-gallery-lightbox__close {
  top: 14px;
  right: 14px;
  font-size: 2rem;
}

.dee-gallery-lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
  font-size: 2.4rem;
}

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

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

.dee-gallery-lightbox__close:hover,
.dee-gallery-lightbox__nav:hover {
  background: rgba(0, 0, 0, 0.75);
}

.dee-gallery-lightbox__close[hidden],
.dee-gallery-lightbox__nav[hidden] {
  display: none !important;
}

@media (max-width: 767px) {
  .dee-gallery-lightbox {
    padding: 52px 8px 8px;
  }

  .dee-gallery-lightbox__image {
    max-height: calc(100vh - 88px);
  }

  .dee-gallery-lightbox__close {
    top: 10px;
    right: 10px;
    min-width: 40px;
    min-height: 40px;
    font-size: 1.75rem;
  }

  .dee-gallery-lightbox__nav {
    min-width: 40px;
    min-height: 40px;
    font-size: 2rem;
  }

  .dee-gallery-lightbox__nav--prev {
    left: 6px;
  }

  .dee-gallery-lightbox__nav--next {
    right: 6px;
  }
}
