/* === ESTILO V13.0 FINAL - ROYAL BLOOD "GOLD MASTER" === */
/* Robusto, Responsivo y con Identidad de Marca */

/* --- 1. REESCRITURA DEL SISTEMA (Variables Globales) --- */
:root {
  /* Forzamos al tema Just-the-Docs a usar nuestra paleta oscura */
  --body-background-color: #050505 !important;
  --body-text-color: #e0e0e0 !important;
  --link-color: #d4af37 !important;           /* ORO ROYAL */
  --nav-child-link-color: #999 !important;
  
  /* Sobrescribimos fondos de componentes para evitar cuadros blancos */
  --code-background-color: #111111 !important;
  --code-text-color: #e0e0e0 !important;
  --border-color: #222 !important;
  --search-background-color: #0a0a0a !important;
  --search-result-preview-color: #888 !important;
  
  /* NUESTRAS VARIABLES PERSONALIZADAS */
  --royal-gold: #d4af37;
  --royal-hover: #f1c40f;    /* Oro más brillante para interacciones */
  --bg-paneles: #0a0a0a;     /* Color para Sidebar y Header */
  --bg-activo: #1a1a1a;      /* Color de selección */
}

/* --- 2. BASE & TIPOGRAFÍA --- */
body, html, .page-content {
  background-color: var(--body-background-color) !important;
  color: var(--body-text-color) !important;
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
}

/* Títulos */
h1, h2, h3, h4, .site-title {
  color: #ffffff !important;
  letter-spacing: -0.02em;
}
h1 {
  border-bottom: 3px solid var(--royal-gold) !important;
  display: inline-block;
  padding-bottom: 0.5rem;
  margin-top: 2rem;
}

/* Links Generales */
a { color: var(--royal-gold) !important; text-decoration: none; }
a:hover { color: #fff !important; text-decoration: underline; }

/* Accesibilidad (Focus) */
:focus-visible {
  outline: 2px solid var(--royal-gold) !important;
  outline-offset: 4px;
}

/* --- 3. HEADER & SIDEBAR (Layout) --- */
.site-header, .side-bar {
  background-color: var(--bg-paneles) !important;
  background-image: none !important;
  border-color: var(--border-color) !important;
}

/* Logo & Título Sidebar */
.site-logo { display: none !important; } /* Ocultamos logo original */
.site-title {
  text-transform: uppercase;
  font-weight: 800;
  color: #fff !important;
  font-size: 1.3rem;
}

/* Enlaces Auxiliares (Top Right) */
.site-header .aux-links {
  background-color: transparent !important;
  height: 100%;
}
.site-header .aux-links a {
  color: var(--royal-gold) !important;
  font-weight: 700;
  font-size: 0.9rem;
}

/* Iconos SVG (Móvil) */
.site-header .menu-icon svg, 
.site-header .search-icon svg {
  fill: var(--royal-gold) !important;
}

/* --- 4. NAVEGACIÓN ROBUSTA (Menu Multinivel) --- */
/* Limpieza de estilos por defecto del tema */
.side-bar a::before, .side-bar a::after,
.site-nav .nav-list-link::before, .site-nav .nav-list-link::after {
  content: none !important;
}

/* Nivel 1 (Padres) */
.side-bar .nav-list > .nav-list-item > .nav-list-link {
  color: #aaa !important;
  background: transparent !important;
  font-weight: 500;
  border: none;
  padding-left: 1rem;
}

/* Nivel 2 (Hijos) - Sangría + Bullet Personalizado */
.side-bar .nav-list .nav-list-item .nav-list .nav-list-link {
  padding-left: 2.2rem;
  font-weight: 400;
  color: #888 !important;
  font-size: 0.95rem;
  position: relative;
}
/* El "punto" dorado */
.side-bar .nav-list .nav-list-item .nav-list .nav-list-link::before {
  content: "•";
  position: absolute;
  left: 1.2rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--royal-gold);
  opacity: 0.8;
}

/* ESTADOS ACTIVO & HOVER */
.nav-list .nav-list-link.active,
.nav-list .nav-list-link:hover {
  background-image: none !important;
  background-color: rgba(212, 175, 55, 0.15) !important; /* Oro sutil */
  border-left: 3px solid var(--royal-gold) !important;
  color: #fff !important;
}

