/* ========== SECCION DE NAVEGACION ========== */
.nav-arrow {
    background: #039;
    color: #fc0;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: background 0.3s, transform 0.2s;
    text-decoration: none;
}

.nav-arrow:hover {
    background: #fc0;
    color: #039;
    transform: scale(1.1);
}

.nav-arrow.disabled {
    background: #ccc;
    cursor: not-allowed;
    pointer-events: none;
}

.chapter-select {
    padding: 8px 15px;
    font-size: 1rem;
    border: 2px solid #039;
    border-radius: 8px;
    background: white;
    color: #039;
    cursor: pointer;
    min-width: 280px;
    outline: none;
    transition: border-color 0.3s;
}

.chapter-select:focus {
    border-color: #039;
}

.chapter-select option {
    padding: 5px;
}

/* ========== SECCION DATOS ========== */
.modal-titulo {
    background-color: #039;
    color: #FC0;
    text-align: center;
    padding: 1.5rem;
    margin: 0;
    font-size: 3em;
    font-weight: 700;
    flex-grow: 1; /* Ocupa todo el espacio disponible */
    padding-right: 70px; /* Espacio para la X */
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70px;
}


/* VERSIÓN MEJORADA CON MÁS RESPONSIVE */
.perfil.contorno-visual {
    display: block;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #eee;
    overflow: hidden;
    margin-top: 1rem; /* Espacio entre título y contenido */
    padding-top: 0.5rem; /* Espacio interno arriba */
}

