@import url('https://fonts.googleapis.com/css2?family=Nunito:wght@600;700;800&family=DM+Sans:ital,wght@0,400;0,500;0,600;1,400&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #F2F4F8;
  --text: #1B2838;
  --accent: #4E4BFC;
  --muted: #717B8B;
  --white: #FFFFFF;
  --border: #E0E4EC;
  --hover-bg: #EAECF4;
  --radius: 8px;
  --radius-sm: 5px;
  --max-w: 720px;
}

html { font-size: 16px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  min-height: 100vh;
}

/* ── Nav ── */
.nav {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
}

.nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  width: 100%;
}

.nav-logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  gap: 10px;
}

.nav-logo img {
  height: 50px;
  width: auto;
  display: block;
}

/* ── Layout ── */
.page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ── Hero / search ── */
.hero {
  text-align: center;
  margin-bottom: 40px;
}

.hero h1 {
  font-family: 'Nunito', sans-serif;
  font-size: 2rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}

.hero p {
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 24px;
}

.search-wrap {
  position: relative;
  max-width: 520px;
  margin: 0 auto;
}

.search-wrap svg {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

#search-input {
  width: 100%;
  padding: 14px 16px 14px 46px;
  font-family: 'DM Sans', sans-serif;
  font-size: 1rem;
  color: var(--text);
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: 40px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}

#search-input::placeholder { color: var(--muted); }

#search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(78,75,252,.12);
}

/* ── Category sections ── */
.category-section {
  margin-bottom: 36px;
}

.category-label {
  font-family: 'DM Sans', sans-serif;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 10px;
}

.article-list {
  list-style: none;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}

.article-list li {
  border-bottom: 1px solid var(--border);
}

.article-list li:last-child { border-bottom: none; }

.article-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  text-decoration: none;
  color: var(--text);
  font-size: .97rem;
  transition: background .12s;
}

.article-list a:hover { background: var(--hover-bg); }

.article-list a .arr {
  color: var(--muted);
  font-size: .85rem;
  flex-shrink: 0;
  margin-left: 12px;
}

/* ── Search results flat list ── */
#search-results {
  display: none;
}

#search-results.active {
  display: block;
}

.search-result-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 18px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  text-decoration: none;
  color: var(--text);
  font-size: .97rem;
  transition: background .12s;
}

.search-result-item:hover { background: var(--hover-bg); }

.search-result-cat {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  flex-shrink: 0;
}

.no-results {
  text-align: center;
  padding: 40px 0;
  color: var(--muted);
}

.no-results strong { color: var(--text); }

.no-results a {
  color: var(--accent);
  text-decoration: none;
}

.no-results a:hover { text-decoration: underline; }

/* ── Support block ── */
.support-block {
  margin-top: 48px;
  padding: 28px 32px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-align: center;
}

.support-block h3 {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 6px;
}

.support-block p { color: var(--muted); font-size: .95rem; }

.support-block a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.support-block a:hover { text-decoration: underline; }

/* ── Article page ── */
.article-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  font-size: .9rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.back-link:hover { text-decoration: underline; }

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.breadcrumb span { color: var(--muted); }

.article-cat {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

.article-title {
  font-family: 'Nunito', sans-serif;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 24px;
  line-height: 1.3;
}

.article-body {
  font-size: 1rem;
  line-height: 1.75;
}

.article-body h3 {
  font-family: 'Nunito', sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  margin-top: 28px;
  margin-bottom: 8px;
}

.article-body p { margin-bottom: 14px; }

.article-body ul,
.article-body ol {
  padding-left: 22px;
  margin-bottom: 14px;
}

.article-body li { margin-bottom: 5px; }

.article-body ul ul,
.article-body ol ol,
.article-body ul ol,
.article-body ol ul {
  margin-top: 4px;
  margin-bottom: 0;
}

.article-body a {
  color: var(--accent);
  text-decoration: none;
}

.article-body a:hover { text-decoration: underline; }

/* ── kbd ── */
kbd {
  display: inline-block;
  font-family: 'DM Mono', 'SFMono-Regular', 'Consolas', monospace;
  font-size: .8em;
  background: #EAECF4;
  border: 1px solid #CED3DE;
  border-radius: 4px;
  padding: 1px 6px;
  line-height: 1.6;
  color: var(--text);
  white-space: nowrap;
  vertical-align: baseline;
}

/* ── Table (keyboard shortcuts) ── */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: .95rem;
}

.article-body table td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.article-body table td:first-child {
  white-space: nowrap;
  width: 260px;
  color: var(--text);
}

.article-body table td:last-child {
  color: var(--muted);
}

.article-body table tr:last-child td { border-bottom: none; }

/* ── Not found ── */
.not-found {
  text-align: center;
  padding: 60px 0;
}

.not-found h2 {
  font-family: 'Nunito', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  margin-bottom: 10px;
}

.not-found p { color: var(--muted); margin-bottom: 20px; }

.not-found a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.not-found a:hover { text-decoration: underline; }

/* ── code ── */
.article-body code {
  font-family: 'SFMono-Regular', 'Consolas', monospace;
  font-size: .88em;
  background: #EAECF4;
  border-radius: 3px;
  padding: 1px 5px;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .page { padding: 28px 16px 60px; }
  .hero h1 { font-size: 1.5rem; }
  .article-title { font-size: 1.4rem; }
  .article-body table td:first-child { width: auto; white-space: normal; }
  .support-block { padding: 22px 18px; }
}
