/* Leistungen – Variante D: Vollflächiges BG · mittige Titel-Box · vollbreite Bänder · Schreiegg 1:1 */

.wf-leistung--d {
  --wf-leistung-d-gap: clamp(3.25rem, 8vw, 5.5rem);
  --wf-leistung-d-gap-first: clamp(1rem, 2.5vw, 1.75rem);
  position: relative;
  isolation: isolate;
  min-height: 100vh;
  padding: 0;
  /* overflow darf hier NICHT hidden sein – sonst bricht sticky/fixed BG */
  overflow: visible;
}

/*
  Sticky-Hintergrund: Bild bleibt im Viewport stehen,
  Content-Bänder gleiten darüber (Schreiegg-Effekt).
  Voraussetzung: kein Ancestor mit overflow: hidden/auto.
*/
.wf-leistung--d__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.wf-leistung--d__bg img,
.wf-leistung--d__bg .wf-placeholder-image {
  position: sticky;
  top: 0;
  display: block;
  width: 100%;
  height: 100vh;
  object-fit: cover;
  object-position: center;
  border: none;
  border-radius: 0;
}

.wf-leistung--d__stack {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Hero: Titel mittig in leichter Schatten-/Glas-Box */
.wf-leistung--d__hero {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: clamp(200px, 36vh, 340px);
  padding: clamp(2rem, 5vw, 3.25rem) var(--wf-container-padding);
  text-align: center;
}

.wf-leistung--d__title-box {
  display: inline-block;
  max-width: min(28rem, 92vw);
  padding: 0.95rem 1.75rem;
  background: rgba(255, 255, 255, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 8px 28px rgba(0, 0, 0, 0.22),
    0 2px 8px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(2px);
}

.wf-leistung--d__title-box .wf-leistung__title {
  margin: 0;
  color: #fff;
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1.15;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
  text-transform: none;
}

/* Zwischenraum: Hintergrundbild voll sichtbar */
.wf-leistung--d__gap {
  height: var(--wf-leistung-d-gap);
  flex-shrink: 0;
}

/* Engerer Abstand Titel → erste Content-Box */
.wf-leistung--d__hero + .wf-leistung--d__gap {
  height: var(--wf-leistung-d-gap-first);
}

/* Vollbreite Content-Bänder */
.wf-leistung--d__band {
  width: 100%;
  background: var(--wf-bg);
  border: none;
  border-top: 1px solid var(--wf-border);
  border-bottom: 1px solid var(--wf-border);
}

.wf-leistung--d__band--alt {
  background: var(--wf-bg-subtle);
}

.wf-leistung--d__band-inner {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: clamp(2rem, 4.5vw, 3rem) var(--wf-container-padding);
}

.wf-leistung--d__band-title {
  margin: 0 0 var(--wf-space-lg);
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--wf-text);
  text-transform: none;
  letter-spacing: 0.02em;
}

.wf-leistung--d__band-title--accent {
  color: var(--wf-text);
}

.wf-leistung--d__band p {
  margin: 0 0 var(--wf-space-md);
  color: var(--wf-text);
  font-size: var(--wf-body-size);
  line-height: var(--wf-body-line-height);
  max-width: 72rem;
}

.wf-leistung--d__band p:last-child {
  margin-bottom: 0;
}

/* Zwei-Spalten wie Referenz */
.wf-leistung--d__cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(1.25rem, 3vw, 2.5rem);
  align-items: start;
}

.wf-leistung--d__cols p {
  margin: 0;
  max-width: none;
}

.wf-leistung--d__lead {
  font-weight: 700;
  color: var(--wf-text);
}

.wf-leistung--d__actions {
  margin-top: var(--wf-space-xl);
}

@media (max-width: 768px) {
  .wf-leistung--d__hero {
    min-height: clamp(180px, 32vh, 260px);
  }

  .wf-leistung--d__cols {
    grid-template-columns: 1fr;
    gap: var(--wf-space-md);
  }

  .wf-leistung--d__gap {
    height: clamp(2.25rem, 7vw, 3.5rem);
  }

  .wf-leistung--d__hero + .wf-leistung--d__gap {
    height: clamp(0.75rem, 2vw, 1.25rem);
  }
}

/*
  Fallback ohne Sticky-Parallax (ältere Mobile-Browser):
  Bild deckt den gesamten Abschnitt ab, damit keine weiße Hälfte entsteht.
*/
@supports not (position: sticky) {
  .wf-leistung--d__bg img,
  .wf-leistung--d__bg .wf-placeholder-image {
    position: absolute;
    inset: 0;
    height: 100%;
  }
}
