/* Host de fons: cobreix tota la secció (un per carrusel) */
.dms3-fons-carrusel-host {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Degradat de legibilitat per sobre les imatges */
.dms3-fons-carrusel-host::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    hsl(from #2f2d31 calc(h + 0) calc(s + 0) calc(l + 0) / 0.5) 17%,
    hsl(from #2f2d31 calc(h + 0) calc(s + 0) calc(l + 0) / 0.4) 41%,
    hsl(from #2f2d31 calc(h + 0) calc(s + 0) calc(l + 0) / 0.15) 100%
  ) !important;
}

.dms3-fons-carrusel-host.dms3-no-gradient::after {
  content: none;
}

/* Cada imatge omple la secció sencera */
.dms3-fons-carrusel-host .dms3-fons-carrusel-item {
  position: absolute;
  inset: 0;
  opacity: 0;
  z-index: 1;
  pointer-events: none;
  transition: opacity var(--dms3-crossfade-ms, 400ms) ease-in-out;
  will-change: opacity;
}

/* L'activa queda per sobre durant el crossfade */
.dms3-fons-carrusel-host .dms3-fons-carrusel-item.is-active {
  opacity: 1;
  z-index: 2;
}

.dms3-fons-carrusel-host .dms3-fons-carrusel-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Blur opcional per slide (backdrop + màscara lateral). */
.dms3-fons-carrusel-host .dms3-fons-carrusel-item.has-blur::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  -webkit-mask-image: linear-gradient(90deg, #000 0%, #000 50%, transparent 100%);
  mask-image: linear-gradient(90deg, #000 0%, #000 50%, transparent 100%);
}

/* Originals dins l'slide: amagats al frontend */
.et_pb_image.dms3-fons-carrusel-source {
  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;
  white-space: nowrap !important;
  border: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
