/* Reset et styles de base */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #f4f4f9;
    color: #333;
    line-height: 1.6;
}

header {
    background: linear-gradient(135deg, #2c3e50, #4ca1af);
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    margin-bottom: 1rem;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Container de la timeline */
.timeline {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 0;
    display: flow-root;
    /* Clearfix pour les éléments flottants */
}

/* La ligne verticale centrale (Fond par défaut) */
.timeline::after {
    content: '';
    position: absolute;
    width: 6px;
    background-color: #4ca1af;
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -3px;
    border-radius: 3px;
    z-index: 0;
}

/* Les conteneurs d'événements (gauche et droite) */
.container {
    padding: 5px 40px;
    position: relative;
    width: 50%;
}

.left {
    float: left;
    clear: left;
}

.right {
    float: right;
    clear: right;
    left: 0;
    margin-top: 30px;
    /* Décalage systématique pour éviter l'alignement horizontal */
}

/* Création du décalage initial pour l'effet zigzag */
.container:nth-child(2) {
    margin-top: 50px;
}

/* Segments colorés de la timeline */
.timeline-segment {
    position: absolute;
    width: 6px;
    top: 0;
    bottom: 0;
    z-index: 1;
    /* Au-dessus de la ligne par défaut */
}

/* Positionnement du segment pour conteneur gauche */
.left .timeline-segment {
    right: -3px;
}

/* Positionnement du segment pour conteneur droite */
.right .timeline-segment {
    left: -3px;
}

/* Couleurs des périodes */
.timeline-segment.hiver {
    background-color: #bdc3c7;
    /* Gris froid pour l'hiver */
}

.timeline-segment.essor {
    background-color: #e67e22;
    /* Orange pour l'essor */
}

/* Modification des points pour correspondre aux périodes (Optionnel, mais plus joli) */
.container.hiver::after {
    border-color: #bdc3c7;
}

.container.essor::after {
    border-color: #e67e22;
}

/* Cercle sur la timeline */
.container::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    right: -14px;
    background-color: white;
    border: 4px solid #ff9f43;
    /* Couleur par défaut (jaune/orange) */
    top: 20px;
    border-radius: 50%;
    z-index: 2;
    /* Au-dessus des segments */
}

/* Positionnement Gauche */
.left {
    left: 0;
}

/* Positionnement Droite */
.right {
    left: 0;
}

.left::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 22px;
    width: 0;
    z-index: 1;
    right: 30px;
    border: medium solid white;
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent white;
}

.right::before {
    content: " ";
    height: 0;
    position: absolute;
    top: 22px;
    width: 0;
    z-index: 1;
    left: 30px;
    border: medium solid white;
    border-width: 10px 10px 10px 0;
    border-color: transparent white transparent transparent;
}

.right::after {
    left: -14px;
}

/* Le contenu de la carte */
.content {
    padding: 12px 20px;
    background-color: white;
    position: relative;
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

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

.content h2 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 0.3rem;
}

.content .year {
    display: inline-block;
    background-color: #4ca1af;
    color: white;
    padding: 3px 12px;
    border-radius: 20px;
    font-weight: bold;
    margin-bottom: 10px;
}

/* Adapter la couleur de l'année aussi ? Optionnel */
.container.hiver .content .year {
    background-color: #bdc3c7;
}

.container.essor .content .year {
    background-color: #e67e22;
}

.content p {
    font-size: 0.95rem;
    color: #555;
}

/* Styles pour les liens */
.content a {
    display: inline-block;
    margin-top: 5px;
    padding: 8px 12px;
    background-color: #3498db;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.content a:hover {
    background-color: #2980b9;
    text-decoration: none;
}


.content img {
    max-width: 80%;
}

/* Media queries pour le responsive (Mobile) */
@media screen and (max-width: 768px) {
    .timeline::after {
        left: 31px;
    }

    .container {
        width: 100%;
        padding-left: 70px;
        padding-right: 25px;
        float: none;
        clear: none;
    }

    .container:nth-child(2) {
        margin-top: 0;
    }

    /* Ajustement des segments en mobile */
    .left .timeline-segment,
    .right .timeline-segment {
        left: 28px;
        /* Ajuster pour s'aligner avec la ligne centrale mobile */
        right: auto;
    }

    .container::before {
        left: 60px;
        border: medium solid white;
        border-width: 10px 10px 10px 0;
        border-color: transparent white transparent transparent;
    }

    .left::after,
    .right::after {
        left: 21px;
    }

    .right {
        left: 0%;
    }
}

footer {
    text-align: center;
    padding: 2rem;
    color: #777;
    margin-top: 2rem;
    font-size: 0.9rem;
}