/* Revenant Reader — graveyard theme. Dark, bone-white, one spectral accent. */

:root {
  --bg: #0d0f0e;
  --panel: #151816;
  --panel-2: #1c201d;
  --ink: #e8e4d8;
  --ink-dim: #9a958a;
  --line: #2a2f2b;
  --accent: #7ee787;
  --accent-dim: #3f7a4a;
  --danger: #e26d5a;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.5;
}

a { color: var(--accent); }

.topbar {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.brand { display: flex; gap: 0.75rem; align-items: center; }
.brand-mark { font-size: 2rem; line-height: 1; }
.brand h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.6rem;
  letter-spacing: 0.02em;
}
.tagline { margin: 0; color: var(--ink-dim); font-size: 0.85rem; }

.top-actions { display: flex; gap: 0.5rem; align-items: center; }

input, button {
  font: inherit;
  color: var(--ink);
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0.45rem 0.7rem;
}

input:focus, button:focus { outline: 2px solid var(--accent-dim); outline-offset: 1px; }

button { cursor: pointer; }
button:hover { border-color: var(--accent-dim); }
#search { min-width: 220px; }

.layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
  max-width: 1200px;
  margin: 0 auto;
}

.sidebar {
  padding: 1rem 1.25rem;
  border-right: 1px solid var(--line);
}

.sidebar h2, .reader-head h2 {
  font-family: var(--serif);
  margin: 0.25rem 0 0.75rem;
}

.feed-list { list-style: none; margin: 0 0 1rem; padding: 0; }
.feed-list button {
  width: 100%;
  text-align: left;
  background: none;
  border: 1px solid transparent;
  padding: 0.4rem 0.5rem;
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}
.feed-list button.active { background: var(--panel-2); border-color: var(--line); }
.count {
  background: var(--accent-dim);
  color: #fff;
  border-radius: 999px;
  padding: 0 0.45rem;
  font-size: 0.8rem;
}

.feed-list li { display: block; }
.feed-row { display: flex; align-items: center; }
.feed-row button[data-feed] { flex: 1; }
.feed-meta { font-size: 0.72rem; color: var(--ink-dim); padding: 0.1rem 0.2rem 0.35rem; }
.feed-error { color: var(--danger); }
.delete-feed {
  flex: none;
  padding: 0.15rem 0.4rem;
  font-size: 0.9rem;
  line-height: 1;
  background: none;
  border: 1px solid transparent;
  color: var(--ink-dim);
  opacity: 0;
  transition: opacity 0.15s;
}
.feed-row:hover .delete-feed,
.delete-feed:focus { opacity: 1; }
.delete-feed:hover { color: var(--danger); border-color: var(--danger); }

.reader-tools { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin: 0.4rem 0 0.6rem; }
.filter-toggle { display: flex; }
.filter-toggle button { border-radius: 0; }
.filter-toggle button:first-child { border-radius: 6px 0 0 6px; }
.filter-toggle button:last-child { border-radius: 0 6px 6px 0; }
.filter-toggle button.active { background: var(--accent-dim); border-color: var(--accent-dim); color: #fff; }
.keys-hint { font-size: 0.75rem; color: var(--ink-dim); }
.item.selected { outline: 1px solid var(--accent-dim); outline-offset: -1px; }

.opml { display: flex; gap: 0.8rem; align-items: center; font-size: 0.85rem; margin-top: 0.4rem; }
.opml a { color: var(--accent); }
.opml-import { cursor: pointer; color: var(--accent); text-decoration: underline; }

.add-feed { display: grid; gap: 0.4rem; margin-bottom: 1rem; }
.add-feed label { font-size: 0.85rem; color: var(--ink-dim); }
.add-feed button { background: var(--accent-dim); border-color: var(--accent-dim); color: #fff; }
.hint { font-size: 0.8rem; color: var(--ink-dim); }
.hint code { color: var(--ink); }

.reader { padding: 1rem 1.5rem; min-width: 0; }
.reader-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.75rem; }
.meta { color: var(--ink-dim); font-size: 0.85rem; }
.status { min-height: 1.25em; color: var(--ink-dim); margin: 0.25rem 0 0.75rem; }
.status.error, .error { color: var(--danger); }

.item-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; }
.item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  background: var(--panel);
}
.item.read { opacity: 0.55; }
.item-title { font-family: var(--serif); font-size: 1.1rem; text-decoration: none; }
.item-title:hover { text-decoration: underline; }
.item-desc { margin: 0.35rem 0; color: var(--ink-dim); font-size: 0.92rem; }
.item-meta { margin: 0.25rem 0 0; color: var(--ink-dim); font-size: 0.8rem; display: flex; gap: 0.75rem; align-items: center; flex-wrap: wrap; }
.mark-read { padding: 0.15rem 0.5rem; font-size: 0.8rem; }
.empty { color: var(--ink-dim); border-style: dashed; }

.foot {
  border-top: 1px solid var(--line);
  padding: 0.75rem 1.5rem;
  color: var(--ink-dim);
  font-size: 0.8rem;
  text-align: center;
}

@media (max-width: 720px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: 1px solid var(--line); }
  #search { min-width: 0; flex: 1; }
}
