/* ── Bynefit Open Data API docs page ─────────────────────────────────────── */

:root {
  --docs-accent:  #94a3b8;
  --docs-accent2: rgba(148,163,184,.08);
  --docs-accent3: rgba(148,163,184,.15);
  --code-bg:      #0d1117;
  --code-border:  rgba(255,255,255,.07);
  --param-bg:     rgba(255,255,255,.03);
}

code, pre, .mono { font-family: 'JetBrains Mono', monospace; }

/* ── Layout ── */
.docs-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}
@media (max-width: 860px) {
  .docs-layout { grid-template-columns: 1fr; }
  .docs-sidebar { display: none; }
}

/* ── Sidebar ── */
.docs-sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  border-right: 1px solid var(--border);
  padding: 2rem 1.25rem;
  background: var(--bg);
}
.docs-sidebar .logo {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.25rem; font-weight: 800; letter-spacing: -0.04em;
  color: var(--text); text-decoration: none; display: block; margin-bottom: 2rem;
}
.docs-sidebar .logo span { color: var(--docs-accent); }
.sidebar-section { margin-bottom: 1.75rem; }
.sidebar-label {
  font-size: 0.6875rem; font-weight: 600; letter-spacing: .12em;
  text-transform: uppercase; color: var(--dim); margin-bottom: 0.625rem;
  padding: 0 0.5rem;
}
.sidebar-link {
  display: block; padding: 0.45rem 0.625rem; border-radius: 8px;
  font-size: 0.8125rem; font-weight: 400; color: var(--dim);
  text-decoration: none; transition: all .15s;
}
.sidebar-link:hover { background: var(--param-bg); color: var(--text); }
.sidebar-link.active { background: var(--docs-accent2); color: var(--docs-accent); font-weight: 500; }

/* ── Main ── */
.docs-main { max-width: 820px; padding: 3rem 2.5rem 6rem; }
@media (max-width: 640px) { .docs-main { padding: 2rem 1.25rem 4rem; } }

/* ── Sections ── */
.docs-section { margin-bottom: 4rem; scroll-margin-top: 2rem; }
.section-eyebrow {
  font-size: 0.6875rem; font-weight: 600; letter-spacing: .15em;
  text-transform: uppercase; color: var(--docs-accent);
  margin-bottom: 0.75rem;
}
.section-title {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 800; letter-spacing: -0.04em; line-height: 1.1;
  color: var(--text); margin-bottom: 1rem;
}
.section-body {
  font-size: 0.9375rem; font-weight: 300; line-height: 1.7;
  color: var(--dim); margin-bottom: 1.5rem;
}
.section-divider { border: none; border-top: 1px solid var(--border); margin: 4rem 0; }

/* ── Endpoint pill ── */
.endpoint-bar {
  display: flex; align-items: center; gap: 0.75rem;
  background: var(--code-bg); border: 1px solid var(--code-border);
  border-radius: 12px; padding: 1rem 1.25rem; margin-bottom: 1.5rem;
}
.method-pill {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem; font-weight: 500;
  background: var(--docs-accent2); color: var(--docs-accent);
  border: 1px solid var(--docs-accent3);
  padding: 3px 10px; border-radius: 6px; flex-shrink: 0;
}
.endpoint-url { font-family: 'JetBrains Mono', monospace; font-size: 0.8125rem; color: rgba(255,255,255,.6); }
.endpoint-badge {
  margin-left: auto; font-size: 0.6875rem; font-weight: 600;
  padding: 3px 8px; border-radius: 6px;
  background: rgba(37,184,102,.1); color: #25b866; border: 1px solid rgba(37,184,102,.2);
  flex-shrink: 0;
}

/* ── Params table ── */
.params-table { width: 100%; border-collapse: collapse; margin-bottom: 1.5rem; font-size: 0.875rem; }
.params-table th {
  text-align: left; padding: 0.625rem 1rem;
  font-size: 0.6875rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--dim); border-bottom: 1px solid var(--border);
}
.params-table td {
  padding: 0.875rem 1rem; border-bottom: 1px solid rgba(255,255,255,.04);
  vertical-align: top; color: var(--dim);
}
.params-table tr:last-child td { border-bottom: none; }
.params-table tr:hover td { background: var(--param-bg); }
.param-name { font-family: 'JetBrains Mono', monospace; color: var(--docs-accent); font-size: 0.8125rem; }
.param-type { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: rgba(255,255,255,.3); }
.param-opt  { font-size: 0.6875rem; color: rgba(255,255,255,.25); }
.param-desc { color: var(--dim); line-height: 1.55; }

