/* ─── Base ───────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
}

.docs-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  font-family: 'IBM Plex Sans JP', 'Hiragino Kaku Gothic ProN', 'Yu Gothic', sans-serif;
  color: #1f2937;
  line-height: 1.7;
}

/* ─── Sidebar ────────────────────────────────────────────── */
.docs-sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #111827;
  color: #d1d5db;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.25rem 1.25rem;
  border-bottom: 1px solid #1f2937;
}

.brand-logo {
  width: 36px;
  height: 36px;
  background: #3b82f6;
  color: #fff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  flex-shrink: 0;
  font-family: 'JetBrains Mono', Consolas, monospace;
}

.brand-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #f9fafb;
  line-height: 1.2;
}

.brand-sub {
  font-size: 0.68rem;
  color: #6b7280;
  margin-top: 0.15rem;
}

.sidebar-nav {
  flex: 1;
  padding: 0.75rem 0;
}

.nav-link {
  display: block;
  padding: 0.5rem 1.25rem;
  color: #babfc7;
  text-decoration: none;
  font-size: 0.82rem;
  transition: color 0.15s, background 0.15s;
  border-left: 3px solid transparent;
}

.nav-link:hover {
  color: #f9fafb;
  background: rgba(255, 255, 255, 0.05);
}

.nav-link.is-active {
  color: #60a5fa;
  border-left-color: #3b82f6;
  background: rgba(59, 130, 246, 0.1);
}

.sidebar-footer {
  padding: 1rem 1.25rem;
  border-top: 1px solid #1f2937;
  font-size: 0.72rem;
  color: #4b5563;
}

.sidebar-footer p {
  margin: 0 0 0.3rem;
}

.x-link {
  color: #6b7280;
  text-decoration: none;
}

.x-link:hover {
  color: #babfc7;
}

/* ─── Main content ───────────────────────────────────────── */
.docs-main {
  flex: 1;
  min-width: 0;
  background: #f9fafb;
}

/* ─── Hero ───────────────────────────────────────────────── */
.docs-hero {
  padding: 3rem 2.5rem 2.5rem;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
}

.hero-title {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  font-weight: 700;
  color: #111827;
  margin: 0 0 0.75rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  line-height: 1.3;
}

.version-badge {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.65rem;
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  border-radius: 20px;
  letter-spacing: 0.04em;
  font-family: 'JetBrains Mono', Consolas, monospace;
}

.hero-desc {
  margin: 0;
  color: #4b5563;
  font-size: 0.95rem;
}

.hero-desc code {
  background: #f3f4f6;
  color: #1d4ed8;
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: 'JetBrains Mono', Consolas, monospace;
}

/* ─── Sections ───────────────────────────────────────────── */
.doc-section {
  border-bottom: 1px solid #e5e7eb;
}

.doc-section--split {
  display: grid;
  grid-template-columns: 1fr 380px;
}

.doc-text {
  padding: 2.5rem 2.5rem;
  background: #fff;
}

/* ─── Section headings ───────────────────────────────────── */
.section-heading {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
  margin: 0 0 0.5rem;
  padding-left: 0.75rem;
  border-left: 4px solid #3b82f6;
  line-height: 1.3;
}

.section-desc {
  color: #6b7280;
  margin: 0.5rem 0 1.5rem;
  font-size: 0.92rem;
}

/* ─── Info cards ─────────────────────────────────────────── */
.info-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.info-card {
  background: #fff;
  border: 1px solid #d1d5db;
  border-top: 3px solid #3b82f6;
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  min-width: 160px;
}

.info-card--wide {
  flex: 1;
  min-width: 280px;
}

.info-card-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #2563eb;
  margin-bottom: 0.4rem;
}

.info-card-value {
  font-size: 0.92rem;
  color: #111827;
}

.info-card-value code {
  background: #f3f4f6;
  color: #1d4ed8;
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.88em;
  font-family: 'JetBrains Mono', Consolas, monospace;
}

/* ─── Endpoint bar ───────────────────────────────────────── */
.endpoint-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  margin: 0 0 1.5rem;
}

.badge-get {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  background: #10b981;
  color: #fff;
  border-radius: 5px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  font-family: 'JetBrains Mono', Consolas, monospace;
  flex-shrink: 0;
}

.endpoint-bar code {
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 0.86rem;
  color: #111827;
  word-break: break-all;
}

/* ─── Param headings ─────────────────────────────────────── */
.param-heading {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #6b7280;
  margin: 1.5rem 0 0.6rem;
}

/* ─── Tables ─────────────────────────────────────────────── */
.param-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  margin-bottom: 0.25rem;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  overflow: hidden;
}

.param-table th {
  background: #f3f4f6;
  color: #374151;
  font-weight: 600;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.5rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid #d1d5db;
}

.param-table td {
  padding: 0.55rem 0.8rem;
  border-bottom: 1px solid #f3f4f6;
  vertical-align: top;
  color: #374151;
}

