:root {
  --serif: "Iowan Old Style", "Apple Garamond", Baskerville,
           "Times New Roman", "Droid Serif", Times, serif;
  --sans:  -apple-system, BlinkMacSystemFont, "Segoe UI",
           Roboto, "Helvetica Neue", sans-serif;
  --measure: 38rem;
  --leading: 1.65;
  --ink: #1a1a1a;
  --paper: #fafaf8;
  --muted: #6b6b6b;
  --rule: #d8d8d4;
  --accent: #6b3a1a;
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: var(--leading);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

a { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }

/* Sans for UI / metadata */
.meta, nav, footer, .label, .stories-header, .stories-footer,
.themes, .card-themes, .year, .empty, .intro, .read-all, .view-list {
  font-family: var(--sans);
}

/* Header */
.stories-header {
  display: flex;
  align-items: baseline;
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.25rem 1.25rem 0.5rem;
  border-bottom: 1px solid var(--rule);
}
.stories-header .wordmark {
  font-weight: 700;
  letter-spacing: 0.08em;
  font-size: 0.85rem;
  color: var(--ink);
  text-decoration: none;
}
.stories-header nav {
  margin-left: auto;  /* always pushes nav to the right edge,
                         whether the wordmark is present or hidden */
}
.stories-header nav a {
  font-size: 0.85rem;
  text-decoration: none;
}

/* Footer */
.stories-footer {
  max-width: var(--measure);
  margin: 4rem auto 2rem;
  padding: 1rem 1.25rem;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
}
.stories-footer a { color: var(--muted); }

/* Page titles */
.page-title {
  font-size: 2rem;
  line-height: 1.2;
  margin: 1rem 0 0.5rem;
}
.intro { color: var(--muted); margin: 0 0 2rem; font-style: italic; }
.empty { color: var(--muted); font-style: italic; }

/* Year heading */
.year {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-top: 2rem;
  margin-bottom: 0.5rem;
}

/* Stories list */
.stories-list { list-style: none; padding: 0; margin: 0; }
.card { margin: 1.25rem 0; }
.card-date { font-size: 0.85rem; color: var(--muted); margin-right: 0.5rem; }
.card-title { font-family: var(--serif); font-size: 1.15rem; text-decoration: none; color: var(--ink); }
.card-summary { font-style: italic; margin: 0.25rem 0; }
.card-themes { font-size: 0.85rem; color: var(--muted); }

/* Themes index */
.themes-list { list-style: none; padding: 0; margin: 0; }
.theme-row { margin: 1.5rem 0; }
.theme-label { font-family: var(--serif); font-size: 1.15rem; text-decoration: none; color: var(--ink); }
.theme-count { font-size: 0.85rem; color: var(--muted); margin-left: 0.5rem; }
.theme-description { font-style: italic; color: var(--muted); margin: 0.25rem 0 0; }

/* Single story */
.story-title { font-size: 1.75rem; line-height: 1.25; margin: 1rem 0 1rem; }
.summary { font-style: italic; font-size: 1.1rem; color: var(--ink); margin: 0.5rem 0 0.75rem; }
.themes .chip {
  display: inline-block;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  margin-right: 0.5rem;
}
.meta-line { font-size: 0.85rem; color: var(--muted); margin: 0.25rem 0 1rem; }

.body p { margin: 1em 0; }
.body img { display: block; max-width: 100%; height: auto; margin: 1.5rem 0; }

.hero { margin: 1rem 0 0.5rem; }
.hero img { width: 100%; height: auto; display: block; }
.hero figcaption { font-size: 0.8rem; color: var(--muted); margin-top: 0.25rem; }

.rule { border: 0; border-top: 1px solid var(--rule); margin: 2rem 0; }
.strong-rule { border: 0; border-top: 3px double var(--rule); margin: 3rem 0; }

.source-link { font-family: var(--sans); margin-top: 1.5rem; }
.source-link a { font-weight: 600; }

/* Theme list extras */
.read-all, .view-list { display: inline-block; margin: 1rem 0; }

/* Compilation view */
.compiled-story { margin-top: 2rem; }
.compiled-story .story-title { font-size: 1.5rem; }

/* Curator dashboard */
.curator { max-width: 60rem; }
.curator-tally { font-family: var(--sans); }
.curator-list { list-style: none; padding: 0; margin: 0; }
.curator-row {
  display: grid;
  grid-template-columns: 8rem 1fr auto;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--rule);
}
.curator-meta { font-family: var(--sans); font-size: 0.8rem; color: var(--muted); }
.curator-state-badge {
  display: inline-block;
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.05em;
}
.curator-state-published .curator-state-badge { background: #1f3b1f; color: #c9e6c9; }
.curator-state-draft     .curator-state-badge { background: #3b3b1f; color: #e6e6c9; }
.curator-state-rejected  .curator-state-badge { background: #3b1f1f; color: #e6c9c9; }
.curator-state-rejected .curator-title { text-decoration: line-through; opacity: 0.6; }
.curator-date { display: block; margin-top: 0.25rem; }
.curator-title { font-weight: 600; font-size: 1.05rem; }
.curator-summary { margin: 0.4rem 0 0.4rem; font-size: 0.95rem; }
.curator-themes { font-family: var(--sans); font-size: 0.75rem; color: var(--muted); margin: 0; }
.curator-themes .chip { margin-right: 0.4rem; }
.curator-source { font-style: italic; }
.curator-actions { display: flex; flex-direction: column; gap: 0.4rem; align-items: stretch; }
.curator-btn {
  display: inline-block;
  padding: 0.3rem 0.6rem;
  border-radius: 4px;
  font-family: var(--sans);
  font-size: 0.8rem;
  text-align: center;
  text-decoration: none;
  border: 1px solid transparent;
  white-space: nowrap;
}
.curator-btn-publish { background: #1f3b1f; color: #c9e6c9; border-color: #2f5b2f; }
.curator-btn-draft   { background: #3b3b1f; color: #e6e6c9; border-color: #5b5b2f; }
.curator-btn-reject  { background: #3b1f1f; color: #e6c9c9; border-color: #5b2f2f; }
.curator-btn:hover { filter: brightness(1.2); }

@media (max-width: 640px) {
  .curator-row { grid-template-columns: 1fr; }
  .curator-actions { flex-direction: row; flex-wrap: wrap; }
}

/* Pending-saves dashboard */
.pending-row { grid-template-columns: 10rem 1fr auto; }
.pending-author {
  display: block;
  margin-top: 0.2rem;
  font-family: var(--mono, monospace);
  font-size: 0.75rem;
  color: var(--muted);
}
.pending-post {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  white-space: pre-wrap;
}
.pending-embed { margin: 0.4rem 0; font-size: 0.85rem; }
.pending-embed a { font-weight: 600; }
.pending-link {
  font-family: var(--sans);
  font-size: 0.75rem;
  margin-left: 0.4rem;
}
.pending-queued { background: rgba(255, 255, 200, 0.04); }

.chip-guess { opacity: 0.6; font-style: italic; }

.badge {
  display: inline-block;
  padding: 0.05rem 0.4rem;
  margin-right: 0.3rem;
  border-radius: 3px;
  font-family: var(--sans);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: #2a2a2a;
  color: var(--muted);
  border: 1px solid #3a3a3a;
}
.badge-article { color: #a8c8e8; border-color: #2a4a6a; }
.badge-thread  { color: #c8a8e8; border-color: #4a2a6a; }
.badge-image   { color: #e8c8a8; border-color: #6a4a2a; }

.curator-state-queued { background: #1f2f3b; color: #c9d8e6; }

@media (max-width: 640px) {
  .pending-row { grid-template-columns: 1fr; }
}

/* Gap flag — post vs. article publication date differ by > 7 days */
.gap-flag {
  display: inline-block;
  margin-top: 0.2rem;
  padding: 0.05rem 0.4rem;
  border-radius: 3px;
  background: #4a3a1f;
  color: #f0d090;
  font-family: var(--sans);
  font-size: 0.7rem;
  border: 1px solid #6a5a2f;
  white-space: nowrap;
}
.curator-gap-flagged { background: rgba(74, 58, 31, 0.05); }
