/* Site-only styles for the gallery. Everything else comes from Sensible UI. */

.docs-page {
  --container-width: 76rem;
}

.docs-github-icon {
  color: black;
}

.dark .docs-github-icon {
  color: white;
}

/* Landing: a display-size headline and a masonry showcase, which the
   library's typography and grid layouts do not provide. */
.landing-hero {
  padding-block: clamp(2rem, 6vw, 4rem) 1.5rem;
  --layout-gap: 1.25rem;
}

.landing-hero h1 {
  max-width: 16ch;
  margin: 0;
  font-size: clamp(2.25rem, 6vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
}

.landing-lead {
  font-size: 1.125rem;
  text-wrap: pretty;
}

.landing-agent {
  max-width: 60rem;
  margin: 0 auto 3rem;
  scroll-margin-top: 1rem;
}

.landing-showcase {
  columns: 3 18rem;
  column-gap: 1rem;
}

.landing-showcase > * {
  break-inside: avoid;
  margin-block-end: 1rem;
}

/* The docs sidebar sits on the page background so content scrolls under
   it cleanly while it sticks to the top of the viewport. */
.docs-nav {
  padding-block: 0.75rem;
  background: var(--background);
}

/* Collapse instantly so an in-page jump measures its target after the
   panel closes, not partway through the accordion height transition. */
.docs-nav details::details-content {
  transition: none;
}

.docs-section {
  padding-block: 3rem;
  /* Clears the sticky docs navigation when the layout stacks. */
  scroll-margin-top: 4.5rem;
}

.docs-section + .docs-section {
  border-top: 1px solid var(--border);
}

.docs-section > p,
.docs-subsection > p {
  max-width: 72ch;
}

.docs-section h2,
.docs-subsection h3 {
  margin: 0;
}

.docs-section > h3 {
  margin: 1rem 0 0;
}

.docs-subsection {
  padding-block: 1.5rem;
}

.docs-subsection + .docs-subsection {
  border-top: 1px dashed var(--border);
}

.docs-import {
  color: var(--muted-foreground);
  font-size: 0.875rem;
}

/* Gallery examples: a rendered preview above its highlighted source. */
.docs-example {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  background: var(--background);
}

.docs-preview {
  min-width: 0;
  padding: clamp(1rem, 4vw, 2rem);
}

.docs-preview.dark {
  background: var(--background);
  color: var(--foreground);
  color-scheme: dark;
}

.docs-preview > :is(.card:not([data-slot="table-container"]), form, figure) {
  max-width: 40rem;
}

.docs-preview figure img {
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.docs-example > sensible-code {
  border: 0;
  border-top: 1px solid var(--border);
  border-radius: 0;
}

.docs-code-only > sensible-code {
  border-top: 0;
}

.docs-example > sensible-code > pre {
  max-height: 24rem;
}

.docs-page pre code {
  user-select: text;
}

@media (width < 40rem) {
  .docs-section {
    padding-block: 2rem;
  }
}

/* Keeps the brand and actions on one header row on phones. */
@media (width < 30rem) {
  header sensible-navbar > a > code {
    display: none;
  }
}
