body {
            background-color: #f5efe3;
            font-family: 'Inter', sans-serif;
            color: #2d2d2a;
            scroll-behavior: smooth;
        }
        h1, h2, h3, h4, h5 {
            font-family: 'Merriweather', serif;
        }
        .navbar {
            background-color: #2b4f3b !important;
            box-shadow: 0 4px 12px rgba(0,0,0,0.2);
        }
        .navbar-brand {
            font-weight: 700;
            font-size: 1.4rem;
            color: white !important;
        }
        .nav-link {
            font-weight: 500;
            color: rgba(255,255,255,0.9) !important;
            border-radius: 30px;
        }
        .nav-link:hover {
            background: rgba(255,255,240,0.15);
        }
        .container-custom {
            max-width: 1400px;
            margin: 0 auto;
            padding: 0 20px;
        }
        /* TOC SIDEBAR (estilo exacto del original) */
        .toc-sidebar {
            background: #faf7f2;
            border-radius: 28px;
            padding: 1.5rem;
            box-shadow: 0 20px 40px -12px rgba(0,0,0,0.2);
            border: 1px solid #d4b68a;
            position: sticky;
            top: 2rem;
            max-height: calc(100vh - 4rem);
            overflow-y: auto;
            scrollbar-width: thin;
        }
        .toc-sidebar::-webkit-scrollbar {
            width: 6px;
        }
        .toc-sidebar::-webkit-scrollbar-track {
            background: #e9dfd1;
            border-radius: 10px;
        }
        .toc-sidebar::-webkit-scrollbar-thumb {
            background: #2b4f3b;
            border-radius: 10px;
        }
        .toc-title {
            font-size: 1.4rem;
            font-weight: 700;
            color: #2b4f3b;
            border-bottom: 3px solid #d4af37;
            padding-bottom: 0.75rem;
            margin-bottom: 1.25rem;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .toc-category {
            font-weight: 700;
            font-size: 1rem;
            margin-top: 1.2rem;
            margin-bottom: 0.5rem;
            padding-left: 0.5rem;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            color: #7b5a3e;
            border-left: 4px solid #d4af37;
        }
        .toc-item {
            display: block;
            padding: 0.4rem 0.8rem 0.4rem 2rem;
            color: #2d2d2a;
            text-decoration: none;
            border-radius: 8px;
            transition: all 0.2s;
            font-size: 0.95rem;
            border-left: 3px solid transparent;
        }
        .toc-item:hover {
            background: #e9dfd1;
            border-left-color: #2b4f3b;
            color: #2b4f3b;
        }
        /* Badge para imperios */
        .badge-imperio {
            background: #2b4f3b;
            color: #f5efe3;
            padding: 0.5rem 1.5rem;
            border-radius: 40px;
            font-weight: 600;
            display: inline-block;
            margin-bottom: 1rem;
            border: 1px solid #d4af37;
            font-size: 1.2rem;
        }
		
        .evento {
            display: block;
            padding: 0.4rem 0.8rem 0.4rem 2rem;
            color: #2d2d2a;
            text-decoration: none;
            border-radius: 8px;
            transition: all 0.2s;
            font-size: 0.95rem;
            border-left: 3px solid transparent;
        }
        .evento:hover {
            background: #e9dfd1;
            border-left-color: #2b4f3b;
            color: #2b4f3b;
        }		
        /* Cards didácticas (exactas al original) */
        .card-didactica {
            background: #ffffff;
            border-radius: 32px;
			line-height: 1.7;
            padding: 2rem 1rem;
            margin-bottom: 2rem;
            box-shadow: 0 20px 40px -12px rgba(0,0,0,0.1);
            border: 1px solid rgba(0,0,0,0.05);
            transition: transform 0.2s;
        }
        .card-didactica:hover {
            transform: translateY(-4px);
            box-shadow: 0 30px 50px -12px rgba(0,0,0,0.15);
        }
        .biografia-item {
            margin-bottom: 2rem;
            padding-bottom: 1.5rem;
            border-bottom: 1px dashed #d4b68a;
        }
        .biografia-titulo {
            font-size: 1.4rem;
            font-weight: 700;
            color: #2b4f3b;
            display: flex;
            align-items: center;
            gap: 0.5rem;
        }
        .biografia-subtitulo {
            font-size: 0.9rem;
            color: #7b5a3e;
            margin-bottom: 0.75rem;
            background: #f5efe3;
            display: inline-block;
            padding: 0.2rem 1rem;
            border-radius: 30px;
            border: 1px solid #d4b68a;
        }
        .biografia-texto {
            line-height: 1.7;
            text-align: left;
            font-size: 1rem;
        }
        .icon-category {
            background: #2b4f3b;
            color: #d4af37;
            width: 48px;
            height: 48px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            margin-right: 1rem;
        }
        #btnSubir {
            position: fixed;
            bottom: 30px;
            right: 30px;
            width: 50px;
            height: 50px;
            border-radius: 50%;
            background-color: #2b4f3b;
            color: #d4af37;
            border: none;
            box-shadow: 0 4px 10px rgba(0,0,0,0.3);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 1.5rem;
            z-index: 999;
            transition: all 0.3s;
        }
        #btnSubir:hover {
            background-color: #d4af37;
            color: #2b4f3b;
            transform: translateY(-3px);
        }
        footer {
            background: #2b4f3b;
            color: #f5efe3;
            margin-top: 3rem;
            padding: 2rem 0;
        }
        footer a {
            color: #d4af37;
            text-decoration: none;
        }
        footer a:hover {
            text-decoration: underline;
        }
        @media (max-width: 991px) {
            .toc-sidebar {
                position: relative;
                top: 0;
                max-height: 400px;
            }
        }
		
        .mapa-imperio {
            background: #e8e1d3;
            border-radius: 20px;
            padding: 1.5rem;
            margin: 2rem 0;
            text-align: center;
            border: 1px solid #d4c9b8;
        }
        .mapa-imperio img {
            max-width: 100%;
            border-radius: 16px;
            box-shadow: 0 10px 25px rgba(0,0,0,0.1);
            border: 3px solid white;
        }
        .leyenda-mapa {
            font-size: 0.85rem;
            color: #5b4e3e;
            margin-top: 0.5rem;
            font-style: italic;
        }


    /* Estilos para los botones de ampliar */
    .btn-ampliar {
        background: none;
        border: 1px solid #d4af37;
        color: #d4af37;
        font-size: 0.75rem;
        padding: 0.2rem 0.8rem;
        border-radius: 20px;
        cursor: pointer;
        transition: all 0.3s;
        margin-left: 10px;
        font-weight: 500;
        text-transform: lowercase;
    }
    
    .btn-ampliar:hover {
        background: #d4af37;
        color: #000;
    }
    
    /* Estilos para los modales */
    .modal-biografia {
        display: none;
        position: fixed;
        z-index: 1000;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.7);
        overflow-y: auto;
    }
    
    .modal-contenido {
        background-color: #fef9e7;
        margin: 5% auto;
        padding: 0;
        width: 80%;
        max-width: 700px;
        border-radius: 15px;
        box-shadow: 0 5px 30px rgba(0,0,0,0.3);
        border: 2px solid #d4af37;
        animation: modalAbrir 0.4s;
    }
    
    @keyframes modalAbrir {
        from {opacity: 0; transform: translateY(-50px);}
        to {opacity: 1; transform: translateY(0);}
    }
    
    .modal-header-custom {
        background: linear-gradient(135deg, #2a2a2a 0%, #3a3a3a 100%);
        color: #d4af37;
        padding: 15px 25px;
        border-radius: 13px 13px 0 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        border-bottom: 3px solid #d4af37;
    }
    
    .modal-header-custom h2 {
        margin: 0;
        font-size: 1.8rem;
        font-weight: 600;
        letter-spacing: 1px;
    }
    
    .btn-cerrar {
        background: none;
        border: none;
        color: #d4af37;
        font-size: 2.5rem;
        cursor: pointer;
        line-height: 1;
        padding: 0;
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s;
    }
    
    .btn-cerrar:hover {
        color: #fff;
        transform: scale(1.2);
    }
    
    .modal-body-custom {
        padding: 25px;
        color: #333;
        line-height: 1.7;
        font-size: 1.05rem;
        background: #fff9f0;
        border-radius: 0 0 13px 13px;
    }
    
    .modal-body-custom p {
        margin-bottom: 18px;
    }
    
    .modal-body-custom p:first-child {
        font-style: italic;
        color: #8b6b41;
        font-size: 1.2rem;
        border-bottom: 1px dashed #d4af37;
        padding-bottom: 10px;
    }
    
    /* Ajustes responsive */
    @media (max-width: 768px) {
        .modal-contenido {
            width: 95%;
            margin: 10% auto;
        }
        
        .modal-header-custom h2 {
            font-size: 1.4rem;
        }
        
        .btn-ampliar {
            display: block;
            margin: 10px 0 0 0;
            width: fit-content;
        }
    }


/* El contenedor es necesario para que la imagen no se desborde al hacer zoom */
.contenedor-imagen {
  width: 50%; /* <-- Aquí defines que el contenedor (y por tanto la imagen) ocupe el 50% */
  overflow: hidden; /* Esto es clave: esconde cualquier parte de la imagen que se salga al hacer zoom */
  margin: 0 auto; /* Opcional: centra el contenedor */
}

/* La imagen hereda el ancho del contenedor (50%) y es responsive por img-fluid */
.contenedor-imagen img {
  transition: transform 0.3s ease; /* Suaviza la animación */
  display: block; /* Elimina espacios extras típicos de img */
  width: 100%; /* Asegura que la imagen ocupe todo el contenedor */
  height: auto; /* Mantiene la proporción */
}

/* Efecto de lupa (zoom) al pasar el ratón */
.contenedor-imagen img:hover {
  transform: scale(1.5); /* Aumenta el tamaño de la imagen un 20% */
}	