:root {
  --bg: #fafaf9;
  --card-bg: #ffffff;
  --text: #23231f;
  --text-muted: #6b6b63;
  --border: #e2e0d8;
  --border-strong: #c9c6ba;
  --rail-line: #d3d1c5;
  --accent: #0d6e6e;
  --accent-ink: #ffffff;
  --focus: #0d6e6e;
  --tag-bg: transparent;
  --link: #0d6e6e;
  --max-width: 880px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17181a;
    --card-bg: #202224;
    --text: #e7e6e0;
    --text-muted: #a0a096;
    --border: #34363a;
    --border-strong: #47494e;
    --rail-line: #3a3c40;
    --accent: #4ec9c9;
    --accent-ink: #0e1414;
    --focus: #4ec9c9;
    --link: #4ec9c9;
  }
}

:root[data-theme="dark"] {
  --bg: #17181a;
  --card-bg: #202224;
  --text: #e7e6e0;
  --text-muted: #a0a096;
  --border: #34363a;
  --border-strong: #47494e;
  --rail-line: #3a3c40;
  --accent: #4ec9c9;
  --accent-ink: #0e1414;
  --focus: #4ec9c9;
  --link: #4ec9c9;
}

:root[data-theme="light"] {
  --bg: #fafaf9;
  --card-bg: #ffffff;
  --text: #23231f;
  --text-muted: #6b6b63;
  --border: #e2e0d8;
  --border-strong: #c9c6ba;
  --rail-line: #d3d1c5;
  --accent: #0d6e6e;
  --accent-ink: #ffffff;
  --focus: #0d6e6e;
  --link: #0d6e6e;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Georgia, "Iowan Old Style", "Times New Roman", serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
}

.site-header {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem 1.5rem;
}

.site-header h1 {
  font-size: 2rem;
  margin: 0 0 0.75rem;
  letter-spacing: -0.01em;
  font-weight: 700;
}

.subhead {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 65ch;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.disclaimer {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.88rem;
  color: var(--text-muted);
  border-left: 3px solid var(--accent);
  padding-left: 0.9rem;
  max-width: 65ch;
}

.disclaimer, .subhead { margin-top: 0; }

.undated-section {
  max-width: 1160px;
  margin: 0 auto;
  padding: 1rem 1.5rem 3rem;
  border-bottom: 1px solid var(--border);
}

.undated-heading {
  font-size: 1.15rem;
  margin: 0 0 0.5rem;
  font-weight: 700;
}

.undated-intro {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.92rem;
  color: var(--text-muted);
  max-width: 68ch;
  margin: 0 0 1.5rem;
}

.undated-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
  gap: 1.25rem;
  align-items: start;
}

.grid-entry {
  position: relative;
}

.grid-entry .entry-card {
  height: 100%;
}

.grid-entry.is-added .entry-card {
  border-top: 3px solid var(--accent);
}

.timeline-heading {
  font-size: 1.15rem;
  margin: 2rem 0 1.25rem;
  font-weight: 700;
}

main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1rem 1.5rem 4rem;
}

.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.timeline-entry {
  position: relative;
  padding: 0 0 2.5rem 1.75rem;
  border-left: 2px solid var(--rail-line);
}

.timeline-entry:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.timeline-entry::before {
  content: "";
  position: absolute;
  left: -5px;
  top: 0.5rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-strong);
}

.timeline-entry.is-added::before {
  background: var(--accent);
}

.entry-date {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.82rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
  margin-bottom: 0.5rem;
}

.entry-date .unconfirmed {
  font-style: italic;
}

.entry-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem 1.4rem 1.4rem;
}

.entry-tags {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 0.6rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tag {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 3px;
  padding: 0.18rem 0.5rem;
}

.cause-inline {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.cause-inline strong {
  color: var(--text-muted);
  font-weight: 600;
}

.entry-headline {
  margin: 0 0 0.6rem;
  font-size: 1.3rem;
  line-height: 1.3;
  font-weight: 700;
}

.entry-context {
  margin: 0 0 1rem;
  color: var(--text);
  font-size: 1.02rem;
}

.entry-cause-detail {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.85rem;
  color: var(--text-muted);
  border-left: 3px solid var(--accent);
  padding: 0.1rem 0 0.1rem 0.9rem;
  margin: 0 0 1rem;
}

.entry-cause-detail strong {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.85rem;
  margin-bottom: 0.85rem;
  border: 1px solid var(--accent);
  border-radius: 5px;
  width: fit-content;
  overflow: hidden;
}

.toggle-btn {
  appearance: none;
  border: none;
  background: var(--card-bg);
  color: var(--accent);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
}

.toggle-btn:first-child {
  border-right: 1px solid var(--accent);
}

.toggle-btn[aria-pressed="true"] {
  background: var(--accent);
  color: var(--accent-ink);
}

.toggle-btn:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: -2px;
}

.entry-toggle-content {
  font-size: 0.98rem;
  color: var(--text);
}

.entry-toggle-content strong {
  display: block;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.entry-image {
  margin: 0.75rem 0 0;
  max-width: 100%;
}

.entry-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.entry-image figcaption {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 0.4rem;
  line-height: 1.4;
}

.no-equivalent-note {
  font-style: italic;
  color: var(--text-muted);
  font-size: 0.92rem;
  border: 1px dashed var(--border-strong);
  border-radius: 5px;
  padding: 0.7rem 0.9rem;
}

.site-footer {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .site-header { padding-top: 2rem; }
  .timeline-entry { padding-left: 1.25rem; }
}
