/* --- CONTAINER SCOPE --- */
.timeline-container {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
    position: relative; /* Needed for absolute SVG positioning */
}

/* --- ROW LAYOUT --- */
.timeline-container .timeline-row {
    display: flex;
    align-items: center; 
    justify-content: center;
    width: 100%;
    min-height: 200px; 
    margin-bottom: 2rem;
    position: relative;
    z-index: 1; /* Keep content above the SVG */
}

/* --- COLUMNS (3-4-5 Grid) --- */
.timeline-container .timeline-year {
    flex: 3; 
    padding: 0 2rem;
    text-align: right;
}

.timeline-container .timeline-marker {
    flex: 4;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.timeline-container .timeline-content {
    flex: 5;
    padding: 0 2rem;
    text-align: left;
}

/* --- THE CIRCLE --- */
.timeline-container .circle-wrapper {
    width: 200px;
    height: 200px;
    border-radius: 50%;
    /* Use Primary Color for border/background */
    border: 5px solid var(--primary-color);
    background-color: var(--primary-color);
    
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    
    position: relative;
    z-index: 2; /* Sits on top of the SVG line */
}

.timeline-container .circle-wrapper img {
    /* 190px image + 5px gap (filled with primary color) = 200px total */
    width: 190px;
    height: 190px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

/* --- TYPOGRAPHY --- */
.timeline-container .timeline-year h2 {
    font-size: 2.5em; 
    font-weight: 800;
    margin: 0;
    color: var(--primary-color); 
    line-height: 1;
}

.timeline-container .timeline-content h3 {
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 0.5rem;
    font-size: 1.3em;
}

.timeline-container .timeline-content p {
    margin: 0;
    color: var(--secondary-color);
}

/* --- ALTERNATING LAYOUT --- */
.timeline-container .timeline-row:nth-child(even) {
    flex-direction: row-reverse;
}

.timeline-container .timeline-row:nth-child(even) .timeline-year {
    text-align: left;
}

.timeline-container .timeline-row:nth-child(even) .timeline-content {
    text-align: right;
}

/* --- SVG LINE STYLING (The generated line) --- */
.timeline-svg-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0; /* Behind everything */
    pointer-events: none; /* Let clicks pass through */
}

.timeline-path {
    stroke: var(--primary-color);
    stroke-width: 5px;
    fill: none;
    /* Optional: round the joins if the angle is sharp */
    stroke-linejoin: round; 
    stroke-linecap: round;
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    .timeline-container .timeline-row, 
    .timeline-container .timeline-row:nth-child(even) {
        flex-direction: column;
        margin-bottom: 3rem;
    }

    /* Hide the SVG line on mobile? 
       Usually on mobile it stacks, so the calculation might look weird 
       unless you want a straight vertical line. 
       Safest is to hide it or let it redraw vertically. 
       Since the JS recalculates on resize, it will actually draw a 
       straight vertical line down the middle automatically! */
    
    .timeline-container .timeline-year, 
    .timeline-container .timeline-marker, 
    .timeline-container .timeline-content {
        flex: auto;
        width: 100%;
        text-align: center; 
        padding: 0.5rem 1rem;
    }
    
    .timeline-container .timeline-marker {
        order: -1; 
        margin-bottom: 1rem;
    }

    .timeline-container .timeline-row:nth-child(even) .timeline-year,
    .timeline-container .timeline-row:nth-child(even) .timeline-content {
        text-align: center;
    }
}