/* EL Language Docs — forced light theme, regardless of OS preference */

:root {
  color-scheme: light only;

  --el-blue: #48CFFF;
  --el-blue-dark: #0C447C;
  --el-blue-darker: #042C53;
  --el-blue-tint: #E6F1FB;

  --bg: #FFFFFF;
  --bg-sidebar: #FAFBFC;
  --text: #1A1F24;
  --text-secondary: #5B6470;
  --text-muted: #8A93A0;
  --border: #E2E6EA;

  --code-bg: #0F1720;
  --code-text: #C6CCD6;

  --font-ui: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-head: "Space Grotesk", var(--font-ui);
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  --navbar-h: 56px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.65;
}

a { color: var(--el-blue-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Navbar ---------- */

.navbar {
  height: var(--navbar-h);
  background: var(--el-blue);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 16px;
  position: sticky;
  top: 0;
  z-index: 30;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--el-blue-darker) !important;
  text-decoration: none !important;
  flex-shrink: 0;
}

.brand-mark {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  display: block;
  object-fit: contain;
}

.brand-name {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.01em;
}

.search-wrap {
  flex: 1;
  display: flex;
  justify-content: center;
  position: relative;
  max-width: 560px;
  margin: 0 auto;
}

.search-input {
  width: 100%;
  height: 34px;
  border: none;
  border-radius: 6px;
  padding: 0 12px;
  font-family: var(--font-ui);
  font-size: 13.5px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--el-blue-darker);
}

.search-input::placeholder { color: rgba(4, 44, 83, 0.65); }

.search-input:focus {
  outline: none;
  background: #FFFFFF;
}

.search-results {
  position: absolute;
  top: 40px;
  left: 0;
  right: 0;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(4, 44, 83, 0.12);
  max-height: 320px;
  overflow-y: auto;
  z-index: 40;
}

.search-results.hidden { display: none; }

.search-result-item {
  display: block;
  padding: 8px 12px;
  font-size: 13.5px;
  color: var(--text);
  cursor: pointer;
  border-bottom: 1px solid var(--border);
}

.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover, .search-result-item.active { background: var(--el-blue-tint); }
.search-result-item .group-label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 1px;
}

.search-empty {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 30px;
  height: 30px;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
}

.nav-toggle span {
  display: block;
  height: 2px;
  border-radius: 1px;
  background: var(--el-blue-darker);
}

/* ---------- Layout ---------- */

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

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: var(--bg-sidebar);
  border-right: 1px solid var(--border);
  height: calc(100vh - var(--navbar-h));
  position: sticky;
  top: var(--navbar-h);
  overflow-y: auto;
  padding: 20px 12px;
}

.nav-group { margin-bottom: 18px; }

.nav-group-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  padding: 0 10px;
  margin-bottom: 6px;
}

.nav-link {
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13.5px;
  color: var(--text-secondary) !important;
  text-decoration: none !important;
  border-left: 2px solid transparent;
}

.nav-link:hover { background: var(--el-blue-tint); color: var(--el-blue-dark) !important; }

.nav-link.active {
  background: var(--el-blue-tint);
  color: var(--el-blue-dark) !important;
  border-left: 2px solid var(--el-blue);
  font-weight: 500;
}

.content {
  flex: 1;
  min-width: 0;
  padding: 40px 48px 80px;
}

.content h1 {
  font-family: var(--font-head);
  font-size: 30px;
  font-weight: 600;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}

.content h2 {
  font-family: var(--font-head);
  font-size: 21px;
  font-weight: 600;
  margin: 36px 0 12px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.content h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 24px 0 8px;
}

.content p { color: var(--text); margin: 0 0 14px; }

.content ul, .content ol { margin: 0 0 14px; padding-left: 22px; }
.content li { margin-bottom: 4px; }

.content img {
  max-width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin: 12px 0;
}

.content code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: var(--el-blue-tint);
  color: var(--el-blue-dark);
  padding: 2px 5px;
  border-radius: 4px;
}

.content pre {
  background: var(--code-bg);
  color: var(--code-text);
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.6;
}

.content pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}

.content blockquote {
  margin: 0 0 14px;
  padding: 8px 14px;
  border-left: 3px solid var(--el-blue);
  background: var(--el-blue-tint);
  color: var(--text-secondary);
  border-radius: 0 6px 6px 0;
}

.content table {
  border-collapse: collapse;
  width: 100%;
  margin: 0 0 18px;
  font-size: 13.5px;
}

.content th, .content td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: left;
}

.content th { background: var(--bg-sidebar); font-weight: 600; }

.mermaid {
  margin: 0 0 20px;
  display: flex;
  justify-content: center;
}

.loading, .error-msg { color: var(--text-muted); font-size: 14px; }
.error-msg { color: #A32D2D; }

.page-footer-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 13.5px;
}

/* ---------- Mobile ---------- */

.nav-scrim {
  position: fixed;
  inset: 0;
  background: rgba(4, 44, 83, 0.35);
  z-index: 20;
}

.nav-scrim.hidden { display: none; }

@media (max-width: 860px) {
  .brand-name { display: none; }
  .nav-toggle { display: flex; }

  .sidebar {
    position: fixed;
    top: var(--navbar-h);
    left: -260px;
    height: calc(100vh - var(--navbar-h));
    width: 240px;
    z-index: 25;
    transition: left 0.18s ease;
  }

  .sidebar.open { left: 0; }

  .content { padding: 28px 20px 60px; }
}
