/**
 * LoveLens gallery IMG SEO
 * Display: Elementor background tiles. SEO: visually hidden <img> in DOM.
 */

.elementor-widget-gallery {
  clear: both !important;
  margin-bottom: 32px !important;
}

.elementor-widget-gallery ~ .elementor-widget {
  position: relative !important;
  z-index: 10 !important;
  background-color: #fff !important;
}

.elementor-widget-gallery ~ .elementor-widget .elementor-widget-container {
  background-color: #fff !important;
}

/* Indexable img — visually hidden, does not affect masonry layout */
.elementor-widget-gallery .lovelens-seo-gallery-img {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* Before e-gallery JS */
.elementor-widget-gallery .elementor-gallery__container:not(.e-gallery-masonry):not(.e-gallery-grid):not(.e-gallery-justified) {
  display: grid !important;
  grid-template-columns: repeat(3, 1fr) !important;
  gap: 10px !important;
}

.elementor-widget-gallery .elementor-gallery__container:not(.e-gallery-masonry):not(.e-gallery-grid):not(.e-gallery-justified) .e-gallery-item {
  position: relative !important;
}

.elementor-widget-gallery .elementor-gallery__container:not(.e-gallery-masonry):not(.e-gallery-grid):not(.e-gallery-justified) .e-gallery-image {
  position: relative !important;
  padding-bottom: 66.666% !important;
  height: 0 !important;
  overflow: hidden !important;
  background-size: cover !important;
  background-position: center !important;
}

@media (max-width: 1024px) {
  .elementor-widget-gallery {
    overflow: hidden !important;
    margin-bottom: 28px !important;
  }

  .elementor-widget-gallery .elementor-gallery__container.e-gallery-masonry,
  .elementor-widget-gallery .elementor-gallery__container.e-gallery-grid,
  .elementor-widget-gallery .elementor-gallery__container.e-gallery-justified {
    height: auto !important;
    padding-bottom: 0 !important;
    overflow: hidden !important;
  }

  .elementor-widget-gallery .e-gallery-masonry .e-gallery-item,
  .elementor-widget-gallery .e-gallery-grid .e-gallery-item,
  .elementor-widget-gallery .e-gallery-justified .e-gallery-item {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: 100% !important;
    transform: none !important;
    margin-bottom: 10px !important;
  }

  .elementor-widget-gallery .elementor-gallery__container:not(.e-gallery-masonry):not(.e-gallery-grid):not(.e-gallery-justified) {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}

@media (max-width: 767px) {
  .elementor-widget-gallery .elementor-gallery__container:not(.e-gallery-masonry):not(.e-gallery-grid):not(.e-gallery-justified) {
    grid-template-columns: 1fr !important;
  }
}
