/* ==========================================================================
   AlphaPoint Global — brand skin for Slate API docs
   Loaded after screen.css; overrides Slate's default light theme to match
   apglobal.io (dark surfaces, green accent, Outfit / DM Sans).
   ========================================================================== */

:root {
  --dark-1: #0a0d11;
  --dark-2: #0f1217;
  --dark-3: #15181e;
  --dark-4: #1b1f27;
  --green-primary: #1ae5a1;
  --green-dim: #15c98c;
  --blue: #5b9aff;
  --amber: #f5c462;
  --white-90: rgba(255, 255, 255, 0.92);
  --white-60: rgba(255, 255, 255, 0.6);
  --white-40: rgba(255, 255, 255, 0.38);
  --white-08: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, Menlo, Monaco, 'Liberation Mono', monospace;
}

/* ---------- base ---------- */

html, body {
  background-color: var(--dark-2);
  color: var(--white-90);
  font-family: var(--font-body);
  font-size: 15px;
}

.content h1, .content h2, .content h3, .content h4, .content h5, .content h6 {
  font-family: var(--font-heading);
  letter-spacing: -0.015em;
}

.content code, .content pre {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.65;
}

.page-wrapper {
  background-color: var(--dark-2);
}

/* ---------- sidebar ---------- */

.toc-wrapper {
  background-color: var(--dark-1);
  border-right: 1px solid var(--border);
  width: 250px;
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 400;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}

.page-wrapper { margin-left: 250px; }
#nav-button.open { left: 250px; }

.toc-wrapper::-webkit-scrollbar { width: 8px; }
.toc-wrapper::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.13);
  border-radius: 4px;
}

.toc-wrapper .logo {
  width: 172px;
  max-width: calc(100% - 40px);
  height: auto;
  margin: 26px 20px 20px;
  display: block;
}

/* search */
.toc-wrapper > .search input {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--white-90);
  font-family: var(--font-body);
  font-size: 13px;
  margin: 4px 20px 14px;
  padding: 8px 10px 8px 32px;
  width: calc(100% - 40px);
  transition: border-color 140ms linear, background 140ms linear;
}
.toc-wrapper > .search input::placeholder { color: var(--white-40); }
.toc-wrapper > .search input:focus {
  border-color: rgba(26, 229, 161, 0.45);
  background: rgba(26, 229, 161, 0.04);
}
.toc-wrapper > .search:before {
  top: 13px;
  left: 31px;
  color: var(--white-40);
  font-size: 13px;
}

.toc-wrapper .search-results { background: var(--dark-3); }
.toc-wrapper .search-results a { color: var(--white-90); }
.toc-wrapper .search-results a:hover { color: var(--green-primary); text-decoration: none; }

/* nav links */
.toc-link, .toc-footer li {
  padding: 7px 20px;
  color: var(--white-60);
  border-left: 2px solid transparent;
  transition: color 130ms linear, background 130ms linear, border-color 130ms linear;
}
.toc-wrapper ul, .toc-wrapper li { line-height: 1.45; }
.toc-link:hover { color: var(--white-90); background: rgba(255, 255, 255, 0.03); }

.toc-wrapper .toc-link.active {
  background-color: rgba(26, 229, 161, 0.09);
  border-left-color: var(--green-primary);
  color: var(--green-primary);
  font-weight: 500;
}
.toc-wrapper .toc-link.active-parent {
  background-color: transparent;
  border-left-color: rgba(26, 229, 161, 0.4);
  color: var(--white-90);
  font-weight: 500;
}
.toc-wrapper .toc-list-h2 {
  background-color: rgba(0, 0, 0, 0.35);
  font-weight: 400;
}
.toc-wrapper .toc-h2 {
  padding-left: 34px;
  font-size: 12.5px;
}
#toc > ul > li > a > span {
  background-color: rgba(255, 255, 255, 0.12);
  color: var(--white-60);
  font-size: 11px;
  text-align: center;
}

/* sidebar footer (back link) */
.toc-wrapper .toc-footer {
  border-top: 1px solid var(--border);
  margin: 1.5em 20px 0;
  padding: 1em 0 1.6em;
}
.toc-wrapper .toc-footer li { padding: 0; font-size: 12.5px; }
.toc-wrapper .toc-footer a { color: var(--white-40); text-decoration: none; }
.toc-wrapper .toc-footer a:hover { color: var(--green-primary); text-decoration: none; }

/* ---------- language selector ---------- */

.lang-selector {
  background-color: var(--dark-1);
  border-bottom: 1px solid var(--border);
  font-weight: 400;
  font-size: 13px;
}
.lang-selector a {
  color: var(--white-40);
  padding: 0 14px;
  line-height: 38px;
  border-bottom: 2px solid transparent;
  transition: color 130ms linear, border-color 130ms linear;
}
.lang-selector a:hover { color: var(--white-90); }
.lang-selector a:active, .lang-selector a:focus { background-color: transparent; color: var(--white-90); }
.lang-selector a.active {
  background-color: transparent;
  color: var(--green-primary);
  border-bottom-color: var(--green-primary);
}
.page-wrapper .lang-selector { border-bottom: 1px solid var(--border); }

/* ---------- code column ---------- */

.page-wrapper .dark-box { background-color: var(--dark-1); }

.content pre, .content blockquote {
  background-color: var(--dark-1);
  color: var(--white-90);
  border-left: 1px solid var(--border);
}
.content pre { padding: 2em 28px; }
.content pre a, .content blockquote a {
  color: var(--green-primary);
  border-bottom-color: rgba(26, 229, 161, 0.4);
}
.content blockquote > p {
  background-color: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid var(--border);
  color: var(--white-60);
  font-family: var(--font-body);
  font-size: 13px;
  padding: 12px 28px;
}
.highlight, .highlight .w { background-color: transparent; }
.highlight .c, .highlight .cm, .highlight .c1, .highlight .cs { color: rgba(255, 255, 255, 0.34); }

