/*hero*/
#historia-hero {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0 1.5rem 5rem;
}

#historia-hero .wp-block-cover__background {
    opacity: 1;
    background: linear-gradient(to bottom, transparent 45%, color-mix(in srgb, var(--ast-global-color-8) 55%, transparent));
}

#historia-hero :is(h1, p) {
    color: var(--ast-global-color-4);
}

#historia-hero .historia-fechas {
    margin-bottom: .5rem;
    font-size: 20px;
}

#historia-hero h1 {
    margin: 0;
}

/*intro*/
#historia-intro .historia-barco {
    margin: 0 auto 1rem;
    text-align: center;
}

#historia-intro .historia-barco img {
    width: 110px;
}

#historia-intro .historia-lema {
    margin: 0;
    color: var(--ast-global-color-3);
    font-size: 30px;
    line-height: 1.3em;
    text-align: center;
}

#historia-intro .historia-indice {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    max-width: 1120px;
    margin: 5rem auto 0;
    padding: 0;
    list-style: none;
}

#historia-intro .historia-indice li {
    margin: 0;
    border-left: 1px solid var(--ast-global-color-0);
}

#historia-intro .historia-indice li:first-child {
    border-left: 0;
}

#historia-intro .historia-indice a {
    display: block;
    padding: 1rem .5rem;
    color: var(--ast-global-color-3);
    font-size: 18px;
    line-height: 1.6em;
    text-align: center;
    text-decoration: none;
    text-transform: uppercase;
}

#historia-intro .historia-indice a::first-line {
    color: var(--ast-global-color-7);
    font-size: 30px;
}

#historia-intro .historia-indice a:hover,
#historia-intro .historia-indice a:focus-visible {
    text-decoration: underline;
    text-underline-offset: 6px;
}

/*linea de tiempo*/
#historia-linea-tiempo .historia-hitos {
    --hito-gap: 16rem;
    --punto: 24px;
    position: relative;
    max-width: 1340px;
    padding-block: 3rem;
}

#historia-linea-tiempo .historia-hitos::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    margin-left: -1px;
    background: linear-gradient(to bottom, transparent, var(--ast-global-color-7) 4%, var(--ast-global-color-7) 96%, transparent);
    transform: scaleY(var(--veo-progreso, 1));
    transform-origin: top;
}

#historia-linea-tiempo .historia-hito {
    column-gap: var(--hito-gap);
    margin: 0 0 7.5rem;
    scroll-margin-top: 140px;
}

#historia-linea-tiempo .historia-hito:last-child {
    margin-bottom: 0;
}

#historia-linea-tiempo .historia-hito h2 {
    position: relative;
    margin-bottom: 2rem;
    padding-inline-end: max(0px, 100% - 490px);
    font-size: 48px;
}

#historia-linea-tiempo .historia-hito h2::before {
    content: "";
    position: absolute;
    top: calc(.65em - var(--punto) / 2);
    width: var(--punto);
    height: var(--punto);
    border-radius: 50%;
    background: var(--ast-global-color-7);
}

#historia-linea-tiempo .historia-hito-texto:last-child h2::before {
    left: calc(var(--hito-gap) / -2 - var(--punto) / 2);
}

#historia-linea-tiempo .historia-hito-texto:first-child h2::before {
    right: calc(var(--hito-gap) / -2 - var(--punto) / 2);
}

#historia-linea-tiempo .historia-hito-texto > :not(h2) {
    max-width: 490px;
}

#historia-linea-tiempo .historia-hito-texto p {
    margin-bottom: 0;
    line-height: 1.8em;
}

#historia-linea-tiempo .historia-hito-texto .antetitulo {
    margin-bottom: .5rem;
}

#historia-linea-tiempo .historia-hito-texto .historia-destacado {
    margin-top: 2rem;
    color: var(--ast-global-color-7);
    font-size: 20px;
    line-height: 1.4em;
}

#historia-linea-tiempo .historia-hito-imagen figure {
    margin: 0 auto;
    text-align: center;
}

#historia-linea-tiempo .historia-hito-imagen img {
    width: 100%;
}

#historia-origen .historia-firma img {
    width: 233px;
}

@media (width >=1300px) {
    #historia-linea-tiempo .historia-hito-imagen figure:not(.historia-firma) {
        margin-inline: -7.5%;
    }
}

/* El JS añade la clase solo si hay animación: sin JS o con movimiento reducido, todo visible */
.veo-historia-animada .historia-hito > .wp-block-column {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity .8s cubic-bezier(.2, .7, .2, 1), transform .8s cubic-bezier(.2, .7, .2, 1);
}

.veo-historia-animada .historia-hito > .historia-hito-imagen {
    transition-delay: .15s;
}

.veo-historia-animada .historia-hito h2::before {
    transform: scale(0);
    transition: transform .6s cubic-bezier(.2, .7, .2, 1);
}

