/* Documentation pages */

.docs-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: clamp(28px, 4vw, 48px);
  width: 100%;
  max-width: none;
  margin: 0;
  align-items: start;
}

.docs-sidebar {
  position: sticky;
  top: 88px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(251, 253, 255, 0.94) 100%),
    radial-gradient(circle at 0% 0%, rgba(27, 133, 156, 0.06), transparent 38%);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.docs-sidebar h2 {
  margin: 0 0 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.docs-sidebar nav {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.docs-sidebar a {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
}

.docs-sidebar a:hover {
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  text-decoration: none;
}

.docs-content {
  min-width: 0;
}

.docs-hero {
  margin-bottom: 34px;
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(251, 253, 255, 0.92)),
    radial-gradient(circle at 100% 0%, rgba(37, 183, 70, 0.08), transparent 34%);
  box-shadow: var(--shadow-xs);
}

.docs-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.docs-hero p {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.7;
  max-width: 640px;
}

.doc-section {
  margin-bottom: 24px;
  scroll-margin-top: 96px;
  padding: clamp(22px, 3vw, 30px);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-xs);
}

.doc-section h2 {
  margin: 0 0 12px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.doc-section h3 {
  margin: 24px 0 10px;
  font-size: 1rem;
  font-weight: 600;
}

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

.doc-section ul,
.doc-section ol {
  padding-left: 1.25rem;
  margin: 12px 0;
}

.flow-diagram {
  background:
    radial-gradient(circle at 100% 0%, rgba(27, 133, 156, 0.26), transparent 28%),
    #0f172a;
  color: #e2e8f0;
  border-radius: var(--radius);
  padding: 20px 24px;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.65;
  overflow-x: auto;
  margin: 16px 0;
}

.code-block {
  position: relative;
  margin: 16px 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.code-block pre {
  margin: 0;
  padding: 16px 18px;
  background: #0f172a;
  color: #e2e8f0;
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.6;
  overflow-x: auto;
}

.code-block .copy-btn {
  padding: 4px 10px;
  font-size: 0.75rem;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 5px;
  cursor: pointer;
  color: var(--text-secondary);
}

.code-block .copy-btn:hover { background: var(--bg); }

.doc-table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin: 16px 0;
  box-shadow: var(--shadow-xs);
}

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

.doc-table th,
.doc-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

.doc-table th {
  background: #f8fafc;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

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

.doc-callout {
  background:
    linear-gradient(180deg, #f4f7ff, var(--brand-soft));
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 16px 18px;
  margin: 16px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.doc-callout strong { color: var(--brand-dark); }

.arch-figure {
  margin: 20px 0 8px;
  padding: 0;
}

.arch-image {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow-xs);
}

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

.arch-flow {
  margin: 16px 0;
  padding-left: 22px;
  display: grid;
  gap: 12px;
}

.arch-flow li {
  padding-left: 6px;
  line-height: 1.6;
  font-size: 0.92rem;
  color: var(--text-secondary);
}

.arch-flow strong { color: var(--brand-dark); }

.checklist {
  list-style: none;
  padding: 0;
  margin: 16px 0;
}

.checklist li {
  padding: 10px 0 10px 28px;
  position: relative;
  border-bottom: 1px solid var(--border);
}

.checklist li:last-child { border-bottom: none; }

.checklist li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--success);
  font-weight: 700;
}

@media (max-width: 860px) {
  .docs-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .docs-sidebar {
    position: static;
  }

  .docs-sidebar nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
}

