/* ============================================================
   Comparatif des Programmes — Municipales Villeneuve-d'Ascq 2026
   Feuille de style commune à toutes les pages
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  background: #f1f5f9;
  color: #1e293b;
}

/* ---- HEADER ---- */
.site-header {
  background: #1e3a5f;
  color: white;
  padding: 14px 24px;
}
.site-header h1 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  margin-bottom: 10px;
}
.site-header .subtitle {
  font-size: 0.82rem;
  opacity: 0.75;
  margin-bottom: 10px;
}

/* ---- NAVIGATION ---- */
nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
nav a {
  display: inline-flex;
  flex-direction: column;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(255,255,255,0.12);
  color: #e2e8f0;
  text-decoration: none;
  font-size: 0.82rem;
  line-height: 1.3;
  transition: background 0.15s;
}
nav a .nav-movement {
  font-size: 0.68rem;
  font-style: italic;
  opacity: 0.78;
}
nav a:hover, nav a.active {
  background: rgba(255,255,255,0.28);
  color: white;
}

/* ---- INDEX PAGE ---- */
.page-index {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 20px;
}
.page-index .intro {
  background: white;
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 28px;
  border-left: 4px solid #2563eb;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
}
.page-index .intro h2 { font-size: 1.15rem; margin-bottom: 8px; color: #1e3a5f; }
.page-index .intro p { color: #475569; margin-bottom: 8px; }
.page-index .intro p:last-child { margin-bottom: 0; }
.candidate-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.candidate-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
  border-top: 4px solid #2563eb;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.15s, transform 0.12s;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.candidate-card:hover {
  box-shadow: 0 4px 12px rgba(37,99,235,0.15);
  transform: translateY(-2px);
}
.candidate-card .card-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: #1e3a5f;
}
.candidate-card .card-movement {
  font-size: 0.78rem;
  font-style: italic;
  color: #475569;
  margin-top: 2px;
}
.candidate-card .card-desc {
  font-size: 0.83rem;
  color: #64748b;
}
.candidate-card .card-link {
  margin-top: auto;
  font-size: 0.83rem;
  color: #2563eb;
  font-weight: 600;
}

/* ---- CANDIDATE PAGE ---- */
.page-candidate {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}
.candidate-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: #1e3a5f;
  margin-bottom: 4px;
}
.candidate-subtitle {
  font-size: 0.88rem;
  color: #64748b;
  margin-bottom: 6px;
}
.candidate-source {
  font-size: 0.82rem;
  color: #64748b;
  margin-bottom: 20px;
}
.candidate-source a {
  color: #2563eb;
  text-decoration: underline;
}

/* ---- TABS ---- */
.tabs {
  display: flex;
  gap: 0;
  margin-bottom: 0;
  border-bottom: 2px solid #cbd5e1;
}
.tab-btn {
  padding: 10px 22px;
  border: none;
  background: transparent;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
  color: #64748b;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s, border-color 0.15s;
  font-family: inherit;
}
.tab-btn.active {
  color: #2563eb;
  border-bottom-color: #2563eb;
}
.tab-btn:hover { color: #1e3a5f; }

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ---- TABLE WRAPPER ---- */
.table-wrap {
  overflow-x: auto;
  background: white;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  margin-top: 0;
}

/* ---- DATA TABLE ---- */
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
table.data-table thead th {
  background: #e2e8f0;
  color: #334155;
  font-weight: 700;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 2px solid #cbd5e1;
  white-space: nowrap;
}
table.data-table tbody tr:nth-child(even) { background: #f8fafc; }
table.data-table tbody tr:nth-child(odd)  { background: white; }
table.data-table tbody tr:hover { background: #eff6ff; }
table.data-table td {
  padding: 9px 12px;
  border-bottom: 1px solid #e2e8f0;
  vertical-align: top;
}
table.data-table td.prop {
  font-weight: 600;
  color: #1e293b;
  width: 25%;
  min-width: 180px;
}
table.data-table td.analysis {
  color: #475569;
  width: 55%;
}
table.data-table td.score-cell {
  text-align: center;
  width: 10%;
  min-width: 80px;
}
table.data-table td.score-cell-sm {
  text-align: center;
  width: 10%;
  min-width: 70px;
}

/* ---- SCORE BADGE ---- */
.badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 0.78rem;
  color: white;
  white-space: nowrap;
}
.badge.s5 { background: #16a34a; }
.badge.s4 { background: #65a30d; }
.badge.s3 { background: #ca8a04; }
.badge.s2 { background: #ea580c; }
.badge.s1 { background: #dc2626; }

/* Impact-only badge variant */
.badge.imp5 { background: #0369a1; }
.badge.imp4 { background: #0284c7; }
.badge.imp3 { background: #0ea5e9; }
.badge.imp2 { background: #7dd3fc; color: #0c4a6e; }
.badge.imp1 { background: #e0f2fe; color: #0c4a6e; }

/* Stars for readability */
.stars { letter-spacing: -1px; }

/* ---- LEGEND BOX ---- */
.legend-box {
  margin-top: 20px;
  background: white;
  border-radius: 8px;
  padding: 14px 18px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.07);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  font-size: 0.82rem;
}
.legend-box .leg { display: flex; align-items: center; gap: 6px; }

/* ---- PROMPT BLOCK ---- */
.prompt-block {
  margin-top: 12px;
  padding: 14px 16px;
  background: #f1f5f9;
  border-left: 4px solid #1e3a5f;
  border-radius: 4px;
  font-family: 'Courier New', Courier, monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: break-word;
  overflow-x: hidden;
  max-width: 100%;
  box-sizing: border-box;
  color: #1e293b;
}

/* ---- DISCLAIMER ---- */
.disclaimer {
  margin-top: 28px;
  padding: 12px 16px;
  background: #fef9c3;
  border-left: 4px solid #ca8a04;
  border-radius: 4px;
  font-size: 0.81rem;
  color: #78350f;
}

/* ---- FOOTER ---- */
footer {
  text-align: center;
  padding: 18px;
  font-size: 0.78rem;
  color: #94a3b8;
  border-top: 1px solid #e2e8f0;
  margin-top: 24px;
}

/* ---- RESPONSIVE ---- */
@media (max-width: 640px) {
  .site-header h1 { font-size: 0.95rem; }
  nav a { font-size: 0.76rem; padding: 3px 7px; }
  .candidate-title { font-size: 1.3rem; }
  table.data-table { font-size: 0.78rem; }
  table.data-table td { padding: 7px 8px; }
}
