/* Shared design system for the ai_news web pages.
 *
 * The landing page (index.html) keeps its own inline <style>; this file mirrors
 * the same tokens + component look so the server-rendered pages (archive, issue
 * views) are visually consistent with it without coupling to it. Linked from the
 * page shell in server/templates.py. */

:root {
  --ink: #0f1722;
  --muted: #5b6675;
  --line: #e6e8eb;
  --bg: #f5f6f8;
  --accent: #1141a6;
  --accent-d: #0d3380;
  --ok: #0a7d3f;
  --warn: #7a5c00;
  --warn-bg: #fff8e1;
  --warn-line: #f3e2a9;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

.wrap { max-width: 680px; margin: 0 auto; padding: 28px 20px 64px; }

/* --- Site header / nav ---------------------------------------------------- */

.topbar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}
.eyebrow {
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}
.badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--warn);
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: 999px;
  padding: 2px 10px;
  margin-left: 8px;
  vertical-align: middle;
}
.nav { display: flex; gap: 16px; font-size: 14px; }
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover, .nav a.active { color: var(--accent); }

/* --- Headings ------------------------------------------------------------- */

h1 { font-size: 30px; line-height: 1.15; margin: 6px 0 6px; letter-spacing: -.02em; }
.lede { font-size: 17px; color: var(--muted); margin: 0 0 24px; }
.meta { color: var(--muted); font-size: 13px; }

/* --- Cards ---------------------------------------------------------------- */

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px 26px;
  margin: 18px 0;
  box-shadow: 0 1px 2px rgba(16, 23, 34, .04);
}
.card h2 { font-size: 16px; margin: 0 0 14px; }

/* Trends "coming soon" placeholder — the home for future charts. */
.trends {
  background: linear-gradient(180deg, #fff, #fcfdff);
  border: 1px dashed #c7d2ea;
}
.trends h2 { display: flex; align-items: center; gap: 8px; }
.trends .pill {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--accent); background: #eef3fb; border: 1px solid #d6e1f5;
  border-radius: 999px; padding: 2px 10px;
}
.trends p { color: var(--muted); margin: 0; font-size: 14px; }
.trends .spark { display: flex; align-items: flex-end; gap: 5px; height: 46px; margin: 14px 0 4px; opacity: .55; }
.trends .spark span { flex: 1; background: linear-gradient(180deg, #9db8e6, #c9d8f2); border-radius: 3px 3px 0 0; }
.trends .stats { margin: 8px 0 2px; }
.trends .stat { display: inline-block; margin-right: 18px; }
.trends .stat b { display: block; font-size: 20px; color: var(--ink); }
.trends .stat span { font-size: 12px; color: var(--muted); }

/* --- Prediction markets (Manifold swing monitor) -------------------------- */

.markets h2 { display: flex; align-items: center; gap: 8px; }
.markets .pill {
  font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ok); background: #e8f6ee; border: 1px solid #bfe6cf;
  border-radius: 999px; padding: 2px 10px;
}
.markets-lede { color: var(--muted); font-size: 13px; margin: 0 0 12px; }
ul.mkt-list { list-style: none; padding: 0; margin: 0; }
li.mkt { padding: 14px 0; border-bottom: 1px solid var(--line); }
li.mkt:last-child { border-bottom: 0; }
.mkt-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.mkt-q { font-weight: 600; color: var(--accent); text-decoration: none; font-size: 15px; }
.mkt-q:hover { text-decoration: underline; }
.mkt-prob { white-space: nowrap; font-weight: 700; font-size: 15px; color: var(--ink); }
.mkt-lead { font-weight: 600; color: var(--muted); font-size: 12px; }
.mkt-chg { font-size: 12px; font-weight: 700; margin-left: 6px; }
.mkt-chg.up { color: var(--ok); }
.mkt-chg.down { color: var(--err); }
.mkt-chg.flat { color: #9aa0a6; }
.mkt-spark { display: flex; align-items: flex-end; gap: 3px; height: 30px; margin: 8px 0 4px; opacity: .7; }
.mkt-spark span { flex: 1; min-width: 2px; background: linear-gradient(180deg, #9db8e6, #c9d8f2); border-radius: 2px 2px 0 0; }
ul.mkt-answers { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
ul.mkt-answers li {
  display: inline-flex; gap: 6px; align-items: baseline; font-size: 12px;
  background: #f1f4f9; border: 1px solid var(--line); border-radius: 999px; padding: 2px 10px;
}
ul.mkt-answers li span { color: var(--muted); }
ul.mkt-answers li b { color: var(--ink); }
.mkt-swing { margin: 8px 0 0; font-size: 13px; color: #444; }
.mkt-src { font-size: 12px; white-space: nowrap; }

/* --- Archive index -------------------------------------------------------- */

.month {
  font-size: 12px; letter-spacing: .08em; text-transform: uppercase;
  color: var(--muted); font-weight: 700;
  margin: 26px 0 8px; padding-bottom: 6px; border-bottom: 1px solid var(--line);
}
ul.issues { list-style: none; padding: 0; margin: 0; }
ul.issues li { padding: 11px 0; border-bottom: 1px solid var(--line); }
ul.issues li:last-child { border-bottom: 0; }
.issue-link { font-weight: 600; color: var(--accent); text-decoration: none; font-size: 16px; }
.issue-link:hover { text-decoration: underline; }
.issue-row-meta { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.empty { color: var(--muted); }

/* --- Single issue view ---------------------------------------------------- */

ol.items { padding-left: 20px; margin: 14px 0 0; }
ol.items li { margin: 0 0 18px; }
ol.items .title { font-weight: 600; color: var(--accent); text-decoration: none; font-size: 16px; }
ol.items .title:hover { text-decoration: underline; }
ol.items .blurb { margin: 6px 0; color: #333; }
ol.items .src { color: #888; font-size: 12px; }

.pager { display: flex; justify-content: space-between; gap: 12px; margin: 24px 0 8px; }
.pager a, .pager span { font-size: 14px; max-width: 48%; }
.pager .disabled { color: #c2c8d0; }
.pager .dir { display: block; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.caveat {
  background: var(--warn-bg);
  border: 1px solid var(--warn-line);
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 16px;
  color: var(--warn);
  font-size: 12px;
}

footer { color: #9aa0a6; font-size: 13px; text-align: center; margin-top: 30px; }
footer a { color: #9aa0a6; }
.backlink { display: inline-block; margin-top: 8px; }
