@charset "UTF-8";

/* =====================================================
   LÍNEA DEL TIEMPO · "Nuestra historia, evento a evento"
   (eventos.php → php/linea_tiempo.php)
   ===================================================== */
.lt-seccion {
    --lt-eje: 50%;
    /* posición vertical del eje */
    --lt-paso: 145px;
    /* separación entre eventos */
    --lt-tarjeta: 250px;
    /* ancho de cada tarjeta (la foto mide la mitad de alto) */
    --lt-texto: 155px;
    /* alto MÁXIMO del texto bajo la foto */
    --lt-conector: 28px;
    --lt-alto-tarjeta: calc(var(--lt-tarjeta) / 2 + var(--lt-texto));
    /* alto máximo de la tarjeta */
    --lt-alto: calc(2 * (var(--lt-alto-tarjeta) + var(--lt-conector)) + 30px);
    /* alto total de la pista */
    background-color: var(--light);
    /*border-top: 1px solid rgba(186, 103, 70, .15);*/
}

.lt-titulo {
    font-family: "bookerly-bold" !important;
}

/* --- Controles --- */
.lt-controles {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-bottom: 1rem;
}

.lt-flecha {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 2px solid var(--info);
    background: #fff;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background-color .2s, color .2s;
}

.lt-flecha:hover,
.lt-flecha:focus-visible {
    background: var(--info-1);
     border: 2px solid var(--info-1);
    color: #fff;
}

.lt-flecha:disabled {
    opacity: .35;
    pointer-events: none;
}

.lt-anios {
    flex: 1 1 auto;
    display: flex;
    gap: .4rem;
    overflow-x: auto;
    scrollbar-width: none;
    padding: .25rem;
    justify-content: safe center;
}

.lt-anios::-webkit-scrollbar {
    display: none;
}

.lt-anio-btn {
    flex: 0 0 auto;
    border: 1px solid var(--info);
    background: #fff;
    color: var(--secondary);
    border-radius: 50rem;
    padding: .3rem .9rem;
    font-size: .9rem;
    font-weight: 600;
    transition: all .2s;
}

.lt-anio-btn:hover {
    border-color: var(--info);
    color: var(--info);
}

.lt-anio-btn.activo {
    background: var(--info-1);
    border-color: var(--info-1);
    color: #fff;
}

/* --- Área desplazable --- */
.lt-viewport {
    overflow-x: auto;
    overflow-y: hidden;
    cursor: grab;
    scrollbar-width: none;
    /* oculta la barra (Firefox) */
    -ms-overflow-style: none;
    /* oculta la barra (Edge antiguo) */
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 40px, #000 calc(100% - 40px), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 40px, #000 calc(100% - 40px), transparent 100%);
}

.lt-viewport::-webkit-scrollbar {
    display: none;
    /* oculta la barra (Chrome, Safari, Edge) */
}

.lt-viewport:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 4px;
}

.lt-viewport.arrastrando {
    cursor: grabbing;
    user-select: none;
}

.lt-viewport.arrastrando .lt-tarjeta {
    pointer-events: none;
}

.lt-pista {
    position: relative;
    display: flex;
    flex-wrap: nowrap;
    width: max-content;
    min-width: 100%;
    height: var(--lt-alto);
    margin: 0;
    padding: 0 calc(var(--lt-tarjeta) - var(--lt-paso) + 50px) 0 50px;
    list-style: none;
}

/* eje horizontal */
.lt-pista::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: var(--lt-eje);
    height: 3px;
    margin-top: -1.5px;
    background: #c98669;
    /* tono de --primary al 70 % sobre el fondo */
}

/* --- Marca de año --- */
.lt-marca-anio {
    position: relative;
    flex: 0 0 120px;
    width: 120px;
    min-width: 120px;
}

/* tramo del eje dibujado por cada elemento (garantiza la línea continua) */
.lt-marca-anio::before,
.lt-item::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: var(--lt-eje);
    height: 3px;
    margin-top: -1.5px;
    background: #c98669;
    /* tono de --primary al 70 % sobre el fondo */
    z-index: 0;
}

.lt-anio {
    position: absolute;
    top: var(--lt-eje);
    left: 50%;
    transform: translate(-50%, -50%);
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: var(--primary-0);
    color: #fff;
    border: 4px solid var(--light);
    box-shadow: 0 0 0 2px var(--primary-0);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "bookerly-bold";
    font-size: 1.35rem;
    z-index: 2;
}

/* --- Evento --- */
.lt-item {
    position: relative;
    flex: 0 0 var(--lt-paso);
    width: var(--lt-paso);
    min-width: var(--lt-paso);
}

.lt-punto {
    position: absolute;
    top: var(--lt-eje);
    left: 22px;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid var(--primary);
    z-index: 2;
    transition: background-color .2s, transform .2s;
}

