@import url("./ax-colors.css");


/* =========================================================
   CONTENEDOR ENFOLD
   ========================================================= */

.ax-story-wrapper {
    position: relative !important;
    z-index: 1;
    min-height: 0 !important;
    overflow: visible !important;
}

.ax-story-wrapper > .container {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

.ax-story-wrapper .content {
    width: 100% !important;
    padding: 0 !important;
}

.ax-story-wrapper .avia_codeblock,
.ax-story-wrapper .avia_codeblock_section {
    width: 100%;
    margin: 0;
    padding: 0;
}


/* =========================================================
   SECUENCIA DE TEXTOS CON SCROLL
   ========================================================= */

.ax-story {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100svh;
    min-height: 620px;
    margin: 0;
    padding: 0;
    overflow: hidden;
    background: transparent !important;
    color: var(--ax-white);
    isolation: isolate;
}

/*
 * Este elemento es el que GSAP mantendr fijado.
 */

.ax-story__stage {
    position: relative;
    width: 100%;
    height: 100svh;
    min-height: 620px;
    overflow: hidden;
    background: transparent !important;
}

/* =========================================================
   CONTENEDOR DE TEXTOS
   ========================================================= */

.ax-story__texts {
    position: relative;
    width: 100%;
    height: 100%;
}

/*
 * Todos los textos ocupan exactamente la misma posicin.
 * GSAP controla su visibilidad y desplazamiento.
 */

.ax-story__item {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    padding: clamp(80px, 10vw, 160px);
    text-align: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* =========================================================
   TIPOGRAF01A
   ========================================================= */

.ax-story__item h2,
.ax-story__item h3,
.ax-story__item p {
    max-width: 1100px;
    margin-right: auto;
    margin-left: auto;
    color: var(--ax-white) !important;
}

.ax-story__item h2 {
    margin-top: 0;
    margin-bottom: 0;
    font-size: clamp(35px, 5.2vw, 54px);
    line-height: 1.02;
    font-weight: 400;
    letter-spacing: -0.045em;
    color: var(--ax-white);
}

.ax-story__item h2 strong {
    font-weight: 700;
}

.ax-story__item h3 {
    margin-top: 0;
    margin-bottom: 26px;
    font-size: clamp(30px, 5vw, 40px);
    line-height: 0.98;
    font-weight: 700;
    letter-spacing: 1px;
}

.ax-story__item p {
    max-width: 760px;
    margin-top: 0;
    margin-bottom: 0;
    font-size: clamp(17px, 1.45vw, 24px);
    line-height: 1.5;
    font-weight: 400;
}

/* =========================================================
   INDICADORES
   ========================================================= */

.ax-story__dots {
    position: absolute;
    z-index: 5;
    top: 50%;
    right: clamp(22px, 3vw, 52px);
    display: flex;
    flex-direction: column;
    gap: 12px;
    transform: translateY(-50%);
    pointer-events: none;
}

.ax-story__dot {
    display: block;
    width: 7px;
    height: 7px;
    border: 1px solid color-mix(in srgb, var(--ax-white) 55%, transparent);
    border-radius: 50%;
    background: transparent;
    transition:
        background-color 0.25s ease,
        border-color 0.25s ease,
        transform 0.25s ease;
}

.ax-story__dot.is-current {
    border-color: var(--ax-white);
    background: var(--ax-white);
    transform: scale(1.35);
}

/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 989px) {
    .ax-story,
    .ax-story__stage {
        height: 100svh;
        min-height: 0;
    }

    .ax-story__item {
        padding:
            max(70px, env(safe-area-inset-top))
            50px
            max(70px, env(safe-area-inset-bottom));
    }

    .ax-story__item h2 {
        max-width: 850px;
        font-size: clamp(34px, 7vw, 50px);
    }

    .ax-story__item h3 {
        max-width: 850px;
        font-size: clamp(32px, 6.5vw, 46px);
    }

    .ax-story__item p {
        max-width: 650px;
        font-size: clamp(17px, 2.4vw, 22px);
    }
}


/* =========================================================
   M07VIL
   ========================================================= */

@media (max-width: 767px) {
    .ax-story {
        width: 100%;
        height: 100svh;
        min-height: 0;
        overflow: hidden;
    }

    .ax-story__stage {
        width: 100%;
        height: 100svh;
        min-height: 0;
        overflow: hidden;
    }

    .ax-story__texts {
        width: 100%;
        height: 100%;
    }

    .ax-story__item {
        inset: 0;
        width: 100%;
        height: 100%;

        padding:
            max(82px, calc(env(safe-area-inset-top) + 60px))
            26px
            max(80px, calc(env(safe-area-inset-bottom) + 60px));

        justify-content: center;
    }

    .ax-story__item h2 {
        max-width: 360px;
        margin: 0 auto !important;

        font-size: clamp(30px, 9.5vw, 42px);
        line-height: 1;
        letter-spacing: -0.04em;
    }

    .ax-story__item h3 {
        max-width: 350px;
        margin: 0 auto 18px !important;

        font-size: clamp(28px, 8.5vw, 39px);
        line-height: 1;
        letter-spacing: 0;
    }

    .ax-story__item p {
        max-width: 340px;
        margin: 0 auto !important;

        font-size: clamp(16px, 4.4vw, 18px);
        line-height: 1.4;
    }

    .ax-story__dots {
        top: auto;
        right: auto;
        bottom: max(25px, env(safe-area-inset-bottom));
        left: 50%;

        flex-direction: row;
        gap: 11px;

        transform: translateX(-50%);
    }

    .ax-story__dot {
        width: 7px;
        height: 7px;
    }
}


/* Mviles con poca altura */
@media (max-width: 767px) and (max-height: 600px) {
    .ax-story__item {
        padding: 55px 24px 60px;
    }

    .ax-story__item h2 {
        font-size: clamp(27px, 8vw, 36px);
    }

    .ax-story__item h3 {
        margin-bottom: 14px !important;
        font-size: clamp(25px, 7.5vw, 34px);
    }

    .ax-story__item p {
        font-size: 15px;
        line-height: 1.35;
    }

    .ax-story__dots {
        bottom: 16px;
    }
}

/* =========================================================
   HOME: BLOQUE COMPACTO SIN ESPACIO EXTRA DE FIJACI07N
   ========================================================= */

/* La llamada anterior deja de reservar un mnimo de 70vh. */
#top.home #av_section_6:has(+ #av_section_7) {
    height: auto !important;
    min-height: 0 !important;
    padding-top: clamp(48px, 6vw, 80px) !important;
    padding-bottom: 24px !important;
}

