
/* B05: Línea del tiempo de RoboGenius Fest */

.robofest-timeline {
    --robofest-timeline-ink: var(--color-text, #171717);
    --robofest-timeline-paper: var(--color-background, #f7f8f6);
    --robofest-timeline-blue: var(--color-primary, #2563eb);
    --robofest-timeline-orange: #ff7139;
    --robofest-timeline-green: #c7f36b;
    --robofest-timeline-muted: #656565;
    --robofest-timeline-border: 3px solid var(--robofest-timeline-ink);
    --robofest-timeline-shadow: 7px 7px 0 var(--robofest-timeline-ink);
    --robofest-timeline-line-width: 4px;
    --robofest-timeline-line-progress: 0%;

    position: relative;
    isolation: isolate;
    overflow: clip;
    padding-block: clamp(5rem, 9vw, 8rem);
    background: var(--robofest-timeline-paper);
    color: var(--robofest-timeline-ink);
}

.robofest-timeline__container {
    position: relative;
    z-index: 1;
    width: min(100% - 2.5rem, 1240px);
    margin-inline: auto;
}

/* Encabezado */

.robofest-timeline__header {
    max-width: 950px;
    margin-bottom: clamp(4rem, 8vw, 7rem);
}

.robofest-timeline__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    margin: 0 0 1.5rem;
    padding: 0.55rem 0.75rem;
    border: 2px solid var(--robofest-timeline-ink);
    background: var(--robofest-timeline-green);
    color: var(--robofest-timeline-ink);
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    line-height: 1.4;
    text-transform: uppercase;
}

.robofest-timeline__eyebrow::before {
    width: 0.65rem;
    height: 0.65rem;
    flex: 0 0 auto;
    background: currentColor;
    content: "";
}

.robofest-timeline__title {
    max-width: 15ch;
    margin: 0;
    font-size: clamp(3rem, 7.5vw, 6.75rem);
    font-weight: 950;
    line-height: 0.93;
    letter-spacing: -0.08em;
    overflow-wrap: break-word;
    text-wrap: balance;
}

.robofest-timeline__title-highlight {
    display: block;
    margin-top: 0.12em;
    color: var(--robofest-timeline-blue);
    text-decoration: underline;
    text-decoration-thickness: 0.065em;
    text-underline-offset: 0.1em;
    text-decoration-skip-ink: none;
}

.robofest-timeline__intro {
    max-width: 60ch;
    margin: 2rem 0 0;
    color: var(--robofest-timeline-muted);
    font-size: clamp(1rem, 1.5vw, 1.15rem);
    font-weight: 500;
    line-height: 1.85;
    text-wrap: pretty;
}

/* Recorrido y línea compartida */

.robofest-timeline__track {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: clamp(5rem, 10vw, 9rem);
    padding-block: 1rem;
}

.robofest-timeline__line {
    position: absolute;
    z-index: -1;
    top: 0;
    bottom: 0;
    left: 50%;
    width: var(--robofest-timeline-line-width);
    overflow: hidden;
    background: rgb(23 23 23 / 14%);
    transform: translateX(-50%);
}

.robofest-timeline__line-progress {
    position: absolute;
    inset: 0 0 auto;
    width: 100%;
    height: var(--robofest-timeline-line-progress);
    background: var(--robofest-timeline-blue);
    transform-origin: top;
}

/* Bloque de cada edición */

.robofest-timeline__edition {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
    align-items: start;
    gap: clamp(2rem, 5vw, 5rem);
    min-width: 0;
}

.robofest-timeline__edition:nth-of-type(even) {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
}

.robofest-timeline__edition:nth-of-type(even) .robofest-timeline__year-column {
    grid-column: 2;
    grid-row: 1;
}

.robofest-timeline__edition:nth-of-type(even) .robofest-timeline__card {
    grid-column: 1;
    grid-row: 1;
}

/* Año y nodo */

.robofest-timeline__year-column {
    position: sticky;
    top: 7rem;
    display: flex;
    min-width: 0;
    flex-direction: column;
    align-items: flex-start;
    padding-top: 1rem;
}

.robofest-timeline__node {
    position: absolute;
    top: 1.5rem;
    left: calc(100% + clamp(1rem, 2.5vw, 2.5rem));
    z-index: 2;
    width: 1.4rem;
    height: 1.4rem;
    border: 4px solid var(--robofest-timeline-paper);
    outline: 3px solid var(--robofest-timeline-ink);
    background: var(--robofest-timeline-green);
    transform: translateX(-50%) rotate(45deg);
}

.robofest-timeline__edition:nth-of-type(even) .robofest-timeline__node {
    right: calc(100% + clamp(1rem, 2.5vw, 2.5rem));
    left: auto;
    transform: translateX(50%) rotate(45deg);
}

.robofest-timeline__year {
    display: block;
    font-size: clamp(4.5rem, 10vw, 9rem);
    font-weight: 950;
    line-height: 0.8;
    letter-spacing: -0.1em;
    overflow-wrap: normal;
    font-variant-numeric: tabular-nums;
}

.robofest-timeline__edition-number {
    display: inline-block;
    margin-top: 1.5rem;
    padding: 0.5rem 0.7rem;
    border: 2px solid var(--robofest-timeline-ink);
    background: var(--robofest-timeline-ink);
    color: var(--robofest-timeline-paper);
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.1em;
    line-height: 1.4;
}

/* Tarjeta editorial */

.robofest-timeline__card {
    position: relative;
    min-width: 0;
    padding: clamp(1.5rem, 3.5vw, 3rem);
    border: var(--robofest-timeline-border);
    background: #fff;
    box-shadow: var(--robofest-timeline-shadow);
}

.robofest-timeline__card-header {
    margin-bottom: 2rem;
}

.robofest-timeline__chapter {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0 0 1rem;
    color: var(--robofest-timeline-muted);
    font-size: 0.75rem;
    font-weight: 900;
    letter-spacing: 0.09em;
    line-height: 1.5;
    text-transform: uppercase;
}

.robofest-timeline__chapter::before {
    width: 1.5rem;
    height: 3px;
    flex: 0 0 auto;
    background: var(--robofest-timeline-orange);
    content: "";
}

.robofest-timeline__edition-title {
    margin: 0;
    font-size: clamp(2rem, 4vw, 3.4rem);
    font-weight: 950;
    line-height: 0.98;
    letter-spacing: -0.065em;
    overflow-wrap: break-word;
    text-wrap: balance;
}

.robofest-timeline__edition-title-highlight {
    color: var(--robofest-timeline-blue);
}

/* Datos de cada edición */

.robofest-timeline__facts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin-bottom: 1.75rem;
    border-top: 2px solid var(--robofest-timeline-ink);
    border-left: 2px solid var(--robofest-timeline-ink);
}

.robofest-timeline__fact {
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: flex-start;
    gap: 0.55rem;
    padding: 1rem;
    border-right: 2px solid var(--robofest-timeline-ink);
    border-bottom: 2px solid var(--robofest-timeline-ink);
}

.robofest-timeline__fact-label {
    color: var(--robofest-timeline-muted);
    font-size: 0.67rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    line-height: 1.45;
    text-transform: uppercase;
}

.robofest-timeline__fact-value {
    font-size: 0.95rem;
    font-weight: 800;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.robofest-timeline__fact--featured {
    background: var(--robofest-timeline-green);
}

.robofest-timeline__fact--featured .robofest-timeline__fact-value {
    font-size: 1.15rem;
    font-weight: 950;
}

/* Descripciones */

.robofest-timeline__description {
    margin: 0;
    font-size: 0.98rem;
    font-weight: 500;
    line-height: 1.9;
    text-wrap: pretty;
}

.robofest-timeline__description + .robofest-timeline__description {
    margin-top: 1rem;
}

.robofest-timeline__description--secondary {
    padding-left: 1rem;
    border-left: 4px solid var(--robofest-timeline-orange);
}

/* Categorías */

.robofest-timeline__categories {
    margin-top: 2rem;
    border: 2px solid var(--robofest-timeline-ink);
}

.robofest-timeline__categories-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem;
    background: var(--robofest-timeline-ink);
    color: var(--robofest-timeline-paper);
}

.robofest-timeline__categories-label {
    font-size: 0.85rem;
    font-weight: 900;
    line-height: 1.5;
}

.robofest-timeline__categories-count {
    flex: 0 0 auto;
    color: var(--robofest-timeline-green);
    font-size: 0.65rem;
    font-weight: 900;
    letter-spacing: 0.06em;
    line-height: 1.5;
    text-align: right;
}

.robofest-timeline__category-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin: 0;
    padding: 1rem;
    list-style: none;
}

