/* ==========================================================================
   Leistungen – gemeinsame Detailbereiche und Sticky-Navigation
   ========================================================================== */

.leistung-section {
  position: relative;
  scroll-margin-top: calc(var(--h-header-compact, 64px) + 24px);
}

/* Auf großen Displays bleibt rechts Platz für das schwebende Leistungsmenü. */
@media (min-width: 1281px) {
  .leistung-section > .container {
    padding-right: calc(var(--gutter, 2rem) + 245px);
  }
}

.leistung-detail {
  display: block;
}

.leistung-detail__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(280px, .88fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.leistung-detail--reverse .leistung-detail__visual {
  order: -1;
}

.leistung-detail__copy h2 {
  max-width: 760px;
  margin-bottom: var(--sp-5, 1.25rem);
}

.leistung-detail__copy > .lead {
  max-width: 62ch;
  margin-bottom: var(--sp-5, 1.25rem);
}

.leistung-detail__copy > p:not(.lead) {
  max-width: 64ch;
}

.leistung-detail__features {
  margin-top: var(--sp-7, 2rem);
  max-width: 64ch;
}

.leistung-detail__products {
  margin-top: var(--sp-7, 2rem);
  padding-top: var(--sp-6, 1.5rem);
  border-top: 1px solid var(--c-line, #dce3eb);
}

.leistung-detail__products h3 {
  margin-bottom: var(--sp-4, 1rem);
  font-size: var(--fs-h4, 1.0625rem);
}

.leistung-detail__products .anchor-nav {
  margin-top: 0;
  padding-left: 0;
  list-style: none;
}

.leistung-detail__visual {
  position: relative;
  min-height: clamp(280px, 31vw, 410px);
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--c-line, #dce3eb);
  border-radius: var(--r-lg, 16px);
  background:
    radial-gradient(circle at 74% 22%, rgba(94, 135, 182, .21), transparent 34%),
    radial-gradient(circle at 24% 78%, rgba(23, 134, 140, .12), transparent 32%),
    var(--c-surface, #fff);
}

.leistung-section:nth-of-type(even) .leistung-detail__visual {
  background:
    radial-gradient(circle at 74% 22%, rgba(247, 193, 33, .16), transparent 34%),
    radial-gradient(circle at 24% 78%, rgba(94, 135, 182, .14), transparent 32%),
    var(--c-surface, #fff);
}

.leistung-detail__visual::before,
.leistung-detail__visual::after {
  content: "";
  position: absolute;
  border: 1px solid var(--c-line, #dce3eb);
  border-radius: var(--r-lg, 16px);
  pointer-events: none;
}

.leistung-detail__visual::before {
  width: 72%;
  height: 58%;
  transform: translate(12%, -8%);
  background: rgba(255, 255, 255, .44);
}

.leistung-detail__visual::after {
  width: 55%;
  height: 40%;
  transform: translate(-19%, 35%);
  background: rgba(255, 255, 255, .66);
}

.leistung-detail__graphic {
  position: relative;
  z-index: 3;
  width: clamp(122px, 12vw, 166px);
  height: clamp(122px, 12vw, 166px);
  display: grid;
  place-items: center;
  border-radius: 34px;
  background: var(--c-brand-900, #1d3f63);
  color: #fff;
  box-shadow: var(--sh-2, 0 4px 12px rgba(22, 32, 43, .07));
}

.leistung-detail__graphic svg {
  width: 68%;
  height: 68%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.leistung-detail__visual-lines {
  position: absolute;
  left: 24px;
  bottom: 24px;
  z-index: 4;
  width: 42%;
  display: grid;
  gap: 7px;
}

.leistung-detail__visual-lines span {
  display: block;
  height: 3px;
  border-radius: 999px;
  background: var(--c-brand-300, #a8c2dc);
}

.leistung-detail__visual-lines span:nth-child(2) { width: 78%; }
.leistung-detail__visual-lines span:nth-child(3) { width: 58%; }

/* Sticky-/Floating-Menü. Es wird dynamisch aus den Include-Metadaten erzeugt. */
.leistungen-sticky {
  position: fixed;
  z-index: 5;
  top: calc(var(--h-header-compact, 64px) + 28px);
  right: 22px;
  width: 225px;
}

/*
 * Banner und Footer liegen bewusst über dem fixierten Leistungsmenü.
 * Dadurch erscheint das Menü erst auf den eigentlichen Inhaltsabschnitten
 * und verschwindet beim Überfahren dieser Bereiche optisch darunter.
 */
#page-banner,
.banner-hero,
.section--cta,
.site-footer {
  position: relative;
  z-index: 20;
}

.leistungen-sticky__nav {
  padding: 20px;
  background: #eef5fb;
  border: 1px solid var(--c-line, #dce3eb);
  border-radius: var(--r-md, 10px);
  box-shadow: var(--sh-2, 0 4px 12px rgba(22, 32, 43, .07));
  backdrop-filter: blur(10px);
}

.leistungen-sticky__title {
  display: block;
  margin-bottom: 12px;
  font-family: var(--ff-mono, monospace);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--c-ink-500, #5a6875);
}

.leistungen-sticky__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.leistungen-sticky__list li {
  --hovercard-inset: 8px;
  --hovercard-lift: 0px;
  --hovercard-shadow: none;
  --hovercard-background: rgba(255, 255, 255, .38);
  --hovercard-radius: 0;

  margin: 0;
  border-top: 1px solid var(--c-line, #dce3eb);
}

.leistungen-sticky__list li:last-child {
  border-bottom: 1px solid var(--c-line, #dce3eb);
}

.leistungen-sticky__list a {
  position: relative;
  display: block;
  padding: 10px 4px 10px 12px;
  color: var(--c-ink-700, #2e3a46);
  font-size: .82rem;
  line-height: 1.35;
  text-decoration: none;
  transition: color .18s ease, padding-left .18s ease, background-color .18s ease;
}


.leistungen-sticky__list a:hover,
.leistungen-sticky__list a:focus-visible,
.leistungen-sticky__list a.is-active {
  color: var(--c-brand-700, #2e5c8a);
  padding-left: 18px;
}


@media (max-width: 1280px) {
  .leistungen-sticky {
    display: none;
  }
}

@media (max-width: 900px) {
  .leistung-detail__grid {
    grid-template-columns: 1fr;
  }

  .leistung-detail--reverse .leistung-detail__visual {
    order: initial;
  }

  .leistung-detail__visual {
    min-height: 260px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .leistungen-sticky__list a {
    transition: none;
  }
}
