/**
 * Eetkamer Bredius – homepage fader (front end only).
 * In the editor the slides are shown side by side (see theme.css) so they stay editable.
 */

.eb-fader.eb-fader {
  display: block;
  position: relative;
  overflow: hidden;
  height: 672px;
}

.eb-fader > .eb-fader__slide {
  position: absolute;
  inset: 0;
  margin: 0 !important;
  opacity: 0;
  transition: opacity 1.4s ease-in-out;
}

/* Without JS (or before it runs) the first slide is visible. */
.eb-fader:not(.is-ready) > .eb-fader__slide:first-of-type,
.eb-fader > .eb-fader__slide.is-active {
  opacity: 1;
}

.eb-fader > .eb-fader__slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 45%;
}

.eb-fader__dots {
  position: absolute;
  left: 50%;
  bottom: 32px;
  z-index: 2;
  display: flex;
  gap: 11px;
  transform: translateX(-50%);
}

.eb-fader__dot {
  width: 16px;
  height: 16px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background-color: var(--wp--preset--color--off-white);
  opacity: 0.75;
  cursor: pointer;
  transition:
    background-color 0.3s,
    opacity 0.3s;
}

.eb-fader__dot:hover,
.eb-fader__dot:focus-visible {
  opacity: 1;
}

.eb-fader__dot:focus-visible {
  outline: 2px solid var(--wp--preset--color--magenta);
  outline-offset: 2px;
}

.eb-fader__dot[aria-current='true'] {
  background-color: var(--wp--preset--color--green);
  opacity: 1;
}

/* ---------------------------------------------------------------------------
 * Blurred edges (block style "Fader – vervaagde randen")
 * A full-viewport-width copy of the active photo, stretched and blurred,
 * sits behind the wide fader and fills the space on both sides.
 * ------------------------------------------------------------------------ */

.eb-fader.is-style-fader-blur {
  overflow: visible;
  isolation: isolate;
}

.eb-fader.is-style-fader-blur > .eb-fader__slide {
  z-index: 1;
}

.eb-fader__backdrop {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 100vw;
  transform: translateX(-50%);
  overflow: hidden;
  z-index: 0;
  pointer-events: none;
  background-color: var(--wp--preset--color--charcoal);
}

.eb-fader__backdrop-layer {
  position: absolute;
  inset: -80px; /* oversize so the blur has no soft/transparent edges */
  background-size: 100% 100%; /* stretched, as the designer suggested */
  background-position: center;
  filter: blur(40px) saturate(1.15) brightness(1);
  opacity: 0;
  transition: opacity 1.4s ease-in-out;
}

.eb-fader__backdrop-layer.is-active {
  opacity: 1;
}

/* Soft shadow so the sharp photo lifts off the blurred edges. */
.eb-fader.is-style-fader-blur::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .eb-fader__backdrop-layer {
    transition: none;
  }
}

@media (max-width: 1180px) {
  .eb-fader.eb-fader {
    height: clamp(320px, 52vw, 672px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .eb-fader > .eb-fader__slide {
    transition: none;
  }
}
