/* Timeline Section */
.timeline {
    padding: 6vh 3vw;
    background-color: var(--timeline-background-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.timeline__title {
    font-size: 3.5rem;
    margin-bottom: 1.5rem;
    position: absolute;
    top: 6vh;
    left: 50%;
    transform: translateX(-50%);
}

.timeline__events {
    position: relative;
    width: 100%;
    height: 70vh; /* Adjust based on content */
    margin: auto;
}

.timeline__event {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: absolute;
    width: 150px;
}

.timeline__event:nth-child(1) {
    top: 0;
    left: 10%;
}

.timeline__event:nth-child(2) {
    top: 25%;
    right: 10%;
}

.timeline__event:nth-child(3) {
    top: 50%;
    left: 10%;
}

.timeline__event:nth-child(4) {
    top: 75%;
    right: 10%;
}

.timeline__event::after {
    content: '';
    position: absolute;
    width: 80px; /* Adjust size */
    height: 80px; /* Adjust size */
    background-repeat: no-repeat;
    background-size: contain;
}

.timeline__event:nth-child(1)::after {
    background-image: url('../images/timeline/connection_line_1.webp');
    top: 30px;
    left: 110px;
}

.timeline__event:nth-child(2)::after {
    background-image: url('../images/timeline/connection_line_2.webp');
    top: 40px;
    right: 110px;
    transform: scaleX(-1);
}

.timeline__event:nth-child(3)::after {
    background-image: url('../images/timeline/connection_line_3.webp');
    top: 30px;
    left: 110px;
}

.timeline__icon {
    max-width: 140px;
    height: auto;
}

.timeline__details {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.timeline__time {
    font-family: var(--font-sans-serif);
    font-weight: bold;
    font-size: 0.9rem;
}

.timeline__text {
    font-family: var(--font-sans-serif);
    font-size: 2.2rem;
    line-height: 1;
    font-weight: 300;
}

.timeline__connector {
    display: none;
}

/* Desktop layout */
@media (min-width: 768px) {
    .timeline {
        min-height: auto;
        justify-content: flex-start;
        padding: 6vh 3vw;
    }

    .timeline__title {
        font-size: 4rem;
        position: static;
        transform: none;
        margin-bottom: 6vh;
    }

    .timeline__events {
        display: flex;
        flex-direction: row;
        justify-content: center;
        align-items: center;
        gap: 2vw;
        max-width: none;
        height: auto;
        position: static;
    }

    .timeline__event {
        position: static;
        width: 200px;
        gap: 1rem;
    }
    
    .timeline__event--reordered .timeline__icon {
        order: 2;
    }
    
    .timeline__event--reordered .timeline__details {
        order: 1;
    }

    .timeline__event::after {
        display: none;
    }

    .timeline__icon {
        max-height: 160px;
    }

    .timeline__details {
        gap: 0.5rem;
    }

    .timeline__time {
        font-size: 1rem;
    }
    
    .timeline__text {
        font-size: 2.5rem;
    }

    .timeline__connector {
        display: block;
        flex-grow: 0;
        flex-shrink: 0;
        width: 120px;
        height: 80px;
        background-repeat: no-repeat;
        background-position: center;
        background-size: contain;
    }

    .timeline__events > .timeline__connector:nth-of-type(2) {
        background-image: url('../images/timeline/connection_line_1.webp');
    }

    .timeline__events > .timeline__connector:nth-of-type(4) {
        background-image: url('../images/timeline/connection_line_2.webp');
    }

    .timeline__events > .timeline__connector:nth-of-type(6) {
        background-image: url('../images/timeline/connection_line_3.webp');
    }
}

/* Mobile (phone) layout */
@media (max-width: 767px) {
    .timeline {
        min-height: 100vh;
        padding: 5vh 3vw 10vh;
        justify-content: flex-start;
    }

    /* Scale down icons so all events fit in one viewport height */
    .timeline__icon {
        max-height: 14vh;
        width: auto;
    }

    /* Reset title placement */
    .timeline__title {
        position: static;
        transform: none;
        margin-bottom: 3vh;
        font-size: 3rem;
    }

    /* Stack events vertically */
    .timeline__events {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 2vh;
        height: auto;
        position: static;
    }

    /* Event block styling */
    .timeline__event {
        position: static;
        width: 75%;
        max-width: 450px;
        text-align: center;
    }

    /* Zig-zag positioning for events */
    .timeline__event:nth-child(1) {
        align-self: flex-start;
        margin-left: 4%;
    }

    .timeline__event:nth-child(3) {
        align-self: flex-end;
        margin-right: 4%;
    }

    .timeline__event:nth-child(5) {
        align-self: flex-start;
        margin-left: 4%;
    }

    .timeline__event:nth-child(7) {
        align-self: flex-end;
        margin-right: 4%;
    }

    /* Remove old pseudo-line connectors */
    .timeline__event::after {
        display: none;
    }

    /* Show connector elements, rotate them vertically */
    .timeline__connector {
        display: block;
        width: 7vh;
        height: 7vh;
        transform: rotate(90deg);
        flex-shrink: 0;
        background-repeat: no-repeat;
        background-position: center;
        background-size: contain;
        align-self: center;
    }

    /* Assign the same images but reuse orientation */
    .timeline__events > .timeline__connector:nth-of-type(2) {
        background-image: url('../images/timeline/connection_line_1.webp');
    }

    .timeline__events > .timeline__connector:nth-of-type(4) {
        background-image: url('../images/timeline/connection_line_2.webp');
    }

    .timeline__events > .timeline__connector:nth-of-type(6) {
        background-image: url('../images/timeline/connection_line_3.webp');
    }
} 