.copy-clipboard { fill: var(--white-40); }
.copy-clipboard:hover { fill: var(--green-primary); }

/* ---------- headings ---------- */

.content h1 {
  background-color: transparent;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  color: #fff;
  font-size: 27px;
  font-weight: 600;
  padding-top: 0.7em;
  padding-bottom: 0.7em;
  margin-top: 2.4em;
  margin-bottom: 24px;
}
.content h2 {
  background-image: none;
  border-top: 1px solid var(--border);
  color: #fff;
  font-size: 20px;
  font-weight: 600;
  padding-top: 1.3em;
  padding-bottom: 1.1em;
  margin-top: 3.4em;
}
.content h1 + h2, .content h1 + div + h2 { margin-top: -24px; }
.content h3, .content h4, .content h5, .content h6 {
  color: #fff;
  font-size: 15.5px;
  font-weight: 600;
  margin-top: 2.4em;
  margin-bottom: 0.7em;
}
.content h4, .content h5, .content h6 {
  color: var(--white-60);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

/* ---------- body copy ---------- */

.content p, .content li, .content dt, .content dd { line-height: 1.72; }
.content > p, .content > ul, .content > ol, .content > dl { color: var(--white-90); }
.content a { color: var(--green-primary); text-decoration: none; }
.content a:hover { color: var(--green-dim); text-decoration: underline; }
.content strong, .content b { color: #fff; font-weight: 600; }
.content hr {
  border-top: 1px solid var(--border);
  border-bottom: none;
  margin: 2.4em 0;
}

/* Slate uses word-break:break-all, which chops URLs mid-string at the line
   edge. Wrap to the next line first, and only break if it still won't fit. */
.content code {
  word-break: normal;
  overflow-wrap: break-word;
  hyphens: none;
  background-color: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--green-primary);
  padding: 1.5px 5px;
}
.content pre > code { background-color: transparent; border: none; color: inherit; padding: 0; }
.content blockquote > p code { background-color: rgba(255, 255, 255, 0.07); }

/* ---------- tables ---------- */

.content table {
  border: 1px solid var(--border);
  border-radius: 8px;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 1.6em;
  max-width: 100%;
  /* Slate renders tables as display:block, so wide rows (long URLs in <code>)
     overrun the 50% column. Scroll them horizontally inside the table card
     rather than wrapping mid-URL or letting the overflow get cut off. */
  overflow-x: auto;
  overflow-y: hidden;
}
.content table th code, .content table td code { white-space: nowrap; }

.content table::-webkit-scrollbar { height: 9px; }
.content table::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.03);
  border-radius: 0 0 8px 8px;
}
.content table::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.18);
  border-radius: 5px;
}
.content table::-webkit-scrollbar-thumb:hover {
  background-color: rgba(26, 229, 161, 0.5);
}

/* code samples scroll rather than wrap, with a matching scrollbar */
.content pre { overflow-x: auto; }
.content pre::-webkit-scrollbar { height: 9px; }
.content pre::-webkit-scrollbar-track { background: transparent; }
.content pre::-webkit-scrollbar-thumb {
  background-color: rgba(255, 255, 255, 0.16);
  border-radius: 5px;
}
.content pre::-webkit-scrollbar-thumb:hover {
  background-color: rgba(26, 229, 161, 0.5);
}
.content table th {
  background-color: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid var(--border);
  color: var(--white-60);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.07em;
  padding: 9px 12px;
  text-transform: uppercase;
  vertical-align: middle;
}
.content table td {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--white-90);
  padding: 11px 12px;
}
.content table tr:nth-child(odd) > td,
.content table tr:nth-child(even) > td { background-color: transparent; }
.content table tr:hover > td { background-color: rgba(255, 255, 255, 0.02); }
.content table tr:last-child { border-bottom: none; }
.content table tr:last-child > td { border-bottom: none; }

/* ---------- asides ---------- */

.content aside {
  background: rgba(91, 154, 255, 0.09);
  border: 1px solid rgba(91, 154, 255, 0.22);
  border-left-width: 2px;
  border-radius: 6px;
  color: var(--white-90);
  line-height: 1.7;
  padding: 1em 1.2em;
  margin-top: 1.7em;
  margin-bottom: 1.7em;
}
.content aside.warning {
  background-color: rgba(245, 196, 98, 0.09);
  border-color: rgba(245, 196, 98, 0.24);
}
.content aside.success {
  background-color: rgba(26, 229, 161, 0.09);
  border-color: rgba(26, 229, 161, 0.26);
}
.content aside:before { color: var(--blue); opacity: 0.9; }
.content aside.warning:before { color: var(--amber); }
.content aside.success:before { color: var(--green-primary); }

.content .search-highlight {
  background: rgba(26, 229, 161, 0.28);
  border: 1px solid rgba(26, 229, 161, 0.5);
  color: #fff;
}

/* ---------- mobile nav button ---------- */

#nav-button span {
  background-color: rgba(15, 18, 23, 0.92);
  border: 1px solid var(--border);
  border-bottom: none;
  color: var(--white-90);
  font-family: var(--font-heading);
  font-size: 12px;
  letter-spacing: 0.05em;
}
#nav-button { color: var(--white-90); opacity: 0.85; }

@media (max-width: 930px) {
  .toc-wrapper { left: -250px; }
  .toc-wrapper.open { left: 0; }
  .page-wrapper { margin-left: 0; }
}
