/* RadiAPS Tutoriales — estilo documentación (inspirado en Next.js Docs) */

:root {
  --docs-bg: #ffffff;
  --docs-bg-subtle: #fafafa;
  --docs-bg-muted: #f4f4f5;
  --docs-border: #e4e4e7;
  --docs-text: #18181b;
  --docs-text-muted: #71717a;
  --docs-text-subtle: #a1a1aa;
  --docs-accent: #0070f3;
  --docs-accent-hover: #0761d1;
  --docs-sidebar-width: 280px;
  --docs-toc-width: 220px;
  --docs-header-height: 56px;
  --docs-font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --docs-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  --docs-radius: 8px;
  --docs-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --docs-bg: #0a0a0a;
    --docs-bg-subtle: #111111;
    --docs-bg-muted: #1a1a1a;
    --docs-border: #27272a;
    --docs-text: #fafafa;
    --docs-text-muted: #a1a1aa;
    --docs-text-subtle: #71717a;
    --docs-accent: #3291ff;
    --docs-accent-hover: #0070f3;
    --docs-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--docs-font);
  font-size: 16px;
  line-height: 1.6;
  color: var(--docs-text);
  background: var(--docs-bg);
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--docs-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ── Header ── */

.docs-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--docs-header-height);
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--docs-border);
  background: color-mix(in srgb, var(--docs-bg) 92%, transparent);
  backdrop-filter: blur(8px);
}

.docs-header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.docs-menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 1px solid var(--docs-border);
  border-radius: var(--docs-radius);
  background: var(--docs-bg-subtle);
  color: var(--docs-text);
  cursor: pointer;
}

.docs-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--docs-text);
  text-decoration: none;
}

.docs-logo:hover {
  text-decoration: none;
  opacity: 0.85;
}

.docs-logo-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--docs-bg-muted);
  color: var(--docs-text-muted);
  border: 1px solid var(--docs-border);
}

.docs-header-nav a {
  font-size: 0.875rem;
  color: var(--docs-text-muted);
  margin-left: 1rem;
}

.docs-header-nav a:hover {
  color: var(--docs-text);
}

/* ── Layout ── */

.docs-shell {
  display: flex;
  min-height: calc(100vh - var(--docs-header-height));
}

.docs-sidebar {
  position: sticky;
  top: var(--docs-header-height);
  flex-shrink: 0;
  width: var(--docs-sidebar-width);
  height: calc(100vh - var(--docs-header-height));
  overflow-y: auto;
  border-right: 1px solid var(--docs-border);
  background: var(--docs-bg-subtle);
  padding: 1.25rem 0;
}

.docs-sidebar-inner {
  padding: 0 1rem;
}

.docs-nav-group {
  margin-bottom: 1.5rem;
}

.docs-nav-group-title {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--docs-text-subtle);
  margin: 0 0 0.5rem 0.75rem;
}

.docs-nav-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.docs-nav-list li a {
  display: block;
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
  color: var(--docs-text-muted);
  border-radius: 6px;
  text-decoration: none;
  line-height: 1.4;
}

.docs-nav-list li a:hover {
  color: var(--docs-text);
  background: var(--docs-bg-muted);
  text-decoration: none;
}

.docs-nav-list li a.is-active {
  color: var(--docs-text);
  font-weight: 600;
  background: var(--docs-bg-muted);
}

.docs-nav-list li a.is-disabled {
  color: var(--docs-text-subtle);
  pointer-events: none;
  cursor: default;
}

.docs-nav-list li a .badge {
  float: right;
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: var(--docs-bg-muted);
  color: var(--docs-text-subtle);
  border: 1px solid var(--docs-border);
}

.docs-main-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.docs-main {
  flex: 1;
  max-width: 768px;
  padding: 2.5rem 2rem 4rem;
}

.docs-toc {
  position: sticky;
  top: calc(var(--docs-header-height) + 1.5rem);
  flex-shrink: 0;
  width: var(--docs-toc-width);
  height: fit-content;
  max-height: calc(100vh - var(--docs-header-height) - 3rem);
  overflow-y: auto;
  padding: 2.5rem 1.25rem 2rem 0;
  display: none;
}

@media (min-width: 1280px) {
  .docs-toc {
    display: block;
  }
}

.docs-toc-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--docs-text-subtle);
  margin: 0 0 0.75rem;
}

.docs-toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--docs-border);
}

.docs-toc-list a {
  display: block;
  padding: 0.25rem 0 0.25rem 0.75rem;
  font-size: 0.8125rem;
  color: var(--docs-text-muted);
  text-decoration: none;
  line-height: 1.4;
  border-left: 2px solid transparent;
  margin-left: -1px;
}

.docs-toc-list a:hover {
  color: var(--docs-text);
}

.docs-toc-list a.is-active {
  color: var(--docs-accent);
  border-left-color: var(--docs-accent);
  font-weight: 500;
}

.docs-toc-list .depth-3 {
  padding-left: 1.25rem;
  font-size: 0.75rem;
}

/* ── Prose ── */

.docs-prose h1 {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  margin: 0 0 1rem;
}

.docs-prose h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 2.5rem 0 1rem;
  padding-top: 0.5rem;
  scroll-margin-top: calc(var(--docs-header-height) + 1rem);
}

.docs-prose h3 {
  font-size: 1.125rem;
  font-weight: 600;
  margin: 1.75rem 0 0.75rem;
  scroll-margin-top: calc(var(--docs-header-height) + 1rem);
}

