/* Documentation polish (as-6ty.227). Presentation only; loaded after
   docs.css, so equal-specificity rules here win. Layout, the on-page
   contents list and the 3-column wide frame live in docs.css. */

/* Structure: the intro closes with a rule, sections breathe evenly. */
.docs-intro { margin-bottom: 36px; padding-bottom: 32px; border-bottom: 1px solid var(--border); }
.docs-article section { margin-bottom: 44px; }
.docs-article section:last-of-type { margin-bottom: 0; }
.docs-article h2 { margin-bottom: 16px; }
.docs-article section p,
.docs-article li { text-wrap: pretty; }
.docs-article ol { margin: 0; }
.docs-article li { margin: 12px 0; }
.docs-lead { color: var(--text-2); }

/* Sidebar: even rows, comfortable targets, one clear current marker. */
.docs-sidebar nav { gap: 2px; }
.docs-sidebar nav a {
  min-height: 44px;
  display: flex;
  align-items: center;
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  transition: color var(--t-base), background-color var(--t-base);
}
.docs-sidebar nav a[aria-current] { font-weight: 600; }

/* Notes and code. */
.docs-note { padding: 26px 28px; background: var(--bg-1); }
.docs-note h2 { margin-bottom: 12px; font-size: 1.25em; }
.docs-article pre {
  margin: 20px 0;
  padding: 16px 20px;
  background: var(--bg-0);
  border-color: var(--border-strong);
  border-radius: var(--r-md);
  line-height: 1.7;
}
.docs-article pre code { font-size: 14px; background: none; padding: 0; border: 0; }
.docs-article p code,
.docs-article li code {
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-1);
  font-size: .9em;
}
.docs-links { margin-top: 20px; }
.docs-links a { display: inline-flex; align-items: center; min-height: 44px; }

/* Cards: tighter headings, calmer hover, a visible keyboard state. */
.docs-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto 1fr;
  column-gap: 16px;
  align-items: start;
  padding: 22px 24px;
  transition: border-color var(--t-base), background-color var(--t-base);
}
.docs-card h2 { grid-column: 1; margin-bottom: 8px; font-size: 1.25em; line-height: 1.3; }
.docs-card p { grid-column: 1 / -1; }
.docs-card span { grid-column: 2; grid-row: 1; margin: 0; padding: 0; color: var(--text-2); font-size: 20px; line-height: 1.3; }
.docs-card:hover span { color: var(--text-1); }
@media (max-width: 1499px) { .docs-card:last-child:nth-child(odd) { grid-column: 1 / -1; } }
.docs-page .docs-card:focus-visible { outline-offset: 3px; border-radius: var(--r-lg); }

/* Glossary. */
.docs-glossary > div { padding: 26px 0; }
.docs-glossary dt { font-size: 1.25em; letter-spacing: -.02em; }
.docs-glossary dd { margin: 0; }

.docs-next a { display: inline-flex; align-items: center; min-height: 44px; }

@media (max-width: 640px) {
  /* One scrolling row of chips, so the page title leads the first screen. */
  .docs-sidebar { margin-bottom: 24px; padding-bottom: 16px; }
  .docs-sidebar nav {
    position: relative;
    display: flex;
    gap: 8px;
    margin-inline: -20px;
    padding-inline: 20px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 28px), transparent);
    mask-image: linear-gradient(90deg, transparent, #000 20px, #000 calc(100% - 28px), transparent);
  }
  .docs-sidebar nav::-webkit-scrollbar { display: none; }
  .docs-sidebar nav a {
    flex: none;
    white-space: nowrap;
    padding: 0 16px;
    font-size: 14px;
    border: 1px solid var(--border-strong);
    border-radius: 999px;
  }
  .docs-sidebar nav a[aria-current] { border-color: var(--accent); }
  .docs-intro { margin-bottom: 28px; padding-bottom: 24px; }
  .docs-article section { margin-bottom: 36px; }
  .docs-note { padding: 22px 20px; }
  .docs-article h2 { font-size: 21px; }
}
