/* ========== 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;
}

/*=====================================================*/
/*              ESTILO DE CADA CAPÍTULO                */
/*=====================================================*/

/* Chapter Content Styling */
.chapter-content {
    padding: 0;
}

.chapter-main-title {
    width: 100%;
    text-align: center;
    padding: 0;
    margin: 0;
    font-size: 2.8rem;
}

.chapter-body {
    padding: 0;
    color: #003399;
}

.chapter-body section {
    text-align: justify;
}

.chapter-body h2 {
    text-align: left;
    color: #003399;
    margin: 20px 0 10px;
    padding-bottom: 5px;
    border-bottom: 2px solid #ffcc00;
    font-size: 1.6rem;
}

.chapter-body p {
    line-height: 1.6;
    margin-bottom: 15px;
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
}

.chapter-body ul {
    padding-left: 20px;
    margin-bottom: 20px;
}

.chapter-body li {
    margin-bottom: 8px;
    line-height: 1.5;
}


/* Image Wrappers */
.image-wrapper {
    margin: 0 0;
    max-width: 300px;
    min-height: auto;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 2px 2px 10px rgba(0, 51, 153, 0.2);
}

.image-wrapper.right {
    float: right;
    width: 100%;
    margin: 15px 15px;
}

.image-wrapper.left {
    float: left;
    width: 100%;
    margin: 15px 15px;
}

.chapter-img {
    max-width: 300px;
    height: auto;
    display: flex;
}

.image-wrapper-v {
    margin: 0 0;
    max-height: 300px;
    max-width: fit-content;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 2px 2px 10px rgba(0, 51, 153, 0.2);
}

.image-wrapper-v.right {
    float: right;
    width: 100%;
    margin: 0 30px;
}

.image-wrapper-v.left {
    float: left;
    width: 100%;
    margin: 0 30px;
}

.chapter-img-v {
    width: auto;
    height: 30vh;
    display: flex;
}

/* Section Dividers */
.section-divider {
    width: 90%;
    margin: 30px auto;
    border: 1px solid #003399;
    opacity: 0.3;
}

/* Video Section */
.video-container {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16/9;
    width: 70%;
    height: auto;
    margin-left: 15%;
    padding-bottom: 0;
    text-align: center;
}

.video-responsive {
    display: flex;
    align-items: center;
    justify-content: center;
    aspect-ratio: 16/9;
    width: 80%;
    height: auto;
    margin-left: 8%;
    padding-bottom: 0;
}

.video-caption {
    display: inline;
    font-size: 1.2rem;
    color: #039;
}


/* Sources Section */
.sources {
    margin-top: 30px;
    padding: 20px;
    background-color: #f0f4f8;
    border-radius: 8px;
    border-left: 5px solid #003399;
    text-align: left;
}

.source-list {
    list-style: none;
    padding: 0;
}

.source-list li {
    margin-bottom: 10px;
    padding-left: 20px;
    position: relative;
}

.source-list li:before {
    content: "•";
    color: #003399;
    font-weight: bold;
    position: absolute;
    left: 0;
}

