/* ── Wisemonkey documentation page (/projects/wisemonkey/docs/) ──
   Loaded after wisemonkey.css, and deliberately thin: the nav, orbs,
   cards, buttons, palette variables and footer all come from that file, so the
   docs cannot drift away from the landing page. Only the documentation layout
   (sidebar + article, and the typography of an article) is defined here.
*/

.nav-links a.active {
  color: var(--green-4);
  background: var(--green-glow);
  border-color: var(--border-hover);
}

/* ── Docs hero ── */
.docs-hero {
  padding: 64px 0 8px;
  text-align: center;
}

.docs-hero h1 {
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.docs-hero h1 .gradient {
  background: linear-gradient(135deg, var(--green-4) 0%, var(--accent) 50%, #8bfa9b 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.docs-hero p {
  color: var(--text-secondary);
  max-width: 640px;
  margin: 14px auto 0;
}

.docs-hero .docs-meta {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 18px;
}

.docs-hero .docs-meta code {
  color: var(--green-4);
  background: rgba(37, 235, 90, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
}

.docs-hero .docs-meta a {
  color: var(--green-4);
  text-decoration: none;
  border-bottom: 1px dotted var(--border-hover);
  transition: all 0.2s ease;
}

.docs-hero .docs-meta a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.docs-quicklinks {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 26px;
}

.docs-quicklinks a {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 100px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: all 0.3s ease;
}

.docs-quicklinks a:hover {
  color: var(--text-primary);
  border-color: var(--border-hover);
  background: rgba(37, 235, 90, 0.08);
}

/* ── Layout: sticky sidebar + article ── */
.docs-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 56px;
  align-items: start;
  padding: 48px 0 80px;
}

.docs-sidebar {
  position: sticky;
  top: 96px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-right: 6px;
}

.docs-sidebar::-webkit-scrollbar {
  width: 6px;
}

.docs-sidebar::-webkit-scrollbar-thumb {
  background: var(--border-hover);
  border-radius: 3px;
}

/* The shared sheet styles every bare `nav` as the top bar (flex, sticky, with
   a border and a blurred background). This one is a vertical list of links. */
.docs-nav {
  display: block;
  position: static;
  padding: 0;
  border: none;
  background: none;
  backdrop-filter: none;
}

.docs-nav-group {
  margin-bottom: 22px;
}

.docs-nav-group>span {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 8px;
  padding-left: 11px;
}

.docs-nav a {
  display: block;
  padding: 5px 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 0 6px 6px 0;
  transition: all 0.2s ease;
}

.docs-nav a:hover {
  color: var(--text-primary);
  background: var(--green-glow);
}

.docs-nav a.active {
  color: var(--green-4);
  border-left-color: var(--green-4);
  background: rgba(37, 235, 90, 0.06);
}

/* ── Article ── */
.docs-content {
  min-width: 0;
}

.docs-content section {
  scroll-margin-top: 100px;
  margin-bottom: 64px;
}

.docs-content section:last-child {
  margin-bottom: 0;
}

.docs-content h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.65rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  padding-bottom: 12px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.docs-content h2 i {
  font-size: 0.85em;
  color: var(--green-4);
}

.docs-content h3 {
  font-size: 1.12rem;
  font-weight: 600;
  margin: 34px 0 12px;
}

.docs-content h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 22px 0 8px;
  color: var(--text-primary);
}

.docs-content p {
  color: var(--text-secondary);
  margin-bottom: 14px;
}

.docs-content strong {
  color: var(--text-primary);
  font-weight: 600;
}

.docs-content a {
  color: var(--green-4);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: all 0.2s ease;
}

.docs-content a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.docs-content ul,
.docs-content ol {
  margin: 0 0 16px 22px;
  color: var(--text-secondary);
}

.docs-content li {
  margin-bottom: 6px;
}

.docs-content li::marker {
  color: var(--green-4);
}

.docs-content li>ul,
.docs-content li>ol {
  margin-top: 6px;
  margin-bottom: 0;
}

.docs-content code {
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.85em;
  color: var(--green-4);
  background: rgba(37, 235, 90, 0.08);
  padding: 1px 6px;
  border-radius: 4px;
  word-break: break-word;
}

.docs-content kbd {
  font-family: inherit;
  font-size: 0.78em;
  color: var(--text-secondary);
  background: rgba(37, 235, 90, 0.1);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  white-space: nowrap;
}

/* ── Code blocks ── */
.docs-content pre {
  position: relative;
  background: rgba(10, 26, 14, 0.85);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 18px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;
  font-size: 0.8rem;
  line-height: 1.75;
  color: var(--text-primary);
  backdrop-filter: blur(12px);
}

.docs-content pre code {
  background: none;
  border: none;
  padding: 0;
  color: inherit;
  font-size: 1em;
}

.docs-content pre .copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  margin-left: 0;
  opacity: 0;
}

.docs-content pre:hover .copy-btn {
  opacity: 1;
}

.docs-content pre .cmt {
  color: var(--text-muted);
  opacity: 0.75;
}

.docs-content pre .str {
  color: #e8c97a;
}

/* ── Tables ── */
.docs-table-wrap {
  overflow-x: auto;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: 12px;
}

.docs-content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.docs-content th,
.docs-content td {
  text-align: left;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}

.docs-content thead th {
  background: rgba(15, 41, 22, 0.6);
  color: var(--text-primary);
  font-weight: 600;
  white-space: nowrap;
}

.docs-content tbody tr:last-child td {
  border-bottom: none;
}

.docs-content td {
  color: var(--text-secondary);
}

/* ── Callouts ── */
.docs-note,
.docs-warn,
.docs-tip {
  border: 1px solid var(--border);
  border-left: 3px solid var(--green-4);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 18px;
  background: rgba(15, 41, 22, 0.4);
  font-size: 0.88rem;
}

.docs-note p,
.docs-warn p,
.docs-tip p {
  margin-bottom: 0;
  color: var(--text-secondary);
}

.docs-note>strong:first-child,
.docs-warn>strong:first-child,
.docs-tip>strong:first-child {
  display: block;
  margin-bottom: 4px;
  color: var(--green-4);
}

.docs-warn {
  border-left-color: #fbbf24;
}

.docs-warn>strong:first-child {
  color: #fbbf24;
}

.docs-tip {
  border-left-color: var(--accent);
}

.docs-tip>strong:first-child {
  color: var(--accent);
}

/* ── Mini cards used inside the article ── */
.docs-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}

.docs-cards .feature-card {
  padding: 22px;
}

.docs-cards .feature-card h3 {
  font-size: 0.98rem;
  margin-bottom: 6px;
}

.docs-cards .feature-card p {
  font-size: 0.84rem;
  margin-bottom: 0;
}

.docs-cards .feature-icon {
  width: 40px;
  height: 40px;
  margin-bottom: 14px;
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .docs-layout {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 32px;
  }

  .docs-sidebar {
    position: static;
    max-height: none;
    overflow: visible;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--bg-card);
    padding: 18px;
    backdrop-filter: blur(12px);
  }

  .docs-sidebar .docs-nav-group:last-child {
    margin-bottom: 0;
  }
}

@media (max-width: 640px) {
  .docs-content h2 {
    font-size: 1.35rem;
  }

  .docs-content pre {
    font-size: 0.72rem;
    padding: 14px 16px;
  }

  .docs-content pre .copy-btn {
    opacity: 1;
  }

  .docs-content table {
    font-size: 0.78rem;
  }

  .docs-content th,
  .docs-content td {
    padding: 8px 10px;
  }
}