:root {
  --primary: #2B5BA8;
  --secondary: #FFD700;
  
  /* Couleurs Thèmes */
  --vie-locale: #FFB84D;
  --ecologie: #4A7C59;
  --education: #2B5BA8;
  --securite: #D84315;
  --economie: #E65100;
  --urbanisme: #546E7A;

  --text-dark: #1A1A1A;
  --text-light: #FFFFFF;
  --bg-light: #F8F9FA;
  --shadow: 0 10px 40px rgba(0,0,0,0.10);
  --shadow-hover: 0 15px 50px rgba(0,0,0,0.15);

  --nav-height: 76px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

/* PROTECTION CONTENU (ANTI SÉLECTION) */
body {
  font-family: 'DM Sans', sans-serif;
  color: var(--text-dark);
  line-height: 1.65;
  overflow-x: hidden;
  font-size: 18px;
  
  -webkit-user-select: none; /* Safari */
  -ms-user-select: none; /* IE */
  user-select: none; /* Standard */
}

/* Autoriser la sélection uniquement dans les champs de saisie */
input, textarea {
  -webkit-user-select: text;
  user-select: text;
}

h1, h2, h3, h4 { font-family: 'Poppins', sans-serif; font-weight: 800; }
a { text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

:focus-visible { outline: 3px solid rgba(43, 91, 168, 0.35); outline-offset: 3px; }

/* ... (Styles identiques pour Skip Link, Container, Navbar, Hero, Presentation, Thèmes) ... */
/* Pour économiser des lignes ici, je reprends les blocs standards. Ils ne changent pas. */

.container { max-width: 1400px; margin: 0 auto; padding: 0 20px; }
section { padding: 100px 20px; }
.section-title { font-size: 3rem; text-align: center; margin-bottom: 60px; color: var(--primary); position: relative; padding-bottom: 20px; }
.section-title::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 100px; height: 4px; background: var(--secondary); border-radius: 2px; }

.text-justify { text-align: justify; hyphens: none; }
.text-justify p { margin-bottom: 14px; }

/* NAVBAR */
.navbar { position: fixed; top: 0; width: 100%; min-height: var(--nav-height); background: rgba(255, 255, 255, 0.98); backdrop-filter: blur(18px); z-index: 1000; box-shadow: 0 4px 20px rgba(0,0,0,0.08); transition: all 0.3s ease; }
.navbar.scrolled { box-shadow: 0 6px 30px rgba(0,0,0,0.12); }
.nav-content { max-width: 1400px; margin: 0 auto; padding: 16px 40px; display: flex; justify-content: space-between; align-items: center; gap: 14px; min-height: var(--nav-height); }
.nav-links { list-style: none; display: flex; gap: 26px; align-items: center; }
.nav-links a { color: var(--text-dark); font-weight: 800; position: relative; transition: color 0.3s ease; font-size: 1.05rem; padding: 10px 12px; border-radius: 12px; }
.nav-links a:hover { color: var(--primary); background: rgba(0,0,0,0.04); }
.nav-toggle { display: none; }
.nav-burger { display: none; width: 52px; height: 52px; border-radius: 14px; align-items: center; justify-content: center; cursor: pointer; border: 1px solid rgba(0,0,0,0.12); background: rgba(255,255,255,0.95); }
.nav-burger span { display: block; width: 22px; height: 2px; background: #1f1f1f; margin: 3px 0; }

/* HERO */
.hero {
  margin-top: var(--nav-height);
  padding: 0;
  width: 100%;
  position: relative;
  overflow: hidden;
  background: #0f0f0f;

  height: min(calc(100vw * 0.5634), calc(100vh - var(--nav-height)));
  min-height: 320px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: -60px;

  background-image: url("images/cover2.png"), url("images/cover2.PNG");
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;

  filter: blur(22px) saturate(1.1);
  transform: scale(1.1);
  opacity: 0.55;
  z-index: 0;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;

  background-image:
    radial-gradient(circle at 50% 40%, rgba(255,255,255,0.10), rgba(0,0,0,0.35)),
    url("images/cover2.png"),
    url("images/cover2.PNG");

  background-size: cover, contain, contain;
  background-position: center, center, center;
  background-repeat: no-repeat, no-repeat, no-repeat;

  z-index: 1;
  pointer-events: none;
}
/* THEMES */
.projets-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 40px; margin-top: 60px; }
.theme-card { background: white; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); transition: all 0.35s ease; position: relative; }
.theme-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-hover); }
.card-header { height: 180px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: white; position: relative; overflow: hidden; gap: 15px; }
.card-header::before { content: ''; position: absolute; inset: 0; background: linear-gradient(135deg, var(--card-color) 0%, var(--card-color-dark) 100%); clip-path: polygon(0 0, 100% 0, 100% 75%, 50% 100%, 0 75%); }
.icon-header { font-size: 3.5rem; color: rgba(255, 255, 255, 0.9); z-index: 2; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.2)); }
.card-header h3 { position: relative; z-index: 2; font-size: 1.4rem; text-transform: uppercase; letter-spacing: 2px; text-align: center; }
.card-body { padding: 40px 30px 30px; }
.card-body ul { list-style: none; }
.card-body li { margin-bottom: 15px; padding-left: 30px; position: relative; font-size: 1rem; }
.card-body li::before { content: '✓'; position: absolute; left: 0; color: var(--card-color); font-weight: bold; font-size: 1.3rem; }

