/* ============================================================
   Dark — Professional dark mode
   Font: Inter 400/500/600
   GitHub-inspired surfaces: #0d1117 bg / #161b22 surface
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; color-scheme: dark; }

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1rem;
  line-height: 1.75;
  color: #e6edf3;
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--c-link); text-decoration: none; transition: color 0.12s; }
a:hover { color: var(--c-link-hover); text-decoration: underline; }

.skip-link {
  position: absolute; top: -999px; left: 1rem;
  background: var(--c-accent); color: var(--c-accent-text);
  padding: 0.5rem 1rem; z-index: 999; font-size: 0.875rem;
}
.skip-link:focus { top: 0; }

/* ---------- HEADER ---------- */
header {
  background: #161b22;           /* IE11 fallback */
  background: var(--c-header);
  border-bottom: 1px solid var(--c-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 56px;
  gap: 1.5rem;
}
.site-title {
  font-size: 1.0625rem;
  font-weight: 700;
  color: #e6edf3;
  letter-spacing: -0.01em;
  white-space: nowrap;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.site-title:hover { text-decoration: none; color: #fff; }
.site-title::before {
  content: "◆";
  color: var(--c-accent);
  font-size: 0.75rem;
}
.site-title span { color: var(--c-suffix); font-weight: 400; }

.header-inner nav { display: flex; gap: 0; }
.header-inner nav a {
  color: var(--c-nav);
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
  font-weight: 500;
  border-radius: 6px;
  white-space: nowrap;
  transition: background 0.12s, color 0.12s;
}
.header-inner nav a:hover {
  background: rgba(255,255,255,0.06);
  color: #e6edf3;
  text-decoration: none;
}

/* ---------- MAIN ---------- */
main {
  max-width: 780px;
  margin: 2rem auto 4rem;
  padding: 0 1.5rem;
}

/* ---------- BREADCRUMB ---------- */
.breadcrumb {
  font-size: 0.8125rem;
  color: #8b949e;
  margin-bottom: 1.25rem;
}
.breadcrumb a { color: var(--c-link); font-weight: 500; }

/* ---------- PAGE TITLE ---------- */
main > h1,
main > p.breadcrumb + h1 {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.025em;
  color: #f0f6fc;
  margin-bottom: 0.875rem;
}

/* ---------- ARTICLE META ---------- */
.article-date {
  font-size: 0.8125rem;
  color: #8b949e;
  font-weight: 500;
  margin-bottom: 1.5rem;
}

/* ---------- ARTICLE IMAGE ---------- */
.article-image {
  margin: 0 0 2rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--c-border);
}
.article-image img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  display: block;
}
.article-image figcaption {
  font-size: 0.75rem;
  color: #8b949e;
  padding: 0.5rem 0.75rem;
  background: var(--c-surface);
}

/* ---------- ARTICLE TYPOGRAPHY ---------- */
main h2 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-h2);
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--c-border);
}
main h3 {
  font-size: 1.0625rem;
  font-weight: 600;
  color: #c9d1d9;
  margin: 1.5rem 0 0.5rem;
}
main p { margin-bottom: 1.125rem; color: #c9d1d9; }
main ul, main ol { margin: 0 0 1.25rem 1.5rem; color: #c9d1d9; }
main li { margin-bottom: 0.375rem; }
main strong { font-weight: 600; color: #e6edf3; }
main code {
  background: #21262d;
  border: 1px solid var(--c-border);
  border-radius: 6px;
  padding: 0.125rem 0.4rem;
  font-size: 0.875em;
  color: #79c0ff;
  font-family: "SF Mono", "Fira Code", Consolas, monospace;
}
main blockquote {
  border-left: 4px solid var(--c-border);
  padding: 0.5rem 1.25rem;
  margin: 1.75rem 0;
  color: #8b949e;
  background: #161b22;
  border-radius: 0 6px 6px 0;
}

/* ---------- ARTICLE LIST ---------- */
.article-list {
  list-style: none; padding: 0; margin: 1.5rem 0 0;
  display: flex; flex-direction: column; gap: 0.375rem;
}
.article-list li {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 8px;
  transition: border-color 0.12s;
}
.article-list li:hover {
  border-color: var(--c-accent);
}
.article-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.125rem;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #c9d1d9;
  gap: 1rem;
}
.article-list a:hover { color: var(--c-link); text-decoration: none; }
.article-list a::after {
  content: "→";
  color: var(--c-border);
  font-size: 0.875rem;
  flex-shrink: 0;
  transition: color 0.12s;
}
.article-list li:hover a::after { color: var(--c-accent); }

/* ---------- RELATED ARTICLES ---------- */
.related-articles {
  margin-top: 2.5rem;
  padding: 1.5rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: 8px;
}
.related-articles h2 {
  font-size: 0.6875rem;
  font-weight: 700;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.875rem;
  padding: 0; border: none;
}
.related-articles ul { list-style: none; padding: 0; }
.related-articles li a {
  display: flex; align-items: center; gap: 0.5rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--c-border);
  font-size: 0.9375rem;
  color: #8b949e;
  transition: color 0.12s;
}
.related-articles li:last-child a { border-bottom: none; }
.related-articles li a::before { content: "›"; color: var(--c-accent); flex-shrink: 0; }
.related-articles li a:hover { color: var(--c-link); text-decoration: none; }

/* ---------- PAGINATION ---------- */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 0.625rem; margin-top: 2.5rem;
}
.pagination a {
  display: inline-flex; align-items: center;
  padding: 0.5rem 1.125rem;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  color: var(--c-link);
  border-radius: 6px;
  font-size: 0.875rem; font-weight: 600;
  transition: border-color 0.12s, background 0.12s;
}
.pagination a:hover {
  background: #21262d;
  border-color: var(--c-accent);
  text-decoration: none;
  color: var(--c-link);
}
.pagination-info { font-size: 0.8125rem; color: #8b949e; }

/* ---------- FOOTER ---------- */
footer {
  background: var(--c-footer);
  color: var(--c-footer-text);
  padding: 2rem 1.5rem;
  border-top: 1px solid var(--c-border);
}
footer p {
  max-width: 1200px; margin: 0 auto; text-align: center;
  font-size: 0.8125rem;
}
footer a { color: var(--c-footer-hover); font-weight: 500; }
footer a:hover { color: #f0f6fc; text-decoration: underline; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 768px) {
  .header-inner { padding: 0 1rem; }
  main { padding: 0 1rem; }
  main > h1 { font-size: 1.75rem; }
}

/* ---------- ACTIVE NAV ---------- */
.header-inner nav a.nav-active {
  background: rgba(255,255,255,0.12);
  color: #e6edf3;
  border-bottom: 1px solid var(--c-accent);
  padding-bottom: calc(0.5rem - 1px);
  text-decoration: none;
}
