/**
 * Endlos-Galerie-Marquee (init per bd-gallery-slider.js).
 * Host: #galerie .gal-grid / #galerie .grid.grid-gal / #ambiente .gal-grid
 */
.bd-gal-marquee-host {
  display: block !important;
  width: 100%;
  max-width: 100%;
}

.bd-gal-marquee {
  position: relative;
  width: 100%;
  overflow: hidden;
  padding: 8px 0 12px;
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0%,
    #000 3%,
    #000 97%,
    transparent 100%
  );
  mask-image: linear-gradient(90deg, transparent 0%, #000 3%, #000 97%, transparent 100%);
}

.bd-gal-marquee__track {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: clamp(10px, 2vw, 18px);
  width: max-content;
  animation: bd-gal-marquee-x linear infinite;
  will-change: transform;
}

@keyframes bd-gal-marquee-x {
  0% {
    transform: translate3d(0, 0, 0);
  }
  100% {
    transform: translate3d(-50%, 0, 0);
  }
}

.bd-gal-marquee__slide {
  flex: 0 0 auto;
  width: clamp(168px, 26vw, 280px);
  position: relative;
  z-index: 1;
  border-radius: clamp(10px, 1.5vw, 16px);
  transition:
    transform 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.38s ease,
    filter 0.38s ease,
    z-index 0s linear 0.2s;
}

.bd-gal-marquee__slide:hover {
  z-index: 8;
  transition-delay: 0s, 0s, 0s, 0s;
  transform: scale(1.14) translateY(-12px);
  filter: drop-shadow(0 20px 36px rgba(0, 0, 0, 0.35));
}

.bd-gal-marquee__img {
  display: block;
  width: 100%;
  height: clamp(150px, 20vw, 240px);
  object-fit: cover;
  border-radius: inherit;
}

/* Überschreibt Template-Regeln wie #galerie .gal-grid img (max-height / aspect-ratio) */
#galerie .gal-grid .bd-gal-marquee .bd-gal-marquee__img,
#galerie .grid.grid-gal .bd-gal-marquee .bd-gal-marquee__img,
#ambiente .gal-grid .bd-gal-marquee .bd-gal-marquee__img {
  max-height: none;
  aspect-ratio: unset;
  height: clamp(150px, 20vw, 240px);
}

/* Pausiert die Bahn, solange eine Karte hover/focus hat */
.bd-gal-marquee:has(.bd-gal-marquee__slide:hover) .bd-gal-marquee__track,
.bd-gal-marquee:has(.bd-gal-marquee__slide:focus-within) .bd-gal-marquee__track {
  animation-play-state: paused;
}

.bd-gal-marquee__slide:focus-within {
  outline: none;
}

.bd-gal-marquee__slide:focus-within .bd-gal-marquee__img {
  outline: 2px solid rgba(255, 255, 255, 0.95);
  outline-offset: 3px;
}
