/* ─── CSS Variables (shared across all pages) ─── */
:root {
  --bg: #0f0f0f;
  --bg-card: #1a1a1a;
  --bg-hover: #242424;
  --text: #e8e8e8;
  --text-muted: #999;
  --accent: #c9a84c;
  --accent-hover: #dbb95c;
  --accent-dim: rgba(201, 168, 76, 0.15);
  --border: #2a2a2a;
  --font-serif: "Georgia", "Times New Roman", serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius: 12px;
  --max-w: 720px;
}

/* Base reset */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-serif);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}


/* ─── Blockquote (Bekenntnis-Zitat) ─── */
blockquote {
  margin: 1.5rem 0;
  padding: 1.25rem 1.5rem;
  background: rgba(201, 168, 76, 0.06);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: var(--text);
  line-height: 1.8;
  font-size: 0.95rem;
}
blockquote p {
  margin-bottom: 0.5rem;
}
blockquote p:last-child {
  margin-bottom: 0;
}
blockquote footer, blockquote cite {
  font-style: normal;
  font-size: 0.8rem;
  color: var(--text-muted);
  font-family: var(--font-sans);
  margin-top: 0.5rem;
  display: block;
}

/* Future chapters collapsed */
.topic-future {
  opacity: 0.6;
  transition: opacity 0.2s;
}
.topic-future:hover { opacity: 0.9; }
.topic-future .topic-entries,
.topic-future .topic-empty { display: none; }
.topic-future.expanded .topic-entries,
.topic-future.expanded .topic-empty { display: block; }
.topic-future.expanded { opacity: 1; }

/* Show more/less toggle */
.future-toggle {
  display: block;
  text-align: center;
  padding: 12px;
  margin-top: 8px;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--accent);
  cursor: pointer;
  border: 1px dashed var(--border);
  border-radius: 8px;
  transition: all 0.2s;
  background: none;
  width: 100%;
}
.future-toggle:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}


/* ─── Container ─── */
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }

/* ─── Header ─── */
.site-header {
  padding: 20px 0 16px;
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.site-title { font-size: 1.3rem; font-family: var(--font-sans); font-weight: 600; line-height: 1.2; }
.site-title a { color: var(--text); text-decoration: none; }
.site-title .accent { color: var(--accent); }
.header-nav {
  display: flex;
  gap: 8px 16px;
  flex-wrap: wrap;
}
.header-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  letter-spacing: 0.3px;
  padding: 2px 0;
}
.header-nav a:hover { color: var(--accent); }

/* ─── Archive / Topical (Übersicht) ─── */
.archive-header { padding: 24px 0 16px; }
.archive-header h2 { font-size: 1.3rem; }
.archive-header p { margin-top: 4px; }

.topics-overview {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
}
.topics-done { color: var(--accent); }
.topics-total { color: var(--text-muted); }
.topics-pct { color: var(--text-muted); margin-left: auto; }

.topic-group {
  margin-bottom: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-card);
  overflow: hidden;
}
.topic-group.topic-done { border-color: var(--accent-dim); }