.param-table tbody tr:nth-child(even) td {
  background: #f9fafb;
}

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

.param-table code {
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 0.82em;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 0.1em 0.4em;
  border-radius: 3px;
}

/* ─── Type badges ────────────────────────────────────────── */
.type-badge {
  display: inline-block;
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 0.7em;
  font-weight: 700;
  padding: 0.15em 0.55em;
  border-radius: 4px;
  white-space: nowrap;
}

.type-string  { background: #dbeafe; color: #1e40af; }
.type-number  { background: #ede9fe; color: #5b21b6; }
.type-boolean { background: #fef3c7; color: #92400e; }
.type-array   { background: #dcfce7; color: #166534; }

/* ─── Required / Optional badges ────────────────────────── */
.required-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.1em 0.55em;
  border-radius: 4px;
  background: #fee2e2;
  color: #b91c1c;
  white-space: nowrap;
}

.optional-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.1em 0.55em;
  border-radius: 4px;
  background: #f3f4f6;
  color: #6b7280;
  white-space: nowrap;
}

/* ─── Error list ─────────────────────────────────────────── */
.error-list {
  margin: 0 0 0.25rem;
  padding-left: 1.25rem;
  font-size: 0.88rem;
}

.error-list li + li {
  margin-top: 0.3rem;
}

.error-list code {
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 0.88em;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 0.1em 0.4em;
  border-radius: 3px;
}

/* ─── Field note ─────────────────────────────────────────── */
.field-note {
  font-size: 0.84rem;
  color: #78350f;
  background: #fffbeb;
  border-left: 3px solid #f59e0b;
  padding: 0.5rem 0.75rem;
  border-radius: 0 4px 4px 0;
  margin: 0 0 0.75rem;
}

.field-note code {
  font-family: 'JetBrains Mono', Consolas, monospace;
  font-size: 0.88em;
  background: #fef3c7;
  color: #92400e;
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

/* ─── Code panel (right column) ──────────────────────────── */
.doc-code {
  background: #0d1117;
  padding: 2rem 1.5rem;
}

.code-panel-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94a3b8;
  margin-bottom: 0.75rem;
}

/* ─── Code block wrap (copy button container) ────────────── */
.code-block-wrap {
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  padding: 0.2rem 0.6rem;
  font-size: 0.7rem;
  font-family: 'IBM Plex Sans JP', sans-serif;
  background: #374151;
  color: #e2e8f0;
  border: 1px solid #4b5563;
  border-radius: 5px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  z-index: 1;
}

.copy-btn:hover {
  background: #4b5563;
  color: #f9fafb;
}

.copy-btn.copied {
  color: #34d399;
  border-color: #34d399;
}

/* highlight.js pre/code overrides */
.doc-code pre,
.tab-pane pre {
  margin: 0;
  background: #0d1117 !important;
  padding: 1rem 1.15rem;
  border-radius: 6px;
  overflow-x: auto;
}

.doc-code code,
.tab-pane code {
  font-family: 'JetBrains Mono', 'Source Code Pro', Consolas, monospace !important;
  font-size: 0.82rem;
  line-height: 1.7;
  background: transparent !important;
}

/* ─── Tabs ───────────────────────────────────────────────── */
.tabs {
  display: flex;
  border-bottom: 2px solid #e5e7eb;
  margin: 1.5rem 0 0;
}

.tab-btn {
  padding: 0.5rem 1.1rem;
  font-size: 0.85rem;
  font-family: 'IBM Plex Sans JP', sans-serif;
  font-weight: 600;
  color: #6b7280;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  cursor: pointer;
  transition: color 0.15s;
}

.tab-btn:hover {
  color: #111827;
}

.tab-btn--active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}

.tab-pane {
  margin-top: 0;
}

.tab-pane--hidden {
  display: none;
}

.tab-pane .code-block-wrap {
  border-radius: 0 6px 6px 6px;
  overflow: hidden;
  background: #0d1117;
}

/* ─── Footer ─────────────────────────────────────────────── */
.docs-footer {
  padding: 1.5rem 2.5rem;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  font-size: 0.78rem;
  color: #babfc7;
  text-align: center;
}

.docs-footer p {
  margin: 0;
}

.docs-footer a {
  color: #6b7280;
  text-decoration: none;
}

.docs-footer a:hover {
  color: #374151;
}

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 1100px) {
  .doc-section--split {
    grid-template-columns: 1fr 320px;
  }
}

@media (max-width: 900px) {
  .doc-section--split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .docs-sidebar {
    display: none;
  }

  .docs-hero,
  .doc-text {
    padding: 1.5rem 1.25rem;
  }

  .doc-code {
    padding: 1.25rem;
  }

  .info-card--wide {
    min-width: 100%;
  }

  .hero-title {
    font-size: 1.3rem;
  }
}