.vie-locale { --card-color: #FFB84D; --card-color-dark: #FF9800; }
.ecologie { --card-color: #4A7C59; --card-color-dark: #2E5940; }
.education { --card-color: #2B5BA8; --card-color-dark: #1A3F7A; }
.securite { --card-color: #D84315; --card-color-dark: #BF360C; }
.economie { --card-color: #E65100; --card-color-dark: #D84315; }
.urbanisme { --card-color: #546E7A; --card-color-dark: #37474F; }

/* CANDIDATS */
.candidats { background: var(--bg-light); }
.tete-liste { max-width: 1000px; margin: 0 auto 80px; background: white; border-radius: 25px; overflow: hidden; box-shadow: var(--shadow); display: flex; align-items: center; gap: 50px; padding: 50px; }
.tete-liste-img { width: 280px; height: 280px; border-radius: 50%; object-fit: cover; border: 8px solid var(--secondary); flex-shrink: 0; box-shadow: 0 10px 40px rgba(0,0,0,0.15); }
.tete-liste-info h3 { font-size: 2.5rem; color: var(--primary); margin-bottom: 10px; }
.tete-liste-role { font-size: 1.1rem; color: var(--secondary); font-weight: 800; margin-bottom: 18px; text-transform: uppercase; letter-spacing: 1px; }

.candidats-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px; }
.candidat-card { background: white; border-radius: 15px; padding: 25px; box-shadow: 0 5px 20px rgba(0,0,0,0.08); transition: all 0.3s ease; display: flex; flex-direction: column; }
.candidat-card:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.15); }
.candidat-header { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; }
.candidat-img { width: 80px; height: 80px; border-radius: 50%; object-fit: cover; border: 3px solid var(--bg-light); }
.candidat-header h4 { font-size: 1.1rem; margin-bottom: 5px; color: var(--primary); }
.candidat-age { font-size: 0.95rem; color: #888; }
.candidat-role { display: inline-block; background: var(--bg-light); padding: 8px 12px; border-radius: 8px; font-size: 0.78rem; font-weight: 800; color: var(--primary); text-transform: uppercase; margin-bottom: 12px; align-self: flex-start; }

.candidat-desc { font-size: 0.98rem; line-height: 1.6; color: #666; max-height: 110px; overflow: hidden; position: relative; transition: max-height 0.5s ease-in-out; }
.candidat-desc::after { content: ''; position: absolute; bottom: 0; left: 0; width: 100%; height: 50px; background: linear-gradient(to bottom, rgba(255,255,255,0), rgba(255,255,255,1)); pointer-events: none; transition: opacity 0.3s ease; }
.candidat-desc.is-open { max-height: 1500px; }
.candidat-desc.is-open::after { opacity: 0; }
.read-more-btn { display: inline-block; margin-top: 12px; background: none; border: none; color: var(--primary); font-weight: 700; font-size: 0.9rem; cursor: pointer; padding: 0; border-bottom: 2px solid transparent; align-self: flex-start; }
.read-more-btn:hover { color: var(--secondary); border-bottom-color: var(--secondary); }

/* =========================================
   ACTUALITÉ (PATCH MOBILE FIRST)
   ========================================= */
.actualites { background: white; padding-bottom: 80px; }

/* MOBILE DEFAULT : Flex Column */
.actu-grid { display: flex; flex-direction: column; gap: 40px; width: 100%; }

.actu-video-wrapper, .actu-dates-wrapper { width: 100%; }

.video-header { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; color: var(--primary); }
.video-header h3 { font-size: 1.3rem; margin: 0; line-height: 1.3; }
.video-header i { font-size: 1.8rem; color: #FF0000; flex-shrink: 0; }

.video-container { position: relative; width: 100%; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: 20px; box-shadow: var(--shadow); background: #000; }
.video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: none; }

.dates-card { background: var(--bg-light); border-radius: 20px; padding: 25px 20px; height: auto; box-shadow: var(--shadow); border: 1px solid rgba(0,0,0,0.05); display: flex; flex-direction: column; justify-content: center; }
.dates-header { display: flex; align-items: center; gap: 12px; margin-bottom: 25px; border-bottom: 3px solid var(--secondary); padding-bottom: 15px; }
.dates-header h3 { font-size: 1.3rem; color: var(--primary); margin: 0; }
.dates-header i { font-size: 1.5rem; color: var(--secondary); flex-shrink: 0; }
.date-item { margin-bottom: 20px; }
.date-label { display: block; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 1px; color: #666; font-weight: 700; margin-bottom: 4px; }
.date-value { display: block; font-family: 'Poppins', sans-serif; font-size: 1.2rem; font-weight: 700; line-height: 1.3; }
.date-value.warning { color: #D84315; }
.date-value.primary { color: var(--primary); }
.date-desc { font-size: 0.9rem; color: #555; margin-top: 4px; }
.date-separator { border: 0; height: 1px; background: rgba(0,0,0,0.1); margin: 20px 0; }

/* DESKTOP GRID */
@media (min-width: 992px) {
  .actu-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 50px; align-items: stretch; }
  .video-header h3, .dates-header h3 { font-size: 1.4rem; }
  .dates-card { height: 100%; padding: 35px; justify-content: flex-start; }
  .date-value { font-size: 1.3rem; }
}

/* FOOTER */
footer { background: linear-gradient(135deg, #1A1A1A 0%, #2C2C2C 100%); color: white; padding: 80px 20px 30px; }
.footer-content { max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr 1.15fr; gap: 60px; margin-bottom: 50px; }
footer h3 { margin-bottom: 20px; font-size: 1.5rem; color: var(--secondary); }
.footer-link { color: var(--secondary); font-weight: 700; }
.footer-bottom { text-align: center; border-top: 1px solid #444; padding-top: 30px; color: #999; }
.footer-form { display: flex; flex-direction: column; gap: 14px; }
.footer-form-row label { display: block; font-weight: 700; color: rgba(255, 255, 255, 0.92); margin-bottom: 6px; }
.footer-form-row input, .footer-form-row textarea { width: 100%; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.18); color: #fff; border-radius: 12px; padding: 12px 12px; font-size: 1rem; outline: none; }
.footer-form-row textarea { resize: vertical; min-height: 92px; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.footer-btn { border: none; border-radius: 12px; padding: 12px 14px; font-weight: 900; background: var(--secondary); color: #1A1A1A; cursor: pointer; }
.footer-status { min-height: 22px; margin-top: -4px; font-weight: 700; }
.footer-status.ok { color: #9BE29B; }
.footer-status.err { color: #FF9A9A; }
.btn-facebook { display: inline-flex; align-items: center; gap: 10px; background-color: #1877F2; color: white; padding: 10px 20px; border-radius: 12px; font-weight: 700; box-shadow: 0 4px 10px rgba(0,0,0,0.2); }
.btn-facebook:hover { background-color: #166fe5; transform: translateY(-2px); }

/* RESPONSIVE */
@media (max-width: 1024px) {
  .nav-burger { display: inline-flex; }
  .nav-links { display: none; position: absolute; top: calc(var(--nav-height) + 8px); left: 12px; right: 12px; flex-direction: column; gap: 8px; background: rgba(255,255,255,0.98); border-radius: 18px; box-shadow: var(--shadow); padding: 10px; }
  .nav-links a { width: 100%; font-size: 1.12rem; padding: 14px 12px; }
  .nav-toggle:checked ~ .nav-links { display: flex; }
  .candidats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-content { grid-template-columns: 1fr 1fr; }
  .footer-content > div:last-child { grid-column: 1 / -1; }
}
@media (max-width: 768px) {
  section { padding: 60px 20px; }
  .section-title { font-size: 2rem; }
  .tete-liste { flex-direction: column; text-align: center; padding: 30px; gap: 30px; }
  .tete-liste-img { width: 210px; height: 210px; }
  .tete-liste-info h3 { font-size: 1.9rem; }
  .projets-grid { grid-template-columns: 1fr; }
  .footer-content { grid-template-columns: 1fr; gap: 40px; }
}
@media (max-width: 640px) { .candidats-grid { grid-template-columns: 1fr; } }