/* =====================================================
   Cenosis — Docs Layout Styles
   ===================================================== */

/* Docs page layout */
.docs-page {
  display: flex;
  min-height: 100vh;
  padding-top: var(--nav-height);
}

/* =====================================================
   Sidebar
   ===================================================== */
.docs-sidebar {
  position: fixed;
  top: var(--nav-height);
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--clr-bg-alt);
  border-right: 1px solid var(--clr-border-soft);
  overflow-y: auto;
  z-index: 50;
  padding: var(--space-8) 0;
  scrollbar-width: thin;
  scrollbar-color: var(--clr-border) transparent;
}

.docs-sidebar::-webkit-scrollbar { width: 4px; }
.docs-sidebar::-webkit-scrollbar-thumb { background: var(--clr-border); border-radius: 2px; }

.sidebar-section {
  margin-bottom: var(--space-6);
  padding: 0 var(--space-4);
}

.sidebar-section__label {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--clr-text-faint);
  padding: var(--space-2) var(--space-3);
  margin-bottom: var(--space-1);
}

.sidebar-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  color: var(--clr-text-muted);
  font-weight: var(--weight-medium);
  transition: all var(--duration-fast);
  border: 1px solid transparent;
  line-height: var(--leading-snug);
}
.sidebar-link:hover {
  background: var(--clr-surface);
  color: var(--clr-text);
}
.sidebar-link.active {
  background: var(--clr-accent-dim);
  color: var(--clr-green-bright);
  border-color: var(--clr-green-dim);
}


/* Sub-links (on-page anchor nav) */
.sidebar-sublinks {
  margin-left: var(--space-6);
  margin-top: var(--space-1);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-sublink {
  display: block;
  padding: 4px var(--space-3);
  font-size: var(--text-xs);
  color: var(--clr-text-faint);
  border-left: 2px solid var(--clr-border-soft);
  transition: all var(--duration-fast);
  line-height: var(--leading-snug);
}
.sidebar-sublink:hover {
  color: var(--clr-text-muted);
  border-color: var(--clr-green-dim);
}
.sidebar-sublink.active {
  color: var(--clr-green-bright);
  border-color: var(--clr-green);
}

/* Version badge in sidebar */
.sidebar-version {
  padding: var(--space-4);
  margin: 0 var(--space-4);
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  color: var(--clr-text-muted);
}
.sidebar-version__dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--clr-green-bright);
  box-shadow: 0 0 6px var(--clr-green-bright);
  flex-shrink: 0;
}

/* =====================================================
   Docs Main Content
   ===================================================== */
.docs-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-width: 0;
}

.docs-article {
  max-width: 840px;
  margin: 0 auto;
  padding: var(--space-16) var(--space-10);
}

/* Article heading hierarchy */
.docs-article h1 {
  font-size: var(--text-5xl);
  font-weight: var(--weight-black);
  letter-spacing: -0.03em;
  line-height: var(--leading-tight);
  margin-bottom: var(--space-6);
  background: linear-gradient(135deg, var(--clr-text) 60%, var(--clr-green-bright));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.docs-article h2 {
  font-size: var(--text-3xl);
  font-weight: var(--weight-extrabold);
  letter-spacing: -0.02em;
  margin-top: var(--space-16);
  margin-bottom: var(--space-6);
  padding-top: var(--space-6);
  border-top: 1px solid var(--clr-border-soft);
  color: var(--clr-text);
  scroll-margin-top: calc(var(--nav-height) + 24px);
}
.docs-article h3 {
  font-size: var(--text-xl);
  font-weight: var(--weight-bold);
  margin-top: var(--space-10);
  margin-bottom: var(--space-4);
  color: var(--clr-text);
  scroll-margin-top: calc(var(--nav-height) + 24px);
}
.docs-article h4 {
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
  margin-top: var(--space-8);
  margin-bottom: var(--space-3);
  color: var(--clr-text-muted);
}

/* Article lead */
.docs-lead {
  font-size: var(--text-xl);
  color: var(--clr-text-muted);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-10);
  padding-bottom: var(--space-8);
  border-bottom: 1px solid var(--clr-border-soft);
}

.docs-version-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-1) var(--space-3);
  background: var(--clr-accent-dim);
  border: 1px solid var(--clr-green-dim);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  color: var(--clr-green-bright);
  font-weight: var(--weight-semibold);
  margin-bottom: var(--space-4);
}

/* Prose content */
.docs-article p {
  color: var(--clr-text-muted);
  line-height: var(--leading-relaxed);
  margin-bottom: var(--space-5);
}
.docs-article strong {
  color: var(--clr-text);
  font-weight: var(--weight-semibold);
}
.docs-article em { font-style: italic; }

/* Inline code */
.docs-article code:not(pre code) {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-sm);
  padding: 2px 6px;
  color: var(--clr-cyan);
}

/* Code blocks */
.docs-article pre {
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  overflow-x: auto;
  margin: var(--space-6) 0;
  position: relative;
}
.docs-article pre code {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: 1.75;
  color: var(--clr-text);
}

/* Code block label */
.code-label {
  display: inline-block;
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  font-weight: var(--weight-semibold);
  color: var(--clr-text-faint);
  background: var(--clr-surface-2);
  border: 1px solid var(--clr-border);
  border-bottom: none;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: var(--space-1) var(--space-3);
  margin-bottom: -1px;
  position: relative;
  z-index: 1;
}

/* Lists */
.docs-article ul {
  list-style: none;
  margin-bottom: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.docs-article ul li {
  position: relative;
  padding-left: var(--space-6);
  color: var(--clr-text-muted);
  line-height: var(--leading-relaxed);
}
.docs-article ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--clr-green);
  opacity: 0.7;
}

