/* ========================================
   IALCSH Historia - Public Styles
   Replica exacta de ialcsh.org/historia/
   ======================================== */

/* Variables + fuente del sitio original */
.ialcsh-timeline-container {
    --primary-green: #7AB800;
    --bootstrap-dark: #212529;
    --bootstrap-light: #f8f9fa;

    padding: 40px 0;
    position: relative;
    overflow: hidden;
    font-family: 'Montserrat', sans-serif;
    box-sizing: border-box;
}

/* Forzar que respete el ancho del padre (Gutenberg group) */
.ialcsh-timeline-wrap {
    width: 100%;
    max-width: 100%;
}

/* Línea central */
.ialcsh-timeline-line {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 2px;
    height: 100%;
    background-color: var(--primary-green);
    z-index: 1;
}

/* Fila de evento */
.ialcsh-timeline-row {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    margin-bottom: 3rem;
    margin-left: -15px;
    margin-right: -15px;
}

.ialcsh-timeline-row.left {
    flex-direction: row;
}

.ialcsh-timeline-row.right {
    flex-direction: row-reverse;
}

/* Columnas - replicar col-md-5 / col-md-2 / col-md-5 */
.ialcsh-timeline-content-col,
.ialcsh-timeline-image-col {
    flex: 0 0 41.666%;
    max-width: 41.666%;
    padding: 0 15px;
    min-width: 0;
}

.ialcsh-timeline-node-col {
    flex: 0 0 16.666%;
    max-width: 16.666%;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    min-width: 0;
}

/* Nodo del año */
.ialcsh-timeline-year {
    width: 60px;
    height: 60px;
    background-color: var(--primary-green);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 0 0 8px white, 0 4px 10px rgba(0, 0, 0, 0.1);
    z-index: 3;
}

/* Punto pequeño */
.ialcsh-timeline-dot {
    width: 15px;
    height: 15px;
    background-color: var(--primary-green);
    border-radius: 50%;
    margin: 10px auto;
    box-shadow: 0 0 0 5px white, 0 2px 5px rgba(0, 0, 0, 0.1);
}

/* Caja de contenido - shadow-sm de Bootstrap */
.ialcsh-timeline-box {
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 .125rem .25rem rgba(0, 0, 0, .075);
    transition: transform 0.3s ease;
}

.ialcsh-timeline-box:hover {
    transform: translateY(-5px);
}

.ialcsh-timeline-box.dark {
    background-color: var(--bootstrap-dark) !important;
    color: #fff !important;
}

.ialcsh-timeline-box.light {
    background-color: var(--bootstrap-light) !important;
    color: var(--bootstrap-dark) !important;
}

.ialcsh-timeline-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 0.5rem;
    line-height: 1.2;
}

.ialcsh-timeline-desc {
    font-size: 0.95rem;
    line-height: 1.6;
}

.ialcsh-timeline-desc p {
    margin-bottom: 0;
}

/* Galería de imágenes */
.ialcsh-timeline-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.ialcsh-timeline-gallery.single {
    grid-template-columns: 1fr;
}

.ialcsh-timeline-gallery.single .ialcsh-timeline-img-link img {
    max-height: 450px;
}

.ialcsh-timeline-img-link {
    display: block;
    border-radius: 8px;
    overflow: hidden;
}

.ialcsh-timeline-img-link img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Mensaje vacío */
.ialcsh-timeline-empty {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-style: italic;
}

/* ========================================
   RESPONSIVE
   ======================================== */

/* Mobile */
@media (max-width: 767px) {
    .ialcsh-timeline-line {
        left: 30px;
        transform: none;
    }

    .ialcsh-timeline-row,
    .ialcsh-timeline-row.left,
    .ialcsh-timeline-row.right {
        flex-direction: column !important;
        align-items: flex-start !important;
        padding-left: 60px;
        margin-bottom: 30px !important;
    }

    .ialcsh-timeline-node-col {
        position: absolute;
        left: 0;
        top: 0;
        width: 60px !important;
        max-width: 60px !important;
        justify-content: flex-start !important;
    }

    .ialcsh-timeline-dot {
        margin-left: 22px;
        margin-top: 12px;
    }

    .ialcsh-timeline-year {
        width: 40px;
        height: 40px;
        font-size: 0.8rem;
        box-shadow: 0 0 0 5px white, 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    .ialcsh-timeline-content-col,
    .ialcsh-timeline-image-col {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        padding: 0;
        margin-bottom: 15px;
    }

    .ialcsh-timeline-gallery {
        grid-template-columns: 1fr;
    }

    .ialcsh-timeline-container {
        padding: 20px 15px;
    }
}

/* Small phones */
@media (max-width: 430px) {
    .ialcsh-timeline-year {
        width: 35px;
        height: 35px;
        font-size: 0.7rem;
    }

    .ialcsh-timeline-row,
    .ialcsh-timeline-row.left,
    .ialcsh-timeline-row.right {
        padding-left: 45px;
    }

    .ialcsh-timeline-line {
        left: 18px;
    }
}