/* Fallback anteprime gallery se EGallery non assegna ancora il background */
.elementor-widget-gallery .e-gallery-image[data-thumbnail] {
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  min-height: 180px;
}

.elementor-widget-gallery .elementor-gallery__container:not(.e-gallery-container) {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

@media (max-width: 1024px) {
  .elementor-widget-gallery .elementor-gallery__container:not(.e-gallery-container) {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
}

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

.elementor-widget-gallery .elementor-gallery__container:not(.e-gallery-container) .e-gallery-item {
  display: block;
  overflow: hidden;
  border-radius: 6px;
}

.elementor-widget-gallery .elementor-gallery__container:not(.e-gallery-container) .e-gallery-image {
  aspect-ratio: 4 / 3;
  width: 100%;
  min-height: 0;
}

/* Video background YouTube fallback */
.elementor-background-video-container {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
}

.elementor-background-video-embed {
  position: absolute;
  inset: 0;
}