.robofest-timeline__category {
    max-width: 100%;
    padding: 0.55rem 0.7rem;
    border: 1.5px solid var(--robofest-timeline-ink);
    background: var(--robofest-timeline-paper);
    font-size: 0.75rem;
    font-weight: 800;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

/* Cierre de cada tarjeta */

.robofest-timeline__card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 2px solid var(--robofest-timeline-ink);
}

.robofest-timeline__footer-label {
    max-width: 35ch;
    font-size: 0.75rem;
    font-weight: 850;
    line-height: 1.6;
}

.robofest-timeline__footer-symbol {
    display: grid;
    width: 2.25rem;
    height: 2.25rem;
    flex: 0 0 auto;
    place-items: center;
    background: var(--robofest-timeline-blue);
    color: #fff;
    font-size: 1.5rem;
    font-weight: 500;
    line-height: 1;
}

/* Cierre de la línea del tiempo */

.robofest-timeline__ending {
    position: relative;
    margin-top: clamp(5rem, 10vw, 9rem);
    padding: clamp(2rem, 5vw, 4rem);
    border: var(--robofest-timeline-border);
    background: var(--robofest-timeline-green);
    box-shadow: var(--robofest-timeline-shadow);
}

.robofest-timeline__ending-symbol {
    display: block;
    margin-bottom: 1.5rem;
    font-size: 0.8rem;
    font-weight: 950;
    letter-spacing: 0.12em;
}