.docs-article ol {
  list-style: decimal;
  padding-left: var(--space-8);
  margin-bottom: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.docs-article ol li {
  color: var(--clr-text-muted);
  line-height: var(--leading-relaxed);
  padding-left: var(--space-2);
}

/* Tables */
.docs-article table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-6) 0;
  font-size: var(--text-sm);
}
.docs-article th {
  text-align: left;
  padding: var(--space-3) var(--space-4);
  background: var(--clr-surface);
  border-bottom: 2px solid var(--clr-border);
  font-weight: var(--weight-semibold);
  color: var(--clr-text);
  white-space: nowrap;
}
.docs-article td {
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--clr-border-soft);
  color: var(--clr-text-muted);
  vertical-align: top;
}
.docs-article tr:last-child td { border-bottom: none; }
.docs-article tr:hover td { background: var(--clr-surface); }

/* Callout boxes */
.callout {
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  margin: var(--space-6) 0;
  border-left: 3px solid;
}
.callout--note {
  background: hsla(220, 50%, 50%, 0.08);
  border-color: hsl(220, 60%, 60%);
}
.callout--note .callout__title { color: hsl(220, 70%, 70%); }
.callout--warning {
  background: hsla(38, 70%, 50%, 0.08);
  border-color: var(--clr-amber);
}
.callout--warning .callout__title { color: var(--clr-amber); }
.callout--danger {
  background: hsla(0, 60%, 50%, 0.08);
  border-color: hsl(0, 60%, 60%);
}
.callout--danger .callout__title { color: hsl(0, 70%, 70%); }
.callout--tip {
  background: hsla(138, 50%, 40%, 0.08);
  border-color: var(--clr-green);
}
.callout--tip .callout__title { color: var(--clr-green-bright); }

.callout__title {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-2);
}
.callout p { margin-bottom: 0; color: var(--clr-text-muted); font-size: var(--text-sm); }

/* On-page nav (right-side table of contents) */
.docs-toc {
  position: fixed;
  top: calc(var(--nav-height) + var(--space-10));
  right: var(--space-6);
  width: 200px;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.docs-toc__title {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--clr-text-faint);
  margin-bottom: var(--space-2);
}
.docs-toc__link {
  font-size: var(--text-xs);
  color: var(--clr-text-faint);
  line-height: var(--leading-snug);
  transition: color var(--duration-fast);
}
.docs-toc__link:hover { color: var(--clr-text-muted); }
.docs-toc__link.active { color: var(--clr-green-bright); }

/* Capability table / stability badges */
.badge-stable      { display:inline-block; font-size:var(--text-xs); padding:2px 8px; border-radius:var(--radius-full); background:hsla(138,50%,40%,0.15); color:var(--clr-green-bright); border:1px solid var(--clr-green-dim); font-weight:var(--weight-semibold); }
.badge-advanced    { display:inline-block; font-size:var(--text-xs); padding:2px 8px; border-radius:var(--radius-full); background:hsla(200,50%,40%,0.15); color:var(--clr-cyan);          border:1px solid var(--clr-cyan-dim);   font-weight:var(--weight-semibold); }
.badge-experimental{ display:inline-block; font-size:var(--text-xs); padding:2px 8px; border-radius:var(--radius-full); background:hsla(38,50%,40%,0.15);  color:var(--clr-amber);         border:1px solid var(--clr-amber-dim);  font-weight:var(--weight-semibold); }

/* Breadcrumbs */
.docs-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--clr-text-faint);
  margin-bottom: var(--space-6);
}
.docs-breadcrumb a { color: var(--clr-text-muted); transition: color var(--duration-fast); }
.docs-breadcrumb a:hover { color: var(--clr-green-bright); }
.docs-breadcrumb__sep { color: var(--clr-text-faint); }

/* Prev / Next nav */
.docs-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-4);
  margin-top: var(--space-20);
  padding-top: var(--space-8);
  border-top: 1px solid var(--clr-border-soft);
}
.docs-pager__item {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  padding: var(--space-5);
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  transition: all var(--duration-fast);
}
.docs-pager__item:hover {
  border-color: var(--clr-green-dim);
  box-shadow: var(--shadow-green-sm);
}
.docs-pager__item--next { text-align: right; }
.docs-pager__dir {
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--clr-text-faint);
}
.docs-pager__title {
  font-size: var(--text-base);
  font-weight: var(--weight-semibold);
  color: var(--clr-text);
}

/* =====================================================
   Responsive — Docs
   ===================================================== */
@media (max-width: 1280px) {
  .docs-toc { display: none; }
  .docs-article { max-width: 100%; }
}

@media (max-width: 900px) {
  .docs-sidebar {
    transform: translateX(-100%);
    transition: transform var(--duration-base) var(--ease-out);
    z-index: 80;
  }
  .docs-sidebar.open { transform: translateX(0); }
  .docs-content { margin-left: 0; }
  .docs-article { padding: var(--space-8) var(--space-6); }

  .docs-mobile-menu-btn {
    display: flex !important;
  }
}

.docs-mobile-menu-btn {
  display: none;
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  z-index: 90;
  width: 52px; height: 52px;
  border-radius: var(--radius-full);
  background: var(--clr-green-bright);
  color: var(--clr-bg);
  font-size: 1.25rem;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-green-glow);
  transition: all var(--duration-base);
}
.docs-mobile-menu-btn:hover { transform: scale(1.1); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 70;
  backdrop-filter: blur(4px);
}
.sidebar-overlay.open { display: block; }
