/* ============================================
   SPECK.JS DOCS - Additional Styles
   ============================================ */

/* Docs Layout */
.docs-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - var(--nav-height));
  padding-top: var(--nav-height);
}

/* Sidebar */
.docs-sidebar {
  position: sticky;
  top: var(--nav-height);
  height: calc(100vh - var(--nav-height));
  overflow-y: auto;
  padding: 32px 24px;
  border-right: 1px solid var(--border);
  background: var(--bg-dark);
}

.sidebar-section {
  margin-bottom: 28px;
}

.sidebar-section h4 {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.sidebar-link {
  display: block;
  padding: 8px 12px;
  margin: 2px 0;
  border-radius: 6px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all 0.15s;
}

.sidebar-link:hover {
  color: var(--text-primary);
  background: var(--bg-elevated);
}

.sidebar-link.active {
  color: var(--accent);
  background: rgba(124, 58, 237, 0.1);
}

/* Docs Content */
.docs-content {
  padding: 48px 64px;
  max-width: 900px;
}

.docs-article h1 {
  font-size: 2.5rem;
  font-weight: 800;
  margin-bottom: 16px;
}

.docs-article .lead {
  font-size: 1.2rem;
  color: var(--text-secondary);
  margin-bottom: 48px;
}

.docs-article h2 {
  font-size: 1.75rem;
  font-weight: 700;
  margin-top: 64px;
  margin-bottom: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.docs-article h2:first-of-type {
  margin-top: 0;
  border-top: none;
  padding-top: 0;
}

.docs-article h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin-top: 32px;
  margin-bottom: 16px;
}

.docs-article p {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 16px;
}

.docs-article section {
  padding: 0;
  max-width: none;
}

/* Code Blocks */
.code-block {
  background: var(--code-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 24px;
  margin: 16px 0 24px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.875rem;
  line-height: 1.7;
}

.code-comment {
  color: var(--text-muted);
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  margin: 16px 0 24px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

th {
  background: var(--bg-elevated);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

td {
  font-size: 0.9rem;
}

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

td code {
  font-size: 0.8rem;
}

/* Active nav link */
.nav-links a.active {
  color: var(--accent);
}

/* Docs footer */
.docs-footer {
  margin-left: 260px;
}

/* Responsive */
@media (max-width: 1024px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }
  
  .docs-sidebar {
    display: none;
  }
  
  .docs-content {
    padding: 32px 24px;
  }
  
  .docs-footer {
    margin-left: 0;
  }
}

@media (max-width: 600px) {
  .docs-article h1 {
    font-size: 2rem;
  }
  
  .docs-article h2 {
    font-size: 1.5rem;
  }
  
  .code-block {
    padding: 16px;
    font-size: 0.8rem;
  }
}
