/* Forzar tema claro — sobreescribir todas las variables dark del tema */
html, html[data-theme="dark"], html[data-theme="light"] {
  --pst-color-background: #ffffff !important;
  --pst-color-on-background: #f8f8f8 !important;
  --pst-color-text-base: #1b1b1b !important;
  --pst-color-surface: #f0f0f0 !important;
  --pst-color-on-surface: #1b1b1b !important;
  --pst-color-border: #dddddd !important;
  --pst-color-heading: #1b1b1b !important;
  --bs-body-bg: #ffffff !important;
  --bs-body-color: #1b1b1b !important;
  color-scheme: light !important;
}

body {
  background-color: #ffffff;
  background-image: radial-gradient(circle, #e0e0e0 1px, transparent 1px);
  background-size: 15px 15px;
  color: #1b1b1b;
  font-family: 'Arial', sans-serif;
}

/* Colores para enlaces — #c0392b sobre blanco = 5.3:1 (WCAG AA) */
a {
  color: #c0392b !important;
  text-decoration: none;
}
a:hover {
  color: #922b21 !important;
  text-decoration: underline;
}

/* Encabezados */
h1, h2, h3, h4, h5, h6 {
  color: #c0392b !important;
  border-bottom: 2px solid #c0392b !important;
  padding-bottom: 5px;
}

/* Código y bloques de código */
pre, code {
  background-color: #f0f0f0 !important;
  color: #1b1b1b !important;
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
}

div.highlight pre {
  background-color: #f0f0f0 !important;
  color: #1b1b1b !important;
  padding: 10px;
  border-radius: 5px;
  overflow: auto;
  font-size: 0.95em;
}

/* Bordes y contenedores */
.container {
  border: 1px solid #cccccc !important;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 20px;
}

/* Celdas de tabla — blanco sobre #c0392b = 5.3:1 (WCAG AA) */
table {
  width: 100%;
  border-collapse: collapse;
}
table, th, td {
  border: 1px solid #cccccc !important;
}
th {
  background-color: #c0392b !important;
  color: white !important;
  padding: 10px;
}
td {
  background-color: #ffffff !important;
  color: #1b1b1b !important;
  padding: 10px;
}

/* Resaltado de advertencias e información */
.admonition {
  border-left: 4px solid #c0392b !important;
  padding: 15px;
  margin: 20px 0;
  background-color: #f9f9f9 !important;
  color: #1b1b1b !important;
  border-radius: 4px;
}
.admonition-title {
  color: #000000 !important;
  font-weight: bold;
}

/* Fijar el color de fondo y borde de las notas */
.admonition.note {
  background-color: #d0e7ff !important;
  border-left: 5px solid #0056b3 !important;
  padding: 15px;
  border-radius: 5px;
}

.admonition.warning {
  background-color: #ffcb87 !important;
  border-left: 5px solid #c27200 !important;
  padding: 15px;
  border-radius: 5px;
}

/* Título de la nota — #003d80 sobre #a0c4ff = 7.2:1 */
.admonition.note .admonition-title {
  background-color: #a0c4ff !important;
  color: #003d80 !important;
  font-weight: bold;
}

/* Título del warning — #000 sobre #c27200 bg */
.admonition.warning .admonition-title {
  background-color: #c27200 !important;
  color: #000000 !important;
  font-weight: bold;
}

/* Título del tip */
.admonition.tip .admonition-title {
  color: #000000 !important;
  font-weight: bold;
}

p.admonition-title::after {
  color: #000000 !important;
  content: "";
}

/* Mantener el fondo claro en los bloques de código */
.highlight {
  background-color: #ffffff !important;
  color: #1b1b1b !important;
  border-radius: 5px;
  padding: 10px;
  overflow: auto;
}

/* Colores de sintaxis — todos con ratio >= 4.5:1 sobre #f0f0f0 */
.highlight .kn { color: #0000CC !important; } /* import, from — 8.5:1 */
.highlight .nn { color: #005f8a !important; } /* numpy, matplotlib — 5.5:1 */
.highlight .k  { color: #0000CC !important; } /* as, def, return */
.highlight .nf { color: #0000CC !important; } /* funciones */
.highlight .n  { color: #1b1b1b !important; } /* Variables */
.highlight .p  { color: #1b1b1b !important; } /* Puntuación */
.highlight .mi { color: #6a3a09 !important; } /* Números — 6.2:1 */
.highlight .o  { color: #555555 !important; } /* Operadores — 5.5:1 */
.highlight .c1 { color: #006d00 !important; } /* Comentarios — 5.1:1 */
.highlight .s1 { color: #006d00 !important; } /* Strings verdes */
.highlight .sd { color: #006d00 !important; } /* Docstrings */
.highlight .s  { color: #a31515 !important; } /* Strings — 5.9:1 */
.highlight .kc { color: #a31515 !important; } /* Constantes */

/* Evitar que el modo oscuro modifique los colores */
html[data-theme="dark"] .highlight {
  background-color: #ffffff !important;
  color: #1b1b1b !important;
}

/* Botón de copiar */
.copybtn {
  background-color: #f0f0f0 !important;
  border: 1px solid #cccccc !important;
  color: #000000 !important;
  border-radius: 5px;
  padding: 5px;
  cursor: pointer;
}

.copybtn:hover {
  background-color: #e0e0e0 !important;
}

/* Títulos de capítulos en sidebar */
.caption-text {
  color: #c0392b !important;
}

/* Evitar cambios de color en imágenes en modo oscuro */
img {
  background-color: white !important;
  filter: none !important;
}

/* Botones */
button, .btn {
  padding: 10px 20px;
  font-size: 1em;
  border-radius: 5px;
  cursor: pointer;
}

/* Footer — #444 sobre blanco = 9.7:1 */
footer {
  color: #444444 !important;
  font-size: 0.8em;
  text-align: center;
  padding: 10px;
}
footer a {
  color: #c0392b !important;
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
  width: 10px;
  background-color: #ffffff !important;
}
::-webkit-scrollbar-thumb {
  background-color: #c0392b !important;
  border-radius: 5px;
}

/* Enlaces internos — #0044cc sobre blanco = 6.5:1 */
a.reference.internal {
  color: #0044cc !important;
  text-decoration: none;
}

a.reference.internal:hover {
  color: #003399 !important;
  text-decoration: underline;
}

#pst-primary-sidebar {
  background-color: white !important;
  color: black !important;
}

#pst-primary-sidebar a {
  color: black !important;
}

.theme-switch-button {
  display: none !important;
}

/* Barra de encabezado */
.header-article-items {
  background-color: #ffffff !important;
  color: #1b1b1b !important;
  border-bottom: 1px solid #dddddd;
}

/* Botones del header */
.header-article-item button,
.article-header-buttons button {
  background-color: #f8f8f8 !important;
  border: 1px solid #cccccc !important;
  color: #333333 !important;
  padding: 5px 10px;
  border-radius: 5px;
  cursor: pointer;
}

.header-article-item button:hover,
.article-header-buttons button:hover {
  background-color: #e0e0e0 !important;
}

/* Menús desplegables */
.dropdown-menu {
  background-color: #ffffff !important;
  border: 1px solid #dddddd !important;
}

/* Evitar filtros en íconos */
svg {
  filter: none !important;
}

.btn__text-container {
  color: #333333 !important;
}

/* Modo oscuro overrides */
html[data-theme="dark"] .header-article-items,
html[data-theme="dark"] .dropdown-menu {
  background-color: #ffffff !important;
  color: #1b1b1b !important;
}

html[data-theme="dark"] .btn,
html[data-theme="dark"] button {
  background-color: #f8f8f8 !important;
  color: #333333 !important;
}

.bd-header-article {
  background-color: white !important;
}

/* Barra lateral secundaria */
.bd-sidebar-secondary {
  background-color: #ffffff !important;
  color: #1b1b1b !important;
  border-left: 1px solid #dddddd;
}

.sidebar-secondary-items {
  background-color: #ffffff !important;
  color: #1b1b1b !important;
}

/* Tabla de contenido */
.page-toc {
  background-color: #ffffff !important;
  color: #1b1b1b !important;
  padding: 10px;
  border-bottom: 1px solid #dddddd;
}

.bd-toc-nav a {
  color: #1b1b1b !important;
}

.nav-item a {
  background-color: #ffffff !important;
  color: #1b1b1b !important;
  padding: 5px;
  border-radius: 5px;
}

.nav-item a:hover {
  background-color: #f0f0f0 !important;
  color: #c0392b !important;
}

/* Sección activa en TOC (scrollspy) */
.toc-entry a.nav-link.active,
#pst-page-toc-nav .nav-link.active,
#pst-page-toc-nav li.active > a {
  color: #c0392b !important;
  font-weight: 600 !important;
  background-color: transparent !important;
  box-shadow: inset 3px 0 0 #c0392b !important;
}

#pst-page-toc-nav .nav-item.active > .nav-link {
  color: #c0392b !important;
  font-weight: 600 !important;
  box-shadow: inset 3px 0 0 #c0392b !important;
}

/* Modo oscuro overrides para sidebar */
html[data-theme="dark"] .bd-sidebar-secondary,
html[data-theme="dark"] .sidebar-secondary-items,
html[data-theme="dark"] .page-toc {
  background-color: #ffffff !important;
  color: #1b1b1b !important;
}

