/* ════════════════════════════════════════════════════════
   WORLDSCAPE — DOCUMENTATION PAGE STYLES
   Sidebar + content layout, callouts, code, steps, tables
   ════════════════════════════════════════════════════════ */

/* ─── LAYOUT ─── */
.docs-layout {
  display: flex;
  max-width: 1500px;
  margin: 0 auto;
  padding-top: 64px;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ─── SIDEBAR ─── */
.docs-sidebar {
  width: 280px;
  flex-shrink: 0;
  padding: 32px 20px 32px 28px;
  border-right: 1px solid var(--border);
  position: sticky;
  top: 64px;
  height: calc(100vh - 64px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-hover) transparent;
}
.docs-sidebar::-webkit-scrollbar { width: 6px; }
.docs-sidebar::-webkit-scrollbar-track { background: transparent; }
.docs-sidebar::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: 3px;
}
.docs-sidebar-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.docs-sidebar-header .section-tag {
  margin-bottom: 0;
}
.docs-search-mini {
  margin-bottom: 18px;
}
.docs-search-mini input {
  width: 100%;
  padding: 8px 12px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
.docs-search-mini input:focus { border-color: var(--accent-dim); }

.docs-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.docs-nav-group {
  margin-bottom: 8px;
}
.docs-nav-group-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--text-dim);
  padding: 14px 12px 6px;
}
.docs-nav-link {
  display: block;
  padding: 7px 12px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.docs-nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.docs-nav-link.active {
  color: var(--accent);
  background: rgba(74, 222, 128, 0.07);
}
.docs-nav-link.sub {
  font-size: 12.5px;
  padding-left: 24px;
  color: var(--text-dim);
}
.docs-nav-link.sub:hover { color: var(--text-secondary); }
.docs-nav-link.sub.active {
  color: var(--accent);
}

/* ─── CONTENT ─── */
.docs-content {
  flex: 1;
  padding: 48px 64px;
  max-width: 920px;
  min-width: 0;
}
.docs-section {
  padding-bottom: 56px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border);
}
.docs-section:last-child { border-bottom: none; }
.docs-section h1 {
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
  scroll-margin-top: 80px;
}
.docs-lead {
  font-size: 16px;
  color: var(--text-secondary);
  line-height: 1.65;
  margin-bottom: 32px;
}
.docs-subsection {
  margin-top: 40px;
  scroll-margin-top: 80px;
}
.docs-subsection h2,
.docs-section h2 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 14px;
  margin-top: 36px;
  scroll-margin-top: 80px;
}
.docs-section h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 10px;
  margin-top: 28px;
  color: var(--text-primary);
  scroll-margin-top: 80px;
}
.docs-section h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 8px;
  margin-top: 22px;
  color: var(--text-primary);
}
.docs-section p {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 14px;
}
.docs-section strong {
  color: var(--text-primary);
  font-weight: 600;
}
.docs-section em {
  color: var(--accent);
  font-style: normal;
}

/* ─── INLINE CODE ─── */
.docs-section code,
.docs-section p code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 1px 7px;
  border-radius: 4px;
  color: var(--accent);
}

/* ─── STEPS ─── */
.docs-steps {
  display: flex;
  flex-direction: column;
  gap: 22px;
  margin: 24px 0;
}
.docs-step {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}
.docs-step-num {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(74, 222, 128, 0.1);
  border: 1px solid rgba(74, 222, 128, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}
.docs-step h4 {
  margin-top: 0;
  margin-bottom: 6px;
  font-size: 15px;
}
.docs-step p {
  font-size: 14px;
  margin-bottom: 8px;
}

/* ─── CODE BLOCKS ─── */
.docs-code {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 12px 0 20px;
  overflow-x: auto;
  position: relative;
}
.docs-code code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.75;
  background: transparent;
  border: none;
  padding: 0;
}
.docs-code .kw { color: var(--accent); }
.docs-code .ty { color: var(--accent3); }
.docs-code .num { color: var(--accent2); }
.docs-code .str { color: #e8b04b; }
.docs-code .com { color: var(--text-dim); font-style: italic; }

/* ─── CALLOUTS ─── */
.docs-callout {
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  margin: 18px 0;
  font-size: 14px;
  line-height: 1.6;
  border-left: 3px solid;
}
.docs-callout strong { color: var(--text-primary); }
.docs-callout-info {
  background: rgba(56, 189, 248, 0.05);
  border-color: var(--accent3);
  color: var(--text-secondary);
}
.docs-callout-tip {
  background: rgba(74, 222, 128, 0.05);
  border-color: var(--accent);
  color: var(--text-secondary);
}
.docs-callout-warn {
  background: rgba(245, 158, 66, 0.05);
  border-color: var(--accent2);
  color: var(--text-secondary);
}
.docs-callout-beta {
  background: rgba(139, 92, 246, 0.05);
  border-color: #8b5cf6;
  color: var(--text-secondary);
}
.docs-callout-beta strong { color: #c4b5fd; }

/* ─── LISTS ─── */
.docs-list {
  list-style: none;
  margin: 14px 0;
}
.docs-list li {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 5px 0 5px 22px;
  position: relative;
  line-height: 1.65;
}
.docs-list li::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 13px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
.docs-ordered-list {
  margin: 14px 0;
  padding-left: 24px;
}
.docs-ordered-list li {
  font-size: 14px;
  color: var(--text-secondary);
  padding: 4px 0;
  line-height: 1.65;
}
.docs-ordered-list li::marker {
  color: var(--accent);
  font-weight: 700;
}

.docs-link {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(74, 222, 128, 0.35);
  text-underline-offset: 2px;
  transition: text-decoration-color 0.2s;
}
.docs-link:hover { text-decoration-color: var(--accent); }

/* ─── TABLES ─── */
.docs-table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 13.5px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.docs-table th, .docs-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.docs-table th {
  background: var(--bg-elevated);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
}
.docs-table td { color: var(--text-secondary); }
.docs-table tr:last-child td { border-bottom: none; }
.docs-table code {
  font-size: 12px;
  padding: 1px 6px;
}

/* ─── PARAMETER TABLE ─── */
.docs-param-table td:first-child,
.docs-param-table th:first-child {
  font-family: var(--font-mono);
  color: var(--accent);
  width: 28%;
}
.docs-param-table td:nth-child(2) {
  font-family: var(--font-mono);
  color: var(--accent3);
  font-size: 12.5px;
  width: 18%;
}

/* ─── FIGURE / IMAGE ─── */
.docs-figure {
  margin: 18px 0 26px;
}
.docs-figure img {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-elevated);
}
.docs-figure figcaption {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--text-dim);
  text-align: center;
  font-style: italic;
}

