/* MODULE: gallery ─────────────────────────────────────────── */
.gallery { background: var(--bg); }

.gallery-map-cta {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

.gallery-subtitle {
  display: none;
}
.gallery-subtitle.is-visible {
  display: block;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.8;
  max-width: 620px;
  margin: 20px auto 0;
  white-space: pre-line;
}

/* Marquee-Slider – kontinuierlicher links-nach-rechts Lauf.
   Vorher Masonry-Grid (3×4, 7 Kacheln mit Template-Rotation), siehe
   git-History vor 2026-04-24. */
.gallery-masonry {
  position: relative;
  width: 100%;
  overflow: hidden;
  /* Weiche Fade-Masken an den Raendern, damit Items nicht hart ein/aus-poppen */
  -webkit-mask-image: linear-gradient(to right, transparent 0, black 24px, black calc(100% - 24px), transparent 100%);
          mask-image: linear-gradient(to right, transparent 0, black 24px, black calc(100% - 24px), transparent 100%);
}

.gallery-slider-track {
  display: flex;
  gap: 16px;
  width: max-content;
  /* animationDuration wird von JS dynamisch gesetzt (proportional zu Item-Anzahl) */
  animation: gallery-slide-lr 90s linear infinite;
  will-change: transform;
}

/* Pause on hover (Desktop) */
.gallery-masonry:hover .gallery-slider-track { animation-play-state: paused; }

/* Pause on touch (Mobile): JS toggelt .is-paused waehrend Beruehrung */
.gallery-slider-track.is-paused { animation-play-state: paused; }

/* User bevorzugt reduzierte Bewegung? → sehr langsam statt aus
   (a11y-vertraeglich, aber der Inhalt wechselt noch). */
@media (prefers-reduced-motion: reduce) {
  .gallery-slider-track { animation-duration: 600s !important; }
}

@keyframes gallery-slide-lr {
  from { transform: translateX(-50%); }   /* zweite Kopie sichtbar */
  to   { transform: translateX(0); }      /* erste Kopie sichtbar */
}

.gallery-slide {
  flex: 0 0 auto;
  width: 400px;
  height: 280px;
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.gallery-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.gallery-slide:hover img { transform: scale(1.06); }

/* Mobile: kleinere Slides */
@media (max-width: 768px) {
  .gallery-slide { width: 280px; height: 200px; }
  .gallery-slider-track { gap: 12px; }
}

@media (max-width: 480px) {
  .gallery-slide { width: 240px; height: 170px; }
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(20,20,30,0.80) 0%, transparent 55%);
  display: flex;
  align-items: flex-end;
  padding: 20px;
  opacity: 0;
  transition: opacity var(--transition);
  pointer-events: none;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-overlay span {
  font-size: 14px;
  font-weight: 600;
  color: var(--white);
}
