/* ==========================================================================
   Timeline — Trajetória Latitud (Sobre)
   ========================================================================== */

.timeline {
    background-color: #181D27;
    padding: 96px 0 64px;
    /* Cultura agora termina reta (sem clip-path) — timeline começa logo abaixo sem overlap */
}

.timeline__inner {
    position: relative;
}

/* ===== Content (texto + imagem) ===== */

.timeline__content {
    display: flex;
    align-items: flex-start;
    gap: 64px;
    margin-bottom: 64px;
}

/* Texto */

.timeline__text {
    flex: 1;
    min-width: 0;
    max-width: 635px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.timeline__text--exiting {
    opacity: 0;
    transform: translateY(10px);
}

.timeline__text--entering {
    opacity: 0;
    transform: translateY(20px);
}

/* Label do ano (estilo cultura) */
.timeline__label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-text);
    font-weight: 400;
    font-size: 18px;
    line-height: 170%;
    letter-spacing: -0.01em;
    color: #FAFAFA;
}

.timeline__line {
    display: inline-block;
    width: 71px;
    height: 0;
    border-top: 1px solid var(--color-primary);
    flex-shrink: 0;
}

.timeline__title {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 32px;
    line-height: 38px;
    color: #FFFFFF;
}

.timeline__description {
    font-family: var(--font-text);
    font-weight: 400;
    font-size: 20px;
    line-height: 170%;
    letter-spacing: -0.01em;
    color: #FFFFFF;
}

/* Imagem */

.timeline__images {
    flex-shrink: 0;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.timeline__images--exiting {
    opacity: 0;
    transform: translateX(10px);
}

.timeline__images--entering {
    opacity: 0;
    transform: translateX(20px);
}

.timeline__img {
    display: block;
    max-width: 420px;
    width: 100%;
    height: auto;
    border-radius: 8px;
    object-fit: contain;
}

/* ===== Nav — Blocos ===== */

.timeline__nav {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 12px;
}

.timeline__blocks {
    display: flex;
    gap: 6px;
    flex: 1;
    min-width: 0;
}

/* Container dos botões prev/next — oculto por padrão (só aparece no mobile) */
.timeline__nav-controls {
    display: none;
    gap: 32px;
    align-items: center;
    justify-content: center;
}

/* Botões prev/next — pill com cores dinâmicas baseadas no estado */
.timeline__nav-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
    border-radius: 96px;          /* Pill total */
    backdrop-filter: blur(2.937px);
    -webkit-backdrop-filter: blur(2.937px);
    cursor: pointer;
    flex-shrink: 0;
    /* Estado padrão: pode navegar pra essa direção (azul escuro) */
    background: #1F3A5F;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #FFFFFF;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast), transform 0.15s ease-out;
}

/* Feedback de clique — scale 0.9 no :active, volta suavemente pra 1 */
.timeline__nav-btn:active {
    transform: scale(0.9);
}


.timeline__block {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    position: relative;
}

.timeline__block-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.timeline__block-year {
    width: 100%;
    font-family: var(--font-text);
    font-weight: 400;
    font-size: 18px;
    line-height: 170%;
    letter-spacing: -0.01em;
    text-align: center;
    color: #FFFFFF;
    transition: color 0.3s ease, font-weight 0.3s ease;
}

.timeline__block--active .timeline__block-year {
    color: var(--color-primary);
    font-weight: 500;
}

.timeline__block-label {
    width: 100%;
    font-family: var(--font-text);
    font-weight: 400;
    font-size: 14px;
    line-height: 17px;
    letter-spacing: -0.01em;
    text-align: center;
    color: #FFFFFF;
    transition: color 0.3s ease;
}

.timeline__block--active .timeline__block-label {
    color: var(--color-primary);
}

/* Track e barra de progresso */
.timeline__block-track {
    position: relative;
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 29px;
    overflow: hidden;
}

