/* ================================================================
   FILE: /css/components/timeline.css
   PURPOSE: Defines styles for the elegant vertical timeline.
   - Inspired by TGT but adapted for the CH design system.
   - All classes are prefixed with `ch-` for namespacing.
   ================================================================ */

.ch-timeline-wrapper {
    position: relative;
    max-width: 800px;
    margin: var(--ch-spacing-lg) auto;
}

/* The central vertical line */
.ch-timeline-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    height: 100%;
    width: 2px;
    background-color: var(--ch-color-border);
}

.ch-timeline-item {
    padding: 10px 40px;
    position: relative;
    width: 50%;
    box-sizing: border-box;
}

/* Align even items to the right */
.ch-timeline-item:nth-child(even) {
    left: 50%;
}

/* The dot on the timeline */
.ch-timeline-item::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    right: -9px;
    top: 24px;
    background-color: var(--ch-color-background);
    border: 4px solid var(--ch-color-accent);
    border-radius: 50%;
    z-index: 1;
    transition: transform 0.3s ease;
}

.ch-timeline-item:nth-child(even)::after {
    left: -9px;
}

.ch-timeline-item:hover::after {
    transform: scale(1.2);
}

/* The content box */
.ch-timeline-content {
    padding: var(--ch-spacing-sm);
    background-color: var(--ch-color-contrast);
    border: 1px solid var(--ch-color-border);
    border-radius: var(--ch-border-radius);
    box-shadow: var(--ch-box-shadow);
    position: relative;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1),
                box-shadow 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.ch-timeline-item:hover .ch-timeline-content {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(29, 45, 63, 0.1);
}

.ch-timeline-date {
    font-family: var(--ch-font-body);
    font-weight: 700;
    color: var(--ch-color-accent);
    margin-bottom: var(--ch-spacing-xs);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ch-timeline-title {
    font-family: var(--ch-font-heading);
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
    color: var(--ch-color-text-heading);
    line-height: 1.4;
}

/* Responsive styles for the timeline */
@media (max-width: 768px) {
    .ch-timeline-wrapper::before {
        left: 9px;
    }

    .ch-timeline-item,
    .ch-timeline-item:nth-child(even) {
        width: 100%;
        padding-left: 40px;
        padding-right: 10px;
        left: 0;
    }

    .ch-timeline-item::after,
    .ch-timeline-item:nth-child(even)::after {
        left: 0;
    }
}