/* ==========================================================
   20 · Popup (Ankündigung, z. B. nächster Workshop)
   Inhalt: Ordner "Popup" im Backend, Skript: /fileadmin/js/popup.js
   ========================================================== */

dialog.popup {
  width: min(34rem, calc(100vw - 2rem));
  max-width: none;
  max-height: calc(100dvh - 2rem);
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  overflow: visible;
}
dialog.popup::backdrop {
  background: rgba(31, 42, 36, .55);
  backdrop-filter: blur(2px);
}
html.popup-offen { overflow: hidden; }

.popup__box {
  position: relative;
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.popup__bild {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.popup__inhalt { padding: clamp(1.5rem, 5vw, 2.5rem); }

.popup__kicker {
  margin: 0 0 .6rem;
  font-family: var(--sans);
  font-size: var(--step--1);
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--sage);
}

.popup__titel {
  margin: 0 0 1rem;
  padding-right: 2rem; /* Platz für den Schließen-Button ohne Bild */
  font-family: var(--serif);
  font-size: var(--step-2);
  font-weight: 500;
  line-height: 1.15;
  color: var(--ink);
}
.popup__bild + .popup__inhalt .popup__titel { padding-right: 0; }

.popup__fakten {
  display: grid;
  gap: .45rem;
  margin: 0 0 1.25rem;
  padding: 0;
  list-style: none;
  font-size: var(--step--1);
  color: var(--ink-soft);
}
.popup__fakten li { display: flex; align-items: flex-start; gap: .55em; margin: 0; padding: 0; }
.popup__fakten li::before { content: none; }
.popup__fakten svg { flex: none; margin-top: .1em; color: var(--moss); }

.popup__text { margin-bottom: 1.5rem; font-size: var(--step-0); }
.popup__text > :last-child { margin-bottom: 0; }

.popup__aktionen {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .75rem 1.25rem;
}

.popup__spaeter {
  padding: .5em 0;
  border: 0;
  background: none;
  font-family: var(--sans);
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: underline;
  text-underline-offset: .2em;
  cursor: pointer;
}
.popup__spaeter:hover { color: var(--ink); }

.popup__close {
  position: absolute;
  top: .75rem;
  right: .75rem;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(31, 42, 36, .15);
  cursor: pointer;
  transition: background-color .2s var(--ease), transform .2s var(--ease);
}
.popup__close:hover { background: #fff; transform: scale(1.05); }
.popup__close:focus-visible,
.popup__spaeter:focus-visible { outline: 2px solid var(--moss); outline-offset: 3px; }

@media (prefers-reduced-motion: no-preference) {
  dialog.popup[open] { animation: popup-rein .4s var(--ease); }
  dialog.popup[open]::backdrop { animation: popup-blende .4s ease; }
}
@keyframes popup-rein { from { opacity: 0; transform: translateY(16px) scale(.98); } }
@keyframes popup-blende { from { opacity: 0; } }
