*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.7; color: #1a1a2e; background: #f5f5f5;
}
a { color: #2563eb; text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; border-radius: 4px; }
table { border-collapse: collapse; width: 100%; margin: 1rem 0; }
th, td { border: 1px solid #ddd; padding: 0.5rem; text-align: left; }
th { background: #e8f0fe; }
tr:nth-child(even) { background: #fafafa; }
code { background: #f1f1f1; padding: 0.1rem 0.3rem; border-radius: 3px; font-size: 0.9em; }
pre code { background: none; padding: 0; }

.wrapper { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px; background: #1a1a2e; color: #ccc; padding: 1.5rem;
  position: sticky; top: 0; height: 100vh; overflow-y: auto; flex-shrink: 0;
}
.sidebar h1 { font-size: 1.2rem; color: #fff; margin-bottom: 0.25rem; }
.sidebar .subtitle { font-size: 0.8rem; color: #888; margin-bottom: 1.5rem; }
.sidebar nav h2 { font-size: 0.85rem; color: #888; text-transform: uppercase; letter-spacing: 1px; margin: 1rem 0 0.4rem; }
.sidebar #search { margin-bottom: 1rem; }
.sidebar .pagefind-ui { --pagefind-ui-scale: 0.65; --pagefind-ui-primary: #888; --pagefind-ui-text: #ccc; --pagefind-ui-background: #2a2a4e; --pagefind-ui-border: #444; --pagefind-ui-tag: #2a2a4e; --pagefind-ui-border-width: 1px; --pagefind-ui-border-radius: 4px; --pagefind-ui-image-border-radius: 4px; --pagefind-ui-font: inherit; }
.sidebar .pagefind-ui__search-input { background: #2a2a4e; color: #ccc; border: 1px solid #444; border-radius: 4px; padding: 0.35rem 0.5rem; width: 100%; font-size: 0.85rem; }
.sidebar .pagefind-ui__search-input::placeholder { color: #666; }
.sidebar .pagefind-ui__search-clear { display: none; }
.sidebar .pagefind-ui__result { margin: 0.25rem 0; padding: 0.25rem 0; border-bottom: 1px solid #333; }
.sidebar .pagefind-ui__result:last-child { border-bottom: none; }
.sidebar .pagefind-ui__result-link { color: #8ab4f8; font-size: 0.8rem; }
.sidebar .pagefind-ui__result-excerpt { color: #777; font-size: 0.7rem; margin-top: 0.1rem; }
.sidebar .pagefind-ui__result-title { color: #8ab4f8; }
.sidebar .pagefind-ui__search-toggle { background: #2a2a4e; color: #ccc; border: 1px solid #444; border-radius: 4px; padding: 0.35rem 0.5rem; font-size: 0.85rem; width: 100%; text-align: left; cursor: pointer; }
.sidebar .pagefind-ui__search-toggle:hover { background: #333; }
.sidebar nav a { display: block; padding: 0.25rem 0.5rem; color: #aaa; font-size: 0.9rem; border-radius: 3px; }
.sidebar nav a:hover { color: #fff; background: #2a2a4e; text-decoration: none; }
.sidebar nav a.active { color: #fff; background: #2563eb; }

.main { flex: 1; padding: 2rem 3rem; max-width: 900px; }

.breadcrumbs { font-size: 0.85rem; color: #888; margin-bottom: 1.5rem; }
.breadcrumbs a { color: #2563eb; }
.breadcrumbs span { color: #555; }

.page-title { font-size: 2rem; color: #1a1a2e; margin-bottom: 0.5rem; border-bottom: 2px solid #2563eb; padding-bottom: 0.5rem; }
.page-subtitle { font-size: 0.95rem; color: #666; margin-bottom: 1.5rem; }

.content { font-size: 1rem; }
.content h2 { font-size: 1.5rem; color: #1a1a2e; margin: 1.5rem 0 0.75rem; border-bottom: 1px solid #ddd; padding-bottom: 0.3rem; }
.content h3 { font-size: 1.2rem; color: #333; margin: 1.2rem 0 0.5rem; }
.content p { margin: 0.75rem 0; }
.content ul, .content ol { margin: 0.5rem 0 0.5rem 1.5rem; }
.content li { margin: 0.25rem 0; }
.content blockquote { border-left: 3px solid #2563eb; background: #eef2ff; padding: 0.5rem 1rem; margin: 1rem 0; border-radius: 0 4px 4px 0; }
.content hr { border: none; border-top: 1px solid #ddd; margin: 1.5rem 0; }
.content .stat-block { background: #f8f9fa; border: 1px solid #ddd; border-radius: 6px; padding: 1rem; margin: 1rem 0; }
.content .stat-block h3 { margin-top: 0; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin: 1rem 0; }
.card {
  background: #fff; border: 1px solid #ddd; border-radius: 6px; padding: 1rem;
  transition: box-shadow 0.2s;
}
.card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.card h3 { margin: 0 0 0.3rem; font-size: 1rem; }
.card h3 a { color: #1a1a2e; }
.card h3 a:hover { color: #2563eb; }
.card p { font-size: 0.85rem; color: #666; margin: 0; }

.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; margin: 1rem 0; }
.image-grid figure { background: #fff; border: 1px solid #ddd; border-radius: 6px; overflow: hidden; }
.image-grid figcaption { padding: 0.5rem; font-size: 0.85rem; text-align: center; color: #555; }

.footer { margin-top: 3rem; padding-top: 1rem; border-top: 1px solid #ddd; font-size: 0.85rem; color: #888; text-align: center; }

@media (max-width: 768px) {
  .wrapper { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; padding: 1rem; }
  .sidebar nav { columns: 2; }
  .sidebar nav h2 { break-inside: avoid; }
  .main { padding: 1rem; }
}
