:root {
    --emma-bg: #FAD9C6;
    --emma-coral: #E16049;
    --emma-text: #3f403f;
    --emma-muted: #6b625e;
    --emma-card: #d8c2b4;
    --emma-card-light: #efd8ca;
    --emma-white: #fffaf6;
    --radius-lg: 28px;
    --shadow: 0 14px 34px rgba(74, 54, 44, .12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    min-height: 100vh;
    color: var(--emma-text);
    background: var(--emma-bg);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    padding-bottom: 112px;
}
body.newsletter-closed { padding-bottom: 0; }
body.modal-open { overflow: hidden; }
a { color: inherit; }

.site-header { padding: 24px clamp(18px, 4vw, 56px) 10px; }
.nav-pill {
    max-width: 1420px;
    margin: 0 auto;
    min-height: 76px;
    border-radius: 999px;
    background: var(--emma-coral);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 26px;
    padding: 10px 26px 10px 12px;
    box-shadow: 0 8px 22px rgba(157, 65, 47, .15);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
.brand img { width: 56px; height: 56px; display: block; }
.brand span {
    font-family: "Comic Sans MS", "Bradley Hand", cursive;
    font-size: clamp(1.25rem, 2vw, 1.7rem);
    font-weight: 700;
}
.main-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 24px; }
.main-nav a { color: white; text-decoration: none; font-weight: 650; }
.main-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }

.page-shell { max-width: 1420px; margin: 0 auto; padding: 28px clamp(18px, 4vw, 56px) 72px; }
.page-tools { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin: 12px 0 30px; }
h1, h2 { line-height: 1.12; }
.page-tools h1 {
    margin: 0;
    font-family: "Comic Sans MS", "Bradley Hand", cursive;
    font-size: clamp(2rem, 4vw, 3.3rem);
    font-weight: 700;
}
.map-button {
    border: 2px solid var(--emma-coral);
    border-radius: 999px;
    padding: 10px 18px;
    color: var(--emma-coral);
    font-weight: 750;
    white-space: nowrap;
}
.map-button--disabled { opacity: .62; cursor: default; }

