/* ============================================================
   FILE: css/09-events.css
   VERSION: 3.5
   LAST MODIFIED: March 12, 2026
   DESCRIPTION: ZENTRALE EVENT-STEUERUNG (CPT fr_event).
                v3.5: Kooperations-Basis für JS-Smart-Truncate.
                Erzwingt Ellipsis-Fallback und steuert Wrapping via JS.
   ============================================================ */

/* --- 1. DER H3-BALKEN (Synchronisiert auf 36px Desktop) --- */
.news-teaser-h3-balken {
    display: block !important;
    position: relative !important;
    width: 100% !important;
    min-height: 36px !important;
    line-height: 36px !important;
    padding: 0 15px !important;
    margin: 0 0 25px 0 !important;
    font-family: "Open Sans", sans-serif !important;
    font-size: 1.1rem !important;
    font-weight: bold !important;
    color: #ffffff !important;
    box-shadow: 3px 3px 5px #666 !important;
    border-radius: 0 !important;
    box-sizing: border-box !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

.theme-orange .news-teaser-h3-balken {
    background-color: #ae6a3d !important;
}
.theme-blau .news-teaser-h3-balken {
    background-color: #2a6b94 !important;
}

/* DATUM IM BALKEN */
.news-teaser-item .news-teaser-date,
.entry-header .news-teaser-date {
    position: absolute !important;
    top: 0 !important;
    right: 15px !important;
    margin: 0 !important;
    line-height: 36px !important;
    font-size: 0.8rem !important;
    color: #ffffff !important;
    z-index: 50 !important;
    font-weight: normal !important;
    font-family: "Open Sans", sans-serif !important;
    display: block !important;
}
.news-teaser-date .date-short {
    display: none !important;
}
.news-teaser-date .date-full {
    display: inline !important;
}

/* --- 2. TEASER-STRUKTUR (Sync mit News v4.8) --- */
.news-teaser-content-flex {
    display: flex !important;
    align-items: flex-start !important;
    gap: 0 !important;
    margin-top: -7px !important;
}

.news-teaser-img-180 {
    flex-shrink: 0 !important;
    width: 180px !important;
    max-width: 180px !important;
    margin: 7px 25px 10px 0 !important;
}

.news-teaser-img-180 img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    border-radius: 4px;
    box-shadow: 3px 3px 5px #666 !important;
}

.news-teaser-text-box {
    flex: 1 !important;
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    color: #333 !important;
    margin-top: 7px !important;
}

.event-location-badge {
    background: #fff4ec;
    color: #ae6a3d;
    border: 1px solid #ae6a3d;
    font-weight: bold;
    text-transform: uppercase;
    font-size: 0.75rem;
    padding: 3px 10px;
    margin-bottom: 12px;
    display: inline-block;
}

.teaser-text-flow p:first-child {
    margin-top: -5px !important;
}

/* --- 3. DETAILANSICHT & KALENDER (Desktop Basis) --- */
.fr-calendar-wrapper {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    box-shadow: 3px 3px 5px #666 !important;
    margin: 2rem 0;
}

.calendar-header-nav {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 20px !important;
}

.calendar-header-nav h3 {
    margin: 0 !important;
    color: #ae6a3d;
    text-transform: uppercase;
    font-size: 1.1rem;
    text-align: center;
    flex: 1 !important;
}

.cal-nav-btn {
    background: #ae6a3d;
    color: #fff !important;
    text-decoration: none !important;
    padding: 8px 15px !important;
    border-radius: 4px;
    font-weight: bold;
    min-width: 44px;
    text-align: center;
}

.calendar-grid {
    display: grid !important;
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
    gap: 2px;
    background: #ddd;
    border: 1px solid #ddd;
}

.calendar-day-head {
    background: #f8f8f8;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    font-size: 0.8rem;
}

.calendar-day {
    background: #fff;
    min-height: 80px;
    padding: 5px;
    min-width: 0;
    overflow: hidden;
}

/* BASIS-LINK-STYLING: Immer mit Ellipsis-Fallback */
.cal-ev-link {
    display: block !important;
    background: #ae6a3d;
    color: #fff !important;
    font-size: 0.7rem;
    padding: 3px 5px;
    margin-bottom: 2px;
    border-radius: 2px;
    text-decoration: none;
    line-height: 1.2;

    /* Standard: Einzeilig mit Punkten */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* JS-CLASS: Wird vom Script hinzugefügt, wenn Platz für Umbruch ist */
.cal-ev-link.is-wrapping {
    white-space: normal !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2; /* Max 2 Zeilen auf Desktop */
    -webkit-box-orient: vertical;
    word-break: break-word;
}

.event-detail-info-bar {
    margin-bottom: 25px;
    padding: 10px 15px;
    background: #f9f9f9;
    border: 1px solid #eee;
    border-radius: 4px;
    font-size: 0.95rem;
}

.event-teaser-list .news-teaser-item {
    border-left: 6px solid #ae6a3d;
    padding-left: 20px !important;
    background: #fff;
    box-shadow: 3px 3px 5px #666;
    margin-bottom: 30px !important;
}

/* --- 4. RESPONSIVE SYNC (Mobile Optimierung) --- */
@media (max-width: 600px) {
    .news-teaser-content-flex {
        flex-direction: column !important;
        margin-top: 0 !important;
    }

    .news-teaser-h3-balken {
        font-size: 1.05rem !important;
        padding: 4px 100px 5px 15px !important;
        line-height: 1.3 !important;
        min-height: auto !important;
        white-space: normal !important;
    }

    .news-teaser-date span.date-full {
        display: none !important;
    }
    .news-teaser-date span.date-short {
        display: inline !important;
    }

    /* KALENDER MOBILE */
    .fr-calendar-wrapper {
        padding: 5px !important;
    }
    .calendar-grid {
        gap: 1px !important;
    }
    .calendar-day-head {
        padding: 5px 2px !important;
        font-size: 0.6rem !important;
    }
    .calendar-day {
        min-height: 60px !important;
        padding: 2px !important;
    }

    .cal-ev-link {
        font-size: 0.55rem !important;
        padding: 1px 2px !important;
        /* Mobile: Immer streng einzeilig bleiben */
        white-space: nowrap !important;
        -webkit-line-clamp: unset !important;
    }
}

@media (max-width: 390px) {
    .calendar-day {
        min-height: 50px !important;
    }
    .cal-ev-link {
        font-size: 0.5rem !important;
    }
}

/* --- 5. THEME BLAU --- */
.theme-blau .news-teaser-h3-balken {
    background-color: #2a6b94 !important;
}
.theme-blau .event-teaser-list .news-teaser-item {
    border-left-color: #2a6b94;
}
.theme-blau .event-location-badge {
    background: #ecf5ff;
    color: #2a6b94;
    border-color: #2a6b94;
}
.theme-blau .calendar-header-nav h3 {
    color: #2a6b94;
}
.theme-blau .cal-nav-btn {
    background: #2a6b94;
}
.theme-blau .cal-ev-link {
    background: #2a6b94;
}
