/* Documentation: left sidebar + main column only (no marketing top bar) */

:root {
  --docs-sidebar-width: 18rem;
  --docs-sidebar-bg: #f8fafc;
  --docs-sidebar-border: #e2e8f0;
  --docs-sidebar-active: #eff6ff;
  --docs-sidebar-text: #334155;
  --docs-sidebar-muted: #64748b;
  --docs-content-max: 48rem;
  --docs-gutter: clamp(1.5rem, 3.5vw, 3rem);
}

body.docs-has-sidebar {
  margin: 0 !important;
  max-width: none !important;
  padding: 0 !important;
}

.docs-shell {
  display: flex;
  align-items: stretch;
  min-height: 100vh;
  max-width: 100%;
  background: #f8fafc;
  gap: var(--docs-gutter);
  box-sizing: border-box;
  padding-right: clamp(0.5rem, 2vw, 1.25rem);
}

/* ——— Sidebar ——— */
.docs-sidebar {
  flex: 0 0 var(--docs-sidebar-width);
  width: var(--docs-sidebar-width);
  max-width: 100%;
  box-sizing: border-box;
  background: var(--docs-sidebar-bg);
  border-right: 1px solid var(--docs-sidebar-border);
  box-shadow: 1px 0 0 rgba(15, 23, 42, 0.04);
  position: sticky;
  top: 0;
  align-self: flex-start;
  max-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1.25rem 0.75rem 2rem;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 0.875rem;
  z-index: 10;
  -webkit-overflow-scrolling: touch;
}

.docs-sidebar-brand {
  display: block;
  font-weight: 700;
  font-size: 0.9375rem;
  color: #0f172a;
  text-decoration: none;
  padding: 0.25rem 0.75rem 0.35rem;
  margin: 0 0.35rem 0;
  letter-spacing: -0.02em;
}

.docs-sidebar-brand:hover {
  color: #2563eb;
}

.docs-sidebar-product {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--docs-sidebar-muted);
  text-decoration: none;
  padding: 0 0.75rem 0.9rem;
  margin: 0 0.35rem 0.85rem;
  border-bottom: 1px solid var(--docs-sidebar-border);
}

.docs-sidebar-product:hover {
  color: #2563eb;
}

.docs-sidebar-section-title {
  margin: 1rem 0 0.4rem;
  padding: 0 0.85rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--docs-sidebar-muted);
}

.docs-sidebar-section-title:first-of-type {
  margin-top: 0.25rem;
}

.docs-sidebar a.nav-link {
  display: block;
  padding: 0.45rem 0.75rem;
  margin: 0.1rem 0.35rem;
  color: var(--docs-sidebar-text);
  text-decoration: none;
  border-left: 3px solid transparent;
  border-radius: 0.375rem;
  line-height: 1.35;
}

.docs-sidebar a.nav-link:hover {
  background: #fff;
  color: #2563eb;
}

.docs-sidebar a.nav-link.is-active {
  background: var(--docs-sidebar-active);
  border-left-color: #2563eb;
  color: #1e40af;
  font-weight: 600;
}

.docs-sidebar a.nav-sublink {
  display: block;
  padding: 0.3rem 0.75rem 0.3rem 1.5rem;
  margin: 0 0.35rem;
  font-size: 0.8125rem;
  color: #64748b;
  text-decoration: none;
  line-height: 1.35;
  border-radius: 0.25rem;
}

.docs-sidebar a.nav-sublink:hover {
  color: #2563eb;
  background: rgba(255, 255, 255, 0.8);
}

.docs-sidebar .nav-subblock {
  margin-bottom: 0.65rem;
}

/* ——— Main column ——— */
#docs-main {
  flex: 1 1 auto;
  min-width: 0;
  max-width: min(var(--docs-content-max), 100%);
  box-sizing: border-box;
  background: #f8fafc;
  padding-top: clamp(0.75rem, 2vw, 1.35rem);
}

/* Horizontal breathing room inside the article (in addition to shell gap) */
#docs-main > *:not(.hero) {
  padding-left: clamp(0.25rem, 1vw, 0.75rem);
  padding-right: clamp(0.25rem, 1vw, 0.75rem);
}

#docs-main > *:first-child:not(.hero) {
  padding-top: 0;
}

/* Redundant with sidebar: inline mini-navs and back row */
#docs-main nav.doc,
#docs-main nav.doc-nav,
#docs-main .doc-nav,
#docs-main .back-link,
#docs-main > header.site {
  display: none !important;
}

@media (max-width: 52rem) {
  .docs-shell {
    flex-direction: column;
    gap: 0;
    padding-right: 0;
  }

  .docs-sidebar {
    flex: none;
    width: 100%;
    max-height: min(70vh, 28rem);
    position: relative;
    border-right: none;
    border-bottom: 1px solid var(--docs-sidebar-border);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
  }

  #docs-main {
    max-width: 100%;
    padding-top: 1rem;
  }

  #docs-main > *:not(.hero) {
    padding-left: clamp(1rem, 4vw, 1.5rem);
    padding-right: clamp(1rem, 4vw, 1.5rem);
  }
}
