/* Aktivitäts-Popup */

html.modal-open { overflow: hidden; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  padding: 24px 20px;
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
.modal.is-open {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hintergrund pro Aktivität, per JS gesetzt */
.modal__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.9;
  background-color: var(--bg);
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

.modal__dialog {
  --pad: 32px;
  --nav-inset: 24px;
  --nav-gap: 16px;
  position: relative;
  display: flex;
  width: 100%;
  max-width: var(--max-800);
  max-height: 100%;
  overflow: hidden;
  background: var(--bg);
  border-radius: 8px;
}

.modal__scroll {
  width: 100%;
  padding: var(--pad);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #444444 transparent;
}
.modal__scroll::-webkit-scrollbar {
  width: 6px;
}
.modal__scroll::-webkit-scrollbar-track {
  background: transparent;
}
.modal__scroll::-webkit-scrollbar-thumb {
  background: #444444;
  border-radius: 3px;
}
.modal__scroll::-webkit-scrollbar-thumb:hover {
  background: var(--black);
}

/* Schließen */
.modal__close {
  position: absolute;
  top: var(--nav-inset);
  right: var(--nav-inset);
  z-index: 2;
  width: 12px;
  height: 12px;
  padding: 0;
  border: 0;
  background: var(--bg);
  box-shadow: 0 0 0 6px var(--bg);
  color: var(--black);
  cursor: pointer;
}
.modal__close svg { display: block; }
.modal__close::after {
  content: "";
  position: absolute;
  inset: -14px;
}

/* Headline */
.modal__title {
  margin: calc(56px - var(--pad)) 0 0 0;
  text-align: center;
}
.modal__caps {
  display: block;
  text-transform: uppercase;
  font-weight: 900;
}
.modal__sub {
  display: block;
  font-weight: 500;
}

/* Fließtext */
.modal .modal__text {
  max-width: none;
  margin: 40px 0 0 0;
  text-align: left;
}

/* Galerie */
.modal__gallery {
  position: relative;
  margin-top: 32px;
}
.modal__slides {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  touch-action: pan-x pan-y;
}
.modal__slides::-webkit-scrollbar { display: none; }
.modal__slides img {
  flex: 0 0 calc((100% - 16px) / 2);
  min-width: 0;
  scroll-snap-align: start;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: 8px;
}

.modal__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 16px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--black);
  cursor: pointer;
  transition: opacity 120ms ease;
}
.modal__nav svg { display: block; }
.modal__nav::after {
  content: "";
  position: absolute;
  inset: -16px;
}
.modal__nav--prev { left: calc(-1 * (var(--nav-gap) + 8px)); }
.modal__nav--next { right: calc(-1 * (var(--nav-gap) + 8px)); }

/* Presse */
.modal__press {
  margin-top: 40px;
  text-align: left;
}
.modal__press:empty { display: none; }
.modal__press h3 {
  margin: 0;
  font-size: clamp(20px, 8vw, 22px);
}

/* Mobile: Vollbild, ein Bild pro Ansicht */
@media (max-width: 560px) {
  .modal {
    padding: 0;
  }
  .modal__dialog {
    --pad: 24px;
    --nav-gap: 8px;
    max-width: none;
    height: 100%;
    max-height: none;
    border-radius: 0;
  }
  .modal__slides img {
    flex-basis: 100%;
  }
}