.timeline__block-bar {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: var(--color-primary);
    border-radius: 29px;
}

/* Past items (não-ativo, mas já passou): barra branca cheia */
.timeline__block--filled:not(.timeline__block--active) .timeline__block-bar {
    width: 100%;
    background: rgba(255, 255, 255, 0.7);
}

/* Active item: laranja, animando do 0 ao 100% em 8s */
.timeline__block--active .timeline__block-bar {
    background: var(--color-primary);
    animation: timeline-fill 8s linear forwards;
}

@keyframes timeline-fill {
    from { width: 0%; }
    to   { width: 100%; }
}

/* Acessibilidade: usuários que preferem menos animação ficam com a barra cheia direta */
@media (prefers-reduced-motion: reduce) {
    .timeline__block--active .timeline__block-bar {
        animation: none;
        width: 100%;
    }
}

/* ===== Responsivo ===== */

@media (max-width: 768px) {
    .timeline {
        padding: 56px 0 48px;
        /* Sem margin-top negativo — a seção de cima não tem mais clip-path no mobile. */
        margin-top: 0;
    }

    .timeline__content {
        flex-direction: column;
        gap: 32px;
        margin-bottom: 40px;
    }

    .timeline__text {
        max-width: 100%;
        gap: 8px;
        /* Reserva espaço pra slide mais longo (2018) — evita "bump" ao trocar */
        min-height: 280px;
    }

    .timeline__label {
        font-size: 16px;
    }

    .timeline__title {
        font-size: 26px;
        line-height: 32px;
    }

    .timeline__description {
        font-size: 16px;
    }

    .timeline__images {
        width: 100%;
    }

    .timeline__img {
        max-width: 100%;
        height: 240px;
        object-fit: cover;
    }

    /* Scroll horizontal sem scrollbar visível */
    .timeline__blocks {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 0;
        scrollbar-width: none;
        -ms-overflow-style: none;
        scroll-behavior: smooth;
        cursor: grab;
    }

    .timeline__blocks.is-dragging {
        cursor: grabbing;
        scroll-behavior: auto;
    }

    .timeline__blocks::-webkit-scrollbar {
        display: none;
    }

    /* Nav vira coluna no mobile: blocos em cima, controles centralizados embaixo */
    .timeline__nav {
        flex-direction: column;
        gap: 24px;
    }

    /* Container dos botões prev/next aparece no mobile, centralizado */
    .timeline__nav-controls {
        display: flex;
        padding-top: 16px;
    }

    /* Largura fixa + fontes menores + altura padronizada pra 2 linhas de label,
       evitando o deslocamento quando "Estruturação da empresa" quebra em 2 linhas. */
    .timeline__block {
        flex-shrink: 0;
        min-width: 120px;
        gap: 8px;
    }

    .timeline__block-text {
        /* Altura fixa pra year (1 linha) + label (até 2 linhas) centralizados. */
        min-height: 56px;
        justify-content: center;
        align-items: center;
    }

    .timeline__block-year {
        font-size: 16px;
        line-height: 1.3;
    }

    .timeline__block-label {
        font-size: 12px;
        line-height: 1.3;
        /* Reserva espaço pra 2 linhas mesmo quando o label tem 1 linha —
           garante alinhamento vertical consistente entre todos os blocos. */
        min-height: calc(12px * 1.3 * 2);
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .timeline {
        padding: 48px 0 32px;
    }

    .timeline__title {
        font-size: 22px;
        line-height: 28px;
    }

    .timeline__description {
        font-size: 15px;
    }

    .timeline__content {
        gap: 24px;
        margin-bottom: 32px;
    }

    .timeline__img {
        height: 200px;
    }

    .timeline__block {
        min-width: 104px;
    }

    .timeline__block-year {
        font-size: 15px;
    }

    .timeline__block-track {
        height: 6px;
    }

    .timeline__nav-controls {
        gap: 24px;
    }
}
