/*==========================================================
                    TIMELINE
    Shared by Education and Professional Experience:
    a vertical rail with an icon marker for each entry.
    Uses the same 1200px container and side padding as
    every other section.
==========================================================*/

.timeline{
    --marker:40px;
    --marker-gap:14px;
    position:relative;
    max-width:var(--container);
    margin:0 auto;
    list-style:none;
    display:flex;
    flex-direction:column;
    gap:var(--card-gap);
}

/* Connecting line */

.timeline::before{
    content:"";
    position:absolute;
    top:calc(22px + var(--marker) / 2);
    bottom:12px;
    left:calc(var(--marker) / 2 - 1px);
    width:2px;
    border-radius:2px;
    background:linear-gradient(
        to bottom,
        var(--rose),
        var(--sage) 55%,
        rgba(151,161,59,.15)
    );
}

.timeline-item{
    position:relative;
    padding-left:calc(var(--marker) + var(--marker-gap));
}


/*==========================
Marker
==========================*/

.timeline-marker{
    position:absolute;
    top:22px;
    left:0;
    z-index:1;
    width:var(--marker);
    height:var(--marker);
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    background:white;
    border:2px solid var(--citron);
    box-shadow:0 0 0 5px var(--cream);
    color:var(--sage-dark);
    transition:
        background-color var(--transition),
        border-color var(--transition),
        color var(--transition),
        transform var(--transition);
}

.timeline-marker svg{
    width:18px;
    height:18px;
}

.timeline-item.current .timeline-marker{
    border-color:#6BCB77;
}

.timeline-item.upcoming .timeline-marker{
    border-color:var(--rose);
    border-style:dashed;
    color:var(--rose-deep);
}

.timeline-item:hover .timeline-marker,
.timeline-item:focus-within .timeline-marker{
    background:var(--blush);
    border-color:var(--rose);
    color:var(--rose-deep);
    transform:scale(1.08);
}


/*==========================
Card
==========================*/

.timeline-card{
    padding:clamp(20px, 3.5vw, 32px);
    transition:var(--card-transition);
}

.timeline-card:focus-visible{
    outline:3px solid var(--rose);
    outline-offset:4px;
}

@media(hover:hover){

    .timeline-card:hover{
        transform:translateY(-4px);
        box-shadow:var(--shadow-hover);
    }

}

.timeline-header{
    display:flex;
    flex-direction:column;
    gap:12px;
}

.timeline-role{
    font-size:clamp(1.3rem, 1.15rem + .7vw, 1.6rem);
    line-height:1.25;
    color:var(--text);
    -webkit-hyphens:auto;
    hyphens:auto;
    overflow-wrap:break-word;
}

.timeline-org{
    margin-top:4px;
    font-family:'Outfit',sans-serif;
    font-size:16px;
    font-weight:500;
    line-height:1.5;
    color:var(--sage-dark);
}

.timeline-meta{
    display:flex;
    flex-wrap:wrap;
    align-items:center;
    gap:8px;
}

.timeline-date{
    display:inline-block;
    padding:6px 14px;
    border-radius:999px;
    background:var(--hover);
    font-family:'Outfit',sans-serif;
    font-size:14px;
    font-weight:500;
    line-height:1.4;
    color:var(--sage-dark);
    white-space:nowrap;
}

.tag.current{
    background:#E7F5E6;
    color:#3A6E32;
}

.tag.upcoming{
    background:#F8E4EC;
    color:var(--rose-deep);
}

.tag.honours{
    background:#FFF6D8;
    color:#8A6400;
}


/*==========================
Details
==========================*/

.timeline-points{
    margin-top:18px;
    padding-left:20px;
}

.timeline-points li{
    margin-bottom:8px;
    line-height:1.8;
    color:var(--light-text);
}

.timeline-points li:last-child{
    margin-bottom:0;
}

.timeline-points li::marker{
    color:var(--rose);
}


/*==========================
Expand / Collapse (phones)
Toggle is added by script.js to cards with more than two points
==========================*/

.timeline-card.collapsible:not(.expanded) .timeline-points li:nth-child(n+3){
    display:none;
}

.timeline-toggle{
    display:inline-flex;
    align-items:center;
    gap:10px;
    min-height:44px;
    margin-top:14px;
    padding:8px 18px;
    border:1px solid rgba(185,94,132,.3);
    border-radius:999px;
    background:white;
    font-family:'Outfit',sans-serif;
    font-size:14px;
    font-weight:600;
    color:var(--rose-deep);
    cursor:pointer;
    transition:
        background-color var(--transition),
        border-color var(--transition);
}

/* Chevron */

.timeline-toggle::after{
    content:"";
    width:7px;
    height:7px;
    margin-top:-4px;
    border-right:2px solid currentColor;
    border-bottom:2px solid currentColor;
    transform:rotate(45deg);
    transition:transform var(--transition), margin var(--transition);
}

.timeline-card.expanded .timeline-toggle::after{
    margin-top:4px;
    transform:rotate(225deg);
}

.timeline-toggle:hover{
    background:var(--blush);
    border-color:var(--rose);
}


/*====================================
Tablet (768px+): everything visible, date beside the title
====================================*/

@media(min-width:768px){

    .timeline{
        --marker:48px;
        --marker-gap:24px;
    }

    .timeline-marker svg{
        width:20px;
        height:20px;
    }

    .timeline-header{
        flex-direction:row;
        justify-content:space-between;
        align-items:flex-start;
        gap:20px;
    }

    .timeline-meta{
        flex-direction:column;
        align-items:flex-end;
        flex-shrink:0;
    }

    .timeline-card.collapsible:not(.expanded) .timeline-points li:nth-child(n+3){
        display:list-item;
    }

    .timeline-toggle{
        display:none;
    }

}


/*====================================
Desktop (1024px+): experience cards span the container,
so role details sit on the left and achievements on the right
(keeps bullet lines at a comfortable reading length)
====================================*/

@media(min-width:1024px){

    .experience .timeline-card{
        display:grid;
        grid-template-columns:minmax(0, 320px) minmax(0, 1fr);
        column-gap:clamp(32px, 4vw, 56px);
        align-items:start;
    }

    .experience .timeline-header{
        flex-direction:column;
        justify-content:flex-start;
        gap:14px;
    }

    .experience .timeline-meta{
        flex-direction:row;
        flex-wrap:wrap;
        align-items:center;
    }

    .experience .timeline-points{
        margin-top:0;
        padding:2px 0 2px 40px;
        border-left:1px solid rgba(151,161,59,.18);
    }

}
