        
        h1{margin-top: 5px;}
        #main_img {
            max-width: 100%;
            display: flex;
            justify-content: center;



        }

        #main_img img {
          /*   border-radius: 12px;
            max-width: 600px;
            width: 100%; */

border-radius: 12px;
    /* max-width: 600px; */
    width: 100%;
    max-height: 600px;
    width: auto;
max-width: -webkit-fill-available;
        }

        #datos{
                /* padding: 10px;  */
    border-radius: 12px;
    border: solid 2px #e1e3ed;
    margin: 20px 0;
    padding-left: 12px;
    /* line-height: 10px;*/
        }

        .dark-mode #datos {
            background-color: #2b2e41;
            /* border: none; */
            border-color: #2b2e41;

        }

        /* GALERÍA CORREGIDA */
        .gallery {
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            padding: 10px;
            justify-content: center; /* Centra la última fila si hay pocos elementos */
        }

        .gallery-item {
            height: 250px;
            flex-grow: 0;
            max-width: 100%; /* Evita que rompa el esquema en mobile */
            box-sizing: border-box;
        }

        .gallery-item img {
            height: 100%;
            width: 100%;
            object-fit: cover;
            border-radius: 8px;
            transition: transform 0.3s ease;
            cursor: pointer;
            display: block;

        }

       .gallery-item img{border: solid #e1e3ed;}
         .dark-mode .gallery-item img{border: none;}
.gallery-item img:hover {
    transform: scale(1.02);
    cursor: pointer;
}


        /* MODAL */
        .modal {
            display: none;
            position: fixed;
            z-index: 1000;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba(0, 0, 0, 0.95);
            overflow: hidden;
            touch-action: none;
        }

        .modal-content {
            position: relative;
            display: flex;
            justify-content: center;
            align-items: center;
            width: 100%;
            height: 100%;
        }

        .mySlides {
            display: none;
            width: 100%;
            height: 100%;
            flex-direction: column;
            justify-content: center;
            align-items: center;
        }

        .mySlides img {
            max-height: 80vh;
            max-width: 90vw;
            user-select: none;
            transition: transform 0.1s ease-out;
            will-change: transform;
        }

        .caption-container {
            margin-top: 15px;
            color: #ccc;
            font-size: 14px;
            text-align: center;
        }

        .close {
            color: white;
            position: absolute;
            top: 20px;
            right: 30px;
            font-size: 40px;
            font-weight: bold;
            z-index: 1100;
            cursor: pointer;
        }

        .prev, .next {
            cursor: pointer;
            position: absolute;
            top: 50%;
            width: auto;
            padding: 20px;
            margin-top: -30px;
            color: white;
            font-weight: bold;
            font-size: 30px;
            user-select: none;
            z-index: 1100;
            text-decoration: none;
            background: rgba(0,0,0,0.3);
            border-radius: 16%;
            display: flex; /* Se controla por JS si hay > 1 imagen */
        }

        .next { right: 20px; }
        .prev { left: 20px; }

        /* HIDE NAV ON MOBILE/RESPONSIVE */
        @media (max-width: 768px) {
            .prev, .next {
                display: none !important; /* Desaparecen en responsive */
            }
            .gallery-item {
                height: 200px; /* Un poco más bajas en móvil */
                flex-grow: 1;
            }
        }

        .modal-open { overflow: hidden; }




        #next_prev_personaje{
            /* background-color: #ff00005c; */
    display: flex;
    justify-content: space-between;
    transition: transform .45s ease;

    margin-top: -110px;
    padding: 0px 10px;

        }
         #next_prev_personaje a{   display: flex;
    color: white;
    cursor: pointer;
    align-items: center;
    text-decoration: none;}

        #next_prev_personaje button{
            display: flex;
                align-items: center;

                display: flex;
    align-items: center;
    font-size: 30px;
  
    background-color: #67768b6e;
    border: none;
    color: white;
    padding: 11px;
    border-radius: 11px;
    background-color: #ffffff;
        border: solid #e1e3ed;

        }
#next_prev_personaje a {color: #000000;}
        
        .dark-mode  #next_prev_personaje button{   background-color: #2b2e41; border: none;}
 .dark-mode #next_prev_personaje a {color: white;}

        #next_prev_personaje button:hover{
transform: translateY(-5px);

         }
        .next_prev_thumb{      border-radius: 12px;
    overflow: hidden;
    /* height: 80px; */
    height: 55px;
    /* aspect-ratio: 1 / 1; */
}

.next_prev_thumb img{
        width: 100%;
    height: 100%;
    object-fit: cover;
}
#prevLink span{margin-right: 20px;margin-left: 10px;}
#nextLink span{margin-left: 20px;margin-right: 10px;}

@media screen and (max-width: 1300px) {
    #next_prev_personaje { margin-top: 0px;}
}
@media screen and (max-width: 439px) {
    /* #next_prev_personaje {justify-content: space-around;} */
    .next_prev_thumb {aspect-ratio: 1 / 1;}
}