/*
 * Styles for markdown-rendered documentation.
 *
 * The docs pages render raw markdown output (`<h2>`, `<p>`, `<table>`…) with no
 * utility classes, and Tailwind is loaded from the browser CDN, so those
 * elements need explicit styling here. Everything is scoped to `.docs-prose` so
 * it can't leak into the surrounding Tailwind-built page chrome.
 */

.docs-prose {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
  padding: 1.5rem;
  color: #4b5563;
  font-size: 0.875rem;
  line-height: 1.65;
}

/* ---- Headings ---- */

.docs-prose h2 {
  color: #111827;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 2.25rem 0 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e5e7eb;
}

.docs-prose h2:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.docs-prose h3 {
  color: #111827;
  font-size: 0.9375rem;
  font-weight: 600;
  margin: 1.75rem 0 0.5rem;
}

.docs-prose h4 {
  color: #111827;
  font-size: 0.875rem;
  font-weight: 600;
  margin: 1.25rem 0 0.375rem;
}

/* ---- Body copy ---- */

.docs-prose p {
  margin: 0 0 0.875rem;
}

.docs-prose p:last-child {
  margin-bottom: 0;
}

.docs-prose strong {
  color: #111827;
  font-weight: 600;
}

.docs-prose em {
  font-style: italic;
}

.docs-prose a {
  color: #4f46e5;
  font-weight: 500;
  text-decoration: none;
}

.docs-prose a:hover {
  text-decoration: underline;
}

.docs-prose hr {
  border: 0;
  border-top: 1px solid #e5e7eb;
  margin: 2rem 0;
}

/* ---- Lists ---- */

.docs-prose ul,
.docs-prose ol {
  margin: 0 0 0.875rem;
  padding-left: 1.375rem;
}

.docs-prose ul {
  list-style: disc;
}

.docs-prose ol {
  list-style: decimal;
}

.docs-prose li {
  margin-bottom: 0.3rem;
}

.docs-prose li > ul,
.docs-prose li > ol {
  margin: 0.3rem 0 0;
}

/* ---- Code ---- */

.docs-prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8125em;
  background: #f3f4f6;
  color: #4f46e5;
  border-radius: 0.25rem;
  padding: 0.1rem 0.3rem;
}

.docs-prose pre {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 0.875rem 1rem;
  overflow-x: auto;
  margin: 0 0 0.875rem;
}

.docs-prose pre code {
  background: none;
  color: #111827;
  padding: 0;
  font-size: 0.8125rem;
}

/* ---- Tables ---- */

.docs-table-wrap {
  overflow-x: auto;
  margin: 0 0 1rem;
}

.docs-prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
}

.docs-prose thead th {
  text-align: left;
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #6b7280;
  border-bottom: 1px solid #e5e7eb;
  padding: 0.5rem 0.75rem 0.5rem 0;
  white-space: nowrap;
}

.docs-prose tbody td {
  border-bottom: 1px solid #f3f4f6;
  padding: 0.7rem 0.75rem 0.7rem 0;
  vertical-align: top;
}

.docs-prose tbody tr:last-child td {
  border-bottom: 0;
}

.docs-prose tbody td:first-child {
  color: #111827;
  font-weight: 500;
  white-space: nowrap;
}

/* ---- Callouts ---- */

.docs-prose blockquote {
  background: #eef2ff;
  border: 1px solid #e0e7ff;
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  margin: 1.25rem 0;
  color: #3730a3;
}

.docs-prose blockquote p {
  margin-bottom: 0.5rem;
}

.docs-prose blockquote p:first-child {
  color: #312e81;
  font-weight: 600;
}

.docs-prose blockquote ul,
.docs-prose blockquote ol {
  margin-bottom: 0;
}

.docs-prose blockquote strong {
  color: #312e81;
}

.docs-prose blockquote code {
  background: rgb(99 102 241 / 0.12);
  color: #3730a3;
}

/* ---- Dark mode ---- */

.dark .docs-prose {
  background: #181e26;
  border-color: #374151;
  color: #9ca3af;
}

.dark .docs-prose h2 {
  color: #fff;
  border-top-color: #374151;
}

.dark .docs-prose h3,
.dark .docs-prose h4,
.dark .docs-prose strong,
.dark .docs-prose tbody td:first-child {
  color: #fff;
}

.dark .docs-prose a {
  color: #818cf8;
}

.dark .docs-prose code {
  background: #20282e;
  color: #a5b4fc;
}

.dark .docs-prose pre {
  background: #111416;
  border-color: #374151;
}

.dark .docs-prose pre code {
  color: #e5e7eb;
}

.dark .docs-prose hr,
.dark .docs-prose thead th,
.dark .docs-prose tbody td {
  border-color: #374151;
}

.dark .docs-prose thead th {
  color: #9ca3af;
}

.dark .docs-prose blockquote {
  background: rgb(99 102 241 / 0.1);
  border-color: rgb(99 102 241 / 0.2);
  color: #c7d2fe;
}

.dark .docs-prose blockquote p:first-child,
.dark .docs-prose blockquote strong {
  color: #a5b4fc;
}

.dark .docs-prose blockquote code {
  background: rgb(99 102 241 / 0.2);
  color: #c7d2fe;
}

/* ---- Mobile ---- */

@media (max-width: 640px) {
  .docs-prose {
    padding: 1.25rem;
  }

  .docs-prose h2 {
    font-size: 1.125rem;
  }
}
