/* Vollflächige Dialoge auf Website, Portal und in der PWA. */
:root {
  --site-dialog-surface-dark: #141419;
  --site-dialog-surface-light: #fff;
  --site-dialog-scrim: rgb(0 0 0 / 68%);
  --site-dialog-enter: 150ms;
  --site-dialog-leave: 100ms;
  --site-dialog-ease-out: cubic-bezier(0, 0, .38, .9);
  --site-dialog-ease-in: cubic-bezier(.2, 0, 1, .9);
}

@media (prefers-reduced-motion: reduce) {
  :root { --site-dialog-enter: 0ms; --site-dialog-leave: 0ms; }
  :is([data-site-dialog], .site-story-dialog-panel) {
    transition-duration: 0ms !important;
    transform: none !important;
  }
}

dialog:where(:not(#mobile-portal-navigation))::backdrop,
.site-dialog-scrim, .portal-dialog-backdrop { background: var(--site-dialog-scrim); }

@media (prefers-reduced-motion: no-preference) {
  dialog:where(:not(#mobile-portal-navigation)),
  dialog:where(:not(#mobile-portal-navigation))::backdrop {
    opacity: 0;
    transition-property: opacity, display, overlay;
    transition-duration: var(--site-dialog-leave);
    transition-timing-function: var(--site-dialog-ease-in);
    transition-behavior: allow-discrete;
  }
  dialog:where(:not(#mobile-portal-navigation))[open],
  dialog:where(:not(#mobile-portal-navigation))[open]::backdrop {
    opacity: 1;
    transition-duration: var(--site-dialog-enter);
    transition-timing-function: var(--site-dialog-ease-out);
  }
  @starting-style {
    dialog:where(:not(#mobile-portal-navigation))[open],
    dialog:where(:not(#mobile-portal-navigation))[open]::backdrop { opacity: 0; }
  }
  dialog[open][data-portal-dialog-closing],
  dialog[open][data-portal-dialog-closing]::backdrop {
    opacity: 0;
    transition: opacity var(--site-dialog-leave) var(--site-dialog-ease-in);
    pointer-events: none;
  }
}

.site-dialog-panel-dark { background-color: var(--site-dialog-surface-dark); }

.portal-dialog-enter { transition: opacity var(--site-dialog-enter) var(--site-dialog-ease-out); }
.portal-dialog-leave { transition: opacity var(--site-dialog-leave) var(--site-dialog-ease-in); }

#app-popup-root {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: white;
}

.app-popup-close {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 0.5rem);
  right: 0.5rem;
  padding: 8px;
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: 1.875rem; /* 3xl */
  line-height: 1;
  cursor: pointer;
  z-index: 2002;
  transition: opacity 200ms ease-in-out;
}

.app-popup-close:hover {
  opacity: 0.75;
}

.app-popup-layer {
  position: fixed;
  inset: 0;
  z-index: 2001;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding:
    calc(env(safe-area-inset-top, 0px) + 1.5rem)
    1rem
    calc(env(safe-area-inset-bottom, 0px) + 1.5rem); /* px-4 py-6 equivalent */
}

@media (min-width: 640px) {
  .app-popup-layer {
    padding: 1.5rem 1.5rem; /* sm:px-6 */
  }
}

@media (min-width: 1024px) {
  .app-popup-layer {
    padding: 1.5rem 2rem; /* lg:px-8 */
  }
}

.app-popup-container {
  position: relative;
  width: 100%;
  max-width: 64rem; /* max-w-5xl equivalent */
  max-height: 100%;
  display: flex;
  flex-direction: column;
}

.app-popup-panel {
  width: 100%;
  background: var(--site-dialog-surface-dark);
  color: #ffffff;
  overflow-y: auto;
  padding: 40px 16px 20px;
  pointer-events: auto;
  text-align: center;
  border-radius: 2rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  max-height: calc(100dvh - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px) - 3rem);
}

.app-popup-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.2;
  margin: 0 0 12px;
}

.uni-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
}

.uni-popup-nav {
  width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.25);
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.uni-popup-nav svg {
  width: 18px;
  height: 18px;
  display: block;
}

.uni-popup-center {
  flex: 1;
  min-width: 0;
  text-align: center;
}

.uni-popup-name {
  margin: 0;
  line-height: 1.05;
  font-size: 2.2rem;
  text-transform: none;
}

.uni-popup-camping {
  margin-top: 6px;
  font-size: 0.92rem;
  font-weight: 700;
  opacity: 0.85;
}

.area-popup-header {
  text-align: center;
  margin: 0 0 10px;
}

.area-popup-name {
  font-size: 2.2rem; /* match .uni-popup-name for consistency */
  text-transform: none;
}

.area-popup-subtitle {
  margin-top: 6px;
  font-size: 0.92rem;
  font-weight: 700;
  opacity: 0.85;
}

.app-popup-body {
  font-size: 1rem;
  line-height: 1.55;
}

.app-popup-richtext p {
  margin: 0 0 12px;
  color: #ffffff;
}

.app-popup-richtext h3 {
  margin: 16px 0 10px;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.2;
}

.app-popup-richtext h4 {
  margin: 14px 0 8px;
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.2;
}

.app-popup-richtext ul,
.app-popup-richtext ol {
  margin: 0 0 12px 20px;
  padding: 0;
}

.app-popup-richtext li {
  margin: 0 0 6px;
}

.app-tooltip-popup .maplibregl-popup-content {
  background: rgba(0, 0, 0, 0.8);
  color: #ffffff;
  padding: 10px;
  border-radius: 6px;
  box-shadow: none;
}

.maplibregl-popup.app-tooltip-popup {
  opacity: 0;
}

.maplibregl-popup.app-tooltip-popup.app-tooltip-open {
  opacity: 1;
  transition: opacity 300ms ease-in-out;
}

.maplibregl-popup.app-tooltip-popup.app-tooltip-closing {
  opacity: 0;
  transition-duration: 200ms;
}

.maplibregl-popup.app-tooltip-popup .maplibregl-popup-tip {
  border-width: 7px !important;
  margin: 0 !important;
}

.maplibregl-popup.app-tooltip-popup.maplibregl-popup-anchor-top .maplibregl-popup-tip,
.maplibregl-popup.app-tooltip-popup.maplibregl-popup-anchor-top-left .maplibregl-popup-tip,
.maplibregl-popup.app-tooltip-popup.maplibregl-popup-anchor-top-right .maplibregl-popup-tip {
  border-bottom-color: rgba(0, 0, 0, 0.8) !important;
}

.maplibregl-popup.app-tooltip-popup.maplibregl-popup-anchor-bottom .maplibregl-popup-tip,
.maplibregl-popup.app-tooltip-popup.maplibregl-popup-anchor-bottom-left .maplibregl-popup-tip,
.maplibregl-popup.app-tooltip-popup.maplibregl-popup-anchor-bottom-right .maplibregl-popup-tip {
  border-top-color: rgba(0, 0, 0, 0.8) !important;
}

.maplibregl-popup.app-tooltip-popup.maplibregl-popup-anchor-left .maplibregl-popup-tip {
  border-right-color: rgba(0, 0, 0, 0.8) !important;
}

.maplibregl-popup.app-tooltip-popup.maplibregl-popup-anchor-right .maplibregl-popup-tip {
  border-left-color: rgba(0, 0, 0, 0.8) !important;
}

.app-tooltip-content {
  font-size: 0.9rem;
  line-height: 1.35;
}

.app-tooltip-content p:last-child,
.app-tooltip-content ul:last-child,
.app-tooltip-content ol:last-child {
  margin-bottom: 0;
}

body.app-popup-open {
  overflow: hidden;
}

@media (min-width: 1024px) {
  .app-popup-layer {
    padding: 1.5rem 2rem; /* lg:px-8 */
  }

  .app-popup-panel {
    border-radius: 2rem;
    padding: 40px 16px 20px;
  }
}
