/* Estilos del carousel Bootstrap 4.1 - Hero IPS */
.hero {
    padding: 0;
}

#carouselExampleIndicators {
    --hero-bg: #123246;

    width: 100vw;
    margin-left: calc(50% - 50vw);

    /* Proporción fija 1600:466 */
    aspect-ratio: 1600 / 466;
    height: auto;

    overflow: hidden;
    position: relative;

    box-shadow:
        0 12px 30px rgba(20, 77, 99, 0.16),
        0 2px 8px rgba(20, 77, 99, 0.10);

    border-radius: 0;
}


/* =========================================================
   CONTENEDOR DEL CAROUSEL
   ========================================================= */

#carouselExampleIndicators .carousel-inner {
    position: relative;
    height: 100%;
}


/* =========================================================
   ITEMS DEL CAROUSEL
   ========================================================= */

#carouselExampleIndicators .carousel-item {
    display: block !important;

    position: absolute;
    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    opacity: 0;
    pointer-events: none;

    transition: opacity 1.1s ease-in-out;

    z-index: 1;
}

#carouselExampleIndicators .carousel-item.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}


/* =========================================================
   IMAGEN DEL BANNER
   ========================================================= */

#carouselExampleIndicators .carousel-item img {
    position: relative;

    z-index: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;
    object-position: center;

    transform: scale(1.06);

    transition: transform 6s ease-out;

    box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.05);
}


/* =========================================================
   MODO GRÁFICA COMPLETA
   Para imágenes que ya tienen texto incorporado
   ========================================================= */

#carouselExampleIndicators .carousel-item--graphic {
    background-color: var(--hero-bg);
}

#carouselExampleIndicators .carousel-item--graphic img {
    object-fit: contain;

    transform: none;

    transition: none;
}


/* =========================================================
   EFECTO KEN BURNS
   ========================================================= */

#carouselExampleIndicators .carousel-item.active img {
    transform: scale(1);
}


/* =========================================================
   INDICADORES
   ========================================================= */

#carouselExampleIndicators .carousel-indicators {
    bottom: 1.25rem;

    z-index: 3;

    margin: 0;
}

#carouselExampleIndicators .carousel-indicators li {
    list-style: none;

    width: 32px;
    height: 6px;

    border-radius: 999px;

    background-color: rgba(255, 255, 255, 0.5);

    opacity: 1;

    margin: 0 4px;

    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);

    transition:
        background-color 0.3s ease,
        width 0.3s ease;

    cursor: pointer;
}

#carouselExampleIndicators .carousel-indicators .active {
    background-color: #ffffff;

    width: 44px;
}


/* =========================================================
   BOTONES ANTERIOR / SIGUIENTE
   ========================================================= */

#carouselExampleIndicators .carousel-control-prev,
#carouselExampleIndicators .carousel-control-next {
    width: 44px;
    height: 44px;

    border: none;

    background: rgba(20, 77, 99, 0.55);

    border-radius: 50%;

    top: 50%;

    transform: translateY(-50%);

    opacity: 0;

    z-index: 3;

    box-shadow: 0 4px 12px rgba(20, 77, 99, 0.35);

    transition:
        opacity 0.3s ease,
        background 0.3s ease,
        transform 0.3s ease;
}

#carouselExampleIndicators:hover .carousel-control-prev,
#carouselExampleIndicators:hover .carousel-control-next {
    opacity: 1;
}

#carouselExampleIndicators .carousel-control-prev:hover,
#carouselExampleIndicators .carousel-control-next:hover {
    background: rgba(31, 111, 139, 0.9);

    transform: translateY(-50%) scale(1.08);
}

#carouselExampleIndicators .carousel-control-prev {
    left: 1rem;
}

#carouselExampleIndicators .carousel-control-next {
    right: 1rem;
}

#carouselExampleIndicators .carousel-control-prev-icon,
#carouselExampleIndicators .carousel-control-next-icon {
    width: 18px;
    height: 18px;

    background-size: 100%;
}


/* =========================================================
   DEGRADADO INFERIOR
   ========================================================= */

#carouselExampleIndicators::after {
    content: "";

    position: absolute;

    inset: 0;

    background:
        linear-gradient(
            to top,
            rgba(0, 0, 0, 0.35),
            transparent 30%
        );

    z-index: 1;

    pointer-events: none;
}


