/*
Titulo:       Timeline CSS
Autor:      José Carlos Cantero
Descripcion: Este CSS estila de forma automática un timeline 
             independientemente de los hitos que se añadan.
             Incluye soporte responsive y destaca eventos especiales.
*/

/* Timeline container */
.timeline {
    position: relative;
    width: 100%;
    margin: 40px 0;
    padding: 0;
    font-family: 'Roboto', sans-serif;

}

/* Central vertical line */
.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, #a5d6a7 0%, #81c784 100%);
}

/* Individual item */
.timeline-item {
    position: relative;
    width: 50%;
    padding: 20px 40px;
    box-sizing: border-box;
}

/* Odd items on left */
.timeline-item:nth-child(odd) {
    left: 0;
    text-align: right;
}

/* Even items on right */
.timeline-item:nth-child(even) {
    left: 50%;
    text-align: left;
}

/* Connector circle */
.timeline-item::before {
    content: '';
    position: absolute;
    top: 20px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #377b3c;
    border: 4px solid #fff;
    box-sizing: content-box;
}

/* Position circle for odd/even */
.timeline-item:nth-child(odd)::before {
    right: -12px;
}

.timeline-item:nth-child(even)::before {
    left: -12px;
}

/* Date */
.timeline-date {
    display: block;
    color: #377b3c;
    margin-bottom: 6px;

    font-family: var(--e-global-typography-b5826c3-font-family), Sans-serif;
    font-weight: var(--e-global-typography-b5826c3-font-weight);
}

/* Title */
.timeline-title {
    margin: 0;
    font-size: 1.3em;
    color: #1a5e20;

    font-family: var(--e-global-typography-b5826c3-font-family), Sans-serif;
    font-weight: var(--e-global-typography-b5826c3-font-weight);
}

/* Destacado especial para el Sesquicentenario */
.timeline-item.highlight .timeline-title {
    background: rgba(76, 175, 80, 0.1);
    color: #1a5e20;
    padding: 8px 12px;
    border-radius: 4px;
    border-left: 4px solid #4CAF50;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.timeline-item.highlight .timeline-title::before {
    /* código FA para la hoja */
    content: "\f06c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    position: absolute;
    left: -24px;
    top: 50%;
    transform: translateY(-50%);
    color: #4CAF50;
}

/* Content text */
.timeline-content {
    margin-top: 8px;
    color: #1a5e20;
    line-height: 1.5;

    font-family: var(--e-global-typography-text-font-family), Sans-serif;
    font-weight: var(--e-global-typography-text-font-weight);
}

/* Responsive: stack items on small screens */
@media screen and (max-width: 767px) {

    .timeline-item,
    .timeline-item:nth-child(even),
    .timeline-item:nth-child(odd) {
        left: 0 !important;
        width: 100%;
        text-align: left !important;
        padding-left: 40px;
    }

    .timeline::before {
        left: 20px;
    }

    .timeline-item::before {
        left: 8px !important;
    }
}

/**** Plantilla HTML *****/
/*
<div class="timeline">
    <div class="timeline-item">
        <span class="timeline-date">1 de septiembre 1855</span>
        <h3 class="timeline-title">Lorem ipsum dolor</h3>
        <div class="timeline-content">
            Lorem ipsum dolor sit amet, consectetur adipiscing elit.
        </div>
    </div>

    <div class="timeline-item">
        <span class="timeline-date">1861</span>
        <h3 class="timeline-title">Lorem ipsum dolor</h3>
        <div class="timeline-content">
            Lorem ipsum dolor sit amet, consectetur adipiscing elit.
        </div>
    </div>
<div>