.topic-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 20px;
}
.topic-num {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.topic-info { flex: 1; min-width: 0; }
.topic-title {
  font-size: 1.05rem;
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 600;
  margin: 0 0 2px;
}
.topic-desc {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0 0 4px;
  line-height: 1.4;
}
.topic-progress {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.topic-entries { border-top: 1px solid var(--border); }
.topic-entry {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  text-decoration: none;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.topic-entry:last-child { border-bottom: none; }
.topic-entry:hover { background: var(--bg-hover); }
.topic-entry:visited { color: var(--text); }
.topic-entry:visited .topic-entry-num { color: #8a8a8a; }
.topic-entry.consumed .topic-entry-num { color: #4caf50; }

.topic-entry-num {
  flex-shrink: 0;
  width: 32px;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 600;
}
.topic-entry-sec {
  flex-shrink: 0;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--text-muted);
  width: 50px;
}
.topic-entry-title {
  flex: 1;
  min-width: 0;
  font-size: 0.9rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.12s;
}
.topic-entry:hover .topic-entry-title { color: var(--accent); }
.topic-entry-date {
  flex-shrink: 0;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  color: var(--text-muted);
}

.topic-empty {
  padding: 12px 20px;
  margin: 0;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--text-muted);
  font-style: italic;
  border-top: 1px solid var(--border);
}

@media (max-width: 500px) {
  .topic-header { flex-direction: column; gap: 10px; }
  .topic-num { width: 40px; height: 40px; font-size: 0.75rem; }
  .topic-entry { flex-wrap: wrap; gap: 4px; }
  .topic-entry-title { white-space: normal; }
  .topic-entry-date { display: none; }
  .topic-entry-sec { width: auto; }
}

/* ─── Site Footer ─── */
.site-footer {
  padding: 24px 0 80px;
  text-align: center;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.8rem;
  border-top: 1px solid var(--border);
  margin-top: 24px;
}
.site-footer p { margin-bottom: 3px; }

/* ─── Epilogue ─── */
.epilogue {
  margin-top: 32px;
  padding: 20px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  text-align: center;
  font-family: var(--font-sans);
  font-size: 0.85rem;
}
.epilogue a { color: var(--accent); text-decoration: none; }
.epilogue a:hover { text-decoration: underline; }

/* ─── Prev / Next links ─── */
.prev-next-link, .pn {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--accent);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--accent-dim);
  transition: background 0.15s;
  margin: 0 4px;
}
.prev-next-link:hover, .pn:hover {
  background: rgba(201, 168, 76, 0.25);
}

/* ─── Wiki links (episode → wiki integration) ─── */
.wiki-top-link { display: inline-block; margin-left: 10px; font-family: var(--font-sans); }
.wiki-top-link-a {
  font-size: 0.7rem;
  color: var(--accent);
  text-decoration: none;
  opacity: 0.55;
  transition: opacity 0.15s;
}
.wiki-top-link-a:hover { opacity: 1; text-decoration: underline; }
.wiki-top-link-a::before { content: "📖 "; font-size: 0.65rem; }
.wiki-bottom-links {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.wiki-bottom-title {
  font-family: var(--font-sans);
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.wiki-bottom-tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.wiki-tag {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  color: var(--accent);
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  background: var(--accent-dim);
  text-decoration: none;
  transition: background 0.15s;
}
.wiki-tag:hover { background: rgba(201, 168, 76, 0.25); }

/* ─── Leitner badge ─── */
.review-link { position: relative; }
.due-badge {
  display: none;
  position: absolute;
  top: -6px;
  right: -10px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: #ef4444;
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  padding: 0 5px;
  font-family: var(--font-sans);
}
.due-badge.has-due { display: inline-block; }

/* ─── Scrollbar ─── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ─── Misc ─── */
.archive-list { list-style: none; }
.archive-list li { padding: 6px 0; border-bottom: 1px solid var(--border); }
.archive-list a { color: var(--accent); text-decoration: none; }

/* ─── Footer Player ─── */
.footer-player {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  z-index: 1000;
  font-family: var(--font-sans);
}
.fp-progress-wrap {
  height: 3px;
  background: var(--border);
  cursor: pointer;
  position: relative;
}
.fp-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.3s linear;
}
.fp-body {
  display: flex;
  align-items: center;
  padding: 6px 12px;
  gap: 8px;
}
.fp-info {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}
.fp-title {
  font-size: 0.8rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  font-weight: 500;
  display: inline-block;
  animation: fp-scroll 12s linear infinite;
  animation-delay: 2s;
  padding-right: 60px;
}
@keyframes fp-scroll {
  0%, 15% { transform: translateX(0); }
  85%, 100% { transform: translateX(calc(-100% + 120px)); }
}
.fp-controls { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.fp-btn {
  background: none;
  border: none;
  color: var(--text);
  cursor: pointer;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.15s;
}
.fp-btn:hover { background: rgba(255,255,255,0.08); }
.fp-btn svg { display: block; width: 18px; height: 18px; }
.fp-btn-play {
  width: 50px;
  height: 50px;
  background: var(--accent);
  color: var(--bg);
}
.fp-btn-play:hover { background: var(--accent-hover); }
.fp-btn-play svg { width: 26px; height: 26px; }
.fp-speed {
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-hover);
  padding: 3px 8px;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
  border: 1px solid var(--border);
  margin-left: 4px;
  transition: color 0.15s, border-color 0.15s;
  min-width: 34px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  line-height: 1.4;
}
.fp-speed:hover { color: var(--accent); border-color: var(--accent); }
.fp-speed.active-speed { color: var(--accent); border-color: var(--accent); }

/* ─── Chapter markers on progress bar ─── */
.fp-chapter-dot {
  position: absolute;
  top: -2px;
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
  z-index: 2;
  transform: translateX(-50%);
  opacity: 0.6;
  transition: opacity 0.15s, transform 0.15s;
}
.fp-chapter-dot:hover { opacity: 1; transform: translateX(-50%) scale(1.3); }
.fp-chapter-dot.active { opacity: 1; background: #fff; }

.fp-chapter-label {
  display: block;
  font-size: 0.7rem;
  color: var(--accent);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
  line-height: 1.3;
  margin-bottom: 2px;
}
