/* Ajalugu (ajajoon). Kujundus on mooduli enda failis (mitte teemas). */

/* --- [aktiviteet_ajalugu] ajajoon --- */
/* Konteiner */
.aktiv-timeline {
    position: relative;
    max-width: 1000px;
    margin: 60px auto;
    padding: 20px 0;
    overflow: hidden; /* Väldib scrollbari teket */
}

/* Keskmine joon */
.aktiv-timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background-color: #e2e8f0;
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%); /* Tsentreerib joone ideaalselt */
}

/* Üksik sündmus */
.aktiv-timeline .timeline-item {
    position: relative;
    width: 50%;
    padding: 0 40px; /* Ruum sisu ja joone vahel */
    box-sizing: border-box;
    margin-bottom: 40px; /* Vahe sündmuste vahel */
}

/* Vasak ja Parem pool */
/* Kompaktne vaade: kummagi poole kastid voolavad oma veerus, üksteisest sõltumatult */
.aktiv-timeline .timeline-item.left { float: left; clear: left; left: 0; text-align: right; }
.aktiv-timeline .timeline-item.right { float: right; clear: right; left: 0; text-align: left; }
/* Esimene parempoolne kast algab veidi allpool, et mullid ei oleks kõrvuti */
.aktiv-timeline .timeline-item.left + .timeline-item.right:nth-child(2) { margin-top: 70px; }

/* --- ILUSAD MULLID --- */
.aktiv-timeline .timeline-dot {
    position: absolute;
    box-sizing: content-box; /* globaalne border-box nihutas mulli 4px joonest eemale */
    width: 20px;
    height: 20px;
    background: #fff;
    border: 4px solid var(--color-accent); /* Oranž ääris */
    border-radius: 50%;
    top: 25px; /* Mulli kõrgus kasti suhtes */
    z-index: 2;
    box-shadow: 0 0 0 4px rgba(255,255,255,0.8); /* Valge 'halo' mulli ümber, et joon ei paistaks läbi */
    transition: all 0.3s ease;
}

/* Mulli asukoht vasakul pool */
.aktiv-timeline .timeline-item.left .timeline-dot {
    right: -14px; /* (20px laius + 8px border) / 2 = 14px */
}

/* Mulli asukoht paremal pool */
.aktiv-timeline .timeline-item.right .timeline-dot {
    left: -14px;
}

/* Hover efekt mullile */
.timeline-item:hover .timeline-dot {
    background: var(--color-accent);
    transform: scale(1.2);
    box-shadow: 0 0 10px rgba(37, 99, 235, 0.4);
}

/* --- SISU KAST --- */
.aktiv-timeline .timeline-content {
    background: #fff;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.08); /* Pehme vari */
    border-top: 3px solid var(--color-accent); /* Aktsent all */
    position: relative;
    transition: transform 0.3s ease;
}

.aktiv-timeline .timeline-item:hover .timeline-content {
    transform: translateY(-5px);
}

/* Aasta silt */
.timeline-year {
    display: inline-block;
    font-size: 0.85em;
    font-weight: 700;
    color: var(--color-accent);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

.timeline-content h3 {
    margin: 0 0 15px 0;
    font-size: 1.5rem;
    color: #2c3e50;
    line-height: 1.2;
}

.timeline-image img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin-bottom: 15px;
    display: block;
}

.timeline-text {
    color: #555;
    line-height: 1.6;
    font-size: 0.95rem;
}

/* --- NOOLEKESED KASTI KÜLJES --- */
.timeline-content::before {
    content: '';
    position: absolute;
    top: 28px;
    width: 0; 
    height: 0; 
    border-style: solid;
}

/* Vasak nool */
.aktiv-timeline .timeline-item.left .timeline-content::before {
    right: -10px;
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent #fff;
}

/* Parem nool */
.aktiv-timeline .timeline-item.right .timeline-content::before {
    left: -10px;
    border-width: 10px 10px 10px 0;
    border-color: transparent #fff transparent transparent;
}

/* --- MOBIILNE VAADE (< 768px) --- */
@media screen and (max-width: 768px) {
    /* Joon vasakule */
    .aktiv-timeline::after { left: 30px; }

    /* Kastid täislaiusesse */
    .aktiv-timeline .timeline-item {
        width: 100%;
        padding-left: 70px;
        padding-right: 20px;
        margin-bottom: 30px;
        text-align: left !important; /* Force left align */
    }

    /* Nullime vasak/parem loogika */
    .aktiv-timeline .timeline-item.left,
    .aktiv-timeline .timeline-item.right,
    .aktiv-timeline .timeline-item.left + .timeline-item.right:nth-child(2) {
        float: none;
        clear: both;
        left: 0;
        margin-top: 0;
    }

    /* Mullid alati vasakule joone peale */
    .aktiv-timeline .timeline-item.left .timeline-dot,
    .aktiv-timeline .timeline-item.right .timeline-dot {
        left: 16px; /* Joone keskkoht (30px) miinus pool mulli (14px) */
        right: auto;
    }

    /* Nooled alati vasakule */
    .aktiv-timeline .timeline-item.left .timeline-content::before,
    .aktiv-timeline .timeline-item.right .timeline-content::before {
        left: -10px;
        right: auto;
        border-width: 10px 10px 10px 0;
        border-color: transparent #fff transparent transparent;
    }
}

