/* Docs pages. Loaded after styles.css, which brings the tokens, the nav and the footer. */
.docs-page .wrap { max-width: 1240px; }
.nav-links a[aria-current] { color: var(--text); }

.docs { display: grid; grid-template-columns: 210px minmax(0, 1fr) 190px; gap: 56px; align-items: start; padding-top: 28px; padding-bottom: 80px; }
.docs a:focus-visible, .docs-toggle:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* Page menu */
.docs-side, .docs-toc { position: sticky; top: 20px; max-height: calc(100vh - 40px); overflow-y: auto; }
.docs-toggle { display: none; }
.docs-nav { display: flex; flex-direction: column; gap: 2px; }
.docs-nav a { padding: 7px 12px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: 15px; line-height: 1.35; }
.docs-nav a:hover { color: var(--text); }
.docs-nav a[aria-current] { background: var(--bg-3); color: var(--text); font-weight: 500; box-shadow: inset 2px 0 var(--orange); }

/* On this page */
.docs-toc { display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; line-height: 1.4; }
.docs-toc p { margin: 0 0 4px; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.docs-toc a { color: var(--muted); text-decoration: none; }
.docs-toc a:hover, .docs-toc a[data-current] { color: var(--text); }

/* Page content */
.prose { overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose h1 { font-size: clamp(28px, 5vw, 38px); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 16px; }
.prose h2 { font-size: 24px; line-height: 1.25; letter-spacing: -0.01em; margin: 52px 0 14px; }
.prose h3 { font-size: 18px; line-height: 1.3; font-weight: 500; margin: 32px 0 10px; }
.prose h2, .prose h3 { scroll-margin-top: 20px; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre, .table-wrap, .shot { margin: 0 0 18px; }
.prose ul, .prose ol { padding-left: 24px; }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--muted); }
.prose strong { font-weight: 500; }
.prose a { text-decoration-color: var(--orange); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.prose a:hover { color: var(--orange); }
.prose code { padding: 1px 6px; background: var(--bg-3); border: 1px solid var(--line); border-radius: 6px; font: .875em var(--mono); }
.prose pre { padding: 14px 16px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); overflow-x: auto; }
.prose pre code { padding: 0; background: none; border: 0; }
.prose blockquote { padding: 12px 16px; background: var(--bg-2); border: 1px solid var(--line); border-left: 3px solid var(--orange); border-radius: 8px; color: var(--muted); }
.prose blockquote > :last-child { margin-bottom: 0; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.prose th, .prose td { padding: 10px 14px; text-align: left; vertical-align: top; }
.prose th { background: var(--bg-2); color: var(--muted); font-size: 13px; font-weight: 500; white-space: nowrap; }
.prose td { border-top: 1px solid var(--line); }

/* Screenshots */
.shot { display: block; cursor: zoom-in; }
.shot img { display: block; width: 100%; height: auto; border: 1px solid var(--line); border-radius: 10px; }
.zoom { max-width: none; max-height: none; padding: 0; border: 0; background: none; cursor: zoom-out; }
.zoom::backdrop { background: rgba(0, 0, 0, .82); }
.zoom img { display: block; width: auto; height: auto; max-width: 96vw; max-height: 94vh; border-radius: 8px; }

/* Previous / next */
.docs-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 56px; }
.docs-pager a { display: block; padding: 14px 18px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); text-decoration: none; font-weight: 500; line-height: 1.35; }
.docs-pager a:hover { border-color: var(--orange); }
.docs-pager a[rel="next"] { text-align: right; }
.docs-pager small { display: block; margin-bottom: 2px; color: var(--muted); font-size: 12px; font-weight: 400; }

@media (max-width: 1100px) {
  .docs { grid-template-columns: 210px minmax(0, 1fr); gap: 40px; }
  .docs-toc { display: none; }
}

/* On narrow screens the page menu folds under a button. Without JavaScript it stays open. */
@media (max-width: 820px) {
  .docs { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-top: 8px; }
  .docs-side { position: static; max-height: none; }
  .js .docs-toggle {
    display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; padding: 10px 14px;
    background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text);
    font: 500 15px/1.35 "Ubuntu", sans-serif; text-align: left; cursor: pointer;
  }
  .docs-toggle small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
  .docs-toggle svg { width: 18px; height: 18px; flex: none; }
  .docs-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
  .js .docs-toggle[aria-expanded="false"] + .docs-nav { display: none; }
  .js .docs-nav { margin-top: 8px; }
  .prose h2 { margin-top: 40px; }
}