.event-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; align-items: stretch; }
.event-card {
    background: var(--emma-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    min-width: 0;
    cursor: pointer;
    outline: none;
    transform: translateY(0);
    transition: transform .18s ease, box-shadow .18s ease;
}
.event-card:hover, .event-card:focus-visible { transform: translateY(-4px); box-shadow: 0 18px 38px rgba(74, 54, 44, .17); }
.event-card:focus-visible { box-shadow: 0 0 0 4px rgba(225, 96, 73, .25), var(--shadow); }
.event-card__image-wrap { position: relative; aspect-ratio: 16/10; overflow: hidden; background: rgba(255,255,255,.28); }
.event-card__image { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s ease; }
.event-card:hover .event-card__image { transform: scale(1.025); }
.event-card__body { padding: 24px; display: flex; flex: 1; flex-direction: column; }
.event-card h2 { margin: 0; font-size: clamp(1.3rem, 1.6vw, 1.7rem); }
.event-card__subtitle { margin: 10px 0 0; color: var(--emma-muted); line-height: 1.5; }
.event-card__meta { margin: 22px 0 20px; line-height: 1.45; }
.event-card__meta p { margin: 4px 0; }
.event-card__footer {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid rgba(63,64,63,.16);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.event-category { font-size: .88rem; font-weight: 800; letter-spacing: .02em; color: #67554c; }
.event-cta, .primary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--emma-coral);
    border-radius: 999px;
    padding: 10px 16px;
    color: var(--emma-coral);
    background: transparent;
    text-decoration: none;
    font-weight: 800;
}
.event-cta:hover, .primary-button:hover { background: var(--emma-coral); color: white; }
.primary-button { background: var(--emma-coral); color: white; }
.primary-button:hover { filter: brightness(.96); }
.event-status {
    position: absolute;
    left: 16px;
    top: 16px;
    z-index: 2;
    border-radius: 999px;
    padding: 8px 12px;
    color: white;
    font-weight: 850;
    font-size: .8rem;
    letter-spacing: .03em;
    text-transform: uppercase;
    background: var(--emma-coral);
    box-shadow: 0 5px 16px rgba(0,0,0,.12);
}
.event-status--preview { background: #AC7B20; }
.event-status--cancelled { background: #636463; }

.empty-state { padding: 70px 24px; text-align: center; background: rgba(255,255,255,.22); border-radius: var(--radius-lg); }
.site-footer { max-width: 1420px; margin: 0 auto; padding: 0 clamp(18px, 4vw, 56px) 46px; color: var(--emma-muted); }

.newsletter-bar {
    position: fixed;
    z-index: 40;
    left: 18px;
    right: 18px;
    bottom: 16px;
    max-width: 1384px;
    margin: 0 auto;
    border-radius: 22px;
    background: var(--emma-coral);
    color: white;
    display: flex;
    align-items: center;
    gap: 20px;
    justify-content: space-between;
    padding: 15px 52px 15px 22px;
    box-shadow: 0 12px 34px rgba(110, 45, 32, .23);
}
.newsletter-bar div { display: flex; gap: 9px; flex-wrap: wrap; }
.newsletter-bar form { display: flex; gap: 8px; }
.newsletter-bar input { min-width: 240px; border: 0; border-radius: 999px; padding: 11px 15px; font: inherit; }
.newsletter-bar button, .newsletter-bar > a {
    border: 0;
    border-radius: 999px;
    background: white;
    color: var(--emma-coral);
    padding: 11px 17px;
    font-weight: 800;
    text-decoration: none;
}
.newsletter-bar__close { position: absolute; right: 10px; top: 8px; padding: 3px 8px !important; background: transparent !important; color: white !important; font-size: 1.25rem; cursor: pointer; }

.quickview[hidden] { display: none; }
.quickview { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 24px; }
.quickview__backdrop { position: absolute; inset: 0; background: rgba(48, 39, 34, .58); backdrop-filter: blur(3px); }
.quickview__dialog {
    position: relative;
    z-index: 1;
    width: min(980px, 100%);
    max-height: min(86vh, 900px);
    overflow: auto;
    border-radius: 30px;
    background: var(--emma-white);
    box-shadow: 0 28px 80px rgba(0,0,0,.3);
}
.quickview__close { position: sticky; float: right; top: 12px; margin: 12px 12px -52px 0; z-index: 3; width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(255,250,246,.93); font-size: 1.8rem; cursor: pointer; }
.quickview-loading { padding: 80px 30px; text-align: center; }
.quickview-event__image-wrap { position: relative; aspect-ratio: 16/7; overflow: hidden; border-radius: 30px 30px 0 0; }
.quickview-event__image-wrap img { width: 100%; height: 100%; object-fit: cover; }
.quickview-event__body { padding: 30px clamp(24px, 5vw, 54px) 22px; }
.quickview-event__body h2 { margin: 8px 0; font-size: clamp(1.8rem, 3.5vw, 3rem); }
.quickview-event__category { color: var(--emma-coral); font-weight: 850; }
.quickview-event__subtitle { font-size: 1.12rem; color: var(--emma-muted); }
.quickview-event__facts { margin: 26px 0; display: grid; gap: 10px; }
.quickview-event__facts div { display: grid; grid-template-columns: 120px 1fr; gap: 14px; }
.quickview-event__facts dt { font-weight: 800; }
.quickview-event__facts dd { margin: 0; }
.quickview-event__text, .rich-text { line-height: 1.7; }



.back-link { display: inline-block; margin: 0 0 22px; color: var(--emma-coral); font-weight: 800; text-decoration: none; }
.event-detail { overflow: hidden; border-radius: 32px; background: rgba(255,255,255,.32); box-shadow: var(--shadow); }
.event-detail__image-wrap { position: relative; aspect-ratio: 16/7; overflow: hidden; }
.event-detail__image-wrap img { width: 100%; height: 100%; object-fit: cover; }
.event-detail__content { padding: clamp(28px, 5vw, 68px); max-width: 1000px; }
.event-detail__content h1 { margin: 12px 0; font-size: clamp(2.3rem, 5vw, 4.5rem); }
.event-detail__subtitle { color: var(--emma-muted); font-size: 1.25rem; line-height: 1.5; }
.event-detail__facts { margin: 26px 0 34px; font-size: 1.03rem; }
.event-detail__facts p { margin: 6px 0; }
.cancel-note, .preview-note { padding: 16px 18px; border-radius: 16px; background: rgba(225,96,73,.12); font-weight: 750; }

.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 1000px) {
    .event-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .nav-pill { border-radius: 30px; align-items: flex-start; }
    .main-nav { padding-top: 15px; }
}

@media (max-width: 700px) {
    body { padding-bottom: 150px; }
    .site-header { padding-top: 14px; }
    .nav-pill { padding: 10px 16px 14px 10px; flex-direction: column; gap: 8px; }
    .main-nav { justify-content: flex-start; padding: 0 4px 3px; gap: 8px 18px; }
    .page-tools { align-items: flex-start; flex-direction: column; }
    .event-grid { grid-template-columns: 1fr; }
    .newsletter-bar { align-items: stretch; flex-direction: column; gap: 10px; }
    .newsletter-bar form { width: 100%; }
    .newsletter-bar input { min-width: 0; flex: 1; }
    .quickview { padding: 10px; }
    .quickview__dialog { max-height: 94vh; border-radius: 22px; }
    .quickview-event__image-wrap { border-radius: 22px 22px 0 0; aspect-ratio: 16/9; }
    .quickview-event__facts div { grid-template-columns: 1fr; gap: 2px; }
    
    .event-card__footer { align-items: flex-start; flex-direction: column; }
}


/* API-v2 Ergänzungen */
.newsletter-bar__text {
    display: flex;
    gap: 9px;
    flex-wrap: wrap;
    align-items: baseline;
}
.newsletter-bar__message {
    flex-basis: 100%;
    min-height: 1.2em;
    font-size: .86rem;
    opacity: .95;
}
.newsletter-bar button:disabled {
    opacity: .6;
    cursor: wait;
}
.quickview-event__actions,
.event-detail__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}
.secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(225, 96, 73, .34);
    border-radius: 999px;
    padding: 10px 16px;
    color: var(--emma-coral);
    background: transparent;
    text-decoration: none;
    font-weight: 800;
}
.secondary-button:hover {
    border-color: var(--emma-coral);
}




