
/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 18px;
  line-height: 1.7;
  color: #1a1a1a;
  background: #fff;
}

/* ── Top Bar ──────────────────────────────────────────────── */
.top-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  background: #fff;
  border-bottom: 1px solid #e0e0e0;
  display: flex;
  align-items: center;
  padding: 0 20px;
  z-index: 100;
  gap: 16px;
}

.site-title {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
  text-decoration: none;
  white-space: nowrap;
}

.search-wrapper {
  position: relative;
  flex: 1;
  max-width: 360px;
  margin-left: auto;
}

#search-input {
  width: 100%;
  padding: 6px 12px;
  font-size: 14px;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  font-family: inherit;
}

#search-results {
  position: absolute;
  top: 100%;
  left: 0; right: 0;
  background: #fff;
  border: 1px solid #d0d0d0;
  border-top: none;
  border-radius: 0 0 4px 4px;
  max-height: 400px;
  overflow-y: auto;
  display: none;
  z-index: 200;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

#search-results a {
  display: block;
  padding: 8px 12px;
  text-decoration: none;
  color: #1a1a1a;
  font-size: 14px;
  border-bottom: 1px solid #f0f0f0;
}

#search-results a:hover { background: #f5f5f5; }
#search-results .sr-type { color: #888; font-size: 12px; }

.hamburger {
  display: none;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  padding: 4px 8px;
}

/* ── Layout ───────────────────────────────────────────────── */
.layout {
  display: flex;
  margin-top: 52px;
  min-height: calc(100vh - 52px);
}

/* ── Sidebar ──────────────────────────────────────────────── */
.sidebar {
  width: 280px;
  min-width: 280px;
  background: #f5f5f5;
  border-right: 1px solid #e0e0e0;
  padding: 16px 0;
  overflow-y: auto;
  position: fixed;
  top: 52px;
  bottom: 0;
  left: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 14px;
}

.nav-home {
  display: block;
  padding: 8px 20px;
  color: #1a1a1a;
  text-decoration: none;
  font-weight: 600;
  border-bottom: 1px solid #e0e0e0;
  margin-bottom: 8px;
}

.nav-topic-link {
  display: block;
  padding: 5px 20px;
  color: #333;
  text-decoration: none;
  line-height: 1.4;
}

.nav-topic-link:hover { background: #eaeaea; }
.nav-topic.active > .nav-topic-link { font-weight: 600; color: #1a1a1a; background: #e8e8e8; }

.nav-docs {
  list-style: none;
  padding: 0;
  margin: 0 0 4px 0;
}

.nav-docs li a {
  display: block;
  padding: 3px 20px 3px 36px;
  color: #555;
  text-decoration: none;
  font-size: 13px;
}

.nav-docs li a:hover { background: #eaeaea; color: #1a1a1a; }
.nav-docs li a.current { font-weight: 600; color: #2563eb; }

.nav-transcript a { color: #888; font-size: 12px; }

/* ── Content ──────────────────────────────────────────────── */
.content {
  margin-left: 280px;
  max-width: 840px;
  padding: 24px 40px 60px;
  flex: 1;
}

.breadcrumbs {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 13px;
  color: #888;
  margin-bottom: 16px;
}

.breadcrumbs a { color: #2563eb; text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; }

h1 { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; font-size: 28px; font-weight: 700; margin-bottom: 16px; color: #1a1a1a; }
h2 { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; font-size: 22px; font-weight: 600; margin: 32px 0 12px; color: #1a1a1a; border-bottom: 1px solid #e0e0e0; padding-bottom: 6px; }
h3 { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif; font-size: 18px; font-weight: 600; margin: 24px 0 8px; color: #333; }

a { color: #2563eb; }
a:hover { text-decoration: underline; }

p { margin-bottom: 12px; }
ul, ol { margin: 0 0 12px 24px; }
li { margin-bottom: 4px; }

blockquote {
  border-left: 3px solid #d0d0d0;
  padding: 8px 16px;
  margin: 12px 0;
  color: #555;
  background: #fafafa;
}

code {
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.9em;
  background: #f4f4f4;
  padding: 1px 4px;
  border-radius: 3px;
}

pre {
  background: #f4f4f4;
  padding: 12px 16px;
  overflow-x: auto;
  border-radius: 4px;
  margin: 12px 0;
  font-size: 14px;
}

pre code { background: none; padding: 0; }

figure { margin: 16px 0; }
figure img { max-width: 100%; height: auto; border: 1px solid #e0e0e0; border-radius: 4px; }
figcaption { font-size: 13px; color: #888; margin-top: 4px; }

table { border-collapse: collapse; margin: 12px 0; width: 100%; }
th, td { border: 1px solid #d0d0d0; padding: 8px 12px; text-align: left; font-size: 15px; }
th { background: #f5f5f5; font-weight: 600; }

.article-body img { max-width: 100%; height: auto; }

/* ── Landing Page ─────────────────────────────────────────── */
.intro { font-size: 17px; color: #555; margin-bottom: 24px; }

.topic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.topic-card {
  display: block;
  padding: 16px;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  text-decoration: none;
  color: #1a1a1a;
  transition: box-shadow 0.15s;
}

.topic-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); text-decoration: none; }
.topic-card h3 { font-size: 16px; margin: 0 0 6px; }

.badges { margin-bottom: 6px; }

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 3px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-summary { background: #dbeafe; color: #1e40af; }
.badge-digest { background: #fef3c7; color: #92400e; }
.badge-distilled { background: #d1fae5; color: #065f46; }

.excerpt { font-size: 14px; color: #666; margin: 0; line-height: 1.5; }
.doc-count { font-size: 12px; color: #999; margin-top: 8px; display: block; }

/* ── Responsive ───────────────────────────────────────────── */
@media (max-width: 900px) {
  .hamburger { display: block; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.2s;
    z-index: 50;
  }
  .sidebar.open { transform: translateX(0); }
  .content { margin-left: 0; padding: 24px 20px 60px; }
  .topic-grid { grid-template-columns: 1fr; }
}
