﻿/* The actual timeline (the vertical ruler) */
.timeline {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    color: hsla(0,0%,100%,.8);
}

    /* The actual timeline (the vertical ruler) */
    .timeline::after {
        content: '';
        position: absolute;
        width: 6px;
        background-color: #363636;
        top: 0;
        bottom: 0;
        left: 50%;
        margin-left: -3px;
        z-index: -1;
    }

/* Container around content */
.timelinecontainer {
    padding: 10px 40px;
    position: relative;
    width: 50%;
    box-sizing: border-box;
}

    /* The circles on the timeline */
    .timelinecontainer::after {
        content: '';
        position: absolute;
        width: 50px;
        height: 50px;
        right: -25px;
        background-color: #363636;
        top: 15px;
        border-radius: 50%;
        border: 4px solid #ccc;
    }

.experienceIcon-left::after {
    background-image: url('../images/employee.png');
    background-size: cover;
    z-index: 1;
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    right: -55px;
    top: 13px;
}

.experienceIcon-right::after {
    background-image: url('../images/employee.png');
    background-size: cover;
    z-index: 1;
    content: '';
    position: absolute;
    width: 30px;
    height: 30px;
    left: -55px;
    top: 13px;
}

.educationIcon-left::after {
    background-image: url('../images/graduation-cap.png');
    background-size: cover;
    z-index: 1;
    content: '';
    position: absolute;
    width: 35px;
    height: 35px;
    right: -57px;
    top: 11px;
}

.educationIcon-right::after {
    background-image: url('../images/graduation-cap.png');
    background-size: cover;
    z-index: 1;
    content: '';
    position: absolute;
    width: 35px;
    height: 35px;
    left: -57px;
    top: 11px;
}

/* Place the container to the left */
.timelineleft {
    left: 0;
}

/* Place the container to the right */
.timelineright {
    left: 50%;
}

/* Add arrows to the left container (pointing right) */
.timelineleft::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 22px;
    width: 0;
    right: 31px;
    border: medium solid white;
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent #2b2b2b;
}

/* Add arrows to the right container (pointing left) */
.timelineright::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 22px;
    width: 0;
    left: 31px;
    border: medium solid white;
    border-width: 10px 10px 10px 0;
    border-color: transparent #2b2b2b transparent transparent;
}

/* Fix the circle for containers on the right side */
.timelineright::after {
    left: -25px;
}

/* The actual content */
.timelinecontent {
    padding: 20px 30px;
    background-color: #2b2b2b;
    position: relative;
    border-radius: 6px;
    box-shadow: 0 0 10px grey;
}

/* Media queries - Responsive timeline on screens less than 600px wide */
@media screen and (max-width: 768px) {
    /* Place the timelime to the left */
    .timeline::after {
        left: 30px;
    }

    /* Full-width containers */
    .timelinecontainer {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
    }

        /* Make sure that all arrows are pointing leftwards */
        .timelinecontainer::before {
            left: 60px;
            border: medium solid white;
            border-width: 10px 10px 10px 0;
            border-color: transparent #2b2b2b transparent transparent;
        }

    /* Make sure all circles are at the same spot */
    .timelineleft::after, .timelineright::after {
        left: 6px;
    }

    /* Make all right containers behave like the left ones */
    .timelineright {
        left: 0%;
    }

    .experienceIcon-left::after {
        left: -55px;
    }

    .educationIcon-left::after {
        left: -57px;
    }
}

.timeline-animation {
    animation: move linear forwards;
    animation-timeline: view();
    animation-range-start: cover;
    animation-range-end: 400px;
    position: relative;
    opacity: 0;
    scale: 0;
}

@keyframes move {
    to {
        scale: 1;
        opacity: 1;
    }
}