.veo-historia-animada .historia-hito.es-visible > .wp-block-column {
    opacity: 1;
    transform: none;
}

.veo-historia-animada .historia-hito.es-visible h2::before {
    transform: scale(1);
}

@media (prefers-reduced-motion: no-preference) {
    html:has(#historia-linea-tiempo) {
        scroll-behavior: smooth;
    }
}

/*generaciones*/
#historia-generaciones h2,
#historia-cta h2 {
    max-width: 14em;
    margin-inline: auto;
    font-size: 48px;
}

#historia-generaciones .generaciones {
    max-width: 1240px;
    gap: 2rem;
    margin-top: 3rem;
}

#historia-generaciones .generacion {
    text-align: center;
}

#historia-generaciones .generacion figure {
    margin: 0 auto;
}

#historia-generaciones .generacion img {
    width: 100%;
    max-width: 320px;
}

#historia-generaciones .generacion-ano {
    margin: 0 0 .5rem;
    color: var(--ast-global-color-7);
    font-size: 30px;
    line-height: 1.3em;
}

#historia-generaciones .generacion h3 {
    margin-bottom: .5rem;
    font-size: 22px;
}

#historia-generaciones .generacion p:not(.generacion-ano) {
    max-width: 14em;
    margin-inline: auto;
    font-size: 17px;
    line-height: 1.4em;
}

/*cta*/
#historia-cta h2 {
    margin-bottom: 3rem;
}

#historia-cta .wp-block-buttons {
    align-items: center;
    gap: 1.5rem;
}

#historia-cta .wp-block-button__link {
    justify-content: center;
    min-width: 280px;
}

@media (width <=1200px) {
    #historia-linea-tiempo .historia-hitos {
        --hito-gap: 8rem;
    }
}

@media (width <=921px) {
    #historia-intro .historia-indice {
        grid-template-columns: repeat(3, 1fr);
        row-gap: 1.5rem;
    }

    #historia-intro .historia-indice li:nth-child(3n + 1) {
        border-left: 0;
    }

    #historia-linea-tiempo .historia-hito h2,
    #historia-generaciones h2,
    #historia-cta h2 {
        font-size: 40px;
    }
}

@media (width <=781px) {
    #historia-linea-tiempo .historia-hitos {
        --punto: 20px;
        padding-left: 3rem;
    }

    #historia-linea-tiempo .historia-hitos::before {
        left: 10px;
    }

    #historia-linea-tiempo .historia-hito {
        row-gap: 2rem;
        margin-bottom: 5rem;
    }

    #historia-linea-tiempo .historia-hito-texto {
        order: -1;
    }

    #historia-linea-tiempo .historia-hito-texto:is(:first-child, :last-child) h2::before {
        right: auto;
        left: calc(-3rem + 11px - var(--punto) / 2);
    }

    #historia-linea-tiempo .historia-hito-imagen img {
        max-width: 360px;
    }

    #historia-generaciones .generaciones > .generacion {
        flex-basis: calc(50% - 1rem) !important;
    }
}

@media (width <=544px) {
    #historia-hero {
        min-height: 85vh;
        min-height: 85dvh;
        padding-bottom: 3rem;
    }

    #historia-intro .historia-lema {
        font-size: 24px;
    }

    #historia-intro .historia-indice {
        grid-template-columns: repeat(2, 1fr);
        margin-top: 3rem;
    }

    #historia-intro .historia-indice li:nth-child(3n + 1) {
        border-left: 1px solid var(--ast-global-color-0);
    }

    #historia-intro .historia-indice li:nth-child(odd) {
        border-left: 0;
    }

    #historia-intro .historia-indice a {
        padding-block: .5rem;
        font-size: 16px;
    }

    #historia-intro .historia-indice a::first-line {
        font-size: 26px;
    }

    #historia-linea-tiempo .historia-hitos {
        padding-left: 2.5rem;
    }

    #historia-linea-tiempo .historia-hito-texto:is(:first-child, :last-child) h2::before {
        left: calc(-2.5rem + 11px - var(--punto) / 2);
    }

    #historia-linea-tiempo .historia-hito h2,
    #historia-generaciones h2,
    #historia-cta h2 {
        font-size: 32px;
    }

    #historia-origen .historia-firma img {
        width: 180px;
    }

    #historia-generaciones .generaciones {
        gap: 1rem;
    }

    #historia-generaciones .generaciones > .generacion {
        flex-basis: calc(50% - .5rem) !important;
    }

    #historia-generaciones .generacion-ano {
        font-size: 24px;
    }

    #historia-generaciones .generacion h3 {
        font-size: 19px;
    }

    #historia-generaciones .generacion p:not(.generacion-ano) {
        font-size: 15px;
    }

    #historia-cta .wp-block-button__link {
        min-width: 260px;
    }
}
