/* brand.css — Politilens v3 — "Signal" modern theme
   Cool neutrals, near-black ink, single electric indigo accent.
   Edge-to-edge layout, Geist sans, Instrument Serif italic accents. */

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

/* ── Palette ── */
.app, .app.light, .app.dark {
  /* Cool neutrals */
  --bg:           #FAFAFA;
  --paper:        #FAFAFA;
  --paper-2:      #F4F4F5;
  --surface:      #FFFFFF;
  --surface-2:    #F4F4F5;
  --surface-3:    #E4E4E7;
  --ink:          #09090B;
  --ink-1:        #09090B;   /* alias of --ink for legacy callers */
  --ink-2:        #27272A;
  --ink-3:        #71717A;
  --ink-4:        #A1A1AA;
  --line:         #E4E4E7;
  --line-2:       #D4D4D8;

  /* Single electric accent — indigo */
  --indigo:       oklch(54% 0.22 264);
  --indigo-2:     oklch(46% 0.24 264);
  --indigo-soft:  oklch(95% 0.04 264);
  --indigo-line:  oklch(88% 0.08 264);

  /* Secondary semantic (kept restrained) */
  --moss:         oklch(58% 0.13 152);
  --moss-soft:    oklch(95% 0.04 152);
  --clay:         oklch(60% 0.20 28);
  --clay-soft:    oklch(95% 0.04 28);

  --accent:       var(--indigo);
  --accent-ink:   #FFFFFF;
  --link:         var(--indigo);

  --pos:          oklch(58% 0.16 150);
  --neg:          oklch(58% 0.21 28);
  --abs:          #71717A;
  --absent:       #D4D4D8;
  --highlight:    oklch(94% 0.10 95);

  --ff-display:   "Geist", system-ui, -apple-system, sans-serif;
  --ff-sans:      "Geist", system-ui, -apple-system, sans-serif;
  --ff-serif:     "Instrument Serif", Georgia, serif;
  --ff-mono:      "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
}

body {
  font-family: var(--ff-sans);
  background: var(--bg);
  color: var(--ink);
  font-feature-settings: "ss01" 1, "cv11" 1;
  -webkit-font-smoothing: antialiased;
}

.app { background: var(--bg); color: var(--ink); }

/* ── Edge-to-edge, no boxed paper frame ── */
.app {
  max-width: 100%;
  margin: 0;
  min-height: 100vh;
  position: relative;
  box-shadow: none;
}
body { background: var(--bg); }
body::before { display: none; }

.shell, .shell-narrow {
  max-width: 1200px !important;
  margin: 0 auto;
  padding: 40px 48px 120px !important;
}

