:root {
    --primary: #658574;
    --secondary: #fff;
}

.timetable {
    position: relative;
}
.timetable::before {
    content: '';
    background: var(--primary);
    width: 5px;
    height: 95%;
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    opacity: .5;
}
.timetable-item {
    width: 100%;
    margin-bottom: 70px;
    display: none;
}

.timetable-item.visible {
    display: block;
}

.timetable-item:nth-child(even) .timetable-content {
    float: right;
    padding: 30px;
}
.timetable-item:nth-child(even) .timetable-content .date {
    right: auto;
    left: 0;
}
.timetable-item:nth-child(even) .timetable-content::after {
    content: '';
    position: absolute;
    border-style: solid;
    width: 0;
    height: 0;
    top: 30px;
    left: -15px;
    border-width: 10px 15px 10px 0;
    border-color: transparent var(--primary) transparent transparent;
}
.timetable-item::after {
    content: '';
    display: block;
    clear: both;
}

.timetable-content::after {
    content: '';
    position: absolute;
    border-style: solid;
    width: 0;
    height: 0;
    top: 30px;
    right: -15px;
    border-width: 10px 0 10px 15px;
    border-color: transparent transparent transparent var(--primary);
}
.timetable-img {
    width: 30px;
    height: 30px;
    background: var(--primary);
    border-radius: 50%;
    position: absolute;
    left: 50%;
    margin-top: 25px;
    margin-left: -15px;
}

.timetable-content {
    position: relative;
    width: 45%;
    padding: 30px;
    border-radius: 4px;
    background: var(--secondary);
    box-shadow: 0 20px 25px -15px rgba(0, 0, 0, .3);
    display: grid;
    /*justify-content: space-between;*/
    align-items: flex-start;
    border: 1px solid var(--primary);
}

/* Cas où il y a une image */
.timetable-content.with-img {
    grid-template-columns: 1fr 4fr;
}

/* Cas où il n'y a pas d'image */
.timetable-content.no-img {
    grid-template-columns: 1fr;
}

.timetable-content.no-img .timetable-content-inner {
    grid-column: 1 / -1;
}

.timetable-content-img {
    width: 100px;
    object-fit: cover;
    border-radius: 50px;
}

.timetable-content-inner {
    margin-left: 1.5rem;
}

/*.timetable-content-part-1 {
    width: 20%;
}

.timetable-content-part-2 {
    width: 80%;
}*/

.timeline-card {
    padding: 0 !important;
}
.timeline-card p {
    padding: 0 20px;
}
.timeline-card a {
    margin-left: 20px;
}
.timetable-item .timeline-img-header {
    background: linear-gradient(rgba(0, 0, 0, 0), rgba(0, 0, 0, .4)), url('https://picsum.photos/1000/800/?random') center center no-repeat;
    background-size: cover;
}
.timeline-img-header {
    height: 200px;
    position: relative;
    margin-bottom: 20px;
}

.timetable-event-title {
    color: var(--primary);
    font-size: 20px;
    margin-top: 5px;
    margin-bottom: 5px;
    display: block;
}

.timetable-event-date {
    color: var(--primary);
    font-size: 14px;
}

.timetable-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.timetable-tabs {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.timetable-tab {
    margin: 0 10px;
    padding: 10px 20px;
    background: var(--secondary);
    color: var(--primary);
    border: 1px solid var(--primary);
    border-radius: 5px;
    cursor: pointer;
    transition: background 0.3s;
}

.timetable-tab:hover, 
.timetable-tab.open {
    background: var(--primary);
    color: var(--secondary);
}

.timetable-links {
    display: flex;
    justify-content: space-between;
}

/* Styles par défaut (avant animation) */
.js--fadeInLeft,
.js--fadeInRight {
    opacity: 0;
    transform: translateX(100px);
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.js--fadeInLeft {
    transform: translateX(-100px);
}

/* Quand l'élément devient visible */
.js--fadeInLeft.visible,
.js--fadeInRight.visible {
    opacity: 1;
    transform: translateX(0);
}


@media screen and (max-width: 768px) {
    .timetable::before {
        left: 50px;
   }
    .timetable .timetable-img {
        left: 50px;
   }
    .timetable .timetable-content {
        max-width: 100%;
        width: auto;
        margin-left: 70px;
   }
    .timetable .timetable-item:nth-child(even) .timetable-content {
        float: none;
   }
    .timetable .timetable-item:nth-child(odd) .timetable-content::after {
        content: '';
        position: absolute;
        border-style: solid;
        width: 0;
        height: 0;
        top: 30px;
        left: -15px;
        border-width: 10px 15px 10px 0;
        border-color: transparent #f5f5f5 transparent transparent;
   }
}