.robofest-timeline__ending-text {
    max-width: 22ch;
    margin: 0;
    font-size: clamp(2rem, 5vw, 4.5rem);
    font-weight: 950;
    line-height: 1;
    letter-spacing: -0.07em;
    text-wrap: balance;
}

.robofest-timeline__ending-text strong {
    display: block;
    margin-top: 0.2em;
    color: var(--robofest-timeline-blue);
}

/* Elementos decorativos */

.robofest-timeline__decoration {
    position: absolute;
    z-index: 0;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.robofest-timeline__shape {
    position: absolute;
    display: block;
    width: clamp(2.5rem, 5vw, 5rem);
    height: auto;
    color: var(--robofest-timeline-blue);
}

.robofest-timeline__shape--square {
    top: 5%;
    right: 11%;
    transform: rotate(12deg);
}

.robofest-timeline__shape--cross {
    bottom: 1.5%;
    left: 5%;
    color: var(--robofest-timeline-orange);
    transform: rotate(-12deg);
}

/* Adaptación para pantallas medianas */

@media (max-width: 1000px) {
    .robofest-timeline__container {
        width: min(100% - 2rem, 800px);
    }

    .robofest-timeline__header {
        margin-bottom: 4rem;
    }

    .robofest-timeline__track {
        gap: 5rem;
    }

    .robofest-timeline__line {
        left: 1rem;
    }

    .robofest-timeline__edition,
    .robofest-timeline__edition:nth-of-type(even) {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        padding-left: 3.5rem;
    }

    .robofest-timeline__edition:nth-of-type(even) .robofest-timeline__year-column,
    .robofest-timeline__edition:nth-of-type(even) .robofest-timeline__card {
        grid-column: auto;
        grid-row: auto;
    }

    .robofest-timeline__year-column {
        position: relative;
        top: auto;
        padding-top: 0;
    }

    .robofest-timeline__node,
    .robofest-timeline__edition:nth-of-type(even) .robofest-timeline__node {
        top: 0.5rem;
        right: auto;
        left: calc(-2.5rem - 0.7rem);
        transform: translateX(-50%) rotate(45deg);
    }

    .robofest-timeline__year {
        font-size: clamp(4.5rem, 12vw, 7rem);
    }

    .robofest-timeline__edition-number {
        margin-top: 1rem;
    }

    .robofest-timeline__card {
        padding: clamp(1.5rem, 4vw, 2.5rem);
    }

    .robofest-timeline__ending {
        margin-top: 5rem;
    }
}

/* Adaptación para móviles */

@media (max-width: 600px) {
    .robofest-timeline {
        padding-block: 4rem;
    }

    .robofest-timeline__container {
        width: calc(100% - 2rem);
    }

    .robofest-timeline__header {
        margin-bottom: 3.5rem;
    }

    .robofest-timeline__eyebrow {
        margin-bottom: 1.25rem;
        font-size: 0.65rem;
    }

    .robofest-timeline__title {
        font-size: clamp(2.75rem, 12vw, 4.25rem);
        letter-spacing: -0.07em;
    }

    .robofest-timeline__intro {
        margin-top: 1.5rem;
        font-size: 0.95rem;
        line-height: 1.8;
    }

    .robofest-timeline__track {
        gap: 4rem;
    }

    .robofest-timeline__line {
        left: 0.55rem;
        width: 3px;
    }

    .robofest-timeline__edition,
    .robofest-timeline__edition:nth-of-type(even) {
        gap: 1.25rem;
        padding-left: 2rem;
    }

    .robofest-timeline__node,
    .robofest-timeline__edition:nth-of-type(even) .robofest-timeline__node {
        top: 0.4rem;
        left: calc(-1.45rem - 0.55rem);
        width: 1rem;
        height: 1rem;
        border-width: 3px;
        outline-width: 2px;
    }

    .robofest-timeline__year {
        font-size: clamp(3.75rem, 17vw, 5.5rem);
    }

    .robofest-timeline__edition-number {
        margin-top: 0.85rem;
        font-size: 0.62rem;
    }

    .robofest-timeline__card {
        padding: 1.25rem;
        border-width: 2px;
        box-shadow: 5px 5px 0 var(--robofest-timeline-ink);
    }

    .robofest-timeline__card-header {
        margin-bottom: 1.5rem;
    }

    .robofest-timeline__chapter {
        font-size: 0.65rem;
    }

    .robofest-timeline__edition-title {
        font-size: clamp(1.9rem, 8vw, 2.7rem);
    }

    .robofest-timeline__facts {
        grid-template-columns: minmax(0, 1fr);
        margin-bottom: 1.5rem;
    }

    .robofest-timeline__fact {
        padding: 0.85rem;
    }

    .robofest-timeline__fact-value {
        font-size: 0.9rem;
    }

    .robofest-timeline__description {
        font-size: 0.92rem;
        line-height: 1.8;
    }

    .robofest-timeline__categories {
        margin-top: 1.5rem;
    }

    .robofest-timeline__categories-header {
        flex-direction: column;
        gap: 0.45rem;
        padding: 0.85rem;
    }

    .robofest-timeline__categories-count {
        text-align: left;
    }

    .robofest-timeline__category-list {
        gap: 0.45rem;
        padding: 0.75rem;
    }

    .robofest-timeline__category {
        padding: 0.45rem 0.55rem;
        font-size: 0.7rem;
    }

    .robofest-timeline__card-footer {
        margin-top: 1.5rem;
    }

    .robofest-timeline__footer-label {
        font-size: 0.7rem;
    }

    .robofest-timeline__ending {
        margin-top: 4rem;
        padding: 1.5rem;
        border-width: 2px;
        box-shadow: 5px 5px 0 var(--robofest-timeline-ink);
    }

    .robofest-timeline__ending-text {
        font-size: clamp(2rem, 9vw, 3rem);
    }

    .robofest-timeline__shape--square {
        right: -0.75rem;
    }

    .robofest-timeline__shape--cross {
        left: -0.75rem;
    }
}

/* Respeto a las preferencias de movimiento */

@media (prefers-reduced-motion: reduce) {
    .robofest-timeline *,
    .robofest-timeline *::before,
    .robofest-timeline *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}



/* Animaciones controladas por JavaScript */

.robofest-timeline__line-progress {
    height: var(--robofest-timeline-line-progress, 0%);
}

.robofest-timeline--js [data-timeline-edition] {
    opacity: 0;
    transform: translateY(28px);
    transition:
        opacity 650ms ease,
        transform 650ms cubic-bezier(0.2, 0.7, 0.2, 1);
}

.robofest-timeline--js [data-timeline-edition].is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .robofest-timeline--js [data-timeline-edition] {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
