:root {
  --text: #1a1a1a;
  --bg: #fff;
  --accent: #8b4513;
  --border: #ddd;
  --meta-bg: #f8f5f0;
  --tag-bg: #eee;
  --max-width: 48rem;
}

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

body {
  font-family: Georgia, 'Times New Roman', serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1rem;
}

a { color: var(--accent); }
a:hover { text-decoration: none; }

/* Header */
.site-header {
  border-bottom: 2px solid var(--accent);
  padding: 1rem 0;
  margin-bottom: 2rem;
}
.site-header nav {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1.5rem;
}
.site-title {
  font-size: 1.1rem;
  font-weight: bold;
  text-decoration: none;
  margin-right: auto;
}
.nav-links { display: flex; gap: 1rem; flex-wrap: wrap; }
.nav-links a { text-decoration: none; font-size: 0.9rem; }
.nav-links a.active { font-weight: bold; }

/* Homepage */
.home h1 { margin-bottom: 0.5rem; }
.home-description { margin-bottom: 2rem; color: #555; }
.sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}
.section-card {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem;
}
.section-card h2 { font-size: 1.1rem; margin-bottom: 0.25rem; }
.section-card h2 a { text-decoration: none; }
.count { font-size: 0.85rem; color: #888; }

/* Metadata block */
.metadata {
  background: var(--meta-bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem;
  margin: 1rem 0 1.5rem;
  font-size: 0.9rem;
}
.meta-item { margin-bottom: 0.3rem; }

/* Tags */
.tag {
  display: inline-block;
  background: var(--tag-bg);
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
  font-size: 0.8rem;
  margin-right: 0.25rem;
}

/* Content */
.content { margin-top: 1.5rem; }
.content h2 { font-size: 1.3rem; margin: 1.5rem 0 0.5rem; }
.content h3 { font-size: 1.1rem; margin: 1.2rem 0 0.4rem; }
.content p { margin-bottom: 0.8rem; }
.content blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1rem;
  margin: 1rem 0;
  color: #444;
  font-style: italic;
}
.content ul, .content ol { margin: 0.5rem 0 0.8rem 1.5rem; }

/* Lists */
.list-page h1 { margin-bottom: 0.5rem; }
.section-description { color: #555; margin-bottom: 1rem; }
.list-controls { margin-bottom: 1rem; }
#filter-input {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.95rem;
  font-family: inherit;
}
.item-list { list-style: none; }
.item-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem;
}
.item-list a { flex: 1; min-width: 200px; }
.date-mentioned { font-size: 0.85rem; color: #888; }
.author { font-size: 0.85rem; color: #666; }

/* Extract list on homepage */
.extract-list { list-style: none; }
.extract-list li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
}
.extract-list a { flex: 1; }

/* Search */
.search-page { min-height: 60vh; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 1rem 0;
  margin-top: 3rem;
  font-size: 0.85rem;
  color: #888;
}

/* Responsive */
@media (max-width: 600px) {
  .sections-grid { grid-template-columns: 1fr; }
}
