:root {
  --bg: #11131a;
  --fg: #e8e6e1;
  --muted: #8a8d97;
  --accent: #c9a96e;
  --card: #1b1e27;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.site-header {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 1.5rem 2rem; border-bottom: 1px solid #2a2e3a;
}
.site-header h1 { font-size: 1.4rem; margin: 0; }
.site-header h1 a { color: var(--fg); }
.site-header nav a { margin-left: 1.5rem; color: var(--muted); }
.site-header nav a.active { color: var(--accent); }
main { max-width: 1100px; margin: 0 auto; padding: 2rem; }
.catalogue {
  display: grid; gap: 2rem;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.header-search { flex: 1; max-width: 28rem; margin: 0 1rem; }
.header-search input {
  width: 100%; padding: 0.45rem 0.8rem; font-size: 0.95rem;
  background: var(--bg); color: var(--fg); border: 1px solid #2a2e3a;
  border-radius: 4px; font-family: inherit;
}
.header-search input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.search-stats { color: var(--muted); font-size: 0.9rem; margin: 0 0 1rem; }
.no-matches { padding: 2rem; text-align: center; color: var(--muted); }
.book-card[hidden] { display: none; }
@media (max-width: 720px) {
  .site-header { flex-wrap: wrap; gap: 0.5rem; }
  .header-search { order: 3; flex-basis: 100%; max-width: none; margin: 0; }
}
.book-card { background: var(--card); padding: 1rem; border-radius: 6px; }
.book-card .cover img,
.book-card .cover.placeholder {
  width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 4px;
}
.book-card .cover.placeholder {
  display: flex; align-items: center; justify-content: center;
  background: #232634; color: var(--muted); font-size: 0.9rem;
}
.book-card h3 { margin: 0.75rem 0 0.25rem; font-size: 1.1rem; }
.book-card .theme { color: var(--muted); margin: 0; font-size: 0.9rem; }
.book-detail { display: grid; grid-template-columns: 280px 1fr; gap: 2rem; }
.book-detail .cover { width: 280px; aspect-ratio: 1/1; border-radius: 6px; object-fit: cover; }
.book-detail .meta h2 { margin-top: 0; }
.book-detail .stats { color: var(--muted); font-size: 0.9rem; }
.vote { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.vote-link {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.5rem 0.9rem; border-radius: 4px; font-weight: bold;
  color: #11131a; background: var(--accent);
}
.vote-link.like    { background: #6dbf7b; }
.vote-link.dislike { background: #d27474; }
.vote-link:hover { text-decoration: none; opacity: 0.9; }
.vote.pending { color: var(--muted); font-style: italic; }
.cast { padding-left: 1.2rem; }
.cast .role, .cast .source { color: var(--muted); font-size: 0.9rem; }
.sources-note { color: var(--muted); font-size: 0.9rem; max-width: 60ch; }
.sources-list { padding-left: 1.2rem; }
.sources-list li { margin: 0.35rem 0; }
.sources-list .source { color: var(--muted); font-size: 0.85rem; }
.giscus-wrapper { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid #2a2e3a; }
.giscus-wrapper h3 { margin: 0 0 0.5rem; }
.actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.read-link, .download-link {
  display: inline-flex; align-items: center; padding: 0.5rem 0.9rem;
  border-radius: 4px; font-weight: bold;
}
.read-link    { background: var(--accent); color: #11131a; }
.download-link {
  border: 1px solid var(--accent); color: var(--accent); background: transparent;
}
.read-link:hover, .download-link:hover { text-decoration: none; opacity: 0.9; }
.read { max-width: 70ch; margin: 0 auto; font-size: 1.05rem; }
.read h1 { margin-bottom: 0.25rem; }
.read .theme { color: var(--muted); margin-top: 0; font-style: italic; }
.read-back { font-size: 0.9rem; }
.chapter-nav {
  background: var(--card); padding: 0.75rem 1rem; border-radius: 6px;
  margin: 1.5rem 0;
}
.chapter-nav strong { display: block; margin-bottom: 0.4rem; color: var(--muted); font-size: 0.85rem; text-transform: uppercase; }
.chapter-nav ol { margin: 0; padding-left: 1.4rem; }
.chapter { margin-top: 3rem; scroll-margin-top: 2rem; }
.chapter h2 { border-bottom: 1px solid #2a2e3a; padding-bottom: 0.4rem; }
.chapter p { text-align: justify; }
.sources { width: 100%; border-collapse: collapse; }
.sources th, .sources td {
  text-align: left; padding: 0.5rem 1rem; border-bottom: 1px solid #2a2e3a;
}
.site-footer {
  padding: 2rem; color: var(--muted); font-size: 0.85rem; text-align: center;
}
