/* === BANNER SUPERIOR === */
.saberes-banner {
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('../images/historia-1.jpg'); /* Asegúrate de que la ruta a tu imagen sea correcta */
    background-size: cover;
    background-position: center;
    padding: 6rem 1.5rem;
    text-align: center;
    color: #ffffff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.saberes-banner__title {
    font-size: clamp(2.5rem, 5vw, 3.5rem); /* Tamaño de fuente adaptable */
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
}

.saberes-banner__subtitle {
    max-width: 650px;
    margin: 1rem auto 0;
    font-size: 1.125rem;
    line-height: 1.6;
    opacity: 0.9;
}

/* === CONTENEDOR PRINCIPAL Y TÍTULOS DE SECCIÓN === */
.saberes-container {
    max-width: 900px;
    margin: 4rem auto;
    padding: 0 1.5rem;
}

.saberes-main-title {
    text-align: center;
    font-size: clamp(1.8rem, 4vw, 2.25rem);
    font-weight: 700;
    margin-bottom: 3rem;
    color: #1f2937; /* Gris oscuro */
}

/* === LISTA DE SABERES === */
.saberes-list {
    display: grid;
    gap: 4rem; /* Espacio entre cada saber */
}

.saber-item {
    display: grid;
    grid-template-columns: 1fr; /* Una columna en móvil */
    gap: 1.5rem;
    align-items: center;
    padding-bottom: 4rem; /* Espacio para la línea de abajo */
    border-bottom: 1px solid #e5e7eb; /* Línea sutil de separación */
}

.saber-item:last-child {
    border-bottom: none; /* No mostrar la línea en el último elemento */
}

/* Diseño para pantallas más grandes (tablets y escritorio) */
@media (min-width: 768px) {
    .saber-item {
        grid-template-columns: repeat(2, 1fr); /* Dos columnas */
        gap: 2.5rem;
    }
    /* Alterna la posición de la imagen */
    .saber-item:nth-child(even) .saber-item__media {
        order: 2;
    }
}

.saber-item__media {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 0.75rem;
    overflow: hidden;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.saber-item__media iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.saber-item__content {
    display: flex;
    flex-direction: column;
}

.saber-item__title {
    font-size: 1.75rem;
    font-weight: 600;
    color: #111827;
    margin-bottom: 0.75rem;
}

.saber-item__description {
    color: #4b5563;
    line-height: 1.7;
    flex-grow: 1; /* Empuja el botón hacia abajo */
    margin-bottom: 1.5rem;
}

.saber-item__button {
    display: inline-block;
    align-self: flex-start; /* Alinea el botón a la izquierda */
    background-color: #1f2937;
    color: #ffffff;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.3s ease, transform 0.2s ease;
}

.saber-item__button:hover {
    background-color: #374151;
    transform: translateY(-2px);
}

/* === SECCIÓN DE HISTORIAS (CARRUSEL) === */
.historias-section {
    margin-top: 5rem;
    padding-top: 4rem;
    border-top: 1px solid #e5e7eb;
}

.carousel-wrapper {
    position: relative;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    overflow: hidden; /* Oculta los slides que no se ven */
    border-radius: 0.75rem;
}

.carousel-slides {
    display: flex;
    transition: transform 0.5s ease-in-out; /* La magia de la animación */
}

.carousel-slide {
    flex: 0 0 100%; /* Cada slide ocupa el 100% del contenedor */
    min-width: 100%;
    box-sizing: border-box;
}

.video-slide-wrapper {
    position: relative;
    padding-top: 56.25%; /* Proporción 16:9 */
    background-color: #000;
}

.video-slide-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.video-slide-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, transparent 100%);
    color: #ffffff;
    font-size: 1.25rem;
    font-weight: 600;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background-color: rgba(255, 255, 255, 0.9);
    color: #1f2937;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    transition: background-color 0.3s, transform 0.2s;
}

.carousel-arrow:hover {
    background-color: #ffffff;
    transform: translateY(-50%) scale(1.1);
}

.carousel-arrow--prev { left: 1rem; }
.carousel-arrow--next { right: 1rem; }

.carousel-dots {
    text-align: center;
    padding: 1.5rem 0;
}

.carousel-dots .dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    background-color: #d1d5db; /* Gris claro */
    border-radius: 50%;
    margin: 0 5px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.carousel-dots .dot.active {
    background-color: #1f2937; /* Gris oscuro */
    transform: scale(1.2);
}
