/* ================================================================
   STYLE4.CSS  —  Análisis de Datos
   Primary: #0B3D91 (deep navy)   Accent: #059669 (emerald)
   ================================================================ */

/* ---- Layout -------------------------------------------------- */
.container-fluid {
  max-width: 1140px;
}

body {
  font-size: 1.05rem;
  line-height: 1.82;
  color: #111827;
}

/* ---- Typography ---------------------------------------------- */
h1, h2, h3, h4 {
  font-weight: 700;
  letter-spacing: -0.015em;
  color: #0B3D91;
}

h1 {
  font-size: 2.15rem;
  margin-top: 0.5rem;
  margin-bottom: 1.2rem;
  padding-bottom: 0.55rem;
  border-bottom: 3px solid #0B3D91;
}

h2 {
  font-size: 1.52rem;
  margin-top: 2.8rem;
  margin-bottom: 0.75rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid #D1D5DB;
}

h3 {
  font-size: 1.18rem;
  margin-top: 1.8rem;
  margin-bottom: 0.5rem;
  color: #1E3A8A;
}

h4 {
  font-size: 1.0rem;
  margin-top: 1.3rem;
  margin-bottom: 0.4rem;
  color: #374151;
  font-weight: 600;
}

p {
  margin-bottom: 1rem;
}

/* ---- Links --------------------------------------------------- */
a {
  color: #1D4ED8;
  text-decoration: none;
  border-bottom: 1px solid rgba(29, 78, 216, 0.22);
  transition: color 0.15s, border-color 0.15s;
}

a:hover {
  color: #1E40AF;
  border-bottom-color: rgba(30, 64, 175, 0.55);
  text-decoration: none;
}

/* Sidebar links should not show bottom border */
.sidebar a,
.book-summary a,
nav a {
  border-bottom: none;
}

/* ---- Inline code --------------------------------------------- */
code {
  font-size: 0.87em;
  color: #B91C1C;
  background: #FEF2F2;
  border: 1px solid rgba(185, 28, 28, 0.14);
  border-radius: 4px;
  padding: 0.09em 0.36em;
}

/* ---- Code blocks --------------------------------------------- */
pre {
  background: #1E293B;
  border: none;
  border-radius: 10px;
  padding: 1.1rem 1.4rem;
  margin: 1.3rem 0;
  overflow-x: auto;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

pre code {
  color: #CBD5E1;
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
  line-height: 1.65;
}

/* ---- Tables -------------------------------------------------- */
table {
  border-collapse: collapse;
  width: auto;
  min-width: 45%;
  margin: 1.6rem auto;
  font-size: 0.94rem;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08);
}

thead th {
  background: #0B3D91;
  color: #ffffff;
  font-weight: 600;
  padding: 0.65rem 1.1rem;
  text-align: left;
  border: none;
  letter-spacing: 0.01em;
}

tbody tr:nth-child(even) {
  background: #F1F5F9;
}

tbody tr:nth-child(odd) {
  background: #ffffff;
}

tbody tr:hover {
  background: #EFF6FF;
  transition: background 0.1s;
}

td {
  padding: 0.52rem 1.1rem;
  border-bottom: 1px solid #E5E7EB;
  color: #1F2937;
}

/* ---- Sidebar / TOC ------------------------------------------- */
.sidebar,
.book-summary {
  background: #F8FAFC;
  border-right: 1px solid #E5E7EB;
}

.sidebar .nav a {
  padding-top: 0.22rem;
  padding-bottom: 0.22rem;
  font-size: 0.91rem;
  color: #374151;
  border-bottom: none;
}

.sidebar .nav a:hover {
  color: #0B3D91;
}

/* ---- Page header --------------------------------------------- */
.page-header,
header {
  margin-bottom: 1.2rem;
}

/* ---- Book example boxes -------------------------------------- */
.bookexample {
  background: linear-gradient(135deg, #EEF2FF 0%, #E8EFFA 100%);
  border: 1px solid rgba(11, 61, 145, 0.18);
  border-left: 4px solid #0B3D91;
  border-radius: 0 8px 8px 0;
  padding: 16px 22px;
  margin: 20px 0 24px 0;
  box-shadow: 0 2px 10px rgba(11, 61, 145, 0.07);
}

.bookexample > p:last-child,
.bookexample > ul:last-child,
.bookexample > ol:last-child {
  margin-bottom: 0;
}

/* ---- Solution boxes ------------------------------------------ */
.solution {
  background: #F0FDF4;
  border: 1px solid rgba(5, 150, 105, 0.22);
  border-left: 4px solid #059669;
  border-radius: 0 8px 8px 0;
  padding: 14px 22px 14px 22px;
  margin: 10px 0 20px 0;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.06);
}

.solution::before {
  content: "Solution";
  display: block;
  font-weight: 700;
  color: #047857;
  margin-bottom: 10px;
  font-size: 0.78em;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.solution > p:last-child,
.solution > ul:last-child,
.solution > ol:last-child {
  margin-bottom: 0;
}

/* ---- Blockquotes (hints, notes) ------------------------------ */
blockquote {
  border-left: 3px solid #9CA3AF;
  margin: 1rem 0 1rem 0;
  padding: 0.4rem 1rem;
  color: #6B7280;
  font-style: italic;
  background: #F9FAFB;
  border-radius: 0 6px 6px 0;
}

blockquote p {
  margin-bottom: 0;
}

/* ---- Horizontal rules ---------------------------------------- */
hr {
  border: none;
  border-top: 1px solid #E5E7EB;
  margin: 2.2rem 0;
}

/* ---- Responsive ---------------------------------------------- */
@media (max-width: 900px) {
  .container-fluid { max-width: 100%; }
  body { font-size: 1rem; line-height: 1.75; }
  pre { border-radius: 6px; }
  table { min-width: 100%; }
}