/* =========================================================
   DEGRADADO LATERAL DERECHO
   Para que el texto colocado a la derecha sea legible
   ========================================================= */

#carouselExampleIndicators .carousel-item::before {
    content: "";

    position: absolute;

    inset: 0;

    background:
        linear-gradient(
            to left,
            rgba(10, 35, 46, 0.70) 0%,
            rgba(10, 35, 46, 0.40) 30%,
            transparent 65%
        );

    z-index: 1;

    pointer-events: none;
}


/* =========================================================
   GRÁFICAS QUE YA TIENEN TEXTO INCORPORADO
   ========================================================= */

#carouselExampleIndicators .carousel-item--graphic::before {
    content: none;
}


/* =========================================================
   TEXTO DEL SLIDE
   AHORA UBICADO A LA DERECHA
   ========================================================= */

.hero-caption {
    position: absolute;

    z-index: 2;

    /* Derecha */
    right: 6%;
    left: auto;

    /* Centrado vertical */
    top: 50%;

    transform: translateY(-50%);

    /* Ancho máximo del bloque */
    max-width: 36%;

    color: #ffffff;

    text-align: left;
}


/* =========================================================
   TÍTULO
   ========================================================= */

.hero-caption__title {
    margin: 0 0 0.5rem 0;

    font-size:
        clamp(
            1.3rem,
            2.6vw,
            2.4rem
        );

    font-weight: 700;

    line-height: 1.15;

    text-shadow:
        0 2px 6px rgba(0, 0, 0, 0.55),
        0 1px 2px rgba(0, 0, 0, 0.7);
}


/* =========================================================
   DESCRIPCIÓN
   ========================================================= */

.hero-caption__desc {
    margin: 0;

    font-size:
        clamp(
            0.85rem,
            1.1vw,
            1.1rem
        );

    font-weight: 400;

    line-height: 1.4;

    text-shadow:
        0 1px 4px rgba(0, 0, 0, 0.6),
        0 1px 2px rgba(0, 0, 0, 0.7);

    /* Máximo 3 líneas */
    display: -webkit-box;

    -webkit-line-clamp: 3;

    -webkit-box-orient: vertical;

    overflow: hidden;
}


/* =========================================================
   PLACEHOLDER
   ========================================================= */

.carousel-placeholder {
    max-width: 1200px;

    margin: 0 auto;

    padding: 3rem 2rem;

    text-align: center;

    border-radius: 18px;

    background:
        linear-gradient(
            135deg,
            #f5f8fb,
            #ffffff
        );

    color: #144d63;

    font-weight: 600;

    box-shadow:
        0 8px 20px rgba(20, 77, 99, 0.10);
}


/* =========================================================
   TABLET / MÓVIL
   ========================================================= */

@media (max-width: 768px) {

    #carouselExampleIndicators {
        aspect-ratio: 4 / 3;
        height: auto;
    }


    /* -----------------------------------------
       CONTROLES
       ----------------------------------------- */

    #carouselExampleIndicators .carousel-control-prev,
    #carouselExampleIndicators .carousel-control-next {

        opacity: 1;

        width: 36px;
        height: 36px;
    }


    /* -----------------------------------------
       DEGRADADO DERECHO EN MÓVIL
       ----------------------------------------- */

    #carouselExampleIndicators .carousel-item::before {

        background:
            linear-gradient(
                to left,
                rgba(10, 35, 46, 0.75) 0%,
                rgba(10, 35, 46, 0.45) 45%,
                transparent 75%
            );
    }


    /* Las gráficas que ya tienen texto
       no llevan degradado */
    #carouselExampleIndicators .carousel-item--graphic::before {
        content: none;
    }


    /* -----------------------------------------
       TEXTO A LA DERECHA EN MÓVIL
       ----------------------------------------- */

    .hero-caption {

        right: 6%;
        left: auto;

        max-width: 60%;

        top: auto;

        bottom: 14%;

        transform: none;

        text-align: left;
    }


    /* -----------------------------------------
       DESCRIPCIÓN MÓVIL
       ----------------------------------------- */

    .hero-caption__desc {

        -webkit-line-clamp: 2;
    }
}