/* Estilo sobrio para la documentación de la API (sobre el tema gitbook) */
:root {
  --d-text: #1f2937;
  --d-muted: #6b7280;
  --d-border: #e5e7eb;
  --d-bg-soft: #f9fafb;
  --d-accent: #1d4ed8;
  --d-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --d-sans: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

body, .book { font-family: var(--d-sans); color: var(--d-text); background: #fff; }

/* ---------- Barra lateral ---------- */
.book .book-summary {
  font-family: var(--d-sans);
  background: var(--d-bg-soft);
  border-right: 1px solid var(--d-border);
  color: var(--d-text);
}
#book-search-input { display: none; }
.book-summary ul.summary li a.custom-link,
.book-summary ul.summary li a.custom-link:hover {
  display: block;
  padding: 22px 20px 18px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  color: #111827;
  border-bottom: 1px solid var(--d-border);
  background: none;
}
.book-summary ul.summary li.divider { display: none; }
.book-summary ul.summary { padding-bottom: 24px; }
.book-summary ul.summary li a,
.book-summary ul.summary li span {
  display: block;
  padding: 7px 20px;
  font-size: 14px;
  line-height: 1.4;
  color: #4b5563;
  border-left: 2px solid transparent;
  background: transparent;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}
.book-summary ul.summary li a:hover {
  color: #111827;
  text-decoration: none;
  background: #f3f4f6;
}
.book-summary ul.summary li a[aria-current="page"] {
  color: var(--d-accent);
  font-weight: 600;
  background: #fff;
  border-left-color: var(--d-accent);
}
.book-summary ul.summary li ul.sub-menu li a { padding-left: 34px; }
.book-summary ul.summary li ul.sub-menu li ul.sub-menu li a { padding-left: 48px; font-size: 13px; }
.book-summary ul.summary > li > a[href="#"] {
  margin-top: 10px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--d-muted);
  pointer-events: none;
}

/* ---------- Cabecera de página ---------- */
.book-header { background: #fff; }
.book-header .btn { color: #9ca3af; }
.book-header .btn:hover { color: #111827; }
.book-header .book-title { font-family: var(--d-sans); font-size: 14px; font-weight: 500; color: var(--d-muted); }

/* ---------- Contenido ---------- */
.book-body .page-wrapper .page-inner { max-width: 820px; padding: 8px 32px 64px; }
.markdown-section {
  font-family: var(--d-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--d-text);
  overflow: visible;
}
.markdown-section .doc-breadcrumb {
  margin: 8px 0 6px;
  font-size: 13px;
  color: var(--d-muted);
}
.markdown-section .doc-breadcrumb a { color: var(--d-muted); }
.markdown-section .doc-breadcrumb a:hover { color: var(--d-accent); }

.markdown-section h1,
.markdown-section h2,
.markdown-section h3,
.markdown-section h4 {
  font-family: var(--d-sans);
  color: #111827;
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.markdown-section h1 { font-size: 34px; font-weight: 700; margin: 4px 0 10px; }
.markdown-section h2 {
  font-size: 24px;
  font-weight: 650;
  margin: 2.2em 0 .7em;
  padding-bottom: .35em;
  border-bottom: 1px solid var(--d-border);
}
.markdown-section h3 { font-size: 18px; font-weight: 650; margin: 1.8em 0 .5em; }
.markdown-section h4 { font-size: 16px; font-weight: 650; margin: 1.5em 0 .4em; }

.markdown-section p.note { margin: 0 0 22px; font-size: 13px; color: var(--d-muted); }
.markdown-section p.note small { font-size: inherit; }

.markdown-section p,
.markdown-section ul,
.markdown-section ol { margin: 0 0 1em; }
.markdown-section li { margin: .25em 0; }

.markdown-section a { color: var(--d-accent); text-decoration: none; }
.markdown-section a:hover { text-decoration: underline; text-underline-offset: 2px; }

.markdown-section img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--d-border);
  border-radius: 6px;
}

.markdown-section blockquote {
  margin: 0 0 1.2em;
  padding: 10px 16px;
  color: #374151;
  background: var(--d-bg-soft);
  border-left: 3px solid #9ca3af;
  border-radius: 0 6px 6px 0;
}
.markdown-section blockquote p:last-child { margin-bottom: 0; }

.markdown-section hr { border: 0; border-top: 1px solid var(--d-border); margin: 2em 0; }

/* ---------- Código ---------- */
.markdown-section code {
  font-family: var(--d-mono);
  font-size: .86em;
  padding: .15em .4em;
  background: #f3f4f6;
  border: 1px solid var(--d-border);
  border-radius: 4px;
  color: #111827;
}
.markdown-section pre,
.markdown-section .enlighter-default,
.markdown-section .enlighter-t-enlighter {
  font-family: var(--d-mono);
  font-size: 13px;
  line-height: 1.6;
  background: #f8fafc;
  border: 1px solid var(--d-border);
  border-radius: 6px;
  color: #1f2937;
  margin: 0 0 1.4em;
  padding: 14px 16px;
  overflow: auto;
}
.markdown-section pre code { padding: 0; background: none; border: 0; font-size: inherit; }

/* Bloques de código (SyntaxHighlighter) */
.markdown-section .syntaxhighlighter {
  width: 100% !important;
  max-height: 560px;
  margin: 0 0 1.5em !important;
  padding: 12px 0 !important;
  overflow: auto !important;
  background: #f8fafc !important;
  border: 1px solid var(--d-border);
  border-radius: 6px;
}
.markdown-section .syntaxhighlighter * { background: transparent !important; }
.markdown-section .syntaxhighlighter table {
  display: table;
  width: 100%;
  margin: 0;
  border: 0;
  background: none !important;
}
.markdown-section .syntaxhighlighter td {
  min-width: 0;
  padding: 0 !important;
  border: 0 !important;
  background: none !important;
  vertical-align: top;
}
.markdown-section .syntaxhighlighter td.gutter {
  padding: 0 12px 0 14px !important;
  text-align: right;
  border-right: 1px solid var(--d-border) !important;
  user-select: none;
}
.markdown-section .syntaxhighlighter td.gutter .line { color: #9ca3af !important; }
.markdown-section .syntaxhighlighter td.code { padding-left: 14px !important; }
.markdown-section .syntaxhighlighter .line {
  padding: 0 !important;
  background: none !important;
  font-family: var(--d-mono) !important;
  font-size: 13px !important;
  line-height: 1.65 !important;
  white-space: pre !important;
}
.markdown-section .syntaxhighlighter code {
  padding: 0 !important;
  background: none !important;
  border: 0 !important;
  border-radius: 0;
  font-family: var(--d-mono) !important;
  font-size: inherit !important;
  color: #1f2937 !important;
}
.markdown-section .syntaxhighlighter code.string { color: #0f766e !important; }
.markdown-section .syntaxhighlighter code.color1,
.markdown-section .syntaxhighlighter code.keyword { color: #1f2937 !important; font-weight: 600; }
.markdown-section .syntaxhighlighter code.plain,
.markdown-section .syntaxhighlighter code.value,
.markdown-section .syntaxhighlighter code.constants { color: #1f2937 !important; }

/* ---------- Tablas ---------- */
.markdown-section figure.wp-block-table {
  margin: 0 0 1.5em;
  overflow-x: auto;
  border: 1px solid var(--d-border);
  border-radius: 6px;
}
.markdown-section table,
.markdown-section table.has-fixed-layout {
  display: table;
  width: 100%;
  table-layout: auto;
  border-collapse: collapse;
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  border: 0;
  color: var(--d-text) !important;
  background: #fff !important;
}
.markdown-section .wp-block-table thead { border-bottom: 1px solid #d1d5db !important; }
.markdown-section table th {
  background: var(--d-bg-soft);
  color: #111827;
  font-weight: 600;
  text-align: left;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid #d1d5db;
  white-space: nowrap;
}
.markdown-section table td {
  padding: 10px 14px;
  vertical-align: top;
  border: 0;
  border-bottom: 1px solid var(--d-border);
  background: #fff;
}
.markdown-section table tr:nth-child(2n) td { background: #fff; }
.markdown-section table tbody tr:hover td { background: var(--d-bg-soft); }
.markdown-section table tr:last-child td { border-bottom: 0; }
.markdown-section table:has(th) td:first-child {
  font-family: var(--d-mono);
  font-size: 13px;
  white-space: nowrap;
}
.markdown-section table td { overflow-wrap: normal; word-break: normal; min-width: 120px; }
.markdown-section table td p { margin: 0; }

/* ---------- Navegación entre guías ---------- */
.markdown-section .doc-pager {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--d-border);
  font-size: 14px;
}
.markdown-section .doc-pager a {
  display: inline-block;
  padding: 9px 14px;
  color: #374151;
  background: #fff;
  border: 1px solid var(--d-border);
  border-radius: 6px;
}
.markdown-section .doc-pager a:hover {
  color: var(--d-accent);
  border-color: var(--d-accent);
  text-decoration: none;
}

/* ---------- Móvil ---------- */
@media (max-width: 600px) {
  .book-body .page-wrapper .page-inner { padding: 4px 18px 48px; }
  .markdown-section h1 { font-size: 27px; }
  .markdown-section h2 { font-size: 21px; }
}
