/* ══════════════════════════════════════════
   DOCUMENT PAGE — API Documentation
   public/css/site/document.css
══════════════════════════════════════════ */

/* ── PAGE HEADER overrides ── */
.page-header { padding: 64px 40px 72px; }
.page-header h1 {
  font-size: clamp(26px, 4vw, 42px); line-height: 1.15;
  max-width: 640px; margin-left: auto; margin-right: auto;
}

.page-header .updated {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: rgba(255,255,255,.45); font-weight: 600;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  padding: 6px 14px; border-radius: 20px;
}
.page-header .updated svg { flex-shrink: 0; }

/* ── MAIN LAYOUT ── */
.legal-wrap { background: var(--bg); padding: 56px 40px 88px; }
.legal-layout {
  max-width: 1160px; margin: 0 auto;
  display: grid; grid-template-columns: 250px 1fr; gap: 56px;
  align-items: start;
}
.legal-sidebar {
  position: sticky; top: 88px;
  display: flex; flex-direction: column; gap: 2px;
  max-height: calc(100vh - 65px); overflow-y: auto;
}

/* ── DOC LAYOUT (wider sidebar) ── */
.doc-layout { grid-template-columns: 260px 1fr !important; }
.doc-content { display: flex; flex-direction: column; gap: 28px; }

