@charset "UTF-8";
/*
 * Estrel Popup (Center) — natives <dialog>, Muster Booking-Modal.
 * Panel Creme + Navy-Text in BEIDEN Farbmodi: typography.css setzt Textfarben
 * global je Modus, hier bewusst explizit ueberschrieben (Lesson Modal-Fix 31.08.).
 * CTA traegt eigene Farben (nicht .estrel-btn), damit die Startseiten-Modus-
 * varianten (body.is-startpage) auf dem Creme-Panel nicht greifen.
 */

/* Contao-Wrapper `content-estrel-popup` erzeugt keine eigene Box (kein Abstand im Artikel);
   display:none waere falsch — ein <dialog> in einem unsichtbaren Vorfahren
   kann nicht in den Top-Layer. */
.content-estrel-popup {
    display: contents;
}

.estrel-popup {
    --pp-cream: #FEF5EC;
    --pp-navy: #14172D;
    --pp-watermelon: #FED3CD;
    padding: 0;
    border: 0;
    margin: 0;
    background: transparent;
    /* dvh = sichtbarer Viewport ohne Safari-Leisten; vh nur als Fallback fuer alte Browser */
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-width: 100vw;
    max-height: 100vh;
    max-height: 100dvh;
    color: var(--pp-navy);
    overflow: hidden;
    /* Touch auf dem Backdrop scrollt NICHT die Seite dahinter (iOS-Scroll-Chaining) */
    touch-action: none;
    overscroll-behavior: contain;
}

.estrel-popup:not([open]) {
    display: none;
}

.estrel-popup[open] {
    display: flex;
    align-items: center;
    justify-content: center;
    /* 16px Rand, auf Geraeten mit Notch/Home-Indicator mindestens die Safe-Area */
    padding: max(16px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right))
             max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
    box-sizing: border-box;
}

.estrel-popup::backdrop {
    background: rgba(20, 23, 45, 0.6);
}

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

/* Panel: feste Huelle mit Schliessen-Button, Inhalt scrollt innen (.estrel-popup__scroll) */
.estrel-popup__panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(560px, 100%);
    max-height: 100%;
    background: var(--pp-cream);
    color: var(--pp-navy);
    overflow: hidden;
    box-sizing: border-box;
    box-shadow: 0 24px 64px rgba(20, 23, 45, 0.35);
    animation: estrel-popup-in 200ms ease-out both;
}

.estrel-popup__scroll {
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior: contain;
}

/* Schliessen — 44px Trefferflaeche (Apple/WCAG), oben rechts, bleibt beim Scrollen stehen */
.estrel-popup__close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    background: var(--pp-cream);
    border: 0;
    border-radius: 50%;
    padding: 0;
    cursor: pointer;
    color: var(--pp-navy);
    z-index: 2;
    box-shadow: 0 1px 6px rgba(20, 23, 45, 0.25);
}

.estrel-popup__close:hover,
.estrel-popup__close:focus-visible {
    background: var(--pp-watermelon);
    outline: none;
}

.estrel-popup__close:focus-visible {
    box-shadow: 0 0 0 2px var(--pp-navy), 0 1px 6px rgba(20, 23, 45, 0.25);
}

/* popup.js fokussiert den Close-Button programmatisch (kein User-Interaction-Trigger) —
   in Chromium/Firefox matcht :focus-visible dann nicht; permanenter Ring hier gewollt. */
.estrel-popup__close:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--pp-navy), 0 1px 6px rgba(20, 23, 45, 0.25);
}

.estrel-popup__media {
    margin: 0;
}

.estrel-popup__media img {
    display: block;
    width: 100%;
    max-height: 40vh;
    object-fit: cover;
}

.estrel-popup__body {
    padding: clamp(24px, 5vw, 48px);
}

.estrel-popup__title {
    margin: 0 0 16px;
    font-family: var(--font-alpina);
    font-size: clamp(1.5rem, 2.4vw, 2rem);
    line-height: 1.15;
    color: var(--pp-navy);
}

.estrel-popup__text,
.estrel-popup__text p,
.estrel-popup__text li {
    font-family: var(--font-soehne);
    font-size: 1rem;
    line-height: 1.55;
    color: var(--pp-navy);
}

.estrel-popup__text p {
    margin: 0 0 1em;
}

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

.estrel-popup__text a {
    color: var(--pp-navy);
    text-decoration: underline;
}

.estrel-popup__cta {
    display: inline-block;
    margin-top: 24px;
    min-height: 44px;
    box-sizing: border-box;
    padding: 14px 28px;
    border-radius: 25px;
    border: 1px solid var(--pp-navy);
    background: var(--pp-navy);
    color: var(--pp-cream);
    font-family: var(--font-soehne);
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: 0.05em;
    line-height: 1;
    text-decoration: none;
    transition: background 0.15s ease, color 0.15s ease;
}

.estrel-popup__cta:hover,
.estrel-popup__cta:focus-visible {
    background: var(--pp-watermelon);
    border-color: var(--pp-watermelon);
    color: var(--pp-navy);
    outline: none;
    text-decoration: none;
}

@keyframes estrel-popup-in {
    from { opacity: 0; transform: translateY(12px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .estrel-popup__panel { animation: none; }
}

/* Phones hochkant */
@media (max-width: 767px) {
    .estrel-popup__media img { max-height: 32vh; }
    .estrel-popup__body { padding: 24px 20px 28px; }
    .estrel-popup__title { font-size: 1.375rem; }
}

/* Flache Viewports (Phone quer, kleine Fenster): Bild klein halten, Inhalt scrollt innen */
@media (max-height: 500px) {
    .estrel-popup__media img { max-height: 22vh; }
    .estrel-popup__body { padding: 20px 24px 24px; }
    .estrel-popup__title { font-size: 1.25rem; margin-bottom: 10px; }
    .estrel-popup__cta { margin-top: 16px; }
}
