/* ============================================================
   Accountability Now — Global Stylesheet
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&family=Inter:wght@400;500;600;700&display=swap');

/* === RESET & BASE === */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font: 15px/1.6 'Inter', system-ui, -apple-system, sans-serif;
  background: #f4f4f2;
  color: #1c1c1c;
}

/* === HEADER === */
header {
  background: #f5f0e8;
  color: #1a1a1a;
  padding: 0;
  border-bottom: 2px solid #1a1a1a;
  height: 58px;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px;
  display: flex;
  align-items: center;
  gap: 40px;
  height: 100%;
}

.site-title {
  font-size: 1.15em;
  font-weight: 400;
  color: #1a1a1a;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.01em;
  font-family: 'DM Serif Display', Georgia, serif;
}

.site-title:hover { color: #555; border-bottom: none; }

/* === NAV === */
nav.main-nav {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
}

nav.main-nav a {
  color: #444;
  text-decoration: none;
  font-size: 0.88em;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 0 13px;
  height: 58px;
  display: flex;
  align-items: center;
  position: relative;
  transition: color 0.2s;
  border-bottom: none;
}

nav.main-nav a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 13px;
  right: 13px;
  height: 2px;
  background: #1a1a1a;
  transform: scaleX(0);
  transition: transform 0.2s ease;
}

nav.main-nav a:hover { color: #1a1a1a; }
nav.main-nav a:hover::after { transform: scaleX(1); }
nav.main-nav a.active { color: #1a1a1a; font-weight: 700; }
nav.main-nav a.active::after { transform: scaleX(1); }

/* === MOBILE NAV === */
.nav-toggle { display: none; background: none; border: 1px solid #ccc; border-radius: 5px; padding: 5px 10px; font-size: 0.85em; font-weight: 600; color: #444; cursor: pointer; margin-left: auto; }
@media (max-width: 700px) {
  .header-inner { gap: 0; padding: 0 16px; }
  .nav-toggle { display: block; }
  nav.main-nav { display: none; flex-direction: column; align-items: flex-start; position: absolute; top: 58px; left: 0; right: 0; background: #f5f0e8; border-bottom: 2px solid #1a1a1a; z-index: 200; padding: 8px 0; gap: 0; }
  nav.main-nav.open { display: flex; }
  nav.main-nav a { height: auto; padding: 10px 20px; width: 100%; font-size: 0.95em; }
  nav.main-nav a::after { display: none; }
  header { position: relative; }
}

/* === PAGE CONTENT WRAPPER === */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 28px 72px;
}

main.wide {
  max-width: 1100px;
}

/* === TYPOGRAPHY === */
h1 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 2em;
  font-weight: 400;
  color: #111827;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

h2 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.35em;
  font-weight: 400;
  color: #111827;
  margin: 1.5em 0 0.5em;
  line-height: 1.3;
}

h3 {
  font-size: 1.05em;
  font-weight: 700;
  color: #1c1c1c;
  margin: 1.2em 0 0.4em;
}

p { margin: 0 0 1em; }

a {
  color: #0e6b8a;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.15s, color 0.15s;
}

a:hover {
  color: #0a4f68;
  border-bottom-color: #0a4f68;
}

/* === PAGE SUBTITLE / INTRO TEXT === */
.page-intro {
  color: #4b5563;
  font-size: 0.96em;
  line-height: 1.75;
  margin-bottom: 20px;
}

.page-meta {
  font-size: 0.83em;
  color: #6b7280;
  margin-bottom: 24px;
}

/* === CARDS === */
.card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px 22px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: transform 0.15s, box-shadow 0.15s;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

/* === STAT GRID === */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(155px, 1fr));
  gap: 12px;
  margin-bottom: 28px;
}

.stat-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 20px 16px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
  transition: transform 0.15s, box-shadow 0.15s;
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.stat-value {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.9em;
  font-weight: 400;
  color: #111827;
  letter-spacing: -0.01em;
}

.stat-label {
  font-size: 0.76em;
  color: #6b7280;
  margin-top: 6px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* === FILTER TOGGLES === */
.filter-toggle {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 0.84em;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid #d1d5db;
  background: #fff;
  color: #4b5563;
  transition: all 0.15s;
  cursor: pointer;
}

.filter-btn:hover {
  border-color: #9ca3af;
  color: #1c1c1c;
  border-bottom: 1px solid #9ca3af;
}

.filter-btn.active {
  background: #1a1f2e;
  color: #fff;
  border-color: #1a1f2e;
}

/* === DATA FRESHNESS BAR === */
.data-freshness {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 11px 18px;
  margin-bottom: 28px;
  font-size: 0.84em;
  color: #4b5563;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.data-freshness-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.data-freshness-item strong {
  color: #374151;
  font-weight: 600;
}

.data-freshness-item .date {
  font-size: 1em;
  background: #f3f4f6;
  padding: 2px 8px;
  border-radius: 4px;
  color: #374151;
  font-weight: 600;
}

/* === TABLE === */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
}

th {
  text-align: left;
  padding: 10px 14px;
  font-size: 0.76em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #6b7280;
  border-bottom: 2px solid #e5e7eb;
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid #f3f4f6;
  color: #374151;
}

tr:last-child td { border-bottom: none; }
tr:hover td { background: #fafaf9; }

/* === BADGES / TAGS === */
.badge {
  display: inline-block;
  font-size: 0.74em;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  background: #f3f4f6;
  color: #4b5563;
}

.badge-navy  { background: #1a1f2e; color: #fff; }
.badge-blue  { background: #eff6ff; color: #1d4ed8; }
.badge-green { background: #f0fdf4; color: #166534; }
.badge-red   { background: #fff5f5; color: #b91c1c; }
.badge-amber { background: #fff7ed; color: #0e6b8a; }

/* === BUTTONS === */
.btn {
  display: inline-block;
  padding: 9px 20px;
  border-radius: 7px;
  font-size: 0.9em;
  font-weight: 600;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.btn:hover { transform: translateY(-1px); border-bottom: none; }

.btn-primary {
  background: #0e6b8a;
  color: #fff;
}

.btn-primary:hover { background: #0a4f68; color: #fff; }

.btn-secondary {
  background: #f3f4f6;
  color: #374151;
  border: 1px solid #e5e7eb;
}

.btn-secondary:hover { background: #e5e7eb; color: #1c1c1c; }

/* === SOURCE FOOTNOTES === */
.source-note {
  font-size: 0.8em;
  color: #9ca3af;
  margin-top: 32px;
}

.source-note a { color: #6b7280; border-bottom: none; }
.source-note a:hover { color: #4b5563; }

/* === EMPTY STATE === */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: #9ca3af;
  font-size: 0.95em;
}

/* === PARTY BADGES === */
.mp-party-badge { display: inline-block; font-size: 0.78em; color: #fff; padding: 2px 8px; border-radius: 4px; font-weight: 600; }
.mp-party-badge[data-party="Reform UK"]       { background: #29abe2; }
.mp-party-badge[data-party="Restore Britain"] { background: #1a3a5c; }

/* === RESPONSIVE === */
@media (max-width: 640px) {
  .header-inner { padding: 0 16px; gap: 20px; }
  main { padding: 24px 16px 52px; }
  h1 { font-size: 1.6em; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
}
