.timeline-sort-options{
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 40px;
}

.timeline-sort-options button {
    border-radius: var(--radius-round);
    padding: 12px 32px;
    background-color: var(--color-bg-hover);
    text-align: center;
    cursor: pointer;
    font-weight: 500;
    font-size: var(--font-size-button);
    transition: all 0.3s ease;
    border: none;
    color: var(--color-text-secondary);
}

.timeline-sort-options button:hover{
    background-color: var(--color-bg-coral-tint);
    transform: translateY(-2px);
}

.timeline-sort-options button.active{
    background-color: var(--color-orange);
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(247, 85, 89, 0.3);
}

.timeline-sort-options button.active span{
    color:white;
}

.timeline-item-wrapper{
    width: 100%;
}

.timeline-container {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding: var(--spacing-xl) 0;
}

.timeline-container::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 4px;
    background: linear-gradient(to bottom, var(--color-primary-blue-light), var(--color-primary-blue));
    border: var(--border-width-medium) solid var(--color-border-white);
    transform: translateX(-50%);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    margin-bottom: 60px;
    display: flex;
    align-items: center;
}

.timeline-item-wrapper:nth-child(odd) .timeline-item {
    flex-direction: row-reverse;
}

.timeline-date {
    flex: 1;
    text-align: right;
    padding-right: var(--spacing-xl);
    font-weight: 600;
    color: var(--color-purple);
    font-size: var(--font-size-timeline-date);
}

.timeline-item-wrapper:nth-child(odd) .timeline-date {
    text-align: left;
    padding-left: var(--spacing-xl);
    padding-right: 0;
}