/* ── DOC INTRO ── */
.doc-intro {
  background: linear-gradient(160deg, var(--navy) 0%, #162d6e 55%, #1a3a8a 100%);
  border-radius: 16px; padding: 32px; color: var(--white);
  position: relative; overflow: hidden;
}
.doc-intro::before {
  content: ''; position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 50px 50px; pointer-events: none;
}
.doc-intro::after {
  content: ''; position: absolute; top: -120px; right: -80px;
  width: 320px; height: 320px; border-radius: 50%;
  background: radial-gradient(circle, rgba(26,110,245,.3) 0%, transparent 70%);
  pointer-events: none;
}
.doc-intro-inner { position: relative; z-index: 1; }
.doc-intro h2 { font-size: 22px; font-weight: 800; margin-bottom: 12px; letter-spacing: -.01em; }
.doc-intro p { font-size: 14px; color: rgba(255,255,255,.6); line-height: 1.75; max-width: 640px; }
.doc-intro p + p { margin-top: 10px; }

/* ── DOC GROUP TITLE ── */
.doc-group-title {
  font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase;
  color: var(--blue); margin: 8px 0 -4px; padding-left: 4px;
}

/* ── DOC SECTION ── */
.doc-section {
  background: var(--white); border: 1.5px solid var(--border);
  border-radius: 16px; padding: 28px 32px;
}
.doc-section h3 {
  font-size: 17px; font-weight: 800; color: var(--navy); letter-spacing: -.01em;
  margin-bottom: 14px;
}
.doc-section h4 {
  font-size: 13.5px; font-weight: 800; color: var(--navy);
  margin: 20px 0 10px; letter-spacing: -.005em;
}
.doc-section p { font-size: 13.5px; color: var(--muted); line-height: 1.75; margin-bottom: 12px; }
.doc-section p:last-child { margin-bottom: 0; }
.doc-section a { color: var(--blue); font-weight: 600; }
.doc-section a:hover { text-decoration: underline; }
.doc-section strong { color: var(--navy); font-weight: 700; }

/* ── ENDPOINT BAR ── */
.endpoint-bar {
  display: flex; align-items: center;
  background: var(--navy); border-radius: 10px;
  overflow: hidden; margin: 14px 0;
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  font-size: 12.5px;
}
.endpoint-method {
  background: var(--blue); color: var(--white); font-weight: 800;
  padding: 10px 14px; letter-spacing: .05em; flex-shrink: 0;
}
.endpoint-url {
  padding: 10px 14px; color: #c8d8f0; overflow-x: auto; white-space: nowrap;
  flex: 1;
}
.endpoint-url .param { color: #5ca0ff; }
.endpoint-url .val { color: #34d399; }

/* ── CODE BLOCK ── */
.code-block {
  background: var(--navy); border-radius: 12px; overflow: hidden;
  margin: 14px 0; position: relative;
}
.code-block-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; border-bottom: 1px solid rgba(255,255,255,.08);
  font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255,255,255,.35);
}
.copy-btn {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  color: rgba(255,255,255,.5); font-size: 11px; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 7px; cursor: pointer;
  transition: background .15s, color .15s; font-family: 'Inter', sans-serif;
}
.copy-btn:hover { background: rgba(255,255,255,.1); color: var(--white); }
.copy-btn svg {
  width: 12px; height: 12px; stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.code-block pre {
  margin: 0; padding: 16px; overflow-x: auto;
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
  font-size: 12.5px; line-height: 1.7; color: #c8d8f0;
}
.code-block code { font-family: inherit; }

/* ── SYNTAX TOKENS ── */
.tok-key   { color: #7fb5ff; }
.tok-str   { color: #34d399; }
.tok-bool  { color: #f59e0b; }
.tok-num   { color: #f59e0b; }
.tok-comment { color: rgba(255,255,255,.35); font-style: italic; }
.tok-punc  { color: rgba(255,255,255,.35); }

/* ── CODE TABS ── */
.code-tabs { display: flex; gap: 6px; margin-bottom: -1px; }
.code-tab {
  padding: 9px 18px; border-radius: 9px 9px 0 0;
  font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  background: var(--bg); color: var(--muted); cursor: pointer;
  border: 1.5px solid var(--border); border-bottom: none;
  transition: all .15s;
}
.code-tab.active { background: var(--navy); color: var(--white); border-color: var(--navy); }
.code-panel { display: none; }
.code-panel.active { display: block; }

/* ── DOC TABLE ── */
.doc-table-wrap { overflow-x: auto; margin: 14px 0; border-radius: 10px; border: 1px solid var(--border); }
.doc-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.doc-table th {
  padding: 12px 16px; text-align: left;
  font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); background: var(--bg);
  border-bottom: 1px solid var(--border);
}
.doc-table td {
  padding: 11px 16px; color: var(--text); border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.doc-table tbody tr:last-child td { border-bottom: none; }
.doc-table tbody tr:hover td { background: #f9fbff; }
.doc-table code {
  background: #eef3fe; color: var(--blue); padding: 2px 6px; border-radius: 5px;
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace; font-size: 12px; font-weight: 600;
}
.doc-table .err-code {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; padding: 2px 8px; border-radius: 6px;
  background: #fef2f2; color: #dc2626; font-weight: 800; font-size: 12px;
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
}

/* ── PARAM CHIP ── */
.param-chip {
  display: inline-block; background: #eef3fe; color: var(--blue);
  padding: 1px 7px; border-radius: 5px; font-size: 12px; font-weight: 700;
  font-family: 'JetBrains Mono', 'SF Mono', Menlo, monospace;
}

/* ── NOTE BOX ── */
.note-box {
  display: flex; gap: 12px; align-items: flex-start;
  background: #eef3fe; border: 1px solid #dbe7fe; border-radius: 10px;
  padding: 14px 16px; margin: 14px 0; font-size: 13px; color: var(--navy); line-height: 1.65;
}
.note-box.warn { background: #fff7ed; border-color: #fed7aa; }
.note-box svg {
  width: 18px; height: 18px; stroke: var(--blue); fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0; margin-top: 1px;
}
.note-box.warn svg { stroke: #ea580c; }
.note-box strong { font-weight: 800; }

/* ── PLAN PILLS (doc page badges) ── */
.plan-pills { display: flex; gap: 8px; margin: 10px 0 14px; }
.plan-pill {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 12px; border-radius: 20px;
  background: #eef3fe; color: var(--blue); border: 1px solid #dbe7fe;
}

/* ── CTA WRAP ── */
.cta-wrap {
  background: var(--navy); padding: 64px 40px; text-align: center;
  position: relative; overflow: hidden;
}
.cta-wrap::after {
  content: ''; position: absolute; bottom: -150px; right: -150px;
  width: 500px; height: 500px; border-radius: 50%;
  background: radial-gradient(circle, rgba(26,110,245,.2) 0%, transparent 70%);
  pointer-events: none;
}
.cta-wrap h2 {
  font-size: clamp(20px, 3vw, 28px); font-weight: 800; color: var(--white);
  margin-bottom: 12px; letter-spacing: -.02em;
}
.cta-wrap p { font-size: 14px; color: rgba(255,255,255,.55); margin-bottom: 26px; line-height: 1.65; }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .page-header { padding: 48px 20px 56px; }
  .legal-wrap { padding: 40px 20px 64px; }
  .legal-layout,
  .doc-layout { grid-template-columns: 1fr !important; gap: 28px; }
  .legal-sidebar {
    position: static; flex-direction: row; flex-wrap: wrap;
    gap: 8px; max-height: none; overflow-y: visible;
  }
  .sidebar-label { display: none; }
  .legal-sidebar .sidebar-link { background: var(--white); border: 1px solid var(--border); }
  .sidebar-help { display: none; }
  .doc-section { padding: 22px 18px; }
  .doc-intro { padding: 24px 20px; }
  .cta-wrap { padding: 48px 20px; }
}
