/*
 * Wordcab Docs Theme
 * ------------------
 * Docs-specific layer on top of navy-theme.css + navy-components.css.
 * Provides: two-column docs shell, sidebar, TOC, prose, code blocks,
 * tables, callouts, API-reference layout.
 */

/* ── PAGE SHELL ── */
.docs-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 48px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 24px 96px;
}

@media (max-width: 960px) {
  .docs-shell { grid-template-columns: 1fr; gap: 24px; padding: 24px 16px 64px; }
}

/* ── SIDEBAR ── */
.docs-sidebar {
  position: sticky;
  top: 24px;
  align-self: start;
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  padding-right: 8px;
  font-size: 13px;
}
@media (max-width: 960px) {
  .docs-sidebar { position: static; max-height: none; border-bottom: 1px solid var(--line); padding-bottom: 16px; }
}

.docs-sidebar h4 {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 22px 0 8px;
  padding: 0 12px;
}
.docs-sidebar h4:first-child { margin-top: 0; }

.docs-sidebar ul {
  list-style: none;
  margin: 0 0 6px;
  padding: 0;
}

.docs-sidebar li a {
  display: block;
  padding: 6px 12px;
  border-radius: 8px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.4;
  transition: background 120ms ease, color 120ms ease;
}
.docs-sidebar li a:hover {
  background: var(--bg-soft);
  color: var(--accent);
}
.docs-sidebar li a.active {
  background: rgba(46, 107, 219, 0.1);
  color: var(--accent-bright);
  font-weight: 600;
}

/* ── MAIN CONTENT ── */
.docs-main {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 48px;
  align-items: start;
}
@media (max-width: 1100px) {
  .docs-main { grid-template-columns: 1fr; }
  .docs-toc { display: none; }
}

.docs-article { min-width: 0; }

/* ── BREADCRUMB ── */
.docs-breadcrumb {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.docs-breadcrumb a { color: var(--muted); }
.docs-breadcrumb a:hover { color: var(--accent-bright); }
.docs-breadcrumb span.sep { opacity: 0.5; }

/* ── PROSE ── */
.prose h1 {
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.12;
  color: var(--accent);
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}
.prose > p.lead {
  font-size: 17px;
  line-height: 1.65;
  color: var(--muted);
  margin-bottom: 28px;
}
.prose h2 {
  font-size: 26px;
  line-height: 1.2;
  color: var(--accent);
  margin: 48px 0 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  letter-spacing: -0.01em;
}
.prose h2:first-of-type { border-top: none; padding-top: 0; margin-top: 28px; }
.prose h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--accent);
  margin: 28px 0 10px;
  letter-spacing: -0.005em;
}
.prose h4 {
  font-family: 'DM Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin: 20px 0 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.prose p, .prose li {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
}
.prose p { margin: 0 0 14px; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 22px; }
.prose ul li, .prose ol li { margin-bottom: 6px; }
.prose a {
  color: var(--accent-bright);
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}
.prose a:hover { text-decoration-thickness: 2px; }

/* Card-like links: no underlines anywhere inside the card */
.prose a.docs-card,
.prose a.docs-card:hover,
.prose a.stat-card,
.prose a.stat-card:hover,
.prose .docs-card *,
.prose .stat-card * { text-decoration: none !important; }
.prose strong { font-weight: 700; color: var(--accent); }
.prose hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 32px 0;
}

/* ── INLINE CODE (only when NOT inside a pre) ── */
.prose :not(pre) > code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.88em;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(46, 107, 219, 0.08);
  color: #1a3a6e;
  border: 1px solid rgba(46, 107, 219, 0.12);
  white-space: nowrap;
}

/* ── CODE BLOCKS ── */
.code-block {
  position: relative;
  margin: 16px 0 22px;
  border-radius: 14px;
  background: #0e1a2e;
  border: 1px solid rgba(46, 107, 219, 0.22);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(14, 26, 46, 0.12);
}
.code-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.code-block-lang {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8aa4d4;
}
.code-block pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.65;
  color: #e1ebff;
  background: transparent;
}
.code-block pre code,
.code-tabs-panel pre code {
  background: transparent;
  border: none;
  padding: 0;
  color: #e1ebff;
  font-size: inherit;
  white-space: pre;
  font-family: inherit;
}

/* Code group tabs */
.code-tabs {
  margin: 16px 0 22px;
  border-radius: 14px;
  overflow: hidden;
  background: #0e1a2e;
  border: 1px solid rgba(46, 107, 219, 0.22);
  box-shadow: 0 10px 30px rgba(14, 26, 46, 0.12);
}
.code-tabs-nav {
  display: flex;
  gap: 4px;
  padding: 8px 10px 0;
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  overflow-x: auto;
}
.code-tabs-nav button {
  background: transparent;
  border: none;
  color: #8aa4d4;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 8px 8px 0 0;
  cursor: pointer;
  white-space: nowrap;
}
.code-tabs-nav button.active {
  background: #0e1a2e;
  color: #e1ebff;
}
.code-tabs-panel { display: none; }
.code-tabs-panel.active { display: block; }
.code-tabs-panel pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.65;
  color: #e1ebff;
  background: transparent;
}

