/*
 * Shared theme for the self-service API docs hub + per-plugin landing pages.
 * Tokens copied from esntr/esentire-ui-lib (@esentire/fabric)'s
 * src/scss/_variables.scss + _light.scss, so these pages match Atlas UI's
 * own look without depending on that (Vue) component library directly.
 * Deliberately NOT applied to the vendored Swagger UI bundle -- that's
 * third-party (swagger-ui-dist) and keeps its own default styling.
 */

@font-face {
  font-family: "IBM Plex Sans";
  font-display: swap;
  src: url("/docs/_assets/fonts/IBMPlexSans-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
}
@font-face {
  font-family: "IBM Plex Sans";
  font-display: swap;
  src: url("/docs/_assets/fonts/IBMPlexSans-SemiBold.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
}

:root {
  --es-primary: #40c3d9;
  --es-secondary: #5063f9;
  --es-gray-100: #d6d7db;
  --es-gray-600: #292e3b;
  --es-gray-900: #0f1116;
  --es-body-color: #33394a;
  --es-body-bg: #ffffff;
  --es-border-color: var(--es-gray-100);
  --es-logo-color: #19234d;
  --es-border-radius: 0.375rem;
  --es-font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --es-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

/* Fabric doesn't publish an official dark palette -- this reuses its own
   gray scale (gray-900/gray-600 background, gray-100 text) rather than
   inventing new colors, to stay consistent if one ever does exist. */
html[data-theme="dark"] {
  --es-body-color: var(--es-gray-100);
  --es-body-bg: var(--es-gray-900);
  --es-border-color: var(--es-gray-600);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: var(--es-font-family);
  font-size: 0.875rem;
  color: var(--es-body-color);
  background: var(--es-body-bg);
  transition: background 0.15s, color 0.15s;
}

a {
  color: var(--es-primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.es-header {
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 20px;
  background: var(--es-body-bg);
  border-bottom: 1px solid var(--es-border-color);
  position: sticky;
  top: 0;
}

.es-header__left {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.es-header__logo {
  height: 13px;
  width: auto;
  display: block;
}

.es-header__title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--es-body-color);
}

.es-layout {
  display: flex;
  align-items: flex-start;
  max-width: 1200px;
  margin: 0 auto;
}

.es-sidenav {
  flex: 0 0 220px;
  padding: 1.5rem 12px 2rem 20px;
  position: sticky;
  top: 60px;
}

.es-sidenav a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.5rem 0.75rem;
  border-radius: var(--es-border-radius);
  color: var(--es-body-color);
  font-size: 0.85rem;
  margin-bottom: 0.15rem;
}

.es-sidenav a:hover {
  background: var(--es-gray-100);
  text-decoration: none;
}

html[data-theme="dark"] .es-sidenav a:hover {
  background: var(--es-gray-600);
}

.es-sidenav a.active {
  background: var(--es-gray-100);
  color: var(--es-primary);
  font-weight: 600;
}

html[data-theme="dark"] .es-sidenav a.active {
  background: var(--es-gray-600);
}

.es-sidenav a svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.es-main {
  flex: 1;
  min-width: 0;
  padding: 2rem 20px;
}

.es-main p {
  color: var(--es-gray-600, #292e3b);
}

html[data-theme="dark"] .es-main p {
  color: var(--es-gray-100);
}

#theme-toggle {
  background: none;
  border: 1px solid var(--es-border-color);
  border-radius: var(--es-border-radius);
  color: var(--es-body-color);
  cursor: pointer;
  padding: 0.4rem 0.8rem;
  font-size: 0.8rem;
  font-family: inherit;
}

.es-main h2 {
  margin-top: 2.5rem;
}

.es-main h3 {
  margin-top: 1.75rem;
}

.es-main table {
  border-collapse: collapse;
  width: 100%;
  margin: 1rem 0;
  font-size: 0.85rem;
}

.es-main th,
.es-main td {
  border: 1px solid var(--es-border-color);
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.es-main th {
  background: var(--es-gray-100);
  font-weight: 600;
}

html[data-theme="dark"] .es-main th {
  background: var(--es-gray-600);
}

.es-main code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.85em;
  background: var(--es-gray-100);
  border-radius: 0.25rem;
  padding: 0.1rem 0.35rem;
}

html[data-theme="dark"] .es-main code {
  background: var(--es-gray-600);
}

.es-main pre {
  background: var(--es-gray-100);
  border-radius: var(--es-border-radius);
  padding: 1rem;
  overflow-x: auto;
}

html[data-theme="dark"] .es-main pre {
  background: var(--es-gray-600);
}

.es-main pre code {
  background: none;
  padding: 0;
}

.es-main blockquote {
  margin: 1rem 0;
  padding: 0.25rem 1rem;
  border-left: 3px solid var(--es-primary);
  color: var(--es-gray-600);
}

html[data-theme="dark"] .es-main blockquote {
  color: var(--es-gray-100);
}
