/* Estilos integrados y homogeneizados para máxima responsividad y reducción de dependencias externas */

/* ===== RESET Y BASE ===== */
html {
scroll-behavior: smooth;
scroll-padding-top: 80px;
}
body {
font-family: 'Inter', sans-serif;
background: #fef7e8;
color: #2c2418;
}

h1, h2, h3, h4, .navbar-brand, .toc-title, .leader-name {
  font-family: 'Merriweather', serif;
}

/* ===== CONTENEDOR PRINCIPAL ===== */
.container-custom {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===== NAVBAR ===== */
.navbar {
  background: linear-gradient(135deg, #1e3a2f 0%, #0f2c22 100%);
  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);
}

/* ===== BADGES ===== */
.badge-imperio, .badgeImperio {
  background: #2b4f3b;
  color: #d4af37;
  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;
}
.reign-badge, .badge-period {
  display: inline-block;
  background: #e9e2d0;
  padding: 0.2rem 0.8rem;
  border-radius: 40px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-bottom: 1rem;
  color: #4a5b4c;
}

/* ===== CARDS ===== */
.bio-card, .card-didactica {
  background: #ffffff;
  border-radius: 32px;
  line-height: 1.7;
  padding: 2rem;
  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, box-shadow 0.2s;
}
.bio-card:hover, .card-didactica:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 50px -12px rgba(0,0,0,0.15);
}

/* ===== TOC SIDEBAR ===== */
.toc-sidebar {
  background: #faf7f0;
  border-radius: 28px;
  padding: 1.5rem;
  position: sticky;
  top: 20px;
  border: 1px solid #d4b68a;
  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: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.toc-category {
  font-weight: 800;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #7b5a3e;
  margin: 1rem 0 0.5rem 0;
  padding-left: 0.5rem;
  border-left: 4px solid #d4af37;
}
.toc-item, .tocItem, .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;
}
.toc-item:hover, .tocItem:hover, .evento:hover {
  background: #e9dfd1;
  border-left-color: #2b4f3b;
  color: #2b4f3b;
}

/* ===== BIOGRAFÍAS ===== */
.biografia-item, .biografiaItem, .leader-bio-card {
  margin-bottom: 1.5rem;
  padding: 0.25rem 0;
  border-bottom: 1px dashed #e2d9c8;
}
.leader-bio-card {
  background: #fef9ef;
  padding: 1rem 1.2rem;
  border-radius: 20px;
  border-bottom: none;
  margin-bottom: 1.2rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}
.biografia-titulo, .leader-name {
  font-weight: 800;
  font-size: 1.4rem;
  color: #2c4b3b;
  margin-bottom: 0.5rem;
  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;
}

/* ===== ICONOS ===== */
.icon-category {
  background: #e9e2d0;
  padding: 0.2rem 0.8rem;
  border-radius: 40px;
  font-size: 0.8rem;
  font-weight: 600;
  margin-right: 1rem;
  color: #4a5b4c;
}

/* ===== BOTóN SUBIR ===== */
.btnSubir, #btnSubir {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: #2c4b3b;
  color: white;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  font-size: 1.8rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  transition: 0.2s;
  z-index: 1000;
}
.btnSubir:hover, #btnSubir:hover {
  background-color: #d4af37;
  color: #1e3a2f;
  transform: translateY(-3px);
}

/* ===== FOOTER ===== */
footer {
  background-color: #1e2a2e;
  margin-top: 3rem;
  color: #f5efe3;
  padding: 2rem 0;
}
footer a {
  color: #d4af37;
  text-decoration: none;
}
footer a:hover {
  text-decoration: underline;
}

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

/* ===== ZOOM EN IMÁGENES ===== */
.contenedor-imagen {
  width: 50%;
  overflow: hidden;
  margin: 0 auto;
}
.contenedor-imagen img {
  transition: transform 0.3s ease;
  display: block;
  width: 100%;
  height: auto;
}
.contenedor-imagen img:hover {
  transform: scale(1.5);
}

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

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

/* ===== SÍMBOLOS ===== */
.simbolo-item {
  padding: 1rem;
}
.simbolo-item i {
  font-size: 2rem;
  color: #d4af37;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 991px) {
  .toc-sidebar {
    position: relative;
    top: 0;
    max-height: 400px;
  }
}

@media (max-width: 768px) {
  .container-custom {
    padding: 0 1rem;
  }
  .bio-card, .card-didactica {
    padding: 1.2rem;
  }
  .toc-sidebar {
    position: relative;
    max-height: none;
  }
  .btnSubir, #btnSubir {
    bottom: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }
  .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;
  }
  .biografia-titulo, .leader-name {
    font-size: 1.2rem;
  }
}

/* ===== ILUSTRACIONES ===== */
.illustration {
  width: 100%;
  max-width: 600px;
  height: auto;
  display: block;
  margin: 1.5rem auto;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  border: 2px solid #d4af37;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.illustration:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 32px rgba(0,0,0,0.2);
}

/* Versión responsive para móviles */
@media (max-width: 768px) {
  .illustration {
    max-width: 100%;
    margin: 1rem auto;
  }
}

/* Para imágenes dentro de cards o contenedores específicos */
.bio-card .illustration,
.card-didactica .illustration {
  margin: 1rem auto;
  border-radius: 20px;
}

/* Galería de ilustraciones */
.galeria-ilustraciones {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
  margin: 2rem 0;
}

.galeria-ilustraciones .illustration {
  flex: 1;
  min-width: 250px;
  max-width: 350px;
  margin: 0;
}

/* Ilustración con pie de foto */
.figure-ilustration {
  text-align: center;
  margin: 1.5rem 0;
}

.figure-ilustration .illustration {
  margin: 0 auto 0.5rem auto;
}

.figcaption {
  font-size: 0.85rem;
  color: #7b5a3e;
  font-style: italic;
  margin-top: 0.5rem;
}