/* ─── VERBATIM QUOTE ─── */
.docs-verbatim {
  border-left: 3px solid var(--accent2);
  background: rgba(245, 158, 66, 0.04);
  padding: 12px 18px;
  margin: 16px 0;
  font-style: italic;
  color: var(--text-secondary);
  font-size: 14px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.docs-verbatim::before {
  content: '';
  display: none;
}

/* ─── TAG / BADGE ─── */
.docs-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 2px 8px;
  border-radius: 100px;
  margin-left: 8px;
  vertical-align: middle;
}
.docs-tag.beta {
  background: rgba(139, 92, 246, 0.1);
  color: #c4b5fd;
  border: 1px solid rgba(139, 92, 246, 0.3);
}
.docs-tag.exp {
  background: rgba(245, 158, 66, 0.1);
  color: var(--accent2);
  border: 1px solid rgba(245, 158, 66, 0.3);
}
.docs-tag.new {
  background: rgba(74, 222, 128, 0.1);
  color: var(--accent);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

/* ─── TOC (in-page anchor menu) ─── */
.docs-toc {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 18px 0;
}
.docs-toc-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  font-weight: 700;
  margin-bottom: 8px;
}
.docs-toc a {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  padding: 3px 0;
  transition: color 0.15s;
}
.docs-toc a:hover { color: var(--accent); }

/* ─── ARCHITECTURE FLOW ─── */
.docs-arch-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 28px 0;
}
.docs-arch-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 22px;
  text-align: center;
  width: 100%;
  max-width: 520px;
  transition: border-color 0.2s;
}
.docs-arch-step:hover { border-color: var(--accent-dim); }
.docs-arch-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  display: block;
  margin-bottom: 4px;
}
.docs-arch-step p {
  font-size: 13px;
  margin-bottom: 0;
}
.docs-arch-arrow {
  color: var(--accent-dim);
  font-size: 18px;
  line-height: 1;
  padding: 6px 0;
}

/* ─── STATS ─── */
.docs-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 24px 0;
}
.docs-stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 14px;
  text-align: center;
}
.docs-stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.03em;
}
.docs-stat-label {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ─── FAQ ─── */
.docs-faq-item {
  margin-bottom: 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.docs-faq-item:last-child { border-bottom: none; }
.docs-faq-item h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
  margin-top: 0;
  color: var(--accent);
}
.docs-faq-item p { font-size: 14px; }

/* ─── KBD ─── */
kbd {
  display: inline-block;
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-elevated);
  border: 1px solid var(--border-hover);
  border-radius: 4px;
  box-shadow: 0 1px 0 var(--border);
}

/* ─── RESPONSIVE ─── */
@media (max-width: 1100px) {
  .docs-content { padding: 48px 32px; }
}
@media (max-width: 900px) {
  .docs-layout { flex-direction: column; }
  .docs-sidebar {
    width: 100%;
    height: auto;
    position: static;
    border-right: none;
    border-bottom: 1px solid var(--border);
    padding: 16px;
  }
  .docs-nav {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }
  .docs-nav-group { width: 100%; }
  .docs-nav-link {
    font-size: 12.5px;
    padding: 6px 10px;
  }
  .docs-nav-link.sub { display: none; }
  .docs-nav-group-title { padding: 10px 6px 4px; }
  .docs-content { padding: 32px var(--side-pad); }
  .docs-stats-grid { grid-template-columns: repeat(2, 1fr); }
}
