/* S.O.S Calvaires, public vote.
   One loud moment: the cross in the hero, set like the campaign poster. Everything else is quiet and legible
   for a family audience: white pages, the main site's night blue for text, the logo orange (#C25C24) only for
   what you can act on and for the vote gauges, the warm black of the campaign visual for hero and footer. */
:root {
  --black: #191816;            /* campaign visual background */
  --black-2: #23211f;
  --navy: #0d3655;             /* main site "bleu-fonce" */
  --navy-2: #13303a;           /* main site "bleu-hover" */
  --sky: #94b7c3;              /* main site "bleu-clair" */
  --sky-wash: #eef3f5;         /* sky at ~15% on white: gauge tracks, fields */
  --rule: #d8e2e6;
  --orange: #c25c24;           /* logo */
  --orange-hover: #7f351a;     /* main site hover */
  --orange-soft: #ca7f63;      /* main site "orange-clair": orange text on black (contrast) */
  --paper: #ffffff;
  --ink: #0d3655;
  --ink-2: #4a6273;            /* secondary text, 6.3:1 on white */
  --on-black: #ffffff;
  --on-black-2: #b9b4ae;
  --err: #a8321f; --err-soft: #fbe9e4; --ok: #2f6b4a;

  --poster: "Poppins", "Helvetica Neue", Arial, sans-serif;
  --ui: "Poppins", "Helvetica Neue", Arial, sans-serif;
  --serif: "Vollkorn", Georgia, "Times New Roman", serif;
  --r: 3px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 16px/1.6 var(--ui); font-variant-numeric: lining-nums; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.wrap { max-width: 1180px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
/* Vollkorn defaults to old-style figures (the 1 reads as an I); the `font` shorthand resets this, hence the override. */
*:not(.num) { font-variant-numeric: lining-nums !important; }
.num { font-variant-numeric: lining-nums tabular-nums !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
h1, h2, h3 { margin: 0; font-weight: 600; }
h2 { font: 600 clamp(1.9rem, 3.6vw, 2.7rem)/1.1 var(--serif); letter-spacing: -.005em; }

/* ---------- Buttons: sentence case, one shape everywhere ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5em; min-height: 46px; border: 0; border-radius: var(--r); padding: .7em 1.3em; font: 600 .95rem/1.2 var(--ui); text-decoration: none; transition: background-color .15s, color .15s, box-shadow .15s; }
.btn-accent { background: var(--orange); color: #fff; }
.btn-accent:hover { background: var(--orange-hover); }
.btn-ghost { background: transparent; color: var(--on-black); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.4); }
.btn-ghost:hover { box-shadow: inset 0 0 0 1.5px #fff; }
.btn-line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--rule); }
.btn-line:hover { box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn-night { background: transparent; color: var(--on-black); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.4); }
.btn-night:hover { box-shadow: inset 0 0 0 1.5px #fff; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; font: 500 .95rem/1.3 var(--ui); color: var(--ink); text-decoration: underline; text-decoration-color: var(--sky); text-underline-offset: 4px; text-decoration-thickness: 2px; }
.link:hover { text-decoration-color: var(--orange); }

/* ---------- Header ---------- */
.top { position: sticky; top: 0; z-index: 20; background: var(--black); color: var(--on-black); }
.top .wrap { display: flex; align-items: center; gap: 24px; min-height: 76px; }
.logo { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.logo img { height: 52px; width: auto; }
.logo-label { font: 500 .9rem/1 var(--ui); color: var(--on-black-2); padding-left: 14px; border-left: 1px solid rgba(255,255,255,.25); }
.nav { display: flex; gap: 28px; margin-left: auto; align-items: center; }
.nav a:not(.btn) { text-decoration: none; font: 500 .95rem/1 var(--ui); color: var(--on-black-2); }
.nav a:not(.btn):hover { color: #fff; }
.nav .btn { min-height: 40px; padding: .55em 1.2em; }
@media (max-width: 760px) { .nav a:not(.btn) { display: none; } .logo img { height: 44px; } }

/* ---------- Hero: the poster ---------- */
/* The hero fills exactly the visible screen under the header: sizes follow the height too, so it never spills on a laptop. */
.hero { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: center; min-height: calc(100svh - 76px); background: var(--black); color: var(--on-black); }
.hero-cross { position: absolute; top: 0; bottom: 0; right: max(0px, calc((100vw - 1180px) / 2 - 30px)); width: min(44vw, 540px); background: url("img/croix.jpg") center 28% / cover no-repeat; pointer-events: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 30%, #000 75%, transparent); mask-image: linear-gradient(90deg, transparent, #000 30%, #000 75%, transparent); }
.hero-main { position: relative; width: 100%; padding-block: clamp(24px, 5vh, 80px) clamp(64px, 9vh, 96px); }
.hero h1 { max-width: 16ch; font: 800 clamp(2rem, min(5.4vw, 8.6vh), 5rem)/1 var(--poster); text-transform: uppercase; letter-spacing: -.01em; text-wrap: balance; }
.hero .lead { max-width: min(60ch, 58vw); margin: clamp(16px, 3.2vh, 28px) 0 clamp(20px, 3.6vh, 32px); font: 400 clamp(1.02rem, 2.3vh, 1.22rem)/1.6 var(--serif); color: var(--on-black-2); }
.ctas { display: flex; gap: 12px; flex-wrap: wrap; }
.live-line { display: flex; align-items: baseline; gap: 12px; margin: clamp(18px, 4vh, 44px) 0 0; max-width: 72ch; font: 400 1.05rem/1.5 var(--ui); color: var(--on-black-2); }
.live-line strong { color: #fff; font-weight: 600; }
.live-dot { flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%; background: var(--orange); transform: translateY(-1px); animation: pulse 2.4s ease-out infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(194,92,36,.7); } 70%, 100% { box-shadow: 0 0 0 12px rgba(194,92,36,0); } }
.motto { margin: 10px 0 0; font: italic 400 1rem/1 var(--serif); color: rgba(255,255,255,.4); }
.scroll-cue { position: absolute; left: 50%; bottom: clamp(14px, 3vh, 28px); transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 2px; color: rgba(255,255,255,.65); text-decoration: none; font: 500 .85rem/1.2 var(--ui); }
.scroll-cue:hover { color: #fff; }
.scroll-cue svg { animation: cue 2.2s ease-in-out infinite; }
@keyframes cue { 0%, 100% { transform: translateY(0); opacity: .7; } 50% { transform: translateY(6px); opacity: 1; } }
/* Short screens (laptops): drop the least useful line before anything gets cut. */
@media (max-height: 640px) and (min-width: 881px) { .motto { display: none; } .hero .lead { max-width: 64ch; } }
@media (max-width: 880px) {
  .hero-main { padding-block: clamp(20px, 4vh, 40px) 84px; }
  .hero h1 { font-size: clamp(1.9rem, min(9.4vw, 6.4vh), 3rem); }
  .hero .lead { font-size: clamp(.98rem, 2.4vh, 1.1rem); }
  .hero-cross { width: 70vw; right: -30vw; opacity: .3; }
  .live-line { margin-top: 36px; }
}

/* ---------- Section heads ---------- */
.sec-head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 16px 48px; align-items: end; margin-bottom: 36px; }
.sec-head p { margin: 0; max-width: 56ch; color: var(--ink-2); font-size: 1.02rem; }
.sec-head p strong { color: var(--ink); font-weight: 600; }
@media (max-width: 760px) { .sec-head { grid-template-columns: 1fr; margin-bottom: 24px; } }

/* ---------- Places ---------- */
.places { padding-block: 88px 96px; }

/* Standings and places side by side: the ranking stays in view while you browse. */
.board-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 56px; align-items: start; }
.standings { position: sticky; top: 100px; }
.standings h3 { font: 600 1.25rem/1.2 var(--serif); padding-bottom: 12px; border-bottom: 2px solid var(--ink); }
.ranking { list-style: none; margin: 0; padding: 0; }
.rank-row { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr) auto; grid-template-rows: auto auto; align-items: baseline; gap: 6px 10px; width: 100%; padding: 12px 0; border: 0; border-bottom: 1px solid var(--rule); background: none; text-align: left; }
.rank-pos { font: 400 1.15rem/1 var(--serif); color: var(--ink-2); }
.rank-row.top1 .rank-pos { color: var(--orange); font-weight: 600; }
.rank-name { min-width: 0; font: 600 .98rem/1.25 var(--serif); }
.rank-name small { display: none; }
.rank-count { font: 600 .92rem/1 var(--ui); text-align: right; }
.rank-bar { grid-column: 2 / 4; grid-row: 2; height: 4px; background: var(--sky-wash); }
.rank-bar i { display: block; height: 100%; background: var(--navy); transition: width .8s cubic-bezier(.2,.8,.2,1); }
.rank-row.top1 .rank-bar i { background: var(--orange); }
.rank-row:hover .rank-name { text-decoration: underline; text-decoration-color: var(--orange); text-underline-offset: 3px; }
.standings-note { margin: 12px 0 0; font-size: .85rem; color: var(--ink-2); }

.tools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding-bottom: 24px; margin-bottom: 36px; border-bottom: 1px solid var(--rule); }
.field { display: block; min-width: 0; }
.field.search { grid-column: 1 / -1; }
.field input, .field select { width: 100%; height: 48px; border: 1.5px solid var(--rule); border-radius: var(--r); background: var(--paper); color: var(--ink); padding: 0 14px; font: 400 1rem var(--ui); }
.field input:focus, .field select:focus { outline: none; border-color: var(--navy); }
.count { color: var(--ink-2); font-size: .95rem; white-space: nowrap; }
@media (max-width: 520px) { .tools { grid-template-columns: 1fr; } }

@media (max-width: 1100px) {
  .board-layout { grid-template-columns: 1fr; gap: 40px; }
  .standings { position: static; }
  .ranking li:nth-child(n+6) { display: none; }
  .standings-note::before { content: "Top 5. "; }
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 56px 36px; }
.place { position: relative; display: flex; flex-direction: column; min-width: 0; }
.place-media { position: relative; display: block; width: 100%; aspect-ratio: 4 / 3; padding: 0; border: 0; overflow: hidden; background: var(--sky-wash); border-radius: var(--r); }
.place-media img { width: 100%; height: 100%; object-fit: cover; }
.place h3 { margin-top: 20px; font: 600 1.45rem/1.2 var(--serif); }
.place h3 button { all: unset; cursor: pointer; }
.place h3 button:hover, .place:has(.place-media:hover) h3 button { text-decoration: underline; text-decoration-color: var(--orange); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.place h3 button:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.place-where { margin: 6px 0 0; color: var(--ink-2); font-size: .92rem; }
.place .sum { margin: 14px 0 0; font: 400 1.05rem/1.6 var(--serif); color: var(--ink); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.place-foot { display: flex; align-items: flex-end; gap: 20px; margin-top: auto; padding-top: 22px; }
.gauge.mini { flex: 1; min-width: 0; }
.gauge.mini b { display: block; margin-bottom: 8px; font: 600 1rem/1 var(--ui); }
.gauge.mini .gauge-track { height: 4px; }
.btn-vote { flex: 0 0 auto; min-height: 40px; padding: .5em 1.4em; background: transparent; color: var(--orange); box-shadow: inset 0 0 0 1.5px var(--orange); }
.btn-vote:hover { background: var(--orange); color: #fff; }
.place.flash .place-media { box-shadow: 0 0 0 3px var(--orange); }
.bump { position: absolute; right: 12px; top: 12px; padding: 4px 9px; border-radius: 2px; background: var(--orange); color: #fff; font: 700 .9rem/1 var(--ui); pointer-events: none; animation: bump 1.6s ease-out forwards; }
@keyframes bump { 0% { opacity: 0; transform: translateY(6px); } 15% { opacity: 1; transform: none; } 75% { opacity: 1; } 100% { opacity: 0; } }

.gauge-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.gauge-top b { font: 600 1.05rem/1 var(--ui); }
.gauge-top span { font-size: .85rem; color: var(--ink-2); }
.gauge-track { height: 8px; background: var(--sky-wash); overflow: hidden; }
.gauge-track i { display: block; height: 100%; background: var(--orange); transition: width .9s cubic-bezier(.2,.8,.2,1); }

.empty { grid-column: 1 / -1; padding: 48px 0; color: var(--ink-2); font: 400 1.1rem/1.5 var(--serif); }
.skeleton { aspect-ratio: 3 / 2; background: var(--sky-wash); border-radius: var(--r); }

/* Photo still to come: the department number set large, the town in italics. Real photos replace it. */
.ph { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; align-items: flex-start; padding: 20px 22px; text-align: left; background: var(--sky-wash); color: var(--navy); }
.ph b { position: absolute; top: 4px; right: 18px; font: 400 clamp(4.5rem, 8vw, 6.5rem)/1 var(--serif); color: #bcd2da; letter-spacing: -.02em; }
.ph span { position: relative; font: italic 400 1.15rem/1.2 var(--serif); }

/* ---------- Dialog ---------- */
dialog { border: 0; padding: 0; width: min(1040px, 100%); max-width: 100%; max-height: 100%; background: var(--paper); color: var(--ink); border-radius: var(--r); box-shadow: 0 30px 80px -20px rgba(0,0,0,.55); }
dialog::backdrop { background: rgba(13,54,85,.72); }
@media (min-width: 761px) { dialog { height: min(760px, calc(100% - 48px)); max-height: calc(100% - 48px); } }
@media (max-width: 760px) { dialog { width: 100%; height: 100%; border-radius: 0; margin: 0; } }
.dlg { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); height: 100%; min-height: 0; }
.dlg-media { position: relative; background: var(--sky-wash); min-height: 280px; }
.dlg-media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dlg-side { display: flex; flex-direction: column; min-height: 0; height: 100%; }
.dlg-scroll { overflow-y: auto; padding: 36px 36px 24px; flex: 1; min-height: 0; }
.dlg-close { position: absolute; top: 12px; right: 12px; z-index: 3; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(25,24,22,.7); color: #fff; font-size: 1.5rem; line-height: 1; }
.dlg-where { margin: 0; color: var(--ink-2); font-size: .95rem; }
.dlg h2 { font: 600 clamp(1.7rem, 3vw, 2.3rem)/1.15 var(--serif); margin: 6px 0 4px; padding-right: 40px; }
.dlg-place { margin: 0 0 6px; color: var(--ink); font-size: .95rem; }
.dlg-meta { margin: 0 0 22px; color: var(--ink-2); font-size: .92rem; }
.summary p { font: 400 1.14rem/1.7 var(--serif); margin: 0 0 14px; max-width: 60ch; }
.share { margin-top: 8px; }
.dlg-foot { border-top: 1px solid var(--rule); padding: 16px 36px calc(16px + env(safe-area-inset-bottom, 0px)); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; align-items: center; background: var(--paper); }
.dlg-foot .gauge { margin: 0; padding: 0; }
@media (max-width: 760px) {
  .dlg { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .dlg-media { min-height: 0; aspect-ratio: 3 / 2; }
  .dlg-side { height: auto; }
  .dlg.form .dlg-media { display: none; }
  .dlg.form { grid-template-rows: minmax(0, 1fr); }
  .dlg-scroll { padding: 24px 18px; }
  .dlg-foot { padding-left: 18px; padding-right: 18px; grid-template-columns: 1fr; }
  .dlg-foot .btn { width: 100%; }
}

/* ---------- Form ---------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 6px; }
.f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.f.full { grid-column: 1 / -1; }
.f label { font: 500 .9rem/1.2 var(--ui); }
.f input, .f select { height: 50px; border: 1.5px solid var(--rule); border-radius: var(--r); background: var(--paper); color: var(--ink); padding: 0 14px; font: 400 1rem var(--ui); width: 100%; }
.f input:focus, .f select:focus { border-color: var(--navy); outline: none; box-shadow: 0 0 0 3px var(--sky-wash); }
.f .err { color: var(--err); font-size: .85rem; }
.f.bad input { border-color: var(--err); }
.check { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; font-size: .92rem; color: var(--ink-2); grid-column: 1 / -1; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--orange); }
.check a { color: var(--ink); }
.check.bad span { color: var(--err); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-intro { display: flex; gap: 14px; align-items: center; margin: 8px 0 22px; padding-bottom: 18px; border-bottom: 1px solid var(--rule); }
.form-intro .mini { flex: 0 0 72px; height: 48px; position: relative; overflow: hidden; background: var(--sky-wash); border-radius: 2px; }
.form-intro .mini img { width: 100%; height: 100%; object-fit: cover; }
.form-intro .mini .ph b { font-size: 2rem; top: 0; right: 6px; }
.form-intro .mini .ph span { display: none; }
.form-intro b { display: block; font: 600 1.1rem/1.2 var(--serif); }
.form-intro span { font-size: .88rem; color: var(--ink-2); }
.form-msg { grid-column: 1 / -1; padding: 12px 14px; background: var(--err-soft); color: var(--err); font-weight: 500; font-size: .92rem; border-radius: var(--r); }
.why { font-size: .88rem; color: var(--ink-2); margin: 16px 0 0; }
.dlg-title-form { font: 600 2rem/1.1 var(--serif); margin: 4px 0 0; }
.done { padding: 40px 4px; }
.done h3 { font: 600 2rem/1.15 var(--serif); margin-bottom: 14px; }
.done p { max-width: 42ch; margin: 0 0 12px; color: var(--ink-2); font-size: 1.05rem; }
.done p strong { color: var(--ink); }
.done-mark { width: 52px; height: 52px; margin-bottom: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--orange); color: #fff; font: 700 1.5rem/1 var(--ui); }
.back { margin-bottom: 18px; }
#captcha-box { min-height: 65px; }

/* ---------- Closing band and footer ---------- */
.cta-band { background: var(--navy); color: #fff; }
.cta-band .wrap { padding-block: 72px; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 32px 64px; align-items: center; }
.cta-band h2 { font: 600 clamp(1.8rem, 3.4vw, 2.6rem)/1.15 var(--serif); }
.cta-band p { color: rgba(255,255,255,.75); font: 400 1.12rem/1.65 var(--serif); margin: 14px 0 0; max-width: 54ch; }
.cta-band .ctas { justify-content: flex-start; }
@media (max-width: 760px) { .cta-band .wrap { grid-template-columns: 1fr; padding-block: 56px; } }
footer { background: var(--black); color: var(--on-black-2); font-size: .88rem; }
footer .wrap { padding-block: 48px calc(48px + env(safe-area-inset-bottom, 0px)); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 32px 64px; }
footer p { margin: 0 0 10px; max-width: 80ch; }
footer a, footer strong { color: #fff; }
.footer-logo { height: 64px; width: auto; margin-bottom: 18px; }
@media (max-width: 760px) { footer .wrap { grid-template-columns: 1fr; } }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--navy); color: #fff; padding: 12px 18px; border-radius: var(--r); font-weight: 500; z-index: 50; box-shadow: 0 10px 30px rgba(0,0,0,.3); max-width: calc(100% - 32px); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
.dlg-foot .link { justify-self: start; }

/* Selects: custom arrow with breathing room on the right (the native one sat against the border) */
.field select, .f select {
  appearance: none; -webkit-appearance: none;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%230d3655' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 12px 8px;
  cursor: pointer;
}
@media (max-width: 880px) and (max-height: 720px) { .motto, .hero .ctas .btn-ghost { display: none; } }
