/* ==========================================================================
   DOCS PAGE STYLES (Editorial Split)
   ========================================================================== */

.pb-0 {
  padding-bottom: 0;
}
.text-center {
  text-align: center;
}

.wiki-layout {
  display: flex;
  gap: 4rem;
  align-items: flex-start;
  margin-top: 4rem;
}

/* Sidebar */
.wiki-sidebar {
  width: 250px;
  flex-shrink: 0;
}

.sidebar-sticky {
  position: sticky;
  top: 8rem;
}

.sidebar-title {
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.sidebar-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-link {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.95rem;
  transition: color 0.3s ease;
  position: relative;
  padding-left: 1rem;
}

.sidebar-link::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  height: 0;
  width: 2px;
  background: var(--accent-slate);
  transition: height 0.3s var(--ease-fluid);
}

.sidebar-link:hover {
  color: var(--text-main);
}

.sidebar-link.active {
  color: var(--accent-slate);
  font-weight: 600;
}

.sidebar-link.active::before {
  height: 100%;
}

/* Main Content */
.wiki-content {
  flex-grow: 1;
  min-width: 0; /* prevent flex blowout */
  max-width: 100%;
}

.content-core {
  padding: 4.5rem;
  min-width: 0;
}

.docs-intro,
.wiki-section,
.docs-table-wrap,
.code-block {
  min-width: 0;
  max-width: 100%;
}

.docs-intro {
  margin-bottom: 2rem;
}

.docs-intro h2 {
  margin: 1rem 0 1.5rem;
}

.docs-intro p {
  line-height: 1.8;
}

.wiki-section {
  padding-top: 3.5rem;
  padding-bottom: 3.5rem;
}

.wiki-section:first-child {
  padding-top: 0;
}

.wiki-section h2 {
  font-size: 2.5rem;
  margin-bottom: 2rem;
}

.wiki-section h3 {
  font-size: 1.5rem;
  margin-top: 3.5rem;
  margin-bottom: 1.25rem;
}

.wiki-section h4 {
  font-size: 1.2rem;
  margin-top: 2.75rem;
  margin-bottom: 1.25rem;
}

.wiki-section p {
  color: var(--text-muted);
  margin-bottom: 1.5rem;
  font-size: 1.125rem;
  line-height: 1.8;
}

.wiki-list {
  color: var(--text-muted);
  margin-left: 1.5rem;
  margin-bottom: 2rem;
  font-size: 1.125rem;
  line-height: 1.75;
}
.wiki-list li {
  margin-bottom: 0.8rem;
}

.code-block {
  background: #020b12;
  border: 1px solid var(--hairline);
  padding: 1.75rem;
  border-radius: 1rem;
  margin: 2rem 0 2.5rem;
  font-family: monospace;
  color: #62e6f7;
  line-height: 1.7;
  overflow-x: auto;
}

.code-block pre { margin: 0; font: inherit; }

.docs-intro blockquote,
.wiki-section blockquote {
  margin: 2rem 0 2.5rem;
  padding: 1.5rem 1.75rem;
  color: var(--text-muted);
  line-height: 1.7;
  border: 1px solid var(--hairline);
  border-left: 4px solid var(--accent-slate);
  border-radius: 0.75rem;
  background: rgba(98, 230, 247, 0.06);
}

.wiki-section blockquote.warning {
  border-left-color: #ef4444;
  background: rgba(239, 68, 68, 0.08);
}

.docs-table-wrap { width: 100%; margin: 2rem 0 2.5rem; overflow-x: auto; border: 1px solid var(--hairline); border-radius: 0.75rem; }
.docs-table { width: 100%; min-width: 620px; border-collapse: collapse; color: var(--text-muted); }
.docs-table th, .docs-table td { padding: 1.1rem 1.25rem; text-align: left; vertical-align: top; border-bottom: 1px solid var(--hairline-subtle); line-height: 1.6; }
.docs-table th { color: var(--text-main); }
.docs-table tbody tr:last-child td { border-bottom: 0; }

.wiki-divider {
  border: 0;
  height: 1px;
  background: var(--hairline-subtle);
  margin: 3rem 0;
}

/* Mobile Fallback */
@media (max-width: 992px) {
  .wiki-layout {
    flex-direction: column;
    gap: 2rem;
  }
  .wiki-sidebar {
    width: 100%;
    min-width: 0;
  }
  .sidebar-sticky {
    position: static;
  }
  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .sidebar-link::before {
    display: none;
  }
  .sidebar-link {
    padding-left: 0;
  }
  .content-core {
    padding: 2rem;
  }
  .wiki-content {
    flex: 0 1 auto;
    width: 100%;
  }
  .wiki-section h2 {
    font-size: 2rem;
  }
}

@media (max-width: 600px) {
  .wiki-layout {
    width: 100%;
    margin-top: 0;
    padding-top: 2.5rem;
    padding-bottom: 4rem;
    gap: 1.5rem;
  }
  .sidebar-nav {
    flex-direction: column;
    gap: 0.65rem;
  }
  .sidebar-link {
    display: block;
    width: 100%;
    padding: 0.7rem 0.9rem;
    border: 1px solid var(--hairline);
    border-radius: 0.75rem;
  }
  .wiki-content {
    overflow: hidden;
    border-radius: 1.25rem;
  }
  .content-core {
    width: 100%;
    padding: 1.25rem;
    border-radius: calc(1.25rem - 0.375rem);
  }
  .wiki-section {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }
  .docs-intro h2,
  .wiki-section h2 {
    font-size: clamp(1.55rem, 8vw, 2rem);
    line-height: 1.2;
  }
  .wiki-section h3 {
    margin-top: 2.5rem;
    font-size: 1.3rem;
    line-height: 1.3;
  }
  .wiki-section h4 {
    margin-top: 2rem;
    font-size: 1.1rem;
    line-height: 1.4;
  }
  .docs-intro p,
  .wiki-section p,
  .wiki-list,
  .docs-intro blockquote,
  .wiki-section blockquote {
    font-size: 1rem;
    line-height: 1.7;
    overflow-wrap: anywhere;
    word-break: normal;
  }
  .wiki-list {
    margin-left: 1.2rem;
  }
  .docs-intro blockquote,
  .wiki-section blockquote {
    margin: 1.5rem 0 2rem;
    padding: 1.1rem;
  }
  .code-block {
    width: 100%;
    padding: 1rem;
    font-size: 0.85rem;
    margin: 1.5rem 0 2rem;
    -webkit-overflow-scrolling: touch;
  }
  .code-block pre {
    width: max-content;
    min-width: 100%;
  }
  .docs-table-wrap {
    width: 100%;
    margin: 1.5rem 0 2rem;
    border-radius: 0.6rem;
    scrollbar-width: thin;
    scrollbar-color: var(--accent-slate) var(--bg-oled);
  }
  .docs-table-wrap::-webkit-scrollbar {
    height: 6px;
  }
  .docs-table-wrap::-webkit-scrollbar-thumb {
    background: var(--accent-slate);
    border-radius: 9999px;
  }
  .docs-table {
    min-width: 560px;
  }
  .docs-table th,
  .docs-table td {
    padding: 0.85rem;
  }
}
