/* Shildo docs. GitBook style layout */
:root {
  --docs-sidebar-w: 17.5rem;
  --docs-topbar-h: 3.5rem;
}

.docs-page {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-primary);
  color: var(--text-primary);
}

.docs-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.docs-topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--docs-topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 1.25rem;
  border-bottom: 1px solid var(--border-color);
  background: light-dark(rgba(255, 255, 255, 0.88), rgba(7, 8, 9, 0.92));
  backdrop-filter: blur(12px);
}

.docs-topbar-left,
.docs-topbar-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.docs-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 0.8125rem;
}

.docs-brand img {
  width: 1.75rem;
  height: 1.75rem;
}

.docs-topbar-title {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.docs-topbar-title strong {
  color: var(--text-primary);
  font-weight: 600;
}

.docs-nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--border-color);
  border-radius: 0.5rem;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
}

.docs-body {
  flex: 1;
  display: grid;
  grid-template-columns: var(--docs-sidebar-w) minmax(0, 1fr);
  min-height: calc(100vh - var(--docs-topbar-h));
}

.docs-nav {
  position: sticky;
  top: var(--docs-topbar-h);
  align-self: start;
  height: calc(100vh - var(--docs-topbar-h));
  overflow: auto;
  padding: 1.25rem 0.875rem 2rem;
  border-right: 1px solid var(--border-color);
  background: light-dark(#f8f9fc, #0a0b0e);
}

.docs-nav-group {
  margin-bottom: 1.25rem;
}

.docs-nav-label {
  display: block;
  padding: 0 0.75rem;
  margin-bottom: 0.375rem;
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.docs-nav-link {
  display: block;
  padding: 0.45rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}

.docs-nav-link:hover {
  color: var(--text-primary);
  background: light-dark(rgba(0, 82, 255, 0.06), rgba(255, 255, 255, 0.05));
}

.docs-nav-link.is-active {
  color: light-dark(var(--access-mid), var(--access-sky));
  background: light-dark(rgba(0, 82, 255, 0.08), rgba(26, 86, 255, 0.12));
  font-weight: 600;
}

.docs-main {
  padding: 2rem clamp(1.25rem, 4vw, 3rem) 4rem;
}

.docs-content {
  max-width: 48rem;
}

.docs-content h1 {
  font-size: clamp(1.75rem, 3vw, 2.125rem);
  letter-spacing: -0.03em;
  margin: 0 0 0.75rem;
  line-height: 1.15;
}

.docs-lead {
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text-secondary);
  margin: 0 0 2rem;
}

.docs-content h2 {
  font-size: 1.25rem;
  margin: 2rem 0 0.75rem;
  letter-spacing: -0.02em;
}

.docs-content h3 {
  font-size: 1rem;
  margin: 1.5rem 0 0.5rem;
}

.docs-content h4 {
  font-size: 0.9375rem;
  margin: 1.25rem 0 0.4rem;
  color: var(--text-primary);
}

.docs-content p,
.docs-content li {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--text-secondary);
}

.docs-content ul,
.docs-content ol {
  margin: 0.75rem 0 1rem;
  padding-left: 1.25rem;
}

.docs-content li + li {
  margin-top: 0.35rem;
}

.docs-content a {
  color: var(--accent-blue);
  text-decoration: none;
}

.docs-content a:hover {
  text-decoration: underline;
}

.docs-content code {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  padding: 0.12rem 0.35rem;
  border-radius: 0.35rem;
  background: light-dark(rgba(0, 82, 255, 0.07), rgba(255, 255, 255, 0.06));
  color: light-dark(var(--access-mid), var(--access-sky));
}

.docs-pre {
  margin: 1rem 0 1.25rem;
  padding: 1rem 1.1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border-color);
  background: light-dark(#f4f6fb, #0d1018);
  overflow: auto;
}

.docs-pre code {
  display: block;
  padding: 0;
  background: none;
  color: var(--text-primary);
  font-size: 0.8125rem;
  line-height: 1.6;
  white-space: pre;
}

.docs-table-wrap {
  overflow: auto;
  margin: 1rem 0 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: 0.75rem;
}

.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.docs-table th,
.docs-table td {
  padding: 0.65rem 0.85rem;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.docs-table th {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: light-dark(#f8f9fc, #0f1218);
}

.docs-table tr:last-child td {
  border-bottom: none;
}

.docs-callout {
  margin: 1.25rem 0;
  padding: 0.875rem 1rem;
  border-radius: 0.75rem;
  border: 1px solid light-dark(rgba(0, 82, 255, 0.15), rgba(94, 203, 255, 0.15));
  background: light-dark(rgba(0, 82, 255, 0.04), rgba(26, 86, 255, 0.08));
}

.docs-callout p {
  margin: 0;
  font-size: 0.875rem;
}

.docs-steps {
  display: grid;
  gap: 1rem;
  margin: 1.25rem 0 1.5rem;
}

.docs-step {
  padding: 1rem 1.1rem;
  border-radius: 0.75rem;
  border: 1px solid var(--border-color);
  background: light-dark(#fff, rgba(255, 255, 255, 0.02));
}

.docs-step-num {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--accent-blue);
  letter-spacing: 0.06em;
}

.docs-step h3 {
  margin: 0.35rem 0 0.4rem;
  font-size: 0.975rem;
}

.docs-step p {
  margin: 0;
  font-size: 0.875rem;
}

.docs-pager {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
}

.docs-pager a {
  font-size: 0.875rem;
  color: var(--accent-blue);
  text-decoration: none;
}

.docs-pager a:hover {
  text-decoration: underline;
}

.docs-backdrop {
  display: none;
}

@media (max-width: 900px) {
  .docs-nav-toggle {
    display: inline-flex;
  }

  .docs-topbar-title {
    display: none;
  }

  .docs-topbar-left {
    min-width: 0;
    flex: 1;
  }

  .docs-topbar-right .button.primary {
    display: none;
  }

  .docs-body {
    grid-template-columns: 1fr;
  }

  .docs-nav {
    position: fixed;
    top: var(--docs-topbar-h);
    left: 0;
    bottom: 0;
    width: min(88vw, var(--docs-sidebar-w));
    z-index: 50;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
  }

  .docs-nav.is-open {
    transform: translateX(0);
  }

  .docs-backdrop {
    display: block;
    position: fixed;
    inset: var(--docs-topbar-h) 0 0 0;
    z-index: 45;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
  }

  .docs-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }
}
