/* Wrapper für dein CE */
.ce-timeline--style5 {
    margin-bottom: 3rem;
}

/* Haupt-Container mit Mittellinie */
.main-timeline5 {
    position: relative;
    padding: 3rem 0;
    max-width: 1100px;       /* optional, damit es zentriert & nicht zu breit wird */
    margin: 0 auto;
}

.main-timeline5::before {
    content: "";
    position: absolute;
    inset-block: 0;
    left: 50%;
    width: 2px;
    background: #e5e5e5;
    transform: translateX(-50%);
}

/* Ein Eintrag */
.main-timeline5 .timeline {
    position: relative;
    margin: 3.5rem 0;
}

/* Der farbige Kreis in der Mitte */
.main-timeline5 .timeline-icon {
    position: absolute;
    top: 0;
    left: 50%;
    width: 7rem;
    height: 7rem;
    transform: translate(-50%, 0);
    border-radius: 50%;
    border: 10px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, .05);
}

/* Innenkreis mit Jahr */
.main-timeline5 .year {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 4.4rem;
    height: 4.4rem;
    border-radius: 50%;
    font-weight: 700;
    font-size: 1.2rem;
    text-transform: uppercase;
    background: #fff;
}

/* Timeline-Card links/rechts neben der Linie */
.main-timeline5 .timeline-content {
    position: relative;
    width: calc(50% - 60px);     /* halbe Breite minus Abstand zur Mitte */
    background: #fff;
    border-radius: .5rem;
    padding: 1.8rem 2rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, .08);
    color: #222;
}

/* Verbindungskästchen zur Mittellinie */
.main-timeline5 .timeline-content::before {
    content: "";
    position: absolute;
    top: 2.8rem;
    width: 18px;
    height: 18px;
    border-radius: 3px;
    transform: rotate(45deg);
}

/* ungerade: links */
.main-timeline5 .timeline:nth-child(odd) .timeline-content {
    margin-right: auto;      /* nach links schieben */
    padding-right: 3rem;
}

/* Verbindungspfeil links */
.main-timeline5 .timeline:nth-child(odd) .timeline-content::before {
    right: -9px;
}

/* gerade: rechts */
.main-timeline5 .timeline:nth-child(even) .timeline-content {
    margin-left: auto;       /* nach rechts schieben */
    padding-left: 3rem;
}

/* Verbindungspfeil rechts */
.main-timeline5 .timeline:nth-child(even) .timeline-content::before {
    left: -9px;
}

/* ------------------------------------------
   Farben – 8er-Set über CSS-Variablen (Defaults)
   ------------------------------------------ */

:root {
    --timeline-color-1: #f45b69;
    --timeline-color-1-soft: rgba(244, 91, 105, .3);

    --timeline-color-2: #1e88e5;
    --timeline-color-2-soft: rgba(30, 136, 229, .3);

    --timeline-color-3: #43a047;
    --timeline-color-3-soft: rgba(67, 160, 71, .3);

    --timeline-color-4: #ffb300;
    --timeline-color-4-soft: rgba(255, 179, 0, .3);

    --timeline-color-5: #8e24aa;
    --timeline-color-5-soft: rgba(142, 36, 170, .3);

    --timeline-color-6: #00acc1;
    --timeline-color-6-soft: rgba(0, 172, 193, .3);

    --timeline-color-7: #f4511e;
    --timeline-color-7-soft: rgba(244, 81, 30, .3);

    --timeline-color-8: #5e35b1;
    --timeline-color-8-soft: rgba(94, 53, 177, .3);
}

/* 1. Farbe: Items 1,9,17,... (8n+1) */
.main-timeline5 .timeline:nth-child(8n+1) .timeline-icon,
.main-timeline5 .timeline:nth-child(8n+1) .timeline-content,
.main-timeline5 .timeline:nth-child(8n+1) .timeline-content::before {
    background: var(--timeline-color-1);
    border-color: var(--timeline-color-1-soft);
    color: #fff;
}

.main-timeline5 .timeline:nth-child(8n+1) .year {
    background: #fff;
    color: var(--timeline-color-1);
}

/* 2. Farbe: Items 2,10,18,... (8n+2) */
.main-timeline5 .timeline:nth-child(8n+2) .timeline-icon,
.main-timeline5 .timeline:nth-child(8n+2) .timeline-content,
.main-timeline5 .timeline:nth-child(8n+2) .timeline-content::before {
    background: var(--timeline-color-2);
    border-color: var(--timeline-color-2-soft);
    color: #fff;
}

.main-timeline5 .timeline:nth-child(8n+2) .year {
    background: #fff;
    color: var(--timeline-color-2);
}

/* 3. Farbe: Items 3,11,19,... (8n+3) */
.main-timeline5 .timeline:nth-child(8n+3) .timeline-icon,
.main-timeline5 .timeline:nth-child(8n+3) .timeline-content,
.main-timeline5 .timeline:nth-child(8n+3) .timeline-content::before {
    background: var(--timeline-color-3);
    border-color: var(--timeline-color-3-soft);
    color: #fff;
}

