/* MDX prose typography (.doc) — imported only by DocLayout, so it ships only
 * with long-form pages (/docs/*, /changelog, /privacy). Non-doc pages (/)
 * never load these rules.
 *
 * `.doc pre` rules are wrapped in :where() so Tailwind utilities applied
 * directly on <CodeBlock>'s <pre> still win the cascade. Inline-code rules
 * use normal specificity because no component renders bare <code> inside MDX.
 */

.doc h1,
.doc h2,
.doc h3,
.doc h4,
.doc p,
.doc ul,
.doc ol,
.doc blockquote {
  max-width: 70ch;
}

.doc h1 {
  font-size: 2.25rem;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin: 0 0 1rem;
}

.doc h2 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
  margin: 3rem 0 0.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-line);
}

.doc h1 + h2 {
  border-top: 0;
  padding-top: 0;
  margin-top: 2.5rem;
}

.doc h3 {
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 2rem 0 0.5rem;
}

.doc h4 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 1.5rem 0 0.25rem;
}

.doc p {
  margin: 0 0 1rem;
  line-height: 1.7;
}

.doc strong {
  font-weight: 600;
  color: var(--color-ink);
}

.doc em {
  font-style: italic;
}

.doc a {
  color: var(--color-ink);
  text-decoration: underline;
  text-decoration-color: var(--color-line);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.15s ease;
}

.doc a:hover {
  text-decoration-color: var(--color-explicit);
}

.doc ul,
.doc ol {
  margin: 0 0 1.25rem;
  padding-left: 1.5rem;
}

.doc ul {
  list-style: disc;
}

.doc ol {
  list-style: decimal;
}

.doc li {
  margin: 0.4rem 0;
  padding-left: 0.25rem;
  line-height: 1.65;
}

.doc li::marker {
  color: var(--color-ink-soft);
}

.doc li > ul,
.doc li > ol {
  margin: 0.4rem 0;
}

.doc :not(pre) > code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: var(--color-panel);
  border: 1px solid var(--color-line);
  border-radius: 4px;
  padding: 0.1em 0.4em;
  color: var(--color-ink);
}

:where(.doc pre) {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.6;
  background: var(--color-panel);
  border: 1px solid var(--color-line);
  border-radius: 6px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin: 0 0 1.25rem;
}

:where(.doc pre code) {
  background: transparent;
  border: 0;
  padding: 0;
  font-size: inherit;
}

.doc table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0 2rem;
  font-size: 0.9rem;
}

.doc thead {
  border-bottom: 1px solid var(--color-line);
}

.doc th,
.doc td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--color-line);
  vertical-align: top;
}

.doc th {
  font-weight: 600;
  color: var(--color-ink-soft);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}

.doc tbody tr:hover {
  background: var(--color-panel);
}

.doc hr {
  border: 0;
  border-top: 1px solid var(--color-line);
  margin: 2.5rem 0;
}

.doc blockquote {
  border-left: 2px solid var(--color-explicit);
  padding-left: 1rem;
  margin: 1.5rem 0;
  color: var(--color-ink-soft);
  font-style: italic;
}

/* Component grids escape the 70ch text constraint (e.g. AgentLogo matrix). */
.doc .not-prose {
  max-width: none;
  margin: 1.5rem 0 2rem;
}

/* Vertical rhythm around <CodeBlock> instances embedded in MDX.              */
/* Targets the public `cb-wrap` class on CodeBlock's root element.            */
.doc .cb-wrap {
  margin: 0 0 1.25rem;
}
