:root {
  color-scheme: light dark;
  --bg: #faf7f2;
  --fg: #1c1a17;
  --accent: #7a2e2e;
  --muted: #6b6459;
  --border: #ddd6ca;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171512;
    --fg: #ece7dd;
    --accent: #d98b8b;
    --muted: #a39a8a;
    --border: #3a352c;
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  background: var(--bg);
  color: var(--fg);
  line-height: 1.6;
}

header, main, footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.5rem;
}

header {
  border-bottom: 1px solid var(--border);
}

header h1 {
  margin: 0;
  font-size: 1.5rem;
}

.hebrew-date-bar {
  display: flex;
  justify-content: space-between;
  margin: 0.4rem 0 0;
  font-size: 0.85rem;
  color: var(--muted);
}

nav a {
  margin-right: 1.25rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: bold;
}

nav a:hover {
  text-decoration: underline;
}

footer {
  color: var(--muted);
  font-size: 0.9rem;
  border-top: 1px solid var(--border);
}

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

#timeline {
  width: 100%;
  height: 400px;
  border: 1px solid var(--border);
}

.vis-item {
  border-color: var(--accent) !important;
  background-color: color-mix(in srgb, var(--accent) 20%, var(--bg)) !important;
  color: var(--fg) !important;
  cursor: pointer;
}

main.timeline-page {
  max-width: none;
}

main.timeline-page > p {
  max-width: 720px;
}

.timeline-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.5rem;
  align-items: start;
  margin-top: 1rem;
}

#preview {
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1rem;
  min-height: 200px;
}

#preview h2 {
  margin-top: 0;
  font-size: 1.1rem;
}

#preview blockquote {
  margin: 0.75rem 0;
  padding-left: 0.75rem;
  border-left: 2px solid var(--accent);
  font-style: italic;
}

#preview .preview-links a {
  margin-right: 0.75rem;
}

.favicon {
  width: 0.9em;
  height: 0.9em;
  vertical-align: middle;
  margin-left: 0.25rem;
}

.muted {
  color: var(--muted);
}

@media (max-width: 700px) {
  .timeline-layout {
    grid-template-columns: 1fr;
  }
}