/* ── TABLES ── */
.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0 26px;
  font-size: 13.5px;
  background: var(--white-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.prose th, .prose td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.prose th {
  background: var(--bg-soft);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
}
.prose tr:last-child td { border-bottom: none; }

/* ── CALLOUTS ── */
.callout {
  border-radius: var(--radius-md);
  padding: 16px 18px;
  margin: 18px 0 22px;
  border: 1px solid;
  background: rgba(255,255,255,0.5);
  font-size: 14px;
  line-height: 1.65;
}
.callout strong { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 6px; }
.callout p { margin: 0; font-size: 14px; }
.callout a { color: inherit; text-decoration: underline; }

.callout.note     { border-color: rgba(46, 107, 219, 0.25); background: rgba(46, 107, 219, 0.06); color: #1a3a6e; }
.callout.warning  { border-color: rgba(217, 119, 6, 0.3); background: rgba(217, 119, 6, 0.08); color: #7a4a0b; }
.callout.success  { border-color: rgba(22, 163, 74, 0.3); background: rgba(22, 163, 74, 0.08); color: #14532d; }
.callout.tip      { border-color: rgba(124, 58, 237, 0.3); background: rgba(124, 58, 237, 0.08); color: #4c1d95; }

/* ── TOC (right rail) ── */
.docs-toc {
  position: sticky;
  top: 24px;
  align-self: start;
  font-size: 12px;
}
.docs-toc h4 {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 10px;
}
.docs-toc ul { list-style: none; padding: 0; margin: 0; border-left: 1px solid var(--line); }
.docs-toc li a {
  display: block;
  padding: 5px 12px;
  color: var(--muted);
  line-height: 1.4;
  border-left: 2px solid transparent;
  margin-left: -1px;
}
.docs-toc li a:hover { color: var(--accent-bright); }
.docs-toc li.toc-sub a { padding-left: 24px; font-size: 11.5px; }

/* ── DOCS HERO (landing page) ── */
.docs-hero {
  padding: 64px 0 32px;
  text-align: left;
}
.docs-hero h1 {
  font-family: 'Playfair Display', serif;
  font-weight: 400;
  font-size: clamp(34px, 4.5vw, 52px);
  line-height: 1.08;
  color: var(--accent);
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}
.docs-hero h1 em { font-style: italic; color: var(--accent-bright); }
.docs-hero p {
  font-size: 17px;
  line-height: 1.7;
  color: var(--muted);
  max-width: 680px;
}

/* ── DOCS CARD GRID (landing) ── */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin: 26px 0 14px;
}
.docs-card {
  display: block;
  padding: 22px 22px 24px;
  border-radius: var(--radius-md);
  background: var(--white-panel);
  border: 1px solid var(--line);
  transition: var(--hover-transition);
  color: inherit;
}
.docs-card:hover {
  border-color: rgba(46, 107, 219, 0.25);
  box-shadow: var(--hover-glow-soft);
  transform: translateY(-1px);
}
.docs-card .eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-bright);
  margin-bottom: 8px;
  display: block;
}
.docs-card h3 {
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 6px;
}
.docs-card p {
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0;
}

/* ── API ENDPOINT HEADER ── */
.api-endpoint {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin: 14px 0 12px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 13px;
}
.api-method {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 9px;
  border-radius: 5px;
  color: #fff;
}
.api-method.get    { background: #2e6bdb; }
.api-method.post   { background: #16a34a; }
.api-method.patch  { background: #d97706; }
.api-method.put    { background: #d97706; }
.api-method.delete { background: #dc2626; }
.api-path { color: var(--text); font-weight: 600; }

/* ── PARAM LIST ── */
.param {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.param:first-of-type { border-top: none; }
.param-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}
.param-name {
  font-family: ui-monospace, monospace;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent);
}
.param-type {
  font-family: ui-monospace, monospace;
  font-size: 12px;
  color: var(--muted);
}
.param-required {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
}
.param-optional {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  background: var(--bg-soft);
  color: var(--muted);
}
.param p { font-size: 14px; line-height: 1.65; color: var(--muted); margin: 0; }
.param p + p { margin-top: 6px; }

/* ── PAGE NAV (prev/next) ── */
.docs-pagination {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.docs-pagination a {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: var(--white-panel);
  border: 1px solid var(--line);
  color: inherit;
  transition: var(--hover-transition);
}
.docs-pagination a:hover {
  border-color: rgba(46, 107, 219, 0.25);
  box-shadow: var(--hover-glow-soft);
}
.docs-pagination .dir {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
}
.docs-pagination .label {
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
}
.docs-pagination .next { text-align: right; }

/* ── SYNTAX HIGHLIGHT TOKENS (shared, minimal) ── */
.tok-k { color: #f5a76e; }   /* keyword */
.tok-s { color: #9dd88c; }   /* string */
.tok-c { color: #6e85a8; font-style: italic; } /* comment */
.tok-n { color: #e1ebff; }   /* name */
.tok-f { color: #7db9ff; }   /* function */
.tok-p { color: #c794ff; }   /* property */
.tok-v { color: #ffd285; }   /* value/literal */