#top.home #av_section_6:has(+ #av_section_7) > .container {
    height: auto !important;
    min-height: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

#top.home #av_section_6:has(+ #av_section_7) .content {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
}

/* Normaliza Enfold sin depender de la clase ax-story-wrapper,
   ausente en el HTML publicado. No modifica el pin-spacer. */
#top.home #av_section_7 {
    position: relative !important;
    min-height: 0 !important;
    height: auto !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    overflow: visible !important;
}

#top.home #av_section_7 > .container {
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

#top.home #av_section_7 .content {
    width: 100% !important;
    padding: 0 !important;
}

#top.home #av_section_7 .avia_codeblock,
#top.home #av_section_7 .avia_codeblock_section {
    width: 100%;
    margin: 0 !important;
    padding: 0 !important;
}

/* Bloque compacto: la seccin y el escenario siempre tienen la misma altura.
   El JavaScript cambia los mensajes sin generar pin-spacers. */
#top.home .ax-story,
#top.home .ax-story__stage {
    box-sizing: border-box;
    height: clamp(380px, 60svh, 640px);
    min-height: 0;
}

#top.home .ax-story__item {
    box-sizing: border-box;
    justify-content: center;
    padding: 48px clamp(50px, 8vw, 125px);
}

#top.home .ax-story__dots {
    top: 50%;
}

@media (max-width: 767px) {
    #top.home .ax-story,
    #top.home .ax-story__stage {
        height: clamp(380px, 65svh, 560px);
    }

    #top.home .ax-story__item {
        padding: 40px 26px 60px;
    }

    #top.home .ax-story__dots {
        top: auto;
    }
}

@media (max-width: 767px) and (max-height: 600px) {
    #top.home .ax-story,
    #top.home .ax-story__stage {
        height: clamp(320px, 80svh, 420px);
    }

    #top.home .ax-story__item {
        padding: 28px 24px 48px;
    }
}

/* Sin GSAP o con movimiento reducido: mensajes en flujo normal. */
#top.home .ax-story--static,
#top.home .ax-story--static .ax-story__stage,
#top.home .ax-story--static .ax-story__texts {
    height: auto;
    min-height: 0;
    overflow: visible;
}

#top.home .ax-story--static .ax-story__item {
    position: relative;
    inset: auto;
    height: auto;
    opacity: 1;
    visibility: visible;
    transform: none;
    padding-top: 32px;
    padding-bottom: 32px;
    pointer-events: auto;
}

#top.home .ax-story--static .ax-story__dots {
    display: none;
}