.source-list a {
    color: #003399;
    text-decoration: none;
    line-height: 1.5;
    display: inline-block;
    padding: 2px 0;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.source-list a:hover {
    color: #ffcc00;
    border-bottom: 1px solid #ffcc00;
}

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

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

/* ========== RESPONSIVE HISTORIA ========== */

/* ========== */
@media (max-width: 960px) {
    .chapter-main-title {
        font-size: 2.2rem;
    }

    .chapter-body h2 {
        font-size: 1.2rem;
    }

    .chapter-body p {
        line-height: 1.4;
        margin-bottom: 10px;
    }

    .chapter-body li {
        margin-bottom: 6px;
        line-height: 1.4;
    }
}

/* ========== */
@media (max-width: 768px) {
    .chapter-main-title {
        font-size: 2.1rem;
    }

    .chapter-body h2 {
        font-size: 1.1rem;
    }

    /* Video Section */
    .video-container {
        width: 80%;
        height: auto;
        margin-left: 10%;
    }

    .video-responsive {
        width: 90%;
    }

    .video-caption {
        font-size: 1.1rem;
    }
}

/* ========== */
@media (max-width: 700px) {
    /* Ajustes específicos para pantallas desde 320px a 480px */
    .section-small {
        position: relative; /* Evita que el menú fijo tape la lectura */
        margin-top: 10px;
        width: 100%;
        padding: 10px 0;
        flex-wrap: wrap; /* Permite que los elementos bajen de línea si no entran */
    }
    
    .nav-arrow {
        width: 32px;
        height: 32px;
        font-size: 0.9rem;
    }
    
    .chapter-select {
        min-width: 60%;
        max-width: 100%;
        font-size: 0.85rem;
        padding: 5px;
    }

    /* El audio se adapta al 100% */
    .sonido { width: 100%; }
    .sonido audio { width: 100% !important; }

    /* Video Section */
    .video-container {
        margin-left: 6%;
    }

    .video-caption {
        font-size: 1rem;
    }
}

/* ========== */
@media (max-width: 680px) {
    .chapter-main-title {
        font-size: 1.8rem;
    }
}

/* ========== */
@media (max-width: 600px) {
    .chapter-main-title {
        font-size: 1.6rem;
    }

    .video-caption {
        font-size: 0.9rem;
    }

    .source-list {
        font-size: 0.9rem;
    }
}

/* ========== */
@media (max-width: 560px) {
    .chapter-main-title {
        font-size: 1.5rem;
    }

    /* Video Section */
    .video-container {
        width: 85%;
        height: auto;
        margin-left: 5%;
    }

    .video-responsive {
        width: 90%;
    }

    .video-caption {
        font-size: 0.8rem;
    }
}

/* ========== */
@media (max-width: 500px) {
    .image-wrapper-v.right, 
    .image-wrapper-v.left {
        float: none;
        width: 100%;
        margin: 15px 28%;
    }

    .sonido span { font-size: 0.9rem; }

    .video-caption {
        font-size: 0.7rem;
    }

    .source-list {
        font-size: 0.8rem;
    }
}

/* ========== */
@media (max-width: 470px) {
    .chapter-main-title {
        font-size: 1.3rem;
    }
}

/* ========== */
@media (max-width: 420px) {
    .nav-arrow {
        display: none;
    }

    .chapter-main-title {
        padding: 0;
        margin: 0;
        font-size: 1.1rem;
    }

    .chapter-body h2 {
        font-size: 1rem;
    }

    .chapter-body p {
        line-height: 1.4;
        margin-bottom: 12px;
    }

    .chapter-body li {
        text-align: left;
        margin-bottom: 6px;
        line-height: 1.4;
    }

    .image-wrapper-v.right, 
    .image-wrapper-v.left {
        margin: 15px 24%;
    }

    .sonido span { font-size: 0.7rem; }

    /* Video Section */
    .video-container {
        width: 90%;
        margin-left: 2%;
    }

    .video-responsive {
        width: 100%;
    }

    .video-caption {
        font-size: 0.6rem;
    }

    .source-list {
        font-size: 0.7rem;
    }
}

/* ========== */
@media (max-width: 380px) {
    .chapter-body h2 {
        font-size: 0.8rem;
    }

    .image-wrapper-v.right, 
    .image-wrapper-v.left {
        margin: 15px 18%;
    }
}

/* ========== */
@media (max-width: 370px) {
    .chapter-main-title {
        font-size: 1rem;
    }
}

/* ========== */
@media (max-width: 360px) {
    .chapter-body h2 {
        font-size: 0.9rem;
    }

    .chapter-body p {
        font-size: 0.8rem;
    }

    .chapter-body li {
        font-size: 0.8rem;
    }

    .image-wrapper-v.right, 
    .image-wrapper-v.left {
        margin: 15px 14%;
    }

    /* Video Section */
    .video-container {
        width: 100%;
        margin-left: 0;
    }
}

/* ========== */
@media (max-width: 350px) {
    .chapter-main-title {
        font-size: 0.8rem;
    }
}

/* ========== */
@media (max-width: 340px) {
    .image-wrapper-v.right, 
    .image-wrapper-v.left {
        margin: 15px 12%;
    }
}

/* ========== */
@media (min-width: 501px) and (max-width: 540px) {
    .image-wrapper.right, 
    .image-wrapper.left {
        margin: 15px 10%;
    }
}

/* ========== */
@media (min-width: 481px) and (max-width: 500px) {
    .image-wrapper.right, 
    .image-wrapper.left {
        margin: 15px 8%;
    }
}

/* ========== */
@media (min-width: 441px) and (max-width: 480px) {
    .image-wrapper.right, 
    .image-wrapper.left {
        margin: 15px 6%;
    }
}

/* ========== */
@media (min-width: 421px) and (max-width: 440px) {
    .image-wrapper.right, 
    .image-wrapper.left {
        margin: 15px 0;
    }
}

/* ========== */
@media (min-width: 381px) and (max-width: 420px) {
    .image-wrapper.right, 
    .image-wrapper.left {
        max-width: 250px;
        margin: 15px 6%;
    }

    .chapter-img {
        max-width: 250px;
    }
}

/* ========== */
@media (min-width: 361px) and (max-width: 380px) {
    .image-wrapper.right, 
    .image-wrapper.left {
        max-width: 200px;
        margin: 15px 10%;
    }

    .chapter-img {
        max-width: 200px;
    }
}

/* ========== */
@media (min-width: 341px) and (max-width: 360px) {
    .image-wrapper.right, 
    .image-wrapper.left {
        max-width: 200px;
        margin: 15px 4%;
    }

    .chapter-img {
        max-width: 200px;
    }
}

/* ========== */
@media (min-width: 320px) and (max-width: 340px) {
    .image-wrapper.right, 
    .image-wrapper.left {
        max-width: 200px;
        margin: 15px 0;
    }

    .chapter-img {
        max-width: 200px;
    }

}
