/* =========================
   Basis / Layout
========================= */

.termine-page {
    max-width: 1100px;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
}

.termine-hero {
    margin-bottom: 2rem;
    text-align: center;
}

.termine-warning {
    padding: 0.8rem 1rem;
    border-radius: 10px;
    background: #fff5f5;
    border: 1px solid #ffd0d0;
    margin: 0 auto 1rem;
    max-width: 820px;
}

.termine-info {
    margin: 0 auto 1.2rem;
    color: #444;
    max-width: 820px;
}

/* Tabs */
.termine-tabs {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: 0.6rem;
    justify-content: center;
}

.termine-tab {
    display: inline-block;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    border: 1px solid #ddd;
    text-decoration: none;
    color: #222;
    background: #fafafa;
    text-align: center;
}

.termine-tab.is-active {
    border-color: #bbb;
    background: #f0f0f0;
}

.termine-panel {
    padding: 1rem 1.2rem;
    border-radius: 10px;
    border: 1px solid #e5e5e5;
    background: #fafafa;
}

/* =========================
   Kategorien: Farben + Icons
========================= */

.termine-group-title {
    font-size: 1.4rem;
    margin: 2.2rem 0 1rem;
    padding-left: 2.6rem;
    position: relative;
    border-bottom: 2px solid transparent;
    padding-bottom: 0.4rem;
}

/* Veranstaltung */
.termine-group-title.cat-veranstaltung {
    color: #2e7d32;
    border-color: #2e7d32;
}
.termine-group-title.cat-veranstaltung::before {
    content: "🎉";
    position: absolute;
    left: 0;
    top: 0;
}

/* Versammlung */
.termine-group-title.cat-versammlung {
    color: #1565c0;
    border-color: #1565c0;
}
.termine-group-title.cat-versammlung::before {
    content: "🏛️";
    position: absolute;
    left: 0;
    top: 0;
}

/* Hege Einsatz */
.termine-group-title.cat-hege {
    color: #6d4c41;
    border-color: #6d4c41;
}
.termine-group-title.cat-hege::before {
    content: "🌲";
    position: absolute;
    left: 0;
    top: 0;
}

/* =========================
   Liste / Termin-Items
========================= */

.termine-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.termin-item {
    margin: 0 0 0.9rem;
    border-radius: 12px;
    overflow: hidden;
    background: #fafafa;
    border: 1px solid #ececec;
    border-left: 6px solid #ccc;
}

.termin-link {
    display: flex;
    gap: 1rem;
    padding: 1rem 1rem;
    text-decoration: none;
    color: inherit;
}

.termin-link:hover {
    background: #f4f4f4;
}

