/* Plenarwatch — base styles (TheyWorkForYou-inspired)
   Dark header, plain typography, compact single-row footer.
*/

:root {
  --paper: #fdfcf7;
  --paper-sub: #f3f1e8;
  --ink: #111111;
  --muted: #555555;
  --muted-soft: #888888;
  --border: #dadad5;

  --accent: #b9002a;                /* subtle bundestag-ish red for brand mark only */
  --nav-accent: #005299;            /* navy-blue for active tab underline */
  --link: #005299;
  --link-hover: #00213f;

  --ja: #2e7d32;
  --nein: #b71c1c;

  --wrap-w: 720px;
  --wrap-wide: 960px;
  --radius: 2px;

  --font-sans: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--link-hover); }

img { max-width: 100%; height: auto; }

/* ---------- Site header: single row, minimal ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(253, 252, 247, 0.96);
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(180%) blur(8px);
  -webkit-backdrop-filter: saturate(180%) blur(8px);
}

.site-header-inner {
  max-width: var(--wrap-wide);
  margin: 0 auto;
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  font-weight: 700;
  font-size: 19px;
  letter-spacing: -0.02em;
  line-height: 1;
  flex-shrink: 0;
}
.brand:hover { color: var(--ink); }
.brand-mark { color: var(--ink); }
.brand-dot { color: var(--accent); margin-left: 1px; }

.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 1;
  overflow-x: auto;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.main-nav::-webkit-scrollbar { display: none; }
.main-nav a {
  position: relative;
  color: var(--muted);
  text-decoration: none;
  padding: 8px 12px;
  font-size: 14.5px;
  font-weight: 500;
  white-space: nowrap;
  border-radius: var(--radius);
  transition: color .12s ease, background .12s ease;
}
.main-nav a:hover {
  color: var(--ink);
  background: var(--paper-sub);
}
.main-nav a.active {
  color: var(--ink);
}
.main-nav a.active::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  background: var(--nav-accent);
}

.header-cta {
  flex-shrink: 0;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color .12s ease, color .12s ease, background .12s ease;
}
.header-cta:hover {
  color: var(--link);
  border-color: var(--link);
  background: #fff;
  text-decoration: none;
}
.header-cta::after {
  content: " ↗";
  color: var(--muted-soft);
  font-weight: 400;
}

/* ---------- Main content ---------- */

main { min-height: calc(100vh - 200px); }

.wrap, .page, .feed, .tracker-intro, .tracker-chart-area, .hero {
  max-width: var(--wrap-w);
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}
.tracker-chart-area { max-width: var(--wrap-wide); }

h1, h2, h3, h4 {
  color: var(--ink);
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin: 0 0 0.4em;
}
h1 { font-size: 2rem; font-weight: 700; }
h2 { font-size: 1.4rem; font-weight: 700; margin-top: 2em; }
h3 { font-size: 1.15rem; font-weight: 700; margin-top: 1.8em; }
h4 { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }

p { margin: 0 0 1em; }
ul, ol { padding-left: 1.3em; margin: 0 0 1em; }
li { margin: 0.3em 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2em 0; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--paper-sub);
  padding: 1px 5px;
  border-radius: 2px;
}

/* ---------- Homepage intro ---------- */

.hero {
  padding-top: 40px;
  padding-bottom: 8px;
}
.hero h1 { margin-bottom: 8px; }
.hero .tagline {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 0 0 16px;
  max-width: 60ch;
}

/* ---------- Feed articles ---------- */

.feed {
  padding-top: 8px;
  padding-bottom: 48px;
}
.feed h2.section-head {
  margin-top: 24px;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  padding-bottom: 6px;
}

.post {
  border-top: 1px solid var(--border);
  padding: 28px 0;
}
.post:first-of-type { border-top: 0; }
.post:last-child { border-bottom: 1px solid var(--border); }

