/* The site's palette and fonts on Scalar's API Reference
   (/learn/docs/api-reference, api_reference_controller.js).

   Scalar draws with its own --scalar-* variables, set on body.light-mode and
   body.dark-mode. The controller adds tb-scalar to <body> while the reference
   is on the page, so these selectors outrank Scalar's own and do nothing on
   any other page. On <body> rather than on the reference's container, because
   Scalar moves its search dialog and popovers to the end of <body>.

   Colours are the Tailwind grays and indigo the learn layout uses, written out
   because Tailwind only emits the variables a template uses. */

body.tb-scalar {
  --scalar-font: var(--font-sans, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
  --scalar-font-code: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  /* The learn header is sticky and h-16; Scalar's sidebar sticks below it. */
  --scalar-custom-header-height: 4rem;
  --scalar-radius: 0.375rem;
  --scalar-radius-lg: 0.5rem;
  --scalar-radius-xl: 0.75rem;
}

/* Scalar paints <body> in its own surface colour (gray-800 in our dark
   palette), which showed as a band either side of the page. The layout's
   bg-white / dark:bg-gray-950 is what the page should keep. */
body.tb-scalar.light-mode {
  background-color: #fff;
}

body.tb-scalar.dark-mode {
  background-color: #030712; /* gray-950 */
}

body.tb-scalar.light-mode {
  --scalar-background-1: #fff;
  --scalar-background-2: #f9fafb; /* gray-50 */
  --scalar-background-3: #f3f4f6; /* gray-100 */
  --scalar-background-accent: #eef2ff; /* indigo-50 */
  --scalar-color-1: #111827; /* gray-900 */
  --scalar-color-2: #4b5563; /* gray-600 */
  --scalar-color-3: #6b7280; /* gray-500 */
  --scalar-color-accent: #4f46e5; /* indigo-600 */
  --scalar-link-color: #4f46e5;
  --scalar-link-color-hover: #4338ca; /* indigo-700 */
  --scalar-border-color: #e5e7eb; /* gray-200 */
  --scalar-focus-color: #6366f1; /* indigo-500 */
  --scalar-button-1: #4f46e5;
  --scalar-button-1-hover: #4338ca;
  --scalar-button-1-color: #fff;
  --scalar-scrollbar-color: #d1d5db; /* gray-300 */
  --scalar-scrollbar-color-active: #9ca3af; /* gray-400 */
  --scalar-shadow-1: 0 1px 2px 0 rgb(17 24 39 / 0.06);
  --scalar-shadow-2: 0 10px 24px -6px rgb(17 24 39 / 0.14), 0 2px 6px rgb(17 24 39 / 0.06), 0 0 0 1px #e5e7eb;

  --scalar-color-green: #059669; /* emerald-600 */
  --scalar-color-blue: #2563eb; /* blue-600 */
  --scalar-color-orange: #c2410c; /* orange-700 */
  --scalar-color-yellow: #a16207; /* yellow-700 */
  --scalar-color-red: #dc2626; /* red-600 */
  --scalar-color-purple: #7c3aed; /* violet-600 */

  --scalar-sidebar-background-1: #fff;
  --scalar-sidebar-color-1: #111827;
  --scalar-sidebar-color-2: #4b5563;
  --scalar-sidebar-border-color: #e5e7eb;
  --scalar-sidebar-item-hover-background: #f9fafb;
  --scalar-sidebar-item-hover-color: #111827;
  --scalar-sidebar-item-active-background: #eef2ff;
  --scalar-sidebar-color-active: #4338ca;
  --scalar-sidebar-indent-border: #e5e7eb;
  --scalar-sidebar-indent-border-hover: #d1d5db;
  --scalar-sidebar-indent-border-active: #6366f1;
  --scalar-sidebar-search-background: #fff;
  --scalar-sidebar-search-border-color: #e5e7eb;
  --scalar-sidebar-search-color: #6b7280;
}

/* The request sample is always a dark card (Scalar puts dark-mode on it in
   either theme), so it takes the dark palette too rather than Scalar's
   neutral charcoal. */
body.tb-scalar.dark-mode,
body.tb-scalar .dark-mode {
  --scalar-background-1: #030712; /* gray-950 */
  --scalar-background-2: #111827; /* gray-900 */
  --scalar-background-3: #1f2937; /* gray-800 */
  --scalar-background-accent: rgb(99 102 241 / 0.12);
  --scalar-color-1: #f3f4f6; /* gray-100 */
  --scalar-color-2: #9ca3af; /* gray-400 */
  --scalar-color-3: #8b93a1; /* between gray-400 and gray-500: 4.5:1 on gray-950 */
  --scalar-color-accent: #818cf8; /* indigo-400 */
  --scalar-link-color: #818cf8;
  --scalar-link-color-hover: #a5b4fc; /* indigo-300 */
  --scalar-border-color: #1f2937; /* gray-800 */
  --scalar-focus-color: #818cf8;
  --scalar-button-1: #6366f1; /* indigo-500 */
  --scalar-button-1-hover: #818cf8;
  --scalar-button-1-color: #fff;
  --scalar-scrollbar-color: #374151; /* gray-700 */
  --scalar-scrollbar-color-active: #4b5563; /* gray-600 */
  --scalar-shadow-1: 0 1px 2px 0 rgb(0 0 0 / 0.4);
  --scalar-shadow-2: 0 10px 24px -6px rgb(0 0 0 / 0.6), 0 2px 6px rgb(0 0 0 / 0.4), 0 0 0 1px #1f2937;

  --scalar-color-green: #34d399; /* emerald-400 */
  --scalar-color-blue: #60a5fa; /* blue-400 */
  --scalar-color-orange: #fb923c; /* orange-400 */
  --scalar-color-yellow: #facc15; /* yellow-400 */
  --scalar-color-red: #f87171; /* red-400 */
  --scalar-color-purple: #a78bfa; /* violet-400 */

  --scalar-sidebar-background-1: #030712;
  --scalar-sidebar-color-1: #f3f4f6;
  --scalar-sidebar-color-2: #9ca3af;
  --scalar-sidebar-border-color: #1f2937;
  --scalar-sidebar-item-hover-background: #111827;
  --scalar-sidebar-item-hover-color: #f3f4f6;
  --scalar-sidebar-item-active-background: rgb(99 102 241 / 0.12);
  --scalar-sidebar-color-active: #a5b4fc;
  --scalar-sidebar-indent-border: #1f2937;
  --scalar-sidebar-indent-border-hover: #374151;
  --scalar-sidebar-indent-border-active: #818cf8;
  --scalar-sidebar-search-background: #030712;
  --scalar-sidebar-search-border-color: #1f2937;
  --scalar-sidebar-search-color: #9ca3af;
}

/* The reference sits in the learn layout's main column, below the page's own
   heading, so it draws no page background of its own and the column's edge is
   a hairline rather than Scalar's full-height panel. */
.api-reference .scalar-app,
.api-reference .scalar-api-reference {
  background: transparent;
}

.api-reference ::selection {
  background: rgb(99 102 241 / 0.22);
}
