/* Docs, examples and shared inner-page styles. Tokens come from styles.css. */

.nav__links a[aria-current="page"] { color: var(--heading); background: var(--tint); }

.mono { font-family: var(--mono); letter-spacing: -0.02em; }
.more { margin: 16px 0 0; }
.more a { color: var(--heading); font-weight: 700; text-decoration: none; }
.more a:hover { color: var(--cyan); }

/* Page header for index-style pages */
.page-head { padding: clamp(48px, 7vw, 88px) 0 clamp(24px, 4vw, 40px); }
.page-head h1 { font-size: clamp(2.2rem, 5vw, 3.6rem); }
.page-head .lede { margin-bottom: 0; }
.page-head .eyebrow a { text-decoration: none; }
.page-head .eyebrow a:hover { text-decoration: underline; }
.page-head__actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 28px; }
.page-head__actions .install { padding-right: 18px; }
.not-found { padding-bottom: clamp(80px, 12vw, 160px); }
.not-found a { color: var(--heading); font-weight: 700; }

/* Docs index */
.docs-index { padding-top: 0; }
.docs-index__section { margin-bottom: 48px; scroll-margin-top: 88px; }
.docs-index__section h2 { font-size: 1.4rem; margin-bottom: 16px; }
.doc-cards {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px;
}
.doc-cards a {
  display: block; height: 100%; padding: 16px 44px 16px 18px; position: relative;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  text-decoration: none; font-weight: 600; color: var(--ink);
  transition: border-color 0.15s ease;
}
.doc-cards a::after { content: "→"; position: absolute; right: 18px; top: 16px; color: var(--cyan); }
.doc-cards a:hover { border-color: var(--cyan); }
.examples--grid { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* Doc page: sidebar + article */
.docs-layout {
  display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 56px;
  padding-top: 40px; padding-bottom: 96px;
}
.docs-nav details { position: sticky; top: 92px; max-height: calc(100vh - 110px); overflow-y: auto; padding-right: 8px; }
.docs-nav summary { display: none; }
.docs-nav__title {
  margin: 20px 0 6px; font-size: 0.75rem; font-weight: 700;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent);
}
.docs-nav__title:first-of-type { margin-top: 0; }
.docs-nav ul { list-style: none; margin: 0; padding: 0; }
.docs-nav a {
  display: block; padding: 6px 10px; border-radius: 8px;
  font-size: 0.9rem; line-height: 1.35; text-decoration: none; color: var(--muted);
}
.docs-nav a:hover { color: var(--heading); background: var(--tint); }
.docs-nav a[aria-current="page"] { color: var(--heading); background: var(--tint); font-weight: 700; }

@media (max-width: 900px) {
  .docs-layout { grid-template-columns: 1fr; gap: 24px; padding-top: 24px; }
  .docs-nav details { position: static; max-height: none; border: 1px solid var(--line); border-radius: 14px; padding: 4px 12px; background: var(--surface); }
  .docs-nav summary { display: list-item; padding: 10px 0; font-weight: 700; color: var(--heading); cursor: pointer; }
  .docs-nav details:not([open]) summary { padding-bottom: 10px; }
  .docs-nav details[open] { padding-bottom: 12px; }
}

/* Rendered Markdown */
.prose { max-width: 760px; min-width: 0; }
.prose > :first-child { margin-top: 0; }
.prose h1 { font-size: clamp(2rem, 4.2vw, 2.8rem); margin-bottom: 24px; }
.prose h2 { font-size: 1.6rem; margin: 48px 0 16px; scroll-margin-top: 88px; }
.prose h3 { font-size: 1.2rem; margin: 32px 0 12px; scroll-margin-top: 88px; }
.prose h4 { font-size: 1rem; margin: 24px 0 8px; color: var(--heading); }
.prose p, .prose ul, .prose ol, .prose table, .prose blockquote { margin: 0 0 18px; }
.prose li { margin: 6px 0; }
.prose li > p { margin: 0; }
.prose a { color: var(--heading); text-decoration: underline; text-decoration-color: var(--cyan); text-underline-offset: 3px; text-decoration-thickness: 2px; }
.prose a:hover { color: var(--cyan); }
.prose code { background: var(--tint); color: var(--heading); padding: 0.1em 0.35em; border-radius: 6px; font-size: 0.86em; }
.prose pre {
  margin: 0 0 22px; padding: 18px 20px; overflow-x: auto; tab-size: 4;
  background: var(--code-bg); border-radius: 14px; border: 1px solid var(--code-line);
}
.prose pre code { background: none; color: var(--code-ink); padding: 0; font-size: 0.84rem; line-height: 1.7; }
.prose blockquote { border-left: 4px solid var(--cyan); padding: 4px 0 4px 18px; color: var(--muted); }
.prose blockquote p, .prose blockquote { font-size: 1rem; font-style: normal; font-weight: 400; letter-spacing: 0; }
.prose blockquote p::before, .prose blockquote p::after { content: none; }
.prose table { display: block; overflow-x: auto; border-collapse: collapse; font-size: 0.93rem; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.prose th { background: var(--tint); color: var(--heading); }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }

.doc-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 56px; }
.doc-pager a {
  display: flex; flex-direction: column; gap: 2px; padding: 16px 18px;
  border: 1px solid var(--line); border-radius: 14px; background: var(--surface);
  text-decoration: none; color: var(--heading); font-weight: 700;
}
.doc-pager a:hover { border-color: var(--cyan); color: var(--heading); }
.doc-pager span { font-size: 0.78rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; }
.doc-pager__next { grid-column: 2; text-align: right; }
@media (max-width: 560px) { .doc-pager { grid-template-columns: 1fr; } .doc-pager__next { grid-column: 1; } }
.doc-source { margin-top: 32px; font-size: 0.9rem; color: var(--muted); }
.doc-source a { color: var(--muted); }

/* Example page */
.example-body { display: grid; gap: 40px; padding-bottom: 96px; }
.example-body .window pre { max-height: 640px; }

/* Chroma wraps each line in a flex row; keep long lines scrolling, not wrapping. */
.chroma .line { display: block; }

/* Dogfooding section on the home page */
.dogfood { padding-top: 0; }
.dogfood__grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 48px; align-items: center; }
.dogfood__grid > * { min-width: 0; }
.dogfood p:not(.eyebrow) { color: var(--muted); margin: 16px 0 28px; }
@media (max-width: 880px) { .dogfood__grid { grid-template-columns: 1fr; } }
/* The example page already shows the name as its title. */
.example-body .prose > h1:first-child { display: none; }