/* conector vertical entre punto y tarjeta */
.lt-item::after {
    content: "";
    position: absolute;
    left: 29px;
    width: 2px;
    height: var(--lt-conector);
    background: var(--primary-1);
}

.lt-arriba::after {
    bottom: var(--lt-eje);
}

.lt-abajo::after {
    top: var(--lt-eje);
}

.lt-tarjeta {
    position: absolute;
    left: 0;
    width: var(--lt-tarjeta);
    height: auto;
    /* la tarjeta se ajusta a su contenido */
    max-height: var(--lt-alto-tarjeta);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: .5rem;
    border-top: 3px solid var(--primary);
    box-shadow: 0 .25rem 1rem rgba(0, 0, 0, .10);
    overflow: hidden;
    transition: transform .2s, box-shadow .2s;
    z-index: 1;
}

.lt-arriba .lt-tarjeta {
    bottom: calc(100% - var(--lt-eje) + var(--lt-conector));
}

.lt-abajo .lt-tarjeta {
    top: calc(var(--lt-eje) + var(--lt-conector));
}

.lt-item:hover .lt-tarjeta {
    transform: translateY(-3px);
    box-shadow: 0 .5rem 1.5rem rgba(0, 0, 0, .16);
    z-index: 3;
}

.lt-item:hover .lt-punto {
    background: var(--primary);
    transform: scale(1.2);
}

.lt-img {
    flex: 0 0 auto;
    width: 100%;
    height: calc(var(--lt-tarjeta) / 2);
    /* alto de la foto = mitad del ancho */
    background: var(--secondary-2) url("../img/separador.svg") no-repeat center / 55%;
    overflow: hidden;
}

.lt-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 42%;
    /* en portadas verticales deja visible el título */
    display: block;
}

.lt-cuerpo {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    padding: .75rem 1rem .8rem;
    min-height: 0;
}

.lt-tipo {
    color: var(--primary-1);
    font-weight: 700;
    font-size: .72rem;
    letter-spacing: 1px;
    margin-bottom: .14rem;
}

.lt-nombre {
    flex: 0 0 auto;
    /* el título no se comprime */
    font-family: "bookerly-bold" !important;
    color: var(--primary-0);
    font-size: .98rem !important;
    line-height: 1.3;
    margin-bottom: .3rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.lt-fecha {
    flex: 0 0 auto;
    margin: 0;
    /* la fecha va justo debajo del título */
    font-size: .8rem;
    color: var(--secondary);
    margin-top: .25rem;
}

/* --- Barra de desplazamiento personalizada --- */
.lt-barra {
    position: relative;
    height: 18px;
    margin: 12px 40px 0;
    cursor: pointer;
    touch-action: none;
}

/* línea muy delgada a lo largo */
.lt-barra::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
    background: var(--secondary-2);
}

/* recuadro terracota que indica la posición */
.lt-barra-pulgar {
    position: absolute;
    top: 50%;
    left: 0;
    width: 80px;
    min-width: 40px;
    height: 8px;
    margin-top: -4px;
    border-radius: 4px;
    background: var(--info);
    cursor: grab;
    touch-action: none;
    transition: background-color .2s, height .15s, margin-top .15s;
}

.lt-barra:hover .lt-barra-pulgar,
.lt-barra-pulgar.arrastrando {
    background: var(--info-1) !important;
    height: 10px;
    margin-top: -5px;
}

.lt-barra-pulgar.arrastrando {
    cursor: grabbing;
}

.lt-barra.oculta {
    visibility: hidden;
}

/* --- Móvil: todas las tarjetas debajo del eje --- */
@media (max-width: 767px) {
    .lt-seccion {
        --lt-eje: 50px;
        --lt-paso: 262px;
        --lt-tarjeta: 245px;
        --lt-conector: 24px;
        --lt-alto: calc(var(--lt-eje) + var(--lt-conector) + var(--lt-alto-tarjeta) + 12px);
    }

    .lt-pista {
        padding: 0 30px;
    }

    .lt-barra {
        margin: 10px 20px 0;
    }

    .lt-marca-anio {
        flex-basis: 100px;
        width: 100px;
        min-width: 100px;
    }

    .lt-anio {
        width: 70px;
        height: 70px;
        font-size: 1.15rem;
    }

    .lt-arriba::after {
        bottom: auto;
        top: var(--lt-eje);
    }

    .lt-arriba .lt-tarjeta {
        bottom: auto;
        top: calc(var(--lt-eje) + var(--lt-conector));
    }
}

@media (prefers-reduced-motion: reduce) {

    .lt-tarjeta,
    .lt-punto {
        transition: none;
    }
}