.main-timeline5 .timeline:nth-child(8n+3) .year {
    background: #fff;
    color: var(--timeline-color-3);
}

/* 4. Farbe: Items 4,12,20,... (8n+4) */
.main-timeline5 .timeline:nth-child(8n+4) .timeline-icon,
.main-timeline5 .timeline:nth-child(8n+4) .timeline-content,
.main-timeline5 .timeline:nth-child(8n+4) .timeline-content::before {
    background: var(--timeline-color-4);
    border-color: var(--timeline-color-4-soft);
    color: #fff;
}

.main-timeline5 .timeline:nth-child(8n+4) .year {
    background: #fff;
    color: var(--timeline-color-4);
}

/* 5. Farbe: Items 5,13,21,... (8n+5) */
.main-timeline5 .timeline:nth-child(8n+5) .timeline-icon,
.main-timeline5 .timeline:nth-child(8n+5) .timeline-content,
.main-timeline5 .timeline:nth-child(8n+5) .timeline-content::before {
    background: var(--timeline-color-5);
    border-color: var(--timeline-color-5-soft);
    color: #fff;
}

.main-timeline5 .timeline:nth-child(8n+5) .year {
    background: #fff;
    color: var(--timeline-color-5);
}

/* 6. Farbe: Items 6,14,22,... (8n+6) */
.main-timeline5 .timeline:nth-child(8n+6) .timeline-icon,
.main-timeline5 .timeline:nth-child(8n+6) .timeline-content,
.main-timeline5 .timeline:nth-child(8n+6) .timeline-content::before {
    background: var(--timeline-color-6);
    border-color: var(--timeline-color-6-soft);
    color: #fff;
}

.main-timeline5 .timeline:nth-child(8n+6) .year {
    background: #fff;
    color: var(--timeline-color-6);
}

/* 7. Farbe: Items 7,15,23,... (8n+7) */
.main-timeline5 .timeline:nth-child(8n+7) .timeline-icon,
.main-timeline5 .timeline:nth-child(8n+7) .timeline-content,
.main-timeline5 .timeline:nth-child(8n+7) .timeline-content::before {
    background: var(--timeline-color-7);
    border-color: var(--timeline-color-7-soft);
    color: #fff;
}

.main-timeline5 .timeline:nth-child(8n+7) .year {
    background: #fff;
    color: var(--timeline-color-7);
}

/* 8. Farbe: Items 8,16,24,... (8n) */
.main-timeline5 .timeline:nth-child(8n) .timeline-icon,
.main-timeline5 .timeline:nth-child(8n) .timeline-content,
.main-timeline5 .timeline:nth-child(8n) .timeline-content::before {
    background: var(--timeline-color-8);
    border-color: var(--timeline-color-8-soft);
    color: #fff;
}

.main-timeline5 .timeline:nth-child(8n) .year {
    background: #fff;
    color: var(--timeline-color-8);
}

/* Überschriften & Text innen */
.main-timeline5 .timeline-content .timeline-meta {
    margin-bottom: .4rem;
    opacity: .85;
    font-size: .9rem;
}

.main-timeline5 .timeline-content .title {
    margin: 0 0 .3rem;
    font-size: 1.25rem;
    font-weight: 700;
}

.main-timeline5 .timeline-content .subtitle {
    margin: 0 0 .8rem;
    font-size: 1rem;
    font-weight: 600;
    opacity: .9;
}

.main-timeline5 .timeline-content .description {
    font-size: .95rem;
    line-height: 1.6;
}

.main-timeline5 .timeline-content a {
    text-decoration: underline;
}

/* Links im Inhalt */
.main-timeline5 .timeline-content .timeline-link {
    margin-top: 1.2rem;
}

/* Links generell in der Timeline weiß darstellen */
.main-timeline5 a {
    color: #fff;
    text-decoration: underline;
}

/* ------------------------------------------
   Responsive Anpassungen
   ------------------------------------------ */
@media (max-width: 991.98px) {
    .main-timeline5::before {
        left: 20px;
        transform: none;
    }

    .main-timeline5 .timeline-icon {
        left: 20px;
        transform: none;
        width: 4.5rem;
        height: 4.5rem;
        border-width: 6px;
    }

    .main-timeline5 .year {
        width: 2.8rem;
        height: 2.8rem;
        font-size: .9rem;
    }

    .main-timeline5 .timeline-content,
    .main-timeline5 .timeline:nth-child(odd) .timeline-content,
    .main-timeline5 .timeline:nth-child(even) .timeline-content {
        width: auto;
        margin-left: 5.5rem;
        margin-right: 0;
        right: auto;
        left: auto;
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }

    .main-timeline5 .timeline-content::before {
        left: -9px;
        right: auto;
    }
}