/* Quickview v6 – kanonische Navigation --------------------------------- */

.quickview__dialog {
    position: relative;
    overflow: hidden;
}

#quickview-content {
    max-height: min(86vh, 900px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
}

.quickview-event__image-wrap {
    width: 100%;
    height: clamp(210px, 28vh, 300px);
    aspect-ratio: auto;
    border-radius: 30px 30px 0 0;
    overflow: hidden;
}

.quickview-event__image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.quickview__close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #222;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
}

.quickview-nav {
    position: absolute;
    inset: 0;
    z-index: 9;
    pointer-events: none;
}

.quickview-nav__button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    padding: 0;
    margin: 0;
    font-family: Arial, sans-serif;
    line-height: 1;
    cursor: pointer;
    pointer-events: auto;
}

/* Desktop: komplett unsichtbar bis Hover/Fokus */
@media (hover: hover) and (pointer: fine) {
    .quickview-nav__button {
        width: 78px;
        height: 48%;
        min-height: 190px;
        max-height: 360px;
        background: transparent;
        color: transparent;
        box-shadow: none;
        opacity: 1;
        font-size: 4.6rem;
        font-weight: 300;
        transition: background .18s ease, color .18s ease;
    }

    .quickview-nav__button--prev {
        left: 0;
        border-radius: 0 18px 18px 0;
    }

    .quickview-nav__button--next {
        right: 0;
        border-radius: 18px 0 0 18px;
    }

    .quickview-nav__button:hover,
    .quickview-nav__button:focus-visible {
        background: rgba(60, 60, 60, .46);
        color: #fff;
        outline: none;
    }
}

/* Touch/Mobile: dauerhaft sichtbar und gut tappbar */
@media (hover: none), (pointer: coarse), (max-width: 700px) {
    #quickview-content {
        max-height: 94vh;
    }

    .quickview-event__image-wrap {
        height: clamp(180px, 26vh, 240px);
        border-radius: 22px 22px 0 0;
    }

    .quickview__close {
        top: 12px;
        right: 12px;
        width: 38px;
        height: 38px;
        font-size: 1.55rem;
    }

    .quickview-nav__button {
        width: 54px;
        height: 74px;
        min-height: 0;
        max-height: none;
        border-radius: 27px;
        background: rgba(55, 55, 55, .42);
        color: #fff;
        box-shadow: 0 5px 18px rgba(0, 0, 0, .18);
        font-size: 2.7rem;
        font-weight: 300;
        opacity: .94;
    }

    .quickview-nav__button--prev {
        left: 8px;
    }

    .quickview-nav__button--next {
        right: 8px;
    }

    .quickview-nav__button:active {
        background: rgba(55, 55, 55, .62);
        transform: translateY(-50%) scale(.96);
    }

    .quickview-event__body {
        padding-left: 58px;
        padding-right: 58px;
    }
}
