/* ======== Fuente base y cuerpo ======== */
body {
  font-family: 'Segoe UI', 'Roboto', 'Helvetica Neue', sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  color: #333;
  background-color: #fff;
}

/* ======== Títulos ======== */
h1, h2, h3, h4 {
  font-family: 'Segoe UI Semibold', sans-serif;
  color: #004899; /* Azul institucional UDES */
  margin-top: 1.2em;
}

/* ======== Enlaces ======== */
a {
  color: #004899;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ======== Tablas ======== */
table {
  border-collapse: collapse;
  width: 100%;
  margin-bottom: 1.5em;
  font-size: 0.95rem;
}

th, td {
  border: 1px solid #ddd;
  padding: 8px;
  text-align: left;
}

th {
  background-color: #e3eaf6;
  color: #004899;
}

/* ======== Cajas de código ======== */
pre, code {
  background-color: #f4f4f4;
  color: #333;
  font-family: 'Courier New', monospace;
  padding: 0.2em 0.4em;
  border-radius: 4px;
}

/* ======== Bloques de código (R chunks) ======== */
pre {
  overflow-x: auto;
  padding: 1em;
  border: 1px solid #ccc;
}

/* ======== Cuadros de advertencia, nota, tip ======== */
div.callout-note {
  border-left: 5px solid #004899;
  background-color: #f0f5fb;
  padding: 1em;
  margin: 1em 0;
  border-radius: 5px;
}

div.callout-warning {
  border-left: 5px solid #c0392b;
  background-color: #fef2f2;
}

/* ======== Leyendas (figuras/tablas) ======== */
.caption {
  font-style: italic;
  color: #555;
  text-align: center;
  margin-top: 0.5em;
}

/* ======== Sidebar (modo lector) ======== */
.sidebar-title {
  background-color: #004899;
  color: #fff;
  padding: 1em;
}

.sidebar-item {
  border-bottom: 1px solid #ddd;
}

/* ======== Marco azul para figuras ======== */
img {
  border: 2px solid #004899;
  padding: 4px;
  border-radius: 6px;
  background-color: #fff;
} 

/* ======== Para evitar desbordes de Plotly ======== */
.plotly html-widget {
  width: 100% !important;
  overflow-x: auto;
}

/* Estilos para los íconos de la barra lateral */
.sidebar-tools {
  border-top: 1px solid #dee2e6;
  padding-top: 0.5rem;
  margin-top: 0.5rem;
}

.sidebar-tools .sidebar-tool {
  display: flex;
  align-items: center;
  padding: 0.375rem 0.75rem;
  margin: 0.125rem 0;
  border-radius: 0.375rem;
  color: #666;
  text-decoration: none;
  transition: all 0.15s ease-in-out;
}

.sidebar-tools .sidebar-tool:hover {
  background-color: rgba(4, 106, 56, 0.1);
  color: #046A38;
  text-decoration: none;
}

.sidebar-tools .sidebar-tool i {
  margin-right: 0.5rem;
  font-size: 1rem;
}

/* Estilos para el pie de página */
.page-footer {
  background-color: #f8f9fa;
  border-top: 1px solid #dee2e6;
  padding: 1.5rem 0;
  margin-top: 2rem;
}

.page-footer a {
  color: #666;
  text-decoration: none;
  transition: color 0.15s ease-in-out;
}

.page-footer a:hover {
  color: #046A38;
}

.page-footer i {
  font-size: 1.2rem;
}

/* Estilos para los íconos del repositorio (parte superior derecha) */
.navbar-nav .nav-link[href*="github"] {
  color: #666 !important;
}

.navbar-nav .nav-link[href*="github"]:hover {
  color: #046A38 !important;
}

/* Personalización del botón de modo lector */
.btn-reader-mode {
  background-color: #046A38;
  border-color: #046A38;
}

.btn-reader-mode:hover {
  background-color: #034d2a;
  border-color: #034d2a;
}

/* Estilos responsivos para móviles */
@media (max-width: 768px) {
  .page-footer {
    text-align: center;
  }
  
  .page-footer .col-md-4 {
    margin-bottom: 1rem;
  }
  
  .sidebar-tools .sidebar-tool {
    padding: 0.5rem;
    font-size: 0.9rem;
  }
}

img[src*="cover.png"] {
  max-width: 100%;   /* Puedes usar 100% si quieres que llene todo el ancho disponible */
  height: auto;
  display: block;
  margin: 2rem auto;
}

.caption {
  font-size: 0.85rem; /* Tamaño más pequeño */
}
