/* ============================================================
   SECCIÓN PRINCIPAL
============================================================ */

section#trabajando {
    padding: 2rem 1rem;
    background-color: #fff;
    margin: 1rem auto;
    max-width: 1100px;
    border-radius: 14px;
    box-shadow: 0 6px 16px rgba(0,0,0,0.08);
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Tarjeta principal */

.card-trabajo {
    background: #fff;
    border-left: 6px solid #001f3f;
    padding: 2.5rem 2rem;
    border-radius: 14px;
    max-width: 520px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 28px rgba(0,0,0,0.15);
    transition: transform .25s ease, box-shadow .25s ease;
}

.card-trabajo:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(0,0,0,0.18);
}

.card-trabajo .icono {
    font-size: 10.2rem;
    margin-bottom: 1rem;
}

.card-trabajo h1 {
    color: #001f3f;
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 1.2rem;
    letter-spacing: .4px;
}

.card-trabajo p {
    font-size: .95rem;
    font-weight: 600;
    color: #333;
    line-height: 1.7;
    margin-bottom: 1rem;
    text-align: justify;
}

.card-trabajo .mensaje-secundario {
    color: #555;
}


/* ============================================================
   BOTÓN


.btn-volver {
    display: inline-block;
    margin-top: 1.6rem;
    background-color: #001f3f;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    padding: .7rem 1.8rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    transition: background-color .25s ease,
                transform .25s ease,
                box-shadow .25s ease;
}

.btn-volver:hover {
    background-color: #003a7a;
    transform: translateY(-3px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.35);
}
============================================================ */


/* ============================================================
   VIDEO DESTACADO
============================================================ */

.contenedor-video {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    border-radius: 16px;
}

.contenedor-video video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-video {
    max-width: 960px;
    margin: 1.5rem 0 2rem;
}

.card-video .contenedor-video {
    margin: 1.5rem 0 2rem;
}


/* ============================================================
   TIMELINE
============================================================ */

.historia-institucional {
    padding: 60px 20px;
    background: #fdfdfd;
    overflow: hidden;
    position: relative;
}

.timeline-titulo {
    text-align: center;
    color: #001f3f;
    font-size: 2.2rem;
    margin: 35px 0 18px;
}

/* Carril */

.timeline-contenedor {
    position: relative;
    cursor: grab;
    padding: 10px 0 20px;
}

.timeline-contenedor:active {
    cursor: grabbing;
}

/* Línea azul */

.timeline-linea {
    position: absolute;
    top: 87px;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent,
        #001f3f 15%,
        #001f3f 85%,
        transparent
    );
    z-index: 1;
}

/* Scroll */

.timeline-scroll {
    display: flex;
    gap: 40px;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    padding: 20px;
    min-height: 500px;
    scrollbar-width: none;
}

.timeline-scroll::-webkit-scrollbar {
    display: none;
}

/* Item */

.timeline-item {
    flex-shrink: 0;
    width: 400px;
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 2;
    scroll-snap-align: start;
}

/* Fecha */

.item-fecha {
    font-size: 1.5rem;
    font-weight: 800;
    color: #001f3f;
    margin-bottom: 10px;
    text-align: center;
    z-index: 2;
}

/* Punto */

.item-punto {
    width: 18px;
    height: 18px;
    background: #001f3f;
    border: 4px solid #fff;
    border-radius: 50%;
    margin-bottom: 30px;
    box-shadow: 0 0 0 2px #001f3f;
    z-index: 2;
}

/* Tarjeta */

.item-tarjeta {
    background: #fff;
    border-radius: 8px;
    border-left: 5px solid #001f3f;
    box-shadow: 0 10px 25px rgba(0,0,0,0.08);
    overflow: hidden;
    transition: transform .3s ease;
    display: flex;
    flex-direction: column;
    height: 380px; /* Se mantiene igual para conservar diseño */
    padding-top: 20px;
}

.item-tarjeta {
    position: relative;
}

.item-tarjeta:hover {
    transform: translateY(-10px);
}

/* Imagen */

.item-img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    filter: grayscale(100%) sepia(20%) brightness(0.9);
    transition: all .5s ease;
}

.item-tarjeta:hover .item-img {
    filter: grayscale(0%) sepia(0%) brightness(1);
    transform: scale(1.05);
}

/* Texto */

.item-info {
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.item-info h3 {
    margin: 0 0 10px;
    color: #333;
}

.item-info p {
    font-size: .95rem;
    color: #666;
    line-height: 1.5;
    flex-grow: 1;
}


/* Botones */

.timeline-nav {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

.nav-btn {
    background: #001f3f;
    color: #fff;
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    transition: .3s;
}

.nav-btn:hover {
    background: #003366;
    transform: scale(1.1);
}



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

@media (max-width: 768px) {

    .timeline-scroll {
        gap: 30px;
        padding: 20px;
        min-height: 400px;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
    }

    .timeline-item {
        width: 300px;
    }

    .item-fecha {
        font-size: 1.2rem;
    }

    .item-tarjeta {
        height: 330px;
    }

    .item-img {
        height: 180px;
    }

    .timeline-nav {
        display: none;
    }

    section#trabajando {
        padding: 1.5rem 1rem;
    }

    .card-trabajo {
        padding: 2rem 1.4rem;
    }

    .card-trabajo h1 {
        font-size: 1.8rem;
    }

    .card-trabajo .icono {
        font-size: 2.8rem;
    }

    .historia-institucional {
        padding: 40px 15px;
    }
}

@media (max-width: 768px) {

    .timeline-linea {
        top: 80px; /* Ajuste fino para móvil */
    }

}

/* ============================================================
   8. SEPARADOR INSTITUCIONAL
============================================================ */

.separador-institucional {
    width: 100%;
    height: 1px;
    margin: 3rem 0;
    background-color: #e5e7eb;
}

.timeline-link {
    margin-top: 12px;
    padding: 8px 14px;
    font-size: 0.85rem;
    font-weight: 600;

    background: #001f3f;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;

    opacity: 0;
    transform: translateY(8px);
    transition: all .3s ease;
    max-height: 0;
    overflow: hidden;
}
.timeline-item.has-link:hover .item-tarjeta {
    height: 440px; /* solo crecen las que tienen link */
    transform: translateY(-6px);
    box-shadow: 0 14px 35px rgba(0, 31, 63, 0.12);
}

.timeline-item.has-link:hover .timeline-link {
    opacity: 1;
    max-height: 40px;
}

.timeline-item.has-link .item-tarjeta {
    border-left: 5px solid #001f3f;
    transition: border-color .3s ease, box-shadow .3s ease, height .3s ease, transform .3s ease;
}

.timeline-item.has-link:hover .item-tarjeta {
    border-left-color: #003366;
}

.timeline-item.has-link .item-punto {
    transition: transform .3s ease, box-shadow .3s ease;
}

.timeline-item:hover .item-punto {
    transform: scale(1.15);
    box-shadow: 0 0 0 4px rgba(0, 31, 63, 0.15);
}
@media (max-width: 768px) {

    /* Solo tarjetas que tienen link */
    .timeline-item.has-link .item-tarjeta {
        height: auto; /* crece naturalmente */
    }

    /* Mostrar botón siempre en móvil */
    .timeline-item.has-link .timeline-link {
        opacity: 1;
        max-height: 50px;
    }
}

