/* ==========================================================================
   Subnav — in-page section navigation (Event-DJ page)
   Styled as a floating pill, matching .back-home: rounded, hairline border,
   translucent black with blur. Hidden at the top of the page and faded in
   once the visitor starts scrolling; sticks below the global nav from there.
   ========================================================================== */

.subnav {
  position: sticky;
  /* Parks below the collapsed (.is-scrolled) global nav, plus a gap so the
     pill reads as its own element instead of hanging off the header.
     subnav.js measures the nav height into --subnav-top; the fallback
     matches the collapsed nav so placement holds even without JS. */
  top: calc(var(--subnav-top, 68px) + var(--subnav-gap, 0.75rem));
  z-index: calc(var(--z-nav) - 1);
  /* Pulled up over the hero so the pill floats on the image instead of
     pushing the first section down. */
  margin-top: calc(var(--subnav-pull, 96px) * -1);
  margin-bottom: var(--space-lg);
  pointer-events: none;
}

.subnav__inner {
  display: flex;
  justify-content: center;
}

.subnav__pill {
  display: inline-flex;
  align-items: center;
  gap: var(--space-md);
  max-width: 100%;
  padding: 0.55em 1.4em;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  pointer-events: auto;
  /* Horizontal scroll instead of wrapping when the viewport is tight. */
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  /* Hidden until the page is scrolled — subnav.js sets .is-visible on
     .subnav. The pill drifts down a few pixels as it fades in. */
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity var(--dur-base) var(--ease-out),
    transform var(--dur-base) var(--ease-out),
    visibility var(--dur-base) var(--ease-out);
}

.subnav.is-visible .subnav__pill {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.subnav__pill::-webkit-scrollbar {
  display: none;
}

.subnav__pill a {
  position: relative;
  flex-shrink: 0;
  padding-block: 0.85em;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: var(--fs-eyebrow);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color var(--dur-fast) var(--ease-out);
}

.subnav__pill a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0.45em;
  width: 100%;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform var(--dur-base) var(--ease-out);
}

.subnav__pill a:hover {
  color: var(--text);
}

.subnav__pill a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Section currently in the viewport, set by subnav.js via scroll-spy. */
.subnav__pill a.is-current {
  color: var(--accent);
}

.subnav__pill a.is-current::after {
  transform: scaleX(1);
  transform-origin: left;
}

/* Anchor targets must clear the global nav plus the pill when jumped to. */
.subnav-scope :is(#leistungen, #drinkandpaint, #brunchandpaint, #mood, #warum, #ablauf, #events-booking) {
  scroll-margin-top: calc(var(--subnav-top, 68px) + 72px);
}

@media (max-width: 860px) {
  .subnav {
    margin-top: calc(var(--subnav-pull-mobile, 76px) * -1);
  }

  .subnav__inner {
    /* Left-aligned on phones so the first item is always readable, and the
       pill can scroll past the viewport edge instead of being squeezed. */
    justify-content: flex-start;
  }

  .subnav__pill {
    gap: var(--space-sm);
    padding-inline: 1.1em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .subnav__pill,
  .subnav__pill a::after {
    transition: none;
  }

  /* Fade only, no travel. */
  .subnav__pill {
    transform: none;
  }
}