/* ── Code blocks ── */
.code-block {
  background: var(--code-bg); border: 1px solid var(--code-border);
  border-radius: 12px; overflow: hidden; margin-bottom: 1.25rem;
}
.code-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.625rem 1rem; border-bottom: 1px solid var(--code-border);
}
.code-lang {
  font-size: 0.6875rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: rgba(255,255,255,.3);
}
.code-copy {
  font-size: 0.6875rem; color: rgba(255,255,255,.3); background: none; border: none;
  cursor: pointer; padding: 2px 6px; border-radius: 4px; transition: all .15s;
}
.code-copy:hover { background: rgba(255,255,255,.06); color: rgba(255,255,255,.6); }
.code-body { padding: 1.25rem; overflow-x: auto; }
.code-body pre { font-size: 0.8125rem; line-height: 1.65; color: rgba(255,255,255,.72); white-space: pre; }
.c-green  { color: #7ee787; }
.c-blue   { color: #79c0ff; }
.c-str    { color: #a5d6ff; }
.c-num    { color: #f0883e; }
.c-bool   { color: #56d364; }
.c-dim    { color: rgba(255,255,255,.3); }
.c-key    { color: var(--docs-accent); }
.c-purple { color: #d2a8ff; }

/* ── Response schema ── */
.schema-field {
  display: grid; grid-template-columns: 180px 1fr;
  gap: 0.5rem 1rem; padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255,255,255,.04); font-size: 0.875rem;
}
.schema-field:last-child { border-bottom: none; }
.sf-name { font-family: 'JetBrains Mono', monospace; color: var(--docs-accent); font-size: 0.8125rem; }
.sf-type { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: rgba(255,255,255,.3); display: block; margin-top: 2px; }
.sf-desc { color: var(--dim); line-height: 1.55; }

/* ── Categories grid ── */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.625rem; }
.cat-chip {
  padding: 0.5rem 0.875rem; border-radius: 8px;
  background: var(--param-bg); border: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace; font-size: 0.8rem;
  color: var(--dim); transition: all .15s; cursor: default;
}
.cat-chip:hover { border-color: var(--docs-accent3); color: var(--docs-accent); background: var(--docs-accent2); }

/* ── Explorer ── */
.explorer-bar { display: flex; flex-wrap: wrap; gap: 0.625rem; align-items: center; margin-bottom: 1rem; }
.explorer-select {
  background: var(--bg-2, #1a1713); border: 1px solid var(--border);
  border-radius: 8px; padding: 0.5rem 0.875rem;
  font-family: 'DM Sans', sans-serif; font-size: 0.875rem;
  color: var(--text); outline: none; cursor: pointer;
}
.explorer-btn {
  background: rgba(255,255,255,.1); color: var(--text, #f5ede0);
  border: 1px solid rgba(255,255,255,.15); border-radius: 8px; padding: 0.5rem 1.25rem;
  font-family: 'Bricolage Grotesque', sans-serif; font-weight: 700;
  font-size: 0.875rem; cursor: pointer; transition: all .15s;
}
.explorer-btn:hover { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.25); }
.explorer-btn:disabled { opacity: .4; cursor: not-allowed; }
#explorer-output { min-height: 120px; }

/* ── Callout ── */
.callout {
  border-left: 3px solid var(--docs-accent); background: var(--docs-accent2);
  border-radius: 0 10px 10px 0; padding: 1rem 1.25rem;
  font-size: 0.875rem; line-height: 1.65; color: var(--dim);
  margin-bottom: 1.5rem;
}
.callout strong { color: var(--docs-accent); }

/* ── Public top nav ── */
.docs-topnav {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 2rem; border-bottom: 1px solid var(--border);
  background: rgba(18,16,14,.9); backdrop-filter: blur(14px);
  position: sticky; top: 0; z-index: 50;
}
.docs-topnav-logo {
  font-family: 'Bricolage Grotesque', sans-serif;
  font-size: 1.25rem; font-weight: 800; letter-spacing: -0.04em;
  color: var(--text); text-decoration: none;
}
.docs-topnav-logo span { color: var(--docs-accent); }
.docs-topnav-links { display: flex; align-items: center; gap: 1.5rem; font-size: 0.8125rem; }
.docs-topnav-links a { color: var(--dim); text-decoration: none; transition: color .15s; }
.docs-topnav-links a:hover { color: var(--text); }
.docs-topnav-links .signin {
  background: var(--docs-accent2); color: var(--docs-accent);
  border: 1px solid var(--docs-accent3);
  padding: 0.375rem 0.875rem; border-radius: 8px;
}

/* ── Utilities added during inline-style extraction (2026-04-21) ─────── */
/* Every rule here maps to a style="" that used to live in api_docs.php. */

/* Links inside the docs use the accent color. Scoped to .docs-main so the
   sidebar and topnav keep their own treatment. */
.docs-main a,
.docs-main .param-desc a,
.callout a { color: var(--docs-accent); }

/* Stacked section (reduces the default top margin) */
.docs-section-stacked { margin-top: -2rem; }

/* Smaller secondary h2 used by sub-sections */
.section-title.docs-h2-sub { font-size: 1.5rem; }

/* Param-box: bordered rounded panel around schema/response samples */
.docs-param-box {
  background: var(--param-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.5rem;
}

/* Small margin helpers (docs-scoped — don't collide with globals) */
.docs-mb-sm { margin-bottom: .75rem; }
.docs-mb-md { margin-bottom: 1rem; }
.docs-mb-lg { margin-bottom: 1.5rem; }

/* Warning callout variant (orange — used for deprecation notices) */
.callout.callout-warn {
  border-left: 4px solid #d97706;
  background: #fff7ed;
  color: #7c2d12;
}

/* Live explorer key input */
.explorer-select.exp-key-input {
  min-width: 220px;
  font-family: 'JetBrains Mono', monospace;
  font-size: .8rem;
}

/* Explorer output states */
.exp-placeholder { color: rgba(255,255,255,.3); }
.exp-result      { color: rgba(255,255,255,.72); }
.exp-error       { color: #f0883e; }

/* JSON highlighter spans (emitted by the explorer's highlight() JS) */
.jshl-key   { color: #79c0ff; }
.jshl-str   { color: #a5d6ff; }
.jshl-bool  { color: #56d364; }
.jshl-false { color: #f0883e; }
.jshl-null  { color: rgba(255,255,255,.3); }
.jshl-num   { color: #f0883e; }
