/* Anpassungen nur wenn Timeline vorhanden */
#wrap:has(.horizontal-timeline) {
    padding: 20px 0;
    overflow-x: auto; /* Ermöglicht Scrollen nur bei Timeline */
}

.horizontal-timeline {
    padding: 25px;
    min-width: 100%;
    padding: 80px 0;
    position: relative;
    background: #f6f6f6;
    overflow-y: scroll;
}

.horizontal-line {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 2px;
    background: #333;
    z-index: 1;
}

.timeline-items {
    display: flex;
    position: relative;
    z-index: 2;
    width: 3600px;
    margin: 0 auto;
}

.timeline-item {
    position: relative;
    width: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-shrink: 0;
}

/* Abwechselnd oben/unten */
.timeline-item:nth-child(odd) .timeline-content {
    margin-top: -100px;
    background: #e3f2fd;
}

.timeline-item:nth-child(even) .timeline-content {
    margin-top: 160px;
    background: #fff8e1;
}

.timeline-content {
    width: 580px;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    text-align: center;
}

/* Punkte auf der Linie */
.timeline-item::before {
    position: relative;
    top: 50%;
    transform: translateX(-50%);
    content: '';
    display: block;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #ff6b6b;
    box-shadow: 0 0 0 4px rgba(255, 107, 107, 0.2);
    margin: 10px 0;
}

.timeline-number {
    font-weight: bold;
    font-size: 18px;
    color: #ff6b6b;
    margin-bottom: 5px;
}

h2.timeline {
    margin: 5px 0;
    font-size: 16px;
}

p.timeline {
    margin: 5px 0;
    font-size: 14px;
}

@media (max-width: 768px) {
    #wrap:has(.horizontal-timeline) {
        overflow-x: hidden;
        padding: 0;
    }
    
    .horizontal-timeline {
        min-width: auto;
        padding: 40px 20px;
    }
    
    .timeline-items {
        flex-direction: column;
        width: auto;
    }
    
    .timeline-item {
        width: 100%;
        margin: 40px 0;
    }
    
    .timeline-content {
        width: 100%;
        margin-top: 0 !important;
    }
    
    .timeline-item::before {
        margin: 20px 0;
    }
    
    .horizontal-line {
        display: none;
    }
}