/* Farbstreifen pro Kategorie */
.termin-item.cat-veranstaltung { border-left-color: #2e7d32; }
.termin-item.cat-versammlung   { border-left-color: #1565c0; }
.termin-item.cat-hege          { border-left-color: #6d4c41; }

/* Datebox */
.termin-datebox {
    min-width: 78px;
    border-radius: 12px;
    padding: 0.65rem 0.6rem;
    text-align: center;
    background: #ffffff;
    border: 1px solid #eaeaea;
}

.termin-datebox__day {
    display: block;
    font-weight: 800;
    font-size: 1.05rem;
    line-height: 1.1;
}

.termin-datebox__year {
    display: block;
    font-size: 0.9rem;
    color: #666;
    margin-top: 0.2rem;
}

.termin-body {
    flex: 1;
    min-width: 0;
}

.termin-top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}

.termin-title {
    font-weight: 800;
    font-size: 1.05rem;
    color: #111;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.termin-date {
    color: #444;
    font-weight: 600;
    white-space: nowrap;
}

.termin-meta {
    margin-top: 0.35rem;
    color: #555;
    font-size: 0.95rem;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.termin-dot { opacity: 0.7; }

.termin-more {
    margin-top: 0.55rem;
    font-weight: 700;
    color: #222;
}

/* =========================
   Archiv Meta + Pagination (zentriert)
========================= */

.termine-archive-meta {
    margin-top: 0.8rem;
    color: #444;
    font-weight: 600;
    text-align: center;
}

.termine-pagination {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e6e6e6;
}

.termine-pagination.is-centered {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.termine-pagebtn {
    display: inline-block;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    border: 1px solid #ddd;
    background: #fafafa;
    text-decoration: none;
    color: #222;
    font-weight: 700;
    white-space: nowrap;
}

.termine-pagebtn:hover { background: #f2f2f2; }

.termine-pagebtn.is-disabled {
    opacity: 0.45;
    pointer-events: none;
}

.termine-pagelist {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: center;
}

.termine-pagenum {
    display: inline-block;
    min-width: 40px;
    text-align: center;
    padding: 0.45rem 0.65rem;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    background: #fff;
    text-decoration: none;
    color: #222;
    font-weight: 700;
}

.termine-pagenum:hover { background: #f4f4f4; }

.termine-pagenum.is-active {
    border-color: #bbb;
    background: #f0f0f0;
}

.termine-pagegap {
    display: inline-block;
    padding: 0.45rem 0.3rem;
    color: #666;
    font-weight: 700;
}

/* =========================
   Badges: Abgelaufen / Nächster Termin
========================= */

.termin-item.is-expired {
    background: #fbfbfb;
    filter: saturate(0.75);
}
.termin-item.is-expired .termin-link { position: relative; }
.termin-item.is-expired .termin-datebox {
    background: #f7f7f7;
    border-color: #e6e6e6;
}
.termin-item.is-expired .termin-title,
.termin-item.is-expired .termin-meta,
.termin-item.is-expired .termin-date {
    color: #555;
}

.termin-item.is-next {
    background: #ffffff;
    box-shadow: 0 6px 18px rgba(0,0,0,0.06);
}
.termin-item.is-next .termin-link { position: relative; }

.termin-badge-expired,
.termin-badge-next {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    border: 1px solid #e1e1e1;
    background: rgba(255,255,255,0.9);
    font-size: 0.85rem;
    font-weight: 900;
    letter-spacing: 0.2px;
    color: #222;
    backdrop-filter: blur(6px);
}

.termin-badge-expired {
    font-weight: 800;
    color: #555;
}

/* Kategorie-Tönung für "Nächster Termin" */
.termin-item.is-next.cat-veranstaltung .termin-badge-next { border-color: #2e7d32; color: #2e7d32; }
.termin-item.is-next.cat-versammlung   .termin-badge-next { border-color: #1565c0; color: #1565c0; }
.termin-item.is-next.cat-hege          .termin-badge-next { border-color: #6d4c41; color: #6d4c41; }

/* =========================
   Termin Detail
========================= */

.termin-detail {
    border: 1px solid #ececec;
    border-left: 6px solid #ccc;
    border-radius: 14px;
    background: #fafafa;
    padding: 1.2rem 1.2rem;
}

.termin-detail.cat-veranstaltung { border-left-color: #2e7d32; }
.termin-detail.cat-versammlung   { border-left-color: #1565c0; }
.termin-detail.cat-hege          { border-left-color: #6d4c41; }

.termin-detail.is-expired { filter: saturate(0.8); }

.termin-detail-kicker {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.6rem;
}

.termin-detail-badge {
    display: inline-block;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    font-weight: 800;
    border: 1px solid #e1e1e1;
    background: rgba(255,255,255,0.9);
    color: #333;
}

.termin-detail-badge.cat-veranstaltung { border-color: #2e7d32; color: #2e7d32; }
.termin-detail-badge.cat-versammlung   { border-color: #1565c0; color: #1565c0; }
.termin-detail-badge.cat-hege          { border-color: #6d4c41; color: #6d4c41; }

.termin-detail-badge--expired { color: #555; }

.termin-detail-title {
    font-size: 1.8rem;
    margin: 0 0 1rem;
}

.termin-detail-meta {
    display: grid;
    gap: 0.55rem;
    max-width: 800px;
}

.termin-detail-row {
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 0.8rem;
    align-items: baseline;
}

.termin-detail-label {
    font-weight: 800;
    color: #444;
}

.termin-detail-value { color: #222; }

.termin-detail-body {
    margin-top: 1.2rem;
    padding-top: 1rem;
    border-top: 1px solid #e6e6e6;
}

.termin-detail-subtitle {
    font-size: 1.2rem;
    margin: 0 0 0.6rem;
}

.termin-detail-text {
    color: #444;
    line-height: 1.6;
}

/* Detail – Aktionen */
.termin-detail-actions {
    margin-top: 1.6rem;
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.termin-action {
    appearance: none;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 999px;
    padding: 0.55rem 1.1rem;
    font-weight: 800;
    cursor: pointer;
    text-decoration: none;
    color: #222;
    transition: background 0.15s ease, transform 0.05s ease;
}

.termin-action:hover { background: #f3f3f3; }
.termin-action:active { transform: translateY(1px); }

.termin-action--join { border-color: #2e7d32; color: #2e7d32; }
.termin-action--join:hover { background: #edf6ee; }

.termin-action--leave { border-color: #c62828; color: #c62828; }
.termin-action--leave:hover { background: #fdecec; }

.termin-action--back { border-color: #bbb; color: #444; }

/* =========================
   Inline-Sperrseite (Login erforderlich)
========================= */

.auth-inline {
    border: 1px solid #e5e5e5;
    background: #fafafa;
    border-radius: 14px;
    padding: 1.6rem 1.2rem;
    text-align: center;
}

.auth-inline__icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.auth-inline__title {
    margin: 0 0 0.6rem;
    font-size: 1.6rem;
}

.auth-inline__text {
    margin: 0 auto 1.2rem;
    max-width: 620px;
    color: #444;
    line-height: 1.55;
}

.auth-inline__actions {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 0.8rem;
}

.auth-inline__btn {
    display: inline-block;
    padding: 0.6rem 1rem;
    border-radius: 999px;
    border: 1px solid #ddd;
    background: #fff;
    text-decoration: none;
    color: #222;
    font-weight: 900;
}

.auth-inline__btn:hover { background: #f2f2f2; }

.auth-inline__btn--primary {
    background: #f0f0f0;
    border-color: #bbb;
}

.auth-inline__hint {
    margin: 0;
    color: #666;
    font-size: 0.95rem;
}

/* =========================
   Mobile (inkl. Badge-Fix gegen Überdeckung)
========================= */

@media (max-width: 680px) {
    .termin-link {
        flex-direction: column;
        position: relative;
    }

    .termin-datebox {
        width: 100%;
        text-align: left;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .termin-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .termin-title { white-space: normal; }

    .termin-detail-row {
        grid-template-columns: 1fr;
        gap: 0.2rem;
    }

    .termin-detail-title { font-size: 1.55rem; }

    /* ✅ Fix: Badges sollen NICHT die Jahreszahl/Datebox überdecken */
    .termin-badge-expired,
    .termin-badge-next {
        top: 8px;
        right: 10px;
        font-size: 0.8rem;
        padding: 0.22rem 0.5rem;
    }

    /* Platz oben im Link schaffen, damit Badge keinen Inhalt überdeckt */
    .termin-item.is-expired .termin-link,
    .termin-item.is-next .termin-link {
        padding-top: 2.2rem;
    }

    /* kleine optische Korrektur */
    .termin-item.is-expired .termin-datebox,
    .termin-item.is-next .termin-datebox {
        margin-top: 0.2rem;
    }
}
