/* PopUp-Modul – self-contained, theme-unabhängig. Farben/Maße über die Tokens --np-popup-* im Theme
   überschreibbar (z. B. .np-popup { --np-popup-accent: #47590d; }). Baut NICHT auf Theme-Tailwind.
   Die Standardwerte stehen in :where() (Spezifität 0): diese Datei lädt am Seitenende NACH dem Theme-CSS und
   würde sonst jede Theme-Angabe gleicher Spezifität überschreiben. */

:where(.np-popup) {
    --np-popup-bg: #fff;
    --np-popup-fg: #1f2937;
    --np-popup-accent: #374151;
    --np-popup-radius: 1.25rem;
    --np-popup-width: 36rem;
    --np-popup-backdrop: rgb(15 23 42 / .55);
}

.np-popup {
    /* margin:auto zentriert das Modal (Browser-Standard) – das Tailwind-Preflight setzt sonst margin:0 auf alles,
       das Fenster klebte dann oben links. */
    margin: auto;
    width: min(calc(100vw - 2rem), var(--np-popup-width));
    max-height: calc(100dvh - 2rem);
    padding: 0;
    border: 0;
    border-radius: var(--np-popup-radius);
    background: var(--np-popup-bg);
    color: var(--np-popup-fg);
    box-shadow: 0 25px 60px rgb(0 0 0 / .25);
    overflow: auto;
}

.np-popup::backdrop {
    background: var(--np-popup-backdrop);
}

.np-popup[open] {
    animation: np-popup-in .25s ease-out;
}

@keyframes np-popup-in {
    from { opacity: 0; transform: translateY(1rem) scale(.98); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .np-popup[open] {
        animation: none;
    }
}

.np-popup__box {
    position: relative;
    padding: clamp(1.5rem, 4vw, 2.5rem);
}

.np-popup__close {
    position: absolute;
    top: .75rem;
    right: .75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.75rem;
    height: 2.75rem;
    border: 0;
    border-radius: 9999px;
    background: transparent;
    color: var(--np-popup-fg);
    cursor: pointer;
}

.np-popup__close:hover {
    background: rgb(0 0 0 / .06);
}

.np-popup__close:focus-visible {
    outline: 2px solid var(--np-popup-accent);
    outline-offset: 2px;
}

.np-popup__title {
    margin: 0 2.5rem 1rem 0;
    color: var(--np-popup-accent);
    font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.125rem);
    font-weight: 700;
    line-height: 1.15;
}

.np-popup__content > :first-child {
    margin-top: 0;
}

.np-popup__content > :last-child {
    margin-bottom: 0;
}

.np-popup__content img {
    max-width: 100%;
    height: auto;
}

/* Grund-Typografie des Inhalts: das Fenster liegt außerhalb von <main>, Theme-Regeln für den Seiteninhalt greifen
   hier nicht. Bewusst schlicht – ein Theme verfeinert über .np-popup … */
.np-popup__content p,
.np-popup__content ul,
.np-popup__content ol,
.np-popup__content figure {
    margin: 0 0 .85em;
}

.np-popup__content ul,
.np-popup__content ol {
    padding-left: 1.25em;
}

.np-popup__content ul {
    list-style: disc;
}

.np-popup__content ol {
    list-style: decimal;
}

.np-popup__content li {
    margin: .15em 0;
}

.np-popup__content li > p {
    margin: 0;
}

.np-popup__content li::marker {
    color: var(--np-popup-accent);
}

.np-popup__content a {
    color: var(--np-popup-accent);
    text-decoration: underline;
    text-underline-offset: .2em;
}

.np-popup__content strong {
    font-weight: 600;
}
