/* Docsify theme overrides to visually align with the ALEX frontend. */

:root {
  /* Docsify reads this for link accents, etc. */
  --theme-color: rgb(var(--alex-primary));
}

html,
body {
  font-family: "Satoshi", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    "Apple Color Emoji", "Segoe UI Emoji";
  background: rgb(var(--alex-bg));
  color: rgb(var(--alex-text));
}

/* Sidebar (left navigation) */
.sidebar {
  background: rgb(var(--alex-surface));
  border-right: 1px solid rgb(var(--alex-border));
  padding-left: 12px;
  padding-right: 12px;
}

.sidebar .sidebar-nav a,
.sidebar ul li a {
  color: rgb(var(--alex-text) / 0.82);
  font-weight: 500;
}

.sidebar .sidebar-nav a:hover,
.sidebar ul li a:hover {
  color: rgb(var(--alex-text));
}

.sidebar ul li.active>a {
  color: rgb(var(--alex-primary));
  font-weight: 700;
}

/* Logo */
.app-name-link {
  padding-left: 12px;
  padding-right: 12px;
}

.app-name-link img {
  max-height: 70px;
  width: auto;
  margin: 10px 0 0;
}

/* Top navbar language switch */
.app-nav {
  font-family: inherit;
  padding-left: 12px;
  padding-right: 12px;
}

/* Language dropdown injected by assets/lang-switch.js (flag-only) */
.alex-lang-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-right: 6px;
}

.alex-lang-switch__button {
  appearance: none;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  width: 44px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid rgb(var(--alex-border));
  background:
    linear-gradient(180deg, rgb(var(--alex-surface)), rgb(var(--alex-bg))) padding-box,
    radial-gradient(circle at 30% 20%, rgb(var(--alex-primary) / 0.22), transparent 55%) border-box;
  color: rgb(var(--alex-text));
  cursor: pointer;
  outline: none;
}

.alex-lang-switch__button::after {
  content: "";
  width: 0;
  height: 0;
  margin-left: 6px;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid rgb(var(--alex-text) / 0.7);
}

.alex-lang-switch__button:focus-visible {
  border-color: rgb(var(--alex-primary) / 0.55);
  box-shadow: 0 0 0 4px rgb(var(--alex-primary) / 0.18);
}

.alex-lang-switch__button:hover {
  border-color: rgb(var(--alex-primary) / 0.35);
}

.alex-lang-switch__buttonInner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.alex-lang-switch__flag {
  width: 22px;
  height: 16px;
  border-radius: 3px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.12);
}

.alex-lang-switch__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 1000;
  padding: 6px;
  background: rgb(var(--alex-surface));
  border: 1px solid rgb(var(--alex-border));
  border-radius: 12px;
  box-shadow: 0 10px 30px rgb(0 0 0 / 0.16);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.alex-lang-switch__option {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 36px;
  padding: 0;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
}

.alex-lang-switch__option:hover {
  background: rgb(var(--alex-bg));
  border-color: rgb(var(--alex-border));
}

.alex-lang-switch__option:focus-visible {
  border-color: rgb(var(--alex-primary) / 0.55);
  box-shadow: 0 0 0 4px rgb(var(--alex-primary) / 0.18);
  outline: none;
}

.alex-lang-switch__option[aria-selected="true"] {
  background: rgb(var(--alex-primary) / 0.1);
  border-color: rgb(var(--alex-primary) / 0.3);
}

/* Content */
.content {
  background: rgb(var(--alex-bg));
}

.markdown-section {
  max-width: 980px;
  padding: 32px 32px 56px;
  background: rgb(var(--alex-surface));
  border: 1px solid rgb(var(--alex-border));
  border-radius: 14px;
  box-shadow: 0 2px 8px rgb(0 0 0 / 0.06);
}

.markdown-section h1,
.markdown-section h2,
.markdown-section h3,
.markdown-section h4 {
  font-family: inherit;
  color: rgb(var(--alex-text));
}

.markdown-section h1 {
  font-weight: 800;
}

.markdown-section h2 {
  font-weight: 800;
}

.markdown-section h3,
.markdown-section h4 {
  font-weight: 700;
}

.markdown-section a {
  color: rgb(var(--alex-primary));
  text-decoration-color: rgb(var(--alex-primary) / 0.45);
}

.markdown-section a:hover {
  text-decoration-color: rgb(var(--alex-primary));
}

.markdown-section blockquote {
  border-left: 4px solid rgb(var(--alex-primary));
  background: rgb(var(--alex-primary) / 0.05);
  color: rgb(var(--alex-text) / 0.9);
}

.markdown-section code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  background: rgb(var(--alex-primary) / 0.08);
  color: rgb(var(--alex-text));
  border-radius: 6px;
  padding: 0.12em 0.35em;
}

.markdown-section pre>code {
  background: transparent;
  padding: 0;
}

.markdown-section pre {
  border-radius: 12px;
  border: 1px solid rgb(var(--alex-border));
  box-shadow: none;
}

.markdown-section table {
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid rgb(var(--alex-border));
  border-radius: 12px;
  overflow: hidden;
}

.markdown-section th,
.markdown-section td {
  border-color: rgb(var(--alex-border));
}

.markdown-section th {
  background: rgb(var(--alex-bg));
  color: rgb(var(--alex-text));
  font-weight: 700;
}

/* Narrow view: reduce padding so the “card” stays readable. */
@media (max-width: 600px) {
  .markdown-section {
    padding: 20px 18px 40px;
    border-radius: 12px;
  }
}
