/* ---------- Three-pane docs layout ---------- */
.docs-shell {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 440px;
  gap: 0;
  max-width: 1440px;
  margin: 0 auto;
  min-height: calc(100vh - 60px);
  align-items: start;
}

/* Left pane — navigation */
.docs-sidebar {
  position: sticky;
  top: 60px;
  height: calc(100vh - 60px);
  overflow-y: auto;
  border-right: 1px solid var(--border);
  padding: 2rem 1rem 2rem 1.5rem;
  background: #fff;
  font-size: 0.9rem;
}
.docs-sidebar h5 {
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.09em;
  color: var(--fg-subtle);
  margin: 1.4rem 0 0.5rem;
  font-weight: 600;
}
.docs-sidebar h5:first-child { margin-top: 0; }
.docs-sidebar ul { list-style: none; padding: 0; margin: 0; }
.docs-sidebar li { margin: 0.1rem 0; }
.docs-sidebar a {
  display: block;
  padding: 0.35rem 0.6rem;
  color: var(--fg-muted);
  border-radius: 5px;
  font-weight: 400;
  border-left: 2px solid transparent;
}
.docs-sidebar a:hover { background: var(--bg-alt); text-decoration: none; color: var(--fg); }
.docs-sidebar a.active {
  color: var(--accent);
  background: rgba(0, 102, 204, 0.08);
  font-weight: 500;
}

/* Middle pane — prose */
.docs-content {
  padding: 2.5rem 3rem 6rem;
  max-width: 900px;
  min-width: 0;
}
.docs-content h1 { font-size: 2rem; margin: 0 0 0.4rem; }
.docs-content h2 {
  font-size: 1.35rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
}
.docs-content h2:first-of-type { border-top: none; padding-top: 0; margin-top: 2rem; }
.docs-content h3 { font-size: 1.05rem; }
.docs-content .lede {
  font-size: 1.08rem;
  color: var(--fg-muted);
  margin-bottom: 2rem;
}
.docs-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.92rem;
}
.docs-content th, .docs-content td {
  text-align: left;
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.docs-content th {
  font-weight: 600;
  color: var(--fg);
  background: var(--bg-alt);
  font-size: 0.83rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.docs-content td code { white-space: nowrap; }
.docs-content ul, .docs-content ol { color: var(--fg-muted); }
.docs-content li { margin: 0.35rem 0; }
.docs-content li > code { white-space: nowrap; }

.docs-content .callout {
  border-left: 3px solid var(--accent);
  background: rgba(0, 102, 204, 0.06);
  padding: 0.9rem 1.2rem;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 1.2rem 0;
  font-size: 0.93rem;
  color: var(--fg-muted);
}
.docs-content .callout strong { color: var(--fg); }
.docs-content .callout.warn { border-color: #f59e0b; background: rgba(245, 158, 11, 0.08); }
.docs-content .callout.danger { border-color: #ef4444; background: rgba(239, 68, 68, 0.08); }

.param-row {
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.2rem;
}
.param-row:last-child { border-bottom: none; }
.param-name { font-family: var(--font-mono); font-size: 0.88rem; color: var(--fg); font-weight: 600; }
.param-type { font-family: var(--font-mono); font-size: 0.78rem; color: var(--fg-subtle); display: block; margin-top: 0.15rem; font-weight: 400; }
.param-req { display: inline-block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: #d97706; font-weight: 600; margin-top: 0.25rem; }
.param-opt { display: inline-block; font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--fg-subtle); font-weight: 600; margin-top: 0.25rem; }
.param-desc { color: var(--fg-muted); font-size: 0.94rem; }
.param-desc p:first-child { margin-top: 0; }
.param-desc p:last-child { margin-bottom: 0; }

/* Right pane — code examples (sticky) */
.docs-code {
  position: sticky;
  top: 60px;
  align-self: start;
  height: calc(100vh - 60px);
  overflow-y: auto;
  padding: 2rem 1.75rem 2rem 0.5rem;
  background: transparent;
}
.code-block {
  background: var(--code-bg);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-md);
}
.code-block .code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1rem;
  background: #132c49;
  border-bottom: 1px solid var(--border-dark);
}
.code-block .code-title {
  color: #a8bccf;
  font-size: 0.78rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.code-tabs { display: flex; gap: 0.25rem; }
.code-tabs button {
  background: transparent;
  border: none;
  padding: 0.25rem 0.7rem;
  font-size: 0.78rem;
  color: #7a8fa6;
  cursor: pointer;
  font-family: var(--font-mono);
  border-radius: 4px;
  transition: all 0.15s ease;
}
.code-tabs button:hover { color: #e3e8ee; }
.code-tabs button.active {
  background: rgba(0, 204, 255, 0.2);
  color: #7de4ff;
}
.code-block pre {
  margin: 0;
  border-radius: 0;
  font-size: 0.82rem;
  padding: 1rem 1.2rem;
}
.code-block pre.hidden { display: none; }

.response {
  margin-top: 0.6rem;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-subtle);
  padding-left: 1rem;
}

.method {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  font-weight: 600;
  letter-spacing: 0.05em;
  vertical-align: middle;
  margin-right: 0.5rem;
}
.method.get    { background: #dbeafe; color: #1e40af; }
.method.post   { background: #dcfce7; color: #166534; }
.method.put    { background: #fef3c7; color: #92400e; }
.method.delete { background: #fee2e2; color: #991b1b; }

.endpoint {
  font-family: var(--font-mono);
  font-size: 0.92rem;
  color: var(--fg);
  background: var(--bg-alt);
  padding: 0.6rem 1rem;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  margin: 0.5rem 0 1.2rem;
}

.breadcrumb {
  font-size: 0.82rem;
  color: var(--fg-subtle);
  margin-bottom: 1rem;
}
.breadcrumb a { color: var(--fg-subtle); }
.breadcrumb a:hover { color: var(--accent); }

.next-prev {
  display: flex;
  justify-content: space-between;
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
  gap: 1rem;
}
.next-prev a {
  display: block;
  flex: 1;
  padding: 1rem 1.3rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--fg);
  transition: all 0.15s ease;
}
.next-prev a:hover { border-color: var(--accent); text-decoration: none; }
.next-prev a .label { font-size: 0.78rem; color: var(--fg-subtle); text-transform: uppercase; letter-spacing: 0.08em; }
.next-prev a .title { font-weight: 500; margin-top: 0.2rem; }
.next-prev a.next { text-align: right; }

@media (max-width: 1180px) {
  .docs-shell { grid-template-columns: 240px 1fr; }
  .docs-code {
    position: static;
    grid-column: 1 / -1;
    height: auto;
    padding: 0 1.5rem 2rem 1.5rem;
  }
  .docs-content { padding: 2rem 1.5rem 2rem; max-width: none; }
}
@media (max-width: 780px) {
  .docs-shell { grid-template-columns: 1fr; }
  .docs-sidebar {
    position: static;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .param-row { grid-template-columns: 1fr; gap: 0.3rem; }
}