/* Flechas de expansión */
.nav-list-expander svg { color: #555 !important; }
.nav-list-expander:hover svg { color: var(--royal-gold) !important; }


/* --- 5. EL BUSCADOR (Versión Definitiva) --- */
/* Contenedor de resultados */
.search-results-list {
  background-color: #050505 !important;
  border: 1px solid var(--royal-gold) !important;
  box-shadow: 0 20px 50px rgba(0,0,0,1) !important;
  padding: 0 !important;
}

/* Elementos individuales */
.search-results-list-item {
  background-color: #050505 !important;
  color: #ccc !important;
  border-bottom: 1px solid #333 !important;
  padding: 12px 15px !important;
}

/* HOVER / ACTIVO (Gris oscuro, NO blanco) */
.search-results-list-item.active,
.search-results-list-item:hover {
  background-color: #1a1a1a !important; 
  background-image: none !important;
  color: #fff !important;
}

/* Títulos dentro del buscador */
.search-result-title {
  color: var(--royal-gold) !important;
  font-weight: 700;
  display: block;
}
.search-results-list-item.active .search-result-title {
  text-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
}

/* Input */
.search-input {
  background-color: #111 !important;
  border: 1px solid #444 !important;
  color: #fff !important;
  border-radius: 4px;
}
.search-input:focus {
  border-color: var(--royal-gold) !important;
  box-shadow: 0 0 0 1px var(--royal-gold);
}


/* --- 6. COMPONENTES UI --- */
/* Botones Royal */
.btn {
  background: transparent !important;
  border: 2px solid var(--royal-gold) !important;
  color: var(--royal-gold) !important;
  text-transform: uppercase;
  font-weight: 700;
  border-radius: 0;
  padding: 0.6rem 1.2rem;
  transition: all 0.2s ease;
}
.btn:hover {
  background: var(--royal-gold) !important;
  color: #000 !important;
  box-shadow: 0 0 15px rgba(212, 175, 55, 0.6);
}

/* Bloques de Código */
code, pre, .highlighter-rouge {
  background-color: #111 !important;
  color: #ddd !important;
  border: 1px solid #333 !important;
  border-radius: 4px;
}

/* Tablas Transparentes */
table { display: block; width: 100%; overflow: auto; }
table, tr, td, th {
  background-color: transparent !important;
  border-color: #333 !important;
}
th {
  border-bottom: 2px solid var(--royal-gold) !important;
  color: #fff !important;
  white-space: nowrap;
}

/* Citas */
blockquote {
  border-left: 4px solid var(--royal-gold) !important;
  background: rgba(212, 175, 55, 0.05) !important;
  color: #ccc;
  font-style: italic;
  padding: 1rem;
  margin-left: 0;
}

/* Migas de pan (Breadcrumbs) */
.breadcrumbs li a { color: var(--royal-gold) !important; }
.breadcrumbs li { color: #666; }


/* --- 7. FOOTER & MÓVIL (Responsividad) --- */
/* Ocultamos footer default en escritorio */
footer.site-footer { display: none !important; }

/* Footer Personalizado */
.custom-footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid #222;
  color: #666;
  font-size: 0.9rem;
}

/* REGLAS MÓVILES (Max width 66rem) */
@media (max-width: 66rem) {
  /* Forzamos fondo oscuro en menú móvil */
  .site-nav { 
    background-color: var(--bg-paneles) !important; 
    border-right: none;
  }
  
  /* Footer móvil visible */
  footer.site-footer { 
    display: block !important; 
    background: var(--bg-paneles) !important; 
    color: #888 !important;
  }
  
  /* Ajuste buscador móvil */
  .search { margin-right: 0; }
}


/* --- 8. UTILIDADES EXTRA --- */
/* Video Responsivo (YouTube) */
.responsive-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%; /* 16:9 Aspect Ratio */
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #333;
}
.responsive-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Estilos de Impresión (Para PDF limpio) */
@media print {
  body, .page-content { 
    background: #fff !important; 
    color: #000 !important; 
  }
  .side-bar, .site-header, .btn { display: none !important; }
  .page-content { margin: 0 !important; width: 100% !important; }
  a { text-decoration: underline; color: #000 !important; }
  h1 { border-bottom-color: #000 !important; color: #000 !important; }
}