/* ===== Reset básico ===== */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* ===== Layout principal ===== */
.container {
  display: flex;
  min-height: 100vh;
  max-width: 1500px;
  margin: auto;
}

/* ===== Sidebar ===== */
.sidebar {
  width: 450px;
  flex-shrink: 0;
  background: #f0f9ff;
  border-right: 1px solid #bae6fd;
  padding: 2rem 1rem;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.sidebar ul { list-style: none; padding-left: 0; }
.sidebar li { margin: 0.8rem 0; }
.sidebar a {
  color: #0369a1;
  text-decoration: none;
  font-weight: 500;
}
.sidebar a:hover { text-decoration: underline; }

/* ===== Contenido centrado ===== */
.content {
  flex: 1;
  padding: 2rem 3rem;
  max-width: 1200px;
  line-height: 1.7;
}

/* ===== Tipografía ===== */
body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Ubuntu, "Helvetica Neue", Arial, sans-serif;
  background: #f9fafb;
  color: #1f2933;
  margin: 0;
  padding: 0;
}

/* ===== Headings ===== */
h1, h2, h3, h4 {
  font-weight: 600;
  line-height: 1.3;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: #0c4a6e;
}
h1 { font-size: 2.4rem; border-bottom: 2px solid #bae6fd; padding-bottom: 0.5rem; }
h2 { font-size: 1.8rem; border-bottom: 1px solid #bae6fd; padding-bottom: 0.3rem; }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.15rem; color: #075985; }

/* ===== Links ===== */
a { color: #0284c7; text-decoration: none; font-weight: 500; }
a:hover { text-decoration: underline; }
a:visited { color: #0369a1; }

/* ===== Inline code ===== */
code {
  font-family: "JetBrains Mono", "Fira Code", "Source Code Pro",
               Consolas, monospace;
  background: #e0f2fe;
  color: #000000;
  padding: 0.2em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

/* ===== Code blocks ===== */
pre {
  background: #e0f2fe;
  color: #000000;
  padding: 1rem;
  border-radius: 8px;
  overflow-x: auto;
  margin: 1.5rem 0;
  font-size: 0.9rem;
  border: 1px solid #bae6fd;
}
pre code { background: none; padding: 0; color: inherit; font-size: inherit; }

/* ===== Blockquotes ===== */
blockquote {
  border-left: 4px solid #3b82f6;
  background: #eff6ff;
  padding: 1rem 1.2rem;
  margin: 1.5rem 0;
  color: #1e3a8a;
  border-radius: 4px;
}

/* ===== Tables ===== */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 2rem 0;
  font-size: 0.95rem;
}
th, td { border: 1px solid #e5e7eb; padding: 0.6rem 0.8rem; text-align: left; }
th { background: #f1f5f9; font-weight: 600; }
tr:nth-child(even) { background: #fafafa; }

/* ===== Images ===== */
img { max-width: 100%; height: auto; display: block; margin: 1.5rem auto; border-radius: 6px; }

/* ===== Horizontal rule ===== */
hr { border: none; border-top: 1px solid #e5e7eb; margin: 3rem 0; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .container { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: relative; border-right: none; border-bottom: 1px solid #bae6fd; }
  .content { max-width: 100%; padding: 1.5rem 1rem; }
}

/* ===== Dark Mode ===== */
@media (prefers-color-scheme: dark) {
  body { background: #020617; color: #e5e7eb; }
  h1, h2, h3, h4 { color: #7dd3fc; border-color: #1e293b; }
  a { color: #38bdf8; } a:visited { color: #7dd3fc; }
  code { background: #0f172a; color: #e5e7eb; border-color: #1e293b; }
  pre { background: #020617; color: #e5e7eb; border-color: #1e293b; }
  blockquote { background: #020617; border-left-color: #38bdf8; color: #bae6fd; }
  .sidebar { background: #020617; border-color: #1e293b; }
}