.post header time {
  display: inline-block;
  font-size: 0.82rem;
  color: var(--muted-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}
.post header h2 {
  margin-top: 0;
  font-size: 1.4rem;
}
.post .meta {
  color: var(--muted);
  font-size: 0.92rem;
  margin: 0.2em 0 0.6em;
}
.post .result {
  display: inline-block;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius);
  margin: 6px 0 0;
  font-size: 0.92rem;
}
.post .result-ja { background: #e7f2e7; color: var(--ja); }
.post .result-nein { background: #fde8e8; color: var(--nein); }

.post .body { margin-top: 16px; }
.post .body p { margin: 0 0 0.9em; }
.post .body h3 {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 1.4em;
  margin-bottom: 0.3em;
}
.post .body hr.topbar { border: 0; border-top: 1px solid var(--border); margin: 1.2em 0; }
.post .body hr.sep { border: 0; border-top: 1px dashed var(--border); margin: 1.2em 0; }
.post .body .party {
  padding: 6px 10px;
  border-radius: var(--radius);
  margin: 4px 0;
  font-size: 0.94rem;
}
.post .body .party strong { margin-right: 10px; }
.post .body .party .stats { color: var(--muted); }
.post .body .party-cdu-csu { background: #eeeeee; }
.post .body .party-afd { background: #e5f4fb; }
.post .body .party-spd { background: #fde7e9; }
.post .body .party-bndnis-90-die-grnen { background: #eaf3e3; }
.post .body .party-die-linke { background: #f7e8ef; }
.post .body .party-fraktionslose { background: #f3f1e8; }

.post-footer {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  font-size: 0.88rem;
  color: var(--muted);
}

/* ---------- Tracker-chart pages ---------- */

.tracker-intro { padding-top: 40px; padding-bottom: 8px; }
.tracker-intro > p { color: var(--muted); max-width: 62ch; }
.tracker-chart-area { padding-bottom: 48px; }

.aw-controls, .zr-controls {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin: 24px 0 12px; align-items: center;
}
.aw-controls button, .zr-controls button {
  padding: 7px 14px;
  border: 1px solid var(--border);
  background: var(--paper);
  cursor: pointer;
  border-radius: var(--radius);
  font: inherit;
  font-size: 14px;
  color: var(--muted);
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.aw-controls button:hover, .zr-controls button:hover { border-color: var(--ink); color: var(--ink); }
.aw-controls button.active, .zr-controls button.active {
  background: var(--ink); color: #fff; border-color: var(--ink);
}
.aw-controls select, .zr-controls select {
  padding: 7px 10px; font: inherit; font-size: 14px;
  border: 1px solid var(--border); background: var(--paper);
  border-radius: var(--radius);
}
.aw-controls label, .zr-controls label { font-size: 14px; color: var(--muted); margin-left: 8px; }

.aw-chart-wrap, .zr-chart-wrap {
  position: relative;
  height: 440px;
  margin: 10px 0 28px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}

.aw-totals, .zr-totals { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.aw-totals th, .aw-totals td, .zr-totals th, .zr-totals td {
  padding: 10px 14px; text-align: right;
  border-bottom: 1px solid var(--border);
}
.aw-totals th:first-child, .aw-totals td:first-child,
.zr-totals th:first-child, .zr-totals td:first-child { text-align: left; }
.aw-totals thead th, .zr-totals thead th {
  background: var(--paper-sub); font-weight: 700;
  text-transform: uppercase; font-size: 0.76rem;
  letter-spacing: 0.04em; color: var(--muted);
}
.aw-swatch, .zr-swatch {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 2px; margin-right: 8px; vertical-align: middle;
}
.aw-note, .zr-note { color: var(--muted); font-size: 0.85rem; margin-top: 24px; }

/* ---------- Generic content pages ---------- */

.page { padding-top: 40px; padding-bottom: 56px; }
.page h2 { font-size: 1.2rem; margin-top: 2em; }
.page address {
  font-style: normal;
  padding: 12px 16px;
  background: var(--paper-sub);
  border-left: 3px solid var(--accent);
  margin: 10px 0;
  line-height: 1.5;
}

/* ---------- Footer: single horizontal row ---------- */

.site-footer {
  margin-top: 80px;
  border-top: 1px solid var(--border);
  background: var(--paper-sub);
  color: var(--muted);
  font-size: 0.88rem;
}
.footer-inner {
  max-width: var(--wrap-wide);
  margin: 0 auto;
  padding: 20px 24px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px 24px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
}
.footer-links a {
  color: var(--muted);
  text-decoration: none;
  padding: 2px 0;
  transition: color .12s ease;
}
.footer-links a:hover { color: var(--ink); text-decoration: underline; }
.footer-links a + a::before {
  content: "·";
  color: var(--muted-soft);
  margin: 0 12px;
  text-decoration: none;
  display: inline-block;
}

.footer-credit {
  color: var(--muted-soft);
  font-size: 0.82rem;
  white-space: nowrap;
}

/* ---------- Admin dashboard (kept minimal) ---------- */

.an-tabs { display:flex; gap:.5rem; margin:1rem 0; }
.an-tabs button { padding:.4rem .8rem; border:1px solid var(--border); background:var(--paper); cursor:pointer; border-radius:var(--radius); font:inherit; font-size:14px; color:var(--muted); }
.an-tabs button.active { background:var(--ink); color:#fff; border-color:var(--ink); }
.an-kpis { display:grid; grid-template-columns:repeat(auto-fit, minmax(180px, 1fr)); gap:1rem; margin:1rem 0 2rem; }
.an-kpi { background:var(--paper-sub); padding:1rem 1.2rem; border-radius:var(--radius); }
.an-kpi .n { font-size:1.8rem; font-weight:700; line-height:1; }
.an-kpi .l { font-size:.85rem; color:var(--muted); margin-top:.3rem; }
.an-grid { display:grid; grid-template-columns: 1fr 1fr; gap:2rem; }
@media (max-width: 720px) { .an-grid { grid-template-columns: 1fr; } }
.an-table { width:100%; border-collapse:collapse; font-size:.92rem; }
.an-table th, .an-table td { padding:.4rem .6rem; border-bottom:1px solid var(--border); }
.an-table th { text-align:left; background:var(--paper-sub); }
.an-table td:last-child { text-align:right; font-variant-numeric:tabular-nums; }
.an-chart { height: 260px; }
.an-meta { color:var(--muted); font-size:.85rem; margin-top:2rem; }

/* ---------- Responsive ---------- */

@media (max-width: 720px) {
  .site-header-inner { padding: 0 18px; gap: 14px; height: 56px; }
  .brand { font-size: 17px; }
  .main-nav { gap: 0; }
  .main-nav a { padding: 6px 10px; font-size: 14px; }
  .header-cta { padding: 6px 10px; font-size: 13px; }
  .wrap, .page, .feed, .tracker-intro, .tracker-chart-area, .hero {
    padding-left: 18px; padding-right: 18px;
  }
  .aw-chart-wrap, .zr-chart-wrap { height: 340px; padding: 10px; }
  .aw-totals th, .aw-totals td, .zr-totals th, .zr-totals td { padding: 8px 10px; }
  body { font-size: 16px; }
  .footer-inner { padding: 18px; flex-direction: column; align-items: flex-start; gap: 8px; }
}

@media (max-width: 520px) {
  .header-cta { display: none; }
}