.timeline-dot {
    width: 24px;
    height: 24px;
    border-radius: var(--radius-circle);
    background-color: var(--color-purple);
    border: 4px solid var(--color-border-white);
    box-shadow: 0 0 0 3px var(--color-border-pale);
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.timeline-content {
    flex: 1;
    background-color: var(--color-bg-white);
    padding: var(--spacing-lg);
    border-radius: var(--radius-lg);
    /* border: var(--border-width-thick) solid var(--color-border-primary); */
    box-shadow: 0 4px 16px var(--shadow-color-blue-light);
    margin-left: var(--spacing-xl);
    transition: transform 0.3s ease, border-color 0.3s ease, background-color 0.3s ease;
}

.timeline-item-wrapper:nth-child(odd) .timeline-content {
    background-color: var(--color-bg-white);
    margin-left: 0;
    margin-right: var(--spacing-xl);
}

.timeline-item-wrapper:nth-child(even) .timeline-content {
    background-color: var(--color-bg-white);
}

.timeline-content:hover {
    transform: translateY(-5px);
    border-color: var(--color-border-primary-light);
    box-shadow: 0 8px 24px var(--shadow-color-blue-medium);
}

.timeline-content h3 {
    /* color: var(--color-purple); */
    margin-bottom: var(--spacing-sm);
    font-size: var(--font-size-timeline-title);
    /* border-bottom: var(--border-width-medium) solid var(--color-border-pale); */
    padding-bottom: var(--spacing-sm);
}

.timeline-content p {
    color: var(--color-text-secondary);
    line-height: 1.7;
    margin-bottom: var(--spacing-sm);
}

.timeline-description-wrapper {
    position: relative;
}

.timeline-description {
    font-size: var(--font-size-description);
    line-height: 1.8;
    color: var(--color-text-secondary);
    margin-bottom: var(--spacing-md);
}

.timeline-description.truncated {
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    line-clamp: 5;
    -webkit-box-orient: vertical;
    max-height: 9em; /* Approximately 5 lines at 1.8 line-height */
}

.timeline-read-more {
    background: none;
    border: none;
    color: var(--color-coral);
    font-size: var(--font-size-read-more);
    font-weight: 600;
    cursor: pointer;
    padding: 8px 0;
    margin-top: 8px;
    transition: color 0.2s ease;
    text-decoration: underline;
}

.timeline-read-more:hover {
    color: var(--color-purple);
}

.timeline-read-more .read-more-text {
    display: inline;
}

.timeline-read-more .read-less-text {
    display: none;
}

.timeline-read-more.expanded .read-more-text {
    display: none;
}

.timeline-read-more.expanded .read-less-text {
    display: inline;
}

.timeline-attribution{
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    padding: var(--spacing-md);
    background-color: var(--color-bg-hover);
    border-radius: var(--radius-md);
    /* border: var(--border-width-medium) solid var(--color-border-pale); */
}

.section-subtitle {
    font-size: var(--font-size-body-lg);
    color: var(--color-text-muted);
    font-style: italic;
    margin-top: var(--spacing-sm);
}

@media only screen and (max-width: 768px) {
    .timeline-container {
        padding: var(--spacing-lg) var(--spacing-md);
        max-width: 100%;
        overflow-x: hidden;
        position: relative;
    }
    
    /* Vertical line positioned near left border */
    .timeline-container::before {
        left: 0px;
        transform: none;
        width: 3px;
    }
    
    /* Timeline items stack vertically - date above box */
    .timeline-item {
        flex-direction: column !important;
        margin-bottom: var(--spacing-xl);
        align-items: stretch;
        position: relative;
        padding-left: 0;
    }
    
    .timeline-item:nth-child(odd) {
        flex-direction: column !important;
    }
    
    /* Dot positioned on the vertical line, aligned with date */
    .timeline-dot {
        left: 5px;
        transform: translateX(-50%);
        width: 18px;
        height: 18px;
        border: 3px solid var(--color-border-white);
        box-shadow: 0 0 0 2px var(--color-border-pale);
        top: 0.3em;
        margin-top: 0;
    }
    
    /* Date positioned above content box, to the right of vertical line */
    .timeline-date {
        width: auto;
        min-width: auto;
        max-width: none;
        text-align: left !important;
        padding-left: var(--spacing-lg) !important;
        padding-right: 0 !important;
        padding-bottom: var(--spacing-sm);
        font-size: var(--font-size-md);
        font-weight: 600;
        color: var(--color-purple);
        flex-shrink: 0;
        white-space: normal;
        overflow: visible;
        line-height: 1.4;
        margin-bottom: 0;
    }
    
    .timeline-item-wrapper:nth-child(odd) .timeline-date {
        text-align: left !important;
        padding-left: var(--spacing-lg) !important;
        padding-right: 0 !important;
    }
    
    /* Content box takes full width (minus small left margin for line) */
    .timeline-content {
        margin-left: var(--spacing-lg) !important;
        margin-right: 0 !important;
        max-width: calc(100% - var(--spacing-lg));
        width: calc(100% - var(--spacing-lg));
        flex: 0 1 auto;
        padding: var(--spacing-md);
        box-sizing: border-box;
        overflow-wrap: break-word;
        word-wrap: break-word;
        overflow: hidden;
        background-color: var(--color-bg-white);
        border-radius: var(--radius-lg);
        /* border: var(--border-width-thick) solid var(--color-border-primary); */
        box-shadow: 0 2px 8px var(--shadow-color-blue-light);
        transition: none;
    }
    
    /* Ensure all content boxes are uniform */
    .timeline-item-wrapper:nth-child(odd) .timeline-content {
        margin-left: var(--spacing-lg) !important;
        margin-right: 0 !important;
        background-color: var(--color-bg-white);
    }
    
    .timeline-item-wrapper:nth-child(even) .timeline-content {
        background-color: var(--color-bg-white);
        margin-left: var(--spacing-lg) !important;
        margin-right: 0 !important;
    }
    
    /* Remove hover effects on mobile */
    .timeline-content:hover {
        transform: none;
        border-color: var(--color-border-primary);
        box-shadow: 0 2px 8px var(--shadow-color-blue-light);
    }
    
    .timeline-content * {
        max-width: 100%;
    }
    
    .timeline-content h3 {
        font-size: var(--font-size-xl);
        margin-bottom: var(--spacing-sm);
        /* color: var(--color-purple); */
    }
    
    .timeline-content p {
        margin-bottom: var(--spacing-sm);
    }
    
    .timeline-description {
        font-size: var(--font-size-body);
        line-height: 1.6;
    }
    
    .timeline-read-more {
        font-size: var(--font-size-md);
        padding: 6px 0;
    }
}