/* ── Topbar — minimal, hairline, no parchment ── */
.topbar {
  background: color-mix(in srgb, var(--bg) 80%, transparent) !important;
  border-bottom: 1px solid var(--line) !important;
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  padding: 16px 48px !important;
}
.brand {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--ff-sans);
  color: var(--ink);
  cursor: pointer;
}
.brand .dot { display: none !important; }
.brand-mark {
  width: 32px; height: 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--ink);
  border-radius: 10px;
  position: relative;
}
.brand-mark svg { width: 17px; height: 17px; color: var(--surface); }
.brand-mark::after { display: none; }
.brand-name {
  display: flex; flex-direction: column; line-height: 1;
}
.brand-name b {
  font-family: var(--ff-sans);
  font-weight: 600; font-size: 19px;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-style: normal;
}
.brand-name small {
  font-family: var(--ff-sans);
  font-size: 10px; font-weight: 500;
  color: var(--ink-3);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 3px;
}
/* Boussole — bannière CTA en tête de home */
.boussole-cta {
  display: flex; align-items: center; gap: 16px;
  margin: 20px 0 8px;
  padding: 16px 20px;
  border-radius: 16px;
  background: linear-gradient(135deg, oklch(97% 0.03 25) 0%, oklch(96% 0.05 20) 100%);
  border: 1px solid oklch(88% 0.08 25);
  cursor: pointer;
  transition: transform .14s ease, box-shadow .14s ease;
}
.boussole-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 28px -10px rgba(237,41,57,0.35);
}
.boussole-cta-ic {
  flex: 0 0 auto;
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #ED2939, #c81e2c);
  color: #fff; font-size: 20px;
}
.boussole-cta-txt { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.boussole-cta-txt strong { font-family: var(--ff-sans); font-size: 15px; font-weight: 700; color: var(--ink); }
.boussole-cta-txt span { font-size: 12.5px; color: var(--ink-2); }
.boussole-cta-go {
  flex: 0 0 auto;
  font-family: var(--ff-sans); font-size: 13px; font-weight: 600;
  color: #fff; background: #ED2939;
  padding: 9px 16px; border-radius: 999px; white-space: nowrap;
}
@media (max-width: 640px) {
  .boussole-cta { flex-wrap: wrap; gap: 12px; }
  .boussole-cta-go { width: 100%; text-align: center; }
}

/* Boussole — CTA accentué dans la topbar (accroche grand public) */
.topbar-cta {
  font-family: var(--ff-sans);
  font-size: 13px; font-weight: 700;
  color: #fff !important;
  background: linear-gradient(135deg, #ED2939 0%, #c81e2c 100%);
  padding: 7px 15px !important;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 2px 10px -2px rgba(237,41,57,0.5);
  transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}
.topbar-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px -2px rgba(237,41,57,0.6);
  filter: brightness(1.05);
}
.topbar-cta.active { filter: brightness(0.92); }

.topbar-link {
  font-family: var(--ff-sans);
  font-size: 13px; font-weight: 500;
  color: var(--ink-3) !important;
  border-radius: 8px;
  position: relative;
}
.topbar-link:hover {
  color: var(--ink) !important;
  background: var(--surface-2) !important;
}
.topbar-link.active {
  color: var(--ink) !important;
  font-weight: 600;
}
.topbar-link.active::after {
  content: '';
  position: absolute;
  left: 12px; right: 12px; bottom: -2px;
  height: 2px;
  background: #ED2939;
  border-radius: 2px;
}

/* ── Hero — confident, modern type scale ── */
.hero { padding-top: 80px !important; padding-bottom: 32px !important; }
.hero h1 {
  font-family: var(--ff-sans) !important;
  font-weight: 600 !important;
  letter-spacing: -0.035em !important;
  color: var(--ink) !important;
  font-size: clamp(48px, 7.5vw, 96px) !important;
  line-height: 0.96 !important;
  text-wrap: balance;
  margin: 0 0 28px !important;
}
.hero h1 em {
  font-family: var(--ff-serif);
  font-style: italic;
  font-weight: 400;
  color: var(--indigo);
  letter-spacing: -0.02em;
}
.hero p.lede {
  font-family: var(--ff-sans);
  font-size: 18px; line-height: 1.5;
  color: var(--ink-3);
  max-width: 560px;
  font-weight: 400;
  margin: 0 0 40px;
}

/* ── Search bar ── */
.search-wrap {
  border: 1px solid var(--line-2) !important;
  background: var(--surface) !important;
  border-radius: 14px !important;
  padding: 6px 6px 6px 20px !important;
  transition: border-color .15s, box-shadow .15s;
  box-shadow: 0 1px 2px rgba(9, 9, 11, 0.04);
}
.search-wrap:focus-within {
  border-color: var(--indigo) !important;
  box-shadow: 0 0 0 4px var(--indigo-soft) !important;
}
.search-wrap svg.search-ic { color: var(--ink-3); }
.search-wrap input {
  font-family: var(--ff-sans);
  font-size: 16px; font-weight: 400;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.search-wrap input::placeholder { color: var(--ink-4); }
.search-wrap .kbd {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-3);
  font-family: var(--ff-mono);
  font-size: 11px;
  border-radius: 6px;
}

/* ── Filters ── */
.filter-group {
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: 10px !important;
  color: var(--ink) !important;
  font-family: var(--ff-sans);
  font-weight: 500;
  font-size: 13px;
  transition: border-color .12s, background .12s;
}
.filter-group:hover {
  border-color: var(--ink-3) !important;
  background: var(--surface-2) !important;
}
.filter-group .lab { color: var(--ink-3); }
.filter-group .count {
  background: var(--indigo) !important;
  color: var(--surface) !important;
  font-family: var(--ff-mono);
  font-weight: 500;
}
.filter-pop {
  border-radius: 12px !important;
  border-color: var(--line-2) !important;
  box-shadow: 0 16px 48px -16px rgba(9, 9, 11, 0.18) !important;
}

/* ── Cards (search results) ── */
.card {
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: 14px !important;
  transition: transform .2s cubic-bezier(.2,.7,.3,1), border-color .15s, box-shadow .2s;
}
.card:hover {
  border-color: var(--ink) !important;
  box-shadow: 0 16px 40px -20px rgba(9, 9, 11, 0.22);
  transform: translateY(-2px);
}
.card .name {
  font-family: var(--ff-sans) !important;
  font-weight: 600;
  font-size: 18px !important;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.card .meta { color: var(--ink-3); font-size: 12px; }

/* ── Tabs ── */
.tab {
  font-family: var(--ff-sans) !important;
  font-weight: 500 !important;
  color: var(--ink-3) !important;
  border-bottom: 2px solid transparent !important;
  font-size: 14px;
  letter-spacing: -0.01em;
}
.tab:hover { color: var(--ink-2) !important; }
.tab.active {
  color: var(--ink) !important;
  border-bottom-color: var(--ink) !important;
}
.tab .badge {
  background: var(--surface-2) !important;
  color: var(--ink-3) !important;
  font-family: var(--ff-mono);
  font-weight: 500;
  border-radius: 6px;
  padding: 1px 6px;
}
.tab.active .badge {
  background: var(--ink) !important;
  color: var(--surface) !important;
}

/* ── Profile head ── */
.profile-head h1 {
  font-family: var(--ff-sans) !important;
  font-weight: 600 !important;
  letter-spacing: -0.035em !important;
  color: var(--ink) !important;
  font-size: clamp(36px, 5vw, 60px) !important;
  line-height: 1 !important;
}
.profile-head .photo {
  border: 1px solid var(--line) !important;
  border-radius: 14px !important;
  box-shadow: 0 1px 2px rgba(9,9,11,0.04),
              0 12px 32px -16px rgba(9, 9, 11, 0.18) !important;
  overflow: hidden;
}
.profile-head .subline { color: var(--ink-3); }
.profile-head .mandate-line {
  font-family: var(--ff-sans);
  font-weight: 500;
  color: var(--ink-2);
}
.profile-head .bio {
  font-family: var(--ff-sans);
  font-size: 15px;
  line-height: 1.6;
  color: var(--ink-2);
}

/* ── Stats strip ── */
.stats-strip {
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: 14px !important;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(9,9,11,0.03);
}
.stat-cell {
  padding: 22px 24px !important;
  border-right: 1px solid var(--line) !important;
}
.stat-cell:last-child { border-right: none !important; }
.stat-cell .val {
  font-family: var(--ff-sans) !important;
  font-weight: 600 !important;
  font-size: 30px !important;
  letter-spacing: -0.035em;
  color: var(--ink);
  font-feature-settings: "tnum" 1, "ss01" 1;
}
.stat-cell .lab {
  font-family: var(--ff-sans);
  text-transform: uppercase;
  letter-spacing: .08em;
  font-size: 10px;
  color: var(--ink-3);
  font-weight: 500;
}

/* ── Section headers ── */
.section-h {
  font-family: var(--ff-sans) !important;
  font-weight: 600 !important;
  font-size: 22px !important;
  letter-spacing: -0.025em;
  color: var(--ink);
  border-top: 1px solid var(--line);
  padding-top: 36px !important;
  margin-top: 40px !important;
}
.section-h .count {
  font-family: var(--ff-mono);
  color: var(--ink-4);
  font-size: 12px;
  font-weight: 400;
  margin-left: 8px;
}

/* ── Buttons ── */
.btn {
  font-family: var(--ff-sans);
  font-weight: 500;
  font-size: 13px;
  border-radius: 10px !important;
  background: var(--surface);
  border: 1px solid var(--line-2);
  color: var(--ink);
  transition: background .12s, border-color .12s, transform .1s;
  padding: 8px 14px;
}
.btn:hover {
  background: var(--surface-2);
  border-color: var(--ink-3);
  color: var(--ink);
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--ink) !important;
  border-color: var(--ink) !important;
  color: var(--surface) !important;
}
.btn-primary:hover {
  background: var(--indigo) !important;
  border-color: var(--indigo) !important;
}

/* ── Vote / list rows ── */
.vote-row, .list-row {
  border-top: 1px solid var(--line) !important;
  border-bottom: 0 !important;
  transition: background .1s;
}
.vote-row:hover, .list-row:hover { background: var(--surface-2) !important; }
.vote-title, .list-row .title {
  font-family: var(--ff-sans);
  font-weight: 500;
  font-size: 15px;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1.4;
}
.vote-row .vote-date,
.list-row .date {
  font-family: var(--ff-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-4);
}

/* ── Modal ── */
.modal {
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: 16px !important;
  box-shadow: 0 40px 80px -20px rgba(9, 9, 11, 0.35) !important;
}
.modal h2 {
  font-family: var(--ff-sans) !important;
  font-weight: 600 !important;
  font-size: 26px !important;
  letter-spacing: -0.025em;
  color: var(--ink);
  line-height: 1.2;
}

/* ── Timeline (prises de position) ── */
.timeline::before { background: var(--line) !important; }
.stmt:hover { background: var(--surface-2); }
.stmt-glyph {
  box-shadow: 0 0 0 4px var(--bg) !important;
  font-family: var(--ff-sans) !important;
  font-weight: 600;
}
.stmt-title {
  font-family: var(--ff-sans) !important;
  font-weight: 500 !important;
  font-size: 18px !important;
  letter-spacing: -0.02em;
  color: var(--ink) !important;
  line-height: 1.35;
}
.stmt-excerpt {
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.6;
}
.stmt-date {
  color: var(--ink-4) !important;
  font-family: var(--ff-mono) !important;
}

/* ── Sources / links ── */
.src-link {
  color: var(--indigo) !important;
  font-weight: 500;
  border-bottom-color: var(--indigo-line) !important;
  transition: color .1s, border-color .1s;
}
.src-link:hover {
  color: var(--indigo-2) !important;
  border-bottom-color: var(--indigo) !important;
}
.src-link-strong {
  background: var(--indigo-soft) !important;
  border-color: var(--indigo-line) !important;
  color: var(--indigo-2) !important;
  border-radius: 10px !important;
  font-weight: 500;
}
.src-link-strong:hover {
  background: var(--indigo) !important;
  color: var(--surface) !important;
  border-color: var(--indigo) !important;
}

/* ── Program tab ── */
.program-head {
  background: var(--ink) !important;
  border: 1px solid var(--ink) !important;
  color: var(--surface) !important;
  border-radius: 16px !important;
}
.program-head .program-meta,
.program-head .program-elec,
.program-head .program-year { color: rgba(255,255,255,0.65) !important; }
.program-head .program-title {
  color: var(--surface) !important;
  font-family: var(--ff-sans) !important;
  font-weight: 600 !important;
  font-size: 32px !important;
  letter-spacing: -0.035em;
  font-style: normal;
}
.program-head .program-title em {
  font-family: var(--ff-serif);
  font-style: italic;
  font-weight: 400;
  color: oklch(78% 0.18 264);
}
.program-head .src-link-strong {
  background: rgba(255,255,255,0.12) !important;
  color: var(--surface) !important;
  border-color: rgba(255,255,255,0.18) !important;
}
.program-head .src-link-strong:hover {
  background: var(--indigo) !important;
  border-color: var(--indigo) !important;
}
.program-theme {
  font-family: var(--ff-sans) !important;
  color: var(--ink-3) !important;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 11px !important;
  font-weight: 500;
}
.promise {
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
}
.pst-pos     { background: var(--moss-soft) !important; color: oklch(40% 0.13 152) !important; }
.pst-mid     { background: oklch(95% 0.08 95) !important; color: oklch(45% 0.13 70) !important; }
.pst-neg     { background: var(--clay-soft) !important; color: oklch(42% 0.18 28) !important; }
.pst-neutral { background: var(--surface-2) !important; color: var(--ink-3) !important; border: 1px solid var(--line) !important; }

/* ── Alignment / charts ── */
.align-card, .vote-chart {
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: 14px !important;
}
.bars-row .bar {
  background: var(--indigo) !important;
  border-radius: 4px;
}
.bars-bar { border-radius: 4px !important; }

/* ── Chips & tags ── */
.tag {
  background: var(--surface-2) !important;
  color: var(--ink-3) !important;
  font-family: var(--ff-mono);
  border-radius: 6px;
  font-size: 10px;
  font-weight: 500;
}

/* ── Divider ── */
.divider { background: var(--line) !important; }

/* ── Tweaks panel ── */
.tp-panel {
  background: var(--surface) !important;
  border: 1px solid var(--line) !important;
  border-radius: 16px !important;
  font-family: var(--ff-sans);
  box-shadow: 0 24px 60px -20px rgba(9, 9, 11, 0.25);
}
.tp-title {
  color: var(--ink) !important;
  font-family: var(--ff-sans) !important;
  font-weight: 600 !important;
  font-style: normal;
  font-size: 18px !important;
  letter-spacing: -0.02em;
}

/* ── Back link ── */
.back {
  font-family: var(--ff-sans);
  font-weight: 500;
  font-size: 13px;
  color: var(--ink-3);
  border-radius: 8px;
}
.back:hover {
  background: var(--surface-2);
  color: var(--ink);
}

/* ── Autocomplete ── */
.ac {
  border-radius: 14px !important;
  border-color: var(--line-2) !important;
  box-shadow: 0 16px 48px -16px rgba(9, 9, 11, 0.18) !important;
}
.ac-row .ac-name {
  font-family: var(--ff-sans);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -0.01em;
}

/* ── Mobile ── */
@media (max-width: 720px) {
  .topbar { padding: 12px 16px !important; }
  .brand-name b { font-size: 17px; }
  .brand-name small { font-size: 9px; }
  .brand-mark { width: 28px; height: 28px; border-radius: 8px; }
  .brand-mark svg { width: 15px; height: 15px; }
  .shell, .shell-narrow { padding: 20px 18px 80px !important; }
  .hero { padding-top: 28px !important; }
  .hero h1 { font-size: clamp(36px, 11vw, 52px) !important; }
  .hero p.lede { font-size: 15px; }
  .section-h { font-size: 19px !important; padding-top: 24px !important; margin-top: 24px !important; }
  .card .name { font-size: 17px !important; }
  .profile-head h1 { font-size: 32px !important; }
  .stat-cell { padding: 16px 14px !important; }
  .stat-cell .val { font-size: 22px !important; }
  .stmt-title { font-size: 16px !important; }
  .modal h2 { font-size: 22px !important; }
  .program-head .program-title { font-size: 24px !important; }
}
