/*
 * ELVIRA look for the catalog's API documentation (landing page and Redoc reference).
 *
 * The tokens repeat elvira.digital's (Docusaurus, `--e-*`); keep them in step with that site until the
 * design tokens are served from one place (knowledge issue "code style and design tokens over MCP").
 * Colour mode: `html.dark` / `html.light`, as Redoc sets it; without a class, the OS preference decides.
 */

:root {
  --e-paper: #ffffff;
  --e-ink: #1e1b1a;
  --e-muted: #625a55;
  --e-rule: #e5dfdb;
  --e-rule-strong: #cbc2bc;
  --e-wash: #f6f4f3;
  --e-accent: #a80331;
  --e-accent-hover: #8f032a;
  --e-accent-wash: #fbeef1;
  --e-font-display: "Literata", Georgia, "Times New Roman", serif;
  --e-font-text: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --e-font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --e-radius: 4px;
  --e-bar-height: 4rem;
  --e-measure: 40rem;
  --e-wide: 72rem;
  color-scheme: light;
}

:root.dark {
  --e-paper: #151313;
  --e-ink: #ece7e4;
  --e-muted: #a8a09b;
  --e-rule: #2f2a28;
  --e-rule-strong: #4a4340;
  --e-wash: #1f1c1b;
  --e-accent: #ec7a94;
  --e-accent-hover: #f094a9;
  --e-accent-wash: #2a1a1e;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not(.light) {
    --e-paper: #151313;
    --e-ink: #ece7e4;
    --e-muted: #a8a09b;
    --e-rule: #2f2a28;
    --e-rule-strong: #4a4340;
    --e-wash: #1f1c1b;
    --e-accent: #ec7a94;
    --e-accent-hover: #f094a9;
    --e-accent-wash: #2a1a1e;
    color-scheme: dark;
  }
}

/* ── The elvira.digital top bar ─────────────────────────────────────────── */

.e-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--e-bar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 0 1.25rem;
  background: var(--e-paper);
  border-bottom: 1px solid var(--e-rule);
  font-family: var(--e-font-text);
  color: var(--e-ink);
}
.e-bar a { color: inherit; text-decoration: none; }

.e-brand {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  min-width: 0;
}
.e-wordmark {
  font-family: var(--e-font-display);
  font-size: 1.35rem;
  font-weight: 650;
  letter-spacing: 0.04em;
}
.e-org {
  color: var(--e-muted);
  font-size: 0.85rem;
  white-space: nowrap;
}
.e-crumb {
  color: var(--e-muted);
  font-size: 0.9rem;
  white-space: nowrap;
}
.e-crumb a:hover { color: var(--e-accent); }
.e-crumb code {
  font-family: var(--e-font-mono);
  font-size: 0.85rem;
  color: var(--e-ink);
}

.e-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.95rem;
}
.e-nav a { color: var(--e-ink); }
.e-nav a:hover,
.e-nav a[aria-current] { color: var(--e-accent); }
.e-nav a[aria-current] { text-decoration: underline; text-underline-offset: 0.35em; }

.e-mode {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid var(--e-rule);
  border-radius: var(--e-radius);
  background: transparent;
  color: var(--e-muted);
  cursor: pointer;
}
.e-mode:hover { color: var(--e-ink); border-color: var(--e-rule-strong); }
.e-mode svg { width: 1rem; height: 1rem; fill: currentColor; }
.e-mode .e-sun { display: none; }
:root.dark .e-mode .e-sun { display: block; }
:root.dark .e-mode .e-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not(.light) .e-mode .e-sun { display: block; }
  :root:not(.light) .e-mode .e-moon { display: none; }
}

@media (max-width: 960px) {
  .e-nav .e-site { display: none; }
}
@media (max-width: 720px) {
  .e-crumb { display: none; }
}
@media (max-width: 560px) {
  .e-org { display: none; }
  .e-bar { gap: 0.75rem; padding: 0 1rem; }
  .e-nav { gap: 0.75rem; }
}
