.mg-teaser-modal {
  --mg-teaser-vh: 100vh;
  position: fixed;
  inset: 0;
  z-index: 2300;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: max(1rem, env(safe-area-inset-top, 0px))
    max(1rem, env(safe-area-inset-right, 0px))
    max(1rem, env(safe-area-inset-bottom, 0px))
    max(1rem, env(safe-area-inset-left, 0px));
  overflow-y: auto;
  overscroll-behavior: contain;
}

@supports (height: 100dvh) {
  .mg-teaser-modal {
    --mg-teaser-vh: 100dvh;
  }
}

.mg-teaser-modal[hidden] {
  display: none !important;
}

.mg-teaser-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 16, 28, 0.72);
  backdrop-filter: blur(4px);
}

.mg-teaser-modal__dialog {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  width: min(420px, calc(100% - 2rem));
  max-height: min(calc(var(--mg-teaser-vh) - 2rem), 920px);
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: linear-gradient(180deg, #0f1f35 0%, #0a1628 100%);
  border: 1px solid rgba(201, 162, 77, 0.45);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
  color: #f8fafc;
}

.mg-teaser-modal__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(201, 162, 77, 0.5);
  border-radius: 50%;
  background: rgba(10, 22, 40, 0.85);
  color: #e8c872;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.mg-teaser-modal__header {
  position: relative;
  line-height: 0;
}

.mg-teaser-modal__header-bg {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 16px 16px 0 0;
}

.mg-teaser-modal__header-logo-zone {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 25%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 20px;
  box-sizing: border-box;
  pointer-events: none;
}

.mg-teaser-modal__header-logo {
  width: 50%;
  height: auto;
  object-fit: contain;
}

.mg-teaser-modal__body {
  padding: 0.75rem 0.85rem 0.9rem;
  flex: 1 1 auto;
  min-height: 0;
  overflow: visible;
}

.mg-teaser-modal__section-title {
  margin: 0 0 0.75rem;
  text-align: center;
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e8c872;
  font-weight: 700;
}

.mg-teaser-carousel {
  position: relative;
  container-type: inline-size;
}

.mg-teaser-carousel__track {
  position: relative;
  width: 100%;
  min-height: calc(min(100cqw, var(--mg-teaser-photo-max, 100cqw)) + 4.5rem);
}

.mg-teaser-card {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  opacity: 0;
  filter: blur(14px);
  transition:
    opacity 0.87s ease,
    filter 0.87s ease;
  pointer-events: none;
  border: 1px solid rgba(201, 162, 77, 0.35);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  z-index: 1;
}

.mg-teaser-card.is-active {
  opacity: 1;
  filter: blur(0);
  pointer-events: auto;
  z-index: 3;
}

.mg-teaser-card.is-leaving {
  opacity: 0;
  filter: blur(16px);
  z-index: 2;
}

.mg-teaser-card__photo {
  aspect-ratio: 1 / 1;
  width: 100%;
  max-height: var(--mg-teaser-photo-max, none);
  overflow: hidden;
  background: #0a1628;
}

.mg-teaser-card__photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mg-teaser-card__content {
  padding: 0.65rem 0.75rem 0.85rem;
  text-align: center;
}

.mg-teaser-card__title {
  margin: 0 0 0.35rem;
  color: #e8c872;
  font-size: 1rem;
  font-weight: 700;
}

.mg-teaser-card__text {
  margin: 0;
  color: #dbe7f5;
  font-size: 0.82rem;
  line-height: 1.4;
}

@media (max-width: 600px) {
  .mg-teaser-modal {
    align-items: flex-start;
    padding: 5.5rem 50px 50px;
  }

  .mg-teaser-modal__dialog {
    width: 100%;
    max-width: none;
    max-height: min(calc(var(--mg-teaser-vh) - 6.5rem), 920px);
  }
}

/* Tablet / Desktop / TV: größeres Modal, Foto-Höhe begrenzt */
@media (min-width: 601px) {
  .mg-teaser-modal__dialog {
    width: min(440px, calc(100vw - 2.5rem));
  }
}

@media (min-width: 1200px), (min-height: 900px) {
  .mg-teaser-modal {
    --mg-teaser-photo-max: min(38dvh, 360px);
  }

  .mg-teaser-modal__dialog {
    width: min(520px, 38vw, calc(100vw - 2.5rem));
    max-height: min(calc(var(--mg-teaser-vh) - 2.5rem), 900px);
  }

  .mg-teaser-card__photo {
    width: 100%;
    margin-inline: auto;
  }
}

@supports not (height: 100dvh) {
  @media (min-width: 1200px), (min-height: 900px) {
    .mg-teaser-modal {
      --mg-teaser-photo-max: min(38vh, 360px);
    }
  }
}