.foto-redonda {
    width: 400px;
    height: auto;
    border-radius: 50%;
    object-fit: cover;
    float: left;
    margin: 0.5rem 1.5rem 1rem 0; /* 0.5rem arriba, 1.5rem derecha, 1rem abajo */
    margin-top: 0.5rem; /* Espacio arriba de la imagen */
    shape-outside: circle(50%);
    shape-margin: 1rem;
    /* Sombra suave para mejor contraste */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.info-perfil {
    color: #039;
    font-size: 1.4rem;
    line-height: 1.8;
    /* Permite que el texto fluya naturalmente */
    overflow-wrap: break-word;
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;

}

/* Cuando el texto termina de rodear la imagen, 
   continúa normalmente abajo */
.info-perfil::after {
    content: "";
    display: block;
    clear: left;
}

.listado {
    margin-bottom: 2rem;
}

.listado h2 {
    color: #039;
    font-size: 1.6rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #039;
}

.lista-items {
    list-style-type: none;
    color: #039;
    text-align: left;
}

.lista-items li {
    font-size: 1.2rem;
    padding: 0.8rem 1rem;
    margin-bottom: 0.5rem;
    background-color: #f8f9fa;
    border-left: 4px solid #039;
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
}

.lista-items li i {
    font-weight: 600;
    font-style: normal;
}

.cuadro-blanco {
    background-color: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.cuadro-blanco h2 {
    color: #039;
    font-size: 1.6rem;
    margin-bottom: 1.2rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #039;
}

.contenido-agregado {
    color: #039;
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
}

.contenido-agregado p {
    font-size: 1.2rem;
    padding: 0.6rem 1rem;
    margin-bottom: 0.5rem;
    background-color: #f8f9fa;
    border-right: 4px solid #039;
}

/* Forzar visibilidad del audio */
.sonido audio {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    width: 90% !important;
    height: 50px !important;
    margin: 0 auto;
}

/* Centrado horizontal base */
.sonido {
    display: block !important;
    visibility: visible !important;
    text-align: center;
    width: 80%;
    margin: 5px auto;
    margin-bottom: 30px;
    padding: 15px;
    box-sizing: border-box;
    background-color: rgb(255, 204, 0, 0.2);
    border: 1px solid rgba(0, 51, 153);
    border-radius: 12px 5px 10px 0;
    box-shadow: 5px 3px 10px #039;
}

.sonido span {
    color: #039;
    font-size: 1.3em;
}



/* Responsive design */
@media (max-width: 1200px) {
    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

/* RESPONSIVE DESIGN */
@media (max-width: 900px) {
    .foto-redonda {
        width: 350px;
        height: auto;
        margin: 0 1.2rem 1.2rem 0;
    }

    /* Forzar visibilidad del audio */
    .sonido audio {
        width: 90% !important;
        height: 40px !important;
    }

    /* Centrado horizontal base */
    .sonido {
        width: 80%;
        margin-bottom: 10px;
        padding: 10px;
    }

    .sonido span {
        font-size: 1.3em;
    }
}

@media (max-width: 800px) {
    .info-perfil {
        font-size: 1.2rem;
        line-height: 1.7;
    }
}

@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .modal-container {
        max-height: 95vh;
    }
    
    .perfil.contorno-visual {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .modal-titulo {
        padding: 1rem;
        padding-right: 0; /* Espacio para la X */
    }
    
    .foto-redonda {
        float: none;
        width: 350px;
        height: auto;
        margin: 0 auto 1.5rem auto;
        shape-outside: none; /* Desactiva el contorno en móviles */
    }
    
    .info-perfil {
        font-size: 1.1rem;
        line-height: 1.6;
    }

    .close-modal {
        width: 50px;
        height: 50px;
        font-size: 2rem;
        right: 8px;
    }
}

@media (max-width: 576px) {
    header h1 {
        font-size: 2rem;
    }
    
    .grid-container {
        grid-template-columns: 1fr;
        max-width: 400px;
    }
    
    .tarjeta:hover {
        transform: scale(1.05);
    }
    
    .modal-content {
        padding: 0 1rem 1rem;
    }
    
    .modal-titulo {
        font-size: 2.5em;
    }

    .foto-redonda {
        width: 300px;
        height: auto;
    }

    /* Forzar visibilidad del audio */
    .sonido audio {
        width: 100% !important;
        height: 30px !important;
    }

    /* Centrado horizontal base */
    .sonido {
        width: 90%;
    }

    .sonido span {
        font-size: 1.1em;
    }
}

@media (max-width: 480px) {
 .grid-container {
    grid-template-columns: repeat(auto-fill, minmax(170px, 2fr));
    height:70%;
}

.tarjeta:hover {
    transform: scale(1.1);
    box-shadow: none;
    z-index: 10;    
}

    .foto-redonda {
        width: 250px;
        height: auto;
    }

    .info-perfil {
        font-size: 1rem;
        line-height: 1.5;
    }

    .modal-titulo {
        font-size: 2.2em;
    }
    
    .close-modal {
        width: 40px;
        height: 40px;
        font-size: 1.8rem;
        right: 5px;
    }

    .sonido span {
        font-size: 1em;
    }

    .listado {
        margin-bottom: 0;
    }

    .listado h2 {
            font-size: 1.4rem;
        }

    .lista-items li {
        font-size: 1.1rem;
        padding: 0.4rem 0.8rem;
        margin-bottom: 0.5rem;
    }

    .cuadro-blanco {
        padding: 1rem;
    }

    .cuadro-blanco h2 {
        font-size: 1.4rem;
    }

    .contenido-agregado p {
        font-size: 1.1rem;
        padding: 0.4rem 0.8rem;
    }

}

@media (max-width: 420px) {
    .chapter-select {
        min-width: 200px;
    }

    .modal-titulo {
        font-size: 2em;
    }
    
    .info-perfil {
        font-size: 0.9rem;
    }

    .listado h2 {
            font-size: 1.3rem;
        }

    .lista-items li {
        font-size: 1rem;
        padding: 0.3rem 0.7rem;
        text-align: left;
    }

    .cuadro-blanco h2 {
        font-size: 1.3rem;
    }

    .contenido-agregado p {
        font-size: 1rem;
        padding: 0.3rem 0.7rem;
        text-align: left;
    }
}

@media (max-width: 360px) {
    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(170px, 2fr));
        height:80%;
    }

    .tarjeta:hover {
        transform: scale(1.1);
        box-shadow: none;
        z-index: 10;    
    }
        
    .chapter-select {
        min-width: 200px;
    }

    .modal-titulo {
        font-size: 1.6em;
    }
    
    .foto-redonda {
        width: 200px;
        height: auto;
    }

    .info-perfil {
        text-align: left;
    }

    .listado h2 {
            font-size: 1.2rem;
        }

    .lista-items li i {
        font-weight: 700;
    }

    .cuadro-blanco h2 {
        font-size: 1.2rem;
    }

}

@media (max-width: 320px) {
    .grid-container {
        grid-template-columns: repeat(auto-fill, minmax(170px, 2fr));
        height:90%;
    }

    .tarjeta:hover {
        transform: scale(1.1);
        box-shadow: none;
        z-index: 10;    
    }
        
    .chapter-select {
        padding: 2px;
        font-size: 0.9rem;
        min-width: 180px;
    }

    .nav-arrow {
        width: 26px;
        height: 26px;
        font-size: 0.9rem;
    }

    .listado h2 {
            font-size: 1.1rem;
        }

    .lista-items li {
        font-size: 0.9rem;
        padding: 0.2rem 0.6rem;
    }

    .lista-items li i {
        font-weight: 700;
    }

    .cuadro-blanco h2 {
        font-size: 1.1rem;
    }

    .contenido-agregado p {
        font-size: 0.9rem;
        padding: 0.2rem 0.6rem;
    }
}




