/* Documentation: home grid and article layout */

.prose {
  color: #d4d4d8;
  font-size: 17px;
  line-height: 1.75;
}

.prose p,
.prose ul {
  margin: 0 0 20px;
}

.prose h2 {
  color: var(--text);
  font-family: var(--font-mono);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.prose a {
  color: var(--text);
  text-decoration-color: rgba(237, 237, 234, 0.35);
  text-underline-offset: 3px;
}

/* Home */
.docs-sections {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 56px;
}

.docs-section {
  display: flex;
  flex-direction: column;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.docs-section > svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #c8c8cf;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.docs-section h2 {
  margin: 12px 0 2px;
  font-size: 16px;
  font-weight: 500;
}

.docs-section > p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.docs-section ul {
  display: grid;
  gap: 0;
  margin: 12px 0 0;
  padding: 8px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.docs-section li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 -8px;
  padding: 4px 8px;
  border-radius: 8px;
  color: #c8c8cf;
  font-size: 14px;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.docs-section li a:hover {
  background: rgba(237, 237, 234, 0.06);
  color: var(--text);
}

.docs-section li a .chev {
  opacity: 0;
  transition: opacity 0.15s ease;
}

.docs-section li a:hover .chev {
  opacity: 1;
}

.docs-help {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 72px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
}

.docs-help h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
}

.docs-help p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.docs-help__actions {
  display: flex;
  gap: 8px;
}

/* Article: sidebar, article, on-this-page */
.docs {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 200px;
  gap: 56px;
  align-items: start;
}

.docs-nav,
.docs-toc {
  position: sticky;
  top: 104px;
  max-height: calc(100vh - 128px);
  overflow-y: auto;
  scrollbar-width: thin;
}

/* Room for link highlights that extend past the text, inside the scroll clip */
.docs-nav {
  margin-left: -10px;
  padding-left: 10px;
}

.docs-nav__group + .docs-nav__group {
  margin-top: 4px;
}

.docs-nav__group[open] + .docs-nav__group,
.docs-nav__group[open]:not(:first-child) {
  margin-top: 16px;
}

summary.docs-nav__label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 16px 0 -10px;
  padding: 6px 10px;
  border-radius: 10px;
  cursor: pointer;
  list-style: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

summary.docs-nav__label::-webkit-details-marker {
  display: none;
}

summary.docs-nav__label::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.15s ease;
}

.docs-nav__group:not([open]) > summary.docs-nav__label::after {
  transform: rotate(-45deg);
}

summary.docs-nav__label:hover {
  background: rgba(237, 237, 234, 0.06);
  color: var(--text);
}

.docs-nav__group[open] > summary.docs-nav__label {
  margin-bottom: 4px;
}

.docs-nav__label,
.docs-toc__label {
  margin: 0 0 8px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.docs-nav ul,
.docs-toc ul {
  display: grid;
  gap: 1px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.docs-nav a {
  display: block;
  margin: 0 16px 0 -10px;
  padding: 6px 10px;
  border-radius: 10px;
  color: #c8c8cf;
  font-size: 14px;
  text-decoration: none;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.docs-nav a:hover {
  background: rgba(237, 237, 234, 0.06);
  color: var(--text);
}

.docs-nav a[aria-current="page"] {
  background: rgba(237, 237, 234, 0.08);
  color: var(--text);
}

.docs-nav:has(summary.docs-nav__label:hover) a[aria-current="page"] {
  background: transparent;
}

/* Collapsible on small screens; always open on desktop */
.docs-nav__toggle {
  display: none;
}

.docs-toc ul {
  border-left: 1px solid var(--line);
}

.docs-toc a {
  display: block;
  margin-left: -1px;
  padding: 4px 0 4px 14px;
  border-left: 1px solid transparent;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.docs-toc a:hover {
  color: var(--text);
}

.docs-toc a.is-active {
  border-left-color: var(--text);
  color: var(--text);
}

.docs-article {
  max-width: 720px;
}

.docs-article .page-title {
  margin-top: 0;
  font-size: clamp(34px, 4.5vw, 44px);
}

.docs-updated {
  margin-top: 16px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
}

.docs-article .prose {
  margin-top: 40px;
}

.docs-article .prose h2 {
  margin: 48px 0 12px;
  font-size: 22px;
  scroll-margin-top: 104px;
}

.docs-article .prose h3 {
  margin: 32px 0 8px;
  color: var(--text);
  font-size: 17px;
  font-weight: 500;
  scroll-margin-top: 104px;
}

.prose ol {
  margin: 0 0 20px;
  padding-left: 22px;
}

.prose li + li {
  margin-top: 6px;
}

.prose code,
.prose kbd {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(237, 237, 234, 0.06);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 0.85em;
}

.callout {
  display: flex;
  gap: 12px;
  margin: 28px 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #101012;
  font-size: 15px;
  line-height: 1.6;
}

.callout svg {
  flex: none;
  width: 18px;
  height: 18px;
  margin-top: 3px;
  fill: none;
  stroke: #c8c8cf;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.callout p {
  margin: 0;
}

.callout strong {
  color: var(--text);
  font-weight: 500;
}

.callout--tip svg {
  stroke: #6fbf8a;
}

.docs-figure {
  margin: 32px 0;
}

.docs-figure img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  transition: border-color 0.15s ease;
}

.docs-figure a {
  display: block;
  cursor: zoom-in;
}

.docs-figure a:hover img {
  border-color: rgba(255, 255, 255, 0.24);
}

.docs-figure figcaption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.docs-table {
  width: 100%;
  margin: 24px 0;
  border-collapse: collapse;
  font-size: 15px;
}

.docs-table th,
.docs-table td {
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.docs-table th {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.docs-pager {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.docs-pager a {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-self: start;
  color: #c8c8cf;
  font-size: 14px;
  text-decoration: none;
}

.docs-pager a > span:first-child {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.7;
}

.docs-pager__title {
  margin: 0 -10px;
  padding: 6px 10px;
  border-radius: 10px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.docs-pager a:hover .docs-pager__title {
  background: rgba(237, 237, 234, 0.06);
  color: var(--text);
}

.docs-pager .docs-pager__next {
  grid-column: 2;
  align-items: flex-end;
  justify-self: end;
  text-align: right;
}

@media (max-width: 1100px) {
  .docs {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 48px;
  }

  .docs-toc {
    display: none;
  }
}

@media (max-width: 960px) {
  .docs-sections {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .docs {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
  }

  .docs-nav {
    position: static;
    max-height: none;
    margin-left: 0;
    padding-left: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
  }

  .docs-nav__toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    font-size: 14px;
    cursor: pointer;
    list-style: none;
  }

  .docs-nav__toggle::-webkit-details-marker {
    display: none;
  }

  .docs-nav__toggle::after {
    content: "+";
    color: var(--muted);
    font-family: var(--font-mono);
  }

  .docs-nav[open] .docs-nav__toggle::after {
    content: "\2212";
  }

  .docs-nav__body {
    padding: 4px 16px 16px 26px;
  }
}

@media (max-width: 720px) {
  .docs-sections {
    grid-template-columns: minmax(0, 1fr);
  }

  .docs-pager {
    grid-template-columns: minmax(0, 1fr);
  }

  .docs-pager .docs-pager__next {
    grid-column: 1;
    align-items: flex-start;
    justify-self: start;
    text-align: left;
  }
}

.docs-help--quiet {
  margin-top: 12px;
}

.docs-pager__prev {
  grid-column: 1;
}

.docs-article > .page-lead {
  max-width: none;
}
