/* Contenedor principal de la página de inicio. */
.index {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 28px 0 48px;
    box-sizing: border-box;
}

/* Título de bienvenida. */
.index__title {
    width: min(92%, 1440px);
    margin: 0 auto 22px;
    color: #007E67;
    font-size: clamp(1.6rem, 2.5vw, 2.2rem);
    font-weight: 700;
}


.index__information {
    width: 100%;
    max-width: 1200px;
    margin: 40px auto 0;
    padding: 32px 24px;
    box-sizing: border-box;
}

.index__information-content {
    width: 100%;
    margin: 0 auto;
}

.index__section-title {
    margin: 0 0 16px;
    color: var(--verde-principal, #007E67);
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    font-weight: 700;
    line-height: 1.3;
}

.index__section-description {
    max-width: 850px;
    margin: 0;
    color: #4b5563;
    font-size: 1rem;
    line-height: 1.8;
}


/* Marco del carrusel, alineado al ancho disponible del menú. */
.banner-carousel {
    position: relative;
    width: 80%;
    max-width: 100%;
    margin: 0;
    margin-left: 10%;
    overflow: hidden;
    border-radius: 10px;
    background: #f1f5f4;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    isolation: isolate;
    box-sizing: border-box;
}

/* Todas las diapositivas comparten las mismas dimensiones. */
.banner-carousel__track {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 6;
    min-height: 600px;
    max-height: 2000px;
    overflow: hidden;
}

/* Cada diapositiva ocupa exactamente el marco del carrusel. */
.banner-carousel__slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 450ms ease, visibility 450ms ease;
}

.banner-carousel__slide.is-active {
    z-index: 1;
    opacity: 1;
    visibility: visible;
}

/* El enlace también ocupa todo el espacio de la diapositiva. */
.banner-carousel__link {
    display: block;
    width: 100%;
    height: 100%;
}

/* La imagen se adapta al marco sin desbordarlo. */
.banner-carousel__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #fff;
}

/* Degradado para que el texto sea legible sobre la imagen. */
.banner-carousel__caption {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2;
    padding: clamp(20px, 4vw, 48px);
    color: #fff;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.78));
    pointer-events: none;
}

.banner-carousel__caption h3 {
    margin: 0 0 8px;
    font-size: clamp(1.2rem, 2.5vw, 2rem);
}

.banner-carousel__caption p {
    max-width: 850px;
    margin: 0;
    font-size: clamp(.9rem, 1.3vw, 1.1rem);
    line-height: 1.5;
}

.banner-carousel__button {
    display: inline-block;
    margin-top: 14px;
    padding: 10px 18px;
    border-radius: 6px;
    color: #fff;
    background: #007E67;
    font-weight: 700;
    text-decoration: none;
    pointer-events: auto;
}

.banner-carousel__button:hover,
.banner-carousel__button:focus-visible {
    background: #005f4e;
}

/* Controles para avanzar y retroceder. */
.banner-carousel__control {
    position: absolute;
    top: 50%;
    z-index: 3;
    display: grid;
    width: 44px;
    height: 44px;
    place-items: center;
    transform: translateY(-50%);
    border: 0;
    border-radius: 50%;
    color: #fff;
    background: rgba(0, 0, 0, 0.48);
    cursor: pointer;
    font-size: 1.2rem;
    transition: background 180ms ease;
}

.banner-carousel__control:hover,
.banner-carousel__control:focus-visible {
    background: #007E67;
}

.banner-carousel__control--prev { left: 16px; }
.banner-carousel__control--next { right: 16px; }

/* Indicadores de posición. */
.banner-carousel__indicators {
    position: absolute;
    right: 0;
    bottom: 14px;
    left: 0;
    z-index: 4;
    display: flex;
    justify-content: center;
    gap: 9px;
    padding: 0 60px;
}

.banner-carousel__indicator {
    width: 10px;
    height: 10px;
    padding: 0;
    border: 2px solid #fff;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}

.banner-carousel__indicator.is-active {
    background: #fff;
    transform: scale(1.15);
}

/* Mensaje alternativo cuando aún no existen banners vigentes. */
.banner-carousel__empty {
    display: grid;
    min-height: 230px;
    place-items: center;
    padding: 32px;
    border: 1px dashed #b8ccc7;
    border-radius: 14px;
    color: #42635c;
    background: #f5f9f8;
    text-align: center;
}

.banner-carousel__empty p { margin: 0; }

/* Adaptación para dispositivos móviles */
@media (max-width: 768px) {
    .index__information {
        margin-top: 24px;
        padding: 24px 16px;
    }

    .index__section-description {
        font-size: 0.95rem;
    }
}

@media (max-width: 700px) {
    .index {width: 100%; padding-top: 20px;}
    .banner-carousel { border-radius: 0px; }
    .banner-carousel__track { aspect-ratio: 4 / 3; min-height: 210px; }
    .banner-carousel__control { width: 36px; height: 36px; }
    .banner-carousel__control--prev { left: 9px; }
    .banner-carousel__control--next { right: 9px; }
    .banner-carousel__caption { padding: 38px 16px 30px; }
    .banner-carousel__caption p { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 3; }
    .banner-carousel__indicators { bottom: 10px; }
}

@media (prefers-reduced-motion: reduce) {
    .banner-carousel__slide { transition: none; }
}
