/**
 * Umwelt-Info-Modal (dc-c Theme)
 * Modal-Basis eigenständig, konkrete Werte.
 * WICHTIG: Theme-Root ist 10px (skeleton.css html{font-size:62.5%}) → rem-Werte 10px-basiert.
 * Fixe Button-Maße (44px) werden mit px-Abständen freigehalten (nicht rem).
 */

/* ===== Modal-Basis ===== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: max(12px, env(safe-area-inset-top, 0px))
    max(12px, env(safe-area-inset-right, 0px))
    max(12px, env(safe-area-inset-bottom, 0px))
    max(12px, env(safe-area-inset-left, 0px));
  background: rgba(0, 0, 0, 0.45);
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.modal[aria-hidden="false"] {
  display: flex;
}

.modal__dialog {
  position: relative;
  width: 100%;
  max-width: min(100%, 520px);
  max-height: min(92vh, 900px);
  overflow: auto;
  overscroll-behavior: contain;
  background: #ffffff;
  color: #4c4c4c;
  border-radius: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
  padding: 20px 20px 22px;
  padding-top: max(20px, calc(10px + env(safe-area-inset-top, 0px)));
}

@supports (height: 100dvh) {
  .modal__dialog {
    max-height: min(90dvh, 900px);
  }
}

@media (min-width: 768px) {
  .modal__dialog {
    max-width: min(100%, 640px);
    padding: 26px 28px 28px;
  }
}

@media (min-width: 1024px) {
  .modal__dialog {
    max-width: min(100%, 720px);
  }
}

.modal__close {
  position: absolute;
  top: max(6px, env(safe-area-inset-top, 0px));
  right: max(6px, env(safe-area-inset-right, 0px));
  min-width: 44px;
  min-height: 44px;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: #9B9578;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.modal__close:hover {
  background: #867f66;
}

.modal__divider {
  width: 100%;
  height: 2px;
  background: #9B9578;
  opacity: 1;
  margin: 12px 0 16px;
}

.modal__title {
  margin: 0 0 6px;
  /* px-Abstand hält den 44px-Close-Button frei (rem wäre bei 10px-Root zu klein) */
  padding-right: 54px;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.28;
  color: #4c4c4c;
}

/* Theme gibt jeder h2 eine Deko-Linie (static.css h2::after) — im Modal unterdrücken,
   wir haben bereits .modal__divider */
.modal__title::after {
  content: none;
}

.modal__lead {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.4;
  color: #4c4c4c;
}

.modal__body {
  font-size: 15px;
  line-height: 1.55;
  color: #4c4c4c;
}

.modal__body p {
  margin: 0 0 12px;
}

.modal__body p:last-child {
  margin-bottom: 0;
}

.modal__body strong {
  font-weight: 700;
}

body.modal-open {
  overflow: hidden;
}

/* ===== Normen-Liste (Text-only-Layout) ===== */
.modal__norm-list {
  margin: 8px 0 0;
  padding-left: 20px;
  list-style: disc;
}

.modal__norm-list li::marker {
  color: #9B9578;
}

.modal__norm-list li {
  margin-bottom: 6px;
}

.modal__norm-list li:last-child {
  margin-bottom: 0;
}

.modal__dialog--text-only .modal__body {
  padding-right: 54px;
}