.docs-prose p {
  margin: 0 0 1rem;
  color: var(--docs-text);
}

.docs-prose .lead {
  font-size: 1.125rem;
  color: var(--docs-text-muted);
  margin-bottom: 1.5rem;
}

.docs-prose ul,
.docs-prose ol {
  margin: 0 0 1rem;
  padding-left: 1.5rem;
}

.docs-prose li {
  margin-bottom: 0.35rem;
}

.docs-prose strong {
  font-weight: 600;
  color: var(--docs-text);
}

.docs-prose hr {
  border: none;
  border-top: 1px solid var(--docs-border);
  margin: 2rem 0;
}

.docs-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.docs-meta-item {
  font-size: 0.8125rem;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
  background: var(--docs-bg-muted);
  border: 1px solid var(--docs-border);
  color: var(--docs-text-muted);
}

.docs-meta-item strong {
  color: var(--docs-text);
  font-weight: 600;
}

/* Tables */

.docs-table-wrap {
  overflow-x: auto;
  margin: 1rem 0 1.5rem;
  border: 1px solid var(--docs-border);
  border-radius: var(--docs-radius);
}

.docs-prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.docs-prose th,
.docs-prose td {
  padding: 0.65rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--docs-border);
  vertical-align: top;
}

.docs-prose th {
  font-weight: 600;
  background: var(--docs-bg-muted);
  color: var(--docs-text);
  white-space: nowrap;
}

.docs-prose tr:last-child td {
  border-bottom: none;
}

.docs-prose tbody tr:hover td {
  background: color-mix(in srgb, var(--docs-bg-muted) 50%, transparent);
}

/* Code */

.docs-prose code {
  font-family: var(--docs-mono);
  font-size: 0.875em;
  padding: 0.15em 0.4em;
  border-radius: 4px;
  background: var(--docs-bg-muted);
  border: 1px solid var(--docs-border);
}

.docs-prose pre {
  margin: 1rem 0 1.5rem;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  border-radius: var(--docs-radius);
  background: var(--docs-bg-muted);
  border: 1px solid var(--docs-border);
  font-family: var(--docs-mono);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.docs-prose pre code {
  padding: 0;
  border: none;
  background: none;
  font-size: inherit;
}

/* Callouts */

.docs-callout {
  margin: 1.25rem 0;
  padding: 1rem 1.15rem;
  border-radius: var(--docs-radius);
  border: 1px solid var(--docs-border);
  background: var(--docs-bg-subtle);
  font-size: 0.9375rem;
}

.docs-callout-info {
  border-left: 3px solid var(--docs-accent);
}

.docs-callout-warn {
  border-left: 3px solid #f5a623;
}

.docs-callout-title {
  font-weight: 700;
  margin-bottom: 0.35rem;
  font-size: 0.875rem;
}

/* Cards grid (index) */

.docs-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.docs-card {
  display: block;
  padding: 1.25rem;
  border: 1px solid var(--docs-border);
  border-radius: var(--docs-radius);
  background: var(--docs-bg-subtle);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.docs-card:hover {
  border-color: var(--docs-accent);
  box-shadow: var(--docs-shadow);
  text-decoration: none;
}

.docs-card.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

.docs-card h3 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 600;
}

.docs-card p {
  margin: 0;
  font-size: 0.875rem;
  color: var(--docs-text-muted);
  line-height: 1.5;
}

.docs-card-status {
  display: inline-block;
  margin-top: 0.75rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
}

.docs-card-status.ok {
  background: #dcfce7;
  color: #166534;
}

.docs-card-status.pending {
  background: var(--docs-bg-muted);
  color: var(--docs-text-subtle);
  border: 1px solid var(--docs-border);
}

@media (prefers-color-scheme: dark) {
  .docs-card-status.ok {
    background: #14532d;
    color: #86efac;
  }
}

.docs-footer-note {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--docs-border);
  font-size: 0.8125rem;
  color: var(--docs-text-subtle);
}

/* Capturas de pantalla (viewport tablet) */

.docs-figure {
  margin: 1.75rem 0;
}

.docs-figure-frame {
  display: inline-block;
  max-width: 100%;
  padding: 0.65rem;
  background: var(--docs-bg-muted);
  border: 1px solid var(--docs-border);
  border-radius: calc(var(--docs-radius) + 4px);
  box-shadow: var(--docs-shadow);
}

.docs-figure img {
  display: block;
  width: 400px;
  max-width: 100%;
  height: auto;
  border-radius: var(--docs-radius);
  border: 1px solid var(--docs-border);
}

.docs-figure figcaption {
  margin-top: 0.65rem;
  font-size: 0.8125rem;
  color: var(--docs-text-muted);
  line-height: 1.5;
}

.docs-figure-grid {
  display: grid;
  gap: 1.25rem;
  margin: 1.75rem 0;
}

@media (min-width: 720px) {
  .docs-figure-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile sidebar overlay */

@media (max-width: 768px) {
  .docs-menu-btn {
    display: flex;
  }

  .docs-sidebar {
    position: fixed;
    left: 0;
    top: var(--docs-header-height);
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15);
  }

  .docs-sidebar.is-open {
    transform: translateX(0);
  }

  .docs-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    top: var(--docs-header-height);
    z-index: 35;
    background: rgba(0, 0, 0, 0.4);
  }

  .docs-sidebar-backdrop.is-open {
    display: block;
  }

  .docs-main {
    padding: 1.5rem 1.25rem 3rem;
  }

  .docs-prose h1 {
    font-size: 1.75rem;
  }
}
