*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --blue: #24408f;
  --green: #40ad48;
  --dark: #231f20;
  --light: #f7f8fa;
  --white: #ffffff;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', sans-serif;
  color: var(--dark);
  line-height: 1.6;
  background: var(--white);
}

h1, h2, h3 { font-family: 'Playfair Display', serif; }
h2 { font-size: 2.2rem; color: var(--blue); text-align: center; margin-bottom: 2rem; }

.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

.btn {
  display: inline-block; padding: .75rem 1.8rem; border-radius: 6px;
  text-decoration: none; font-weight: 600; font-size: .95rem; transition: all .2s; cursor: pointer; border: none;
}
.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: #1a3070; }
.btn-outline { background: transparent; color: var(--white); border: 2px solid var(--white); }
.btn-outline:hover { background: rgba(255,255,255,.15); }

/* Navbar */
#navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: transparent; transition: background .3s, box-shadow .3s;
}
#navbar.scrolled { background: var(--blue); box-shadow: 0 2px 20px rgba(0,0,0,.15); }
.nav-container {
  max-width: 1100px; margin: 0 auto; padding: .8rem 1.5rem;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-brand { color: var(--white); text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.nav-links { list-style: none; display: flex; gap: 2rem; }
.nav-links a { color: var(--white); text-decoration: none; font-weight: 500; font-size: .95rem; transition: opacity .2s; }
.nav-links a:hover { opacity: .8; }

.hamburger { display: none; background: none; border: none; cursor: pointer; padding: 4px; }
.hamburger span { display: block; width: 24px; height: 2px; background: var(--white); margin: 6px 0; transition: .3s; }
.hamburger.active span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

/* Hero */
#hero {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--blue) 0%, #1a3070 60%, var(--green) 100%);
  color: var(--white); text-align: center; padding: 6rem 1.5rem 4rem;
}
.hero-content { max-width: 750px; }
.hero-content h1 { font-size: 3rem; line-height: 1.15; margin-bottom: 1rem; }
.subtitle { font-size: 1.3rem; opacity: .9; margin-bottom: .5rem; font-style: italic; }
.election-date { font-size: 1.1rem; font-weight: 600; background: rgba(255,255,255,.15); display: inline-block; padding: .4rem 1.2rem; border-radius: 30px; margin-bottom: 1.5rem; }
.intro { font-size: 1.05rem; opacity: .85; margin-bottom: 2rem; line-height: 1.7; }
.hero-buttons { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

/* Programme / Flipbook */
#programme { padding: 5rem 0; background: var(--light); }

.flipbook-wrapper {
  display: flex; align-items: center; justify-content: center; gap: 1rem; margin-bottom: 1rem;
}
.flipbook-container {
  background: var(--white); border-radius: 4px;
  box-shadow: 0 8px 40px rgba(0,0,0,.18), 0 2px 8px rgba(0,0,0,.1);
  overflow: hidden; transition: transform .25s ease;
  max-width: 800px; width: 100%;
}
.flipbook-container.flip-forward { animation: flipF .35s ease; }
.flipbook-container.flip-backward { animation: flipB .35s ease; }
@keyframes flipF { 0%{transform:perspective(1200px) rotateY(0)} 50%{transform:perspective(1200px) rotateY(-8deg)} 100%{transform:perspective(1200px) rotateY(0)} }
@keyframes flipB { 0%{transform:perspective(1200px) rotateY(0)} 50%{transform:perspective(1200px) rotateY(8deg)} 100%{transform:perspective(1200px) rotateY(0)} }

.flipbook-page { display: flex; }
.flipbook-page img { width: 50%; height: auto; display: block; }

.flip-btn {
  background: var(--blue); color: var(--white); border: none; width: 48px; height: 48px;
  border-radius: 50%; font-size: 1.3rem; cursor: pointer; transition: background .2s;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
}
.flip-btn:hover { background: var(--green); }

.flipbook-controls { text-align: center; margin: 1rem 0; font-weight: 500; color: var(--blue); }

.download-btn { display: block; width: fit-content; margin: 1.5rem auto 0; }

/* Actualités */
#actualites { padding: 5rem 0; }
.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }
.news-card {
  background: var(--white); border-left: 4px solid var(--blue); padding: 1.5rem;
  border-radius: 6px; box-shadow: 0 2px 12px rgba(0,0,0,.06); transition: transform .2s;
}
.news-card:hover { transform: translateY(-3px); }
.news-date { font-size: .8rem; color: var(--green); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; }
.news-card h3 { font-size: 1.2rem; margin: .5rem 0; color: var(--blue); }
.news-card p { font-size: .95rem; color: #555; }

/* Contact */
#contact { padding: 5rem 0; background: var(--light); }
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; max-width: 900px; margin: 0 auto; }
.contact-form { display: flex; flex-direction: column; gap: 1rem; }
.contact-form input, .contact-form textarea {
  padding: .8rem 1rem; border: 1px solid #ddd; border-radius: 6px; font-family: inherit;
  font-size: .95rem; transition: border .2s;
}
.contact-form input:focus, .contact-form textarea:focus { border-color: var(--blue); outline: none; }
.checkbox-label { display: flex; align-items: center; gap: .5rem; font-size: .9rem; cursor: pointer; }
.form-success { display: none; color: var(--green); font-weight: 600; margin-top: .5rem; }
.contact-info { padding-top: .5rem; }
.contact-info h3 { color: var(--blue); margin-bottom: 1rem; }
.contact-info p { margin-bottom: .8rem; line-height: 1.6; }
.contact-info a { color: var(--blue); text-decoration: none; }

/* Footer */
footer {
  background: var(--blue); color: var(--white); text-align: center; padding: 2rem 1.5rem;
  font-size: .9rem;
}
footer p { margin: .3rem 0; }
footer a { color: rgba(255,255,255,.8); text-decoration: none; }

/* Hero photo */
.hero-photo {
  margin-bottom: 2rem;
}
.hero-photo img {
  width: 280px; max-width: 80%; height: auto;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0,0,0,.3);
  border: 3px solid rgba(255,255,255,.2);
}

/* Flipbook hint */
.flipbook-hint {
  text-align: center; font-size: .85rem; color: #888; margin-top: .5rem;
}

/* Flipbook cursor */
.flipbook-container { cursor: zoom-in; }

/* Zoom modal */
.zoom-modal {
  display: none; position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.92); z-index: 2000;
  align-items: center; justify-content: center;
}
.zoom-modal.active { display: flex; }
.zoom-modal img {
  max-height: 90vh; max-width: 90vw; object-fit: contain;
  border-radius: 4px;
  -webkit-user-select: none; user-select: none;
  touch-action: pinch-zoom;
}
.zoom-close {
  position: absolute; top: 1rem; right: 1.5rem;
  background: none; border: none; color: white; font-size: 2rem; cursor: pointer;
  z-index: 2001;
}
.zoom-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.15); border: none; color: white;
  width: 48px; height: 48px; border-radius: 50%; font-size: 1.3rem; cursor: pointer;
  transition: background .2s; z-index: 2001;
}
.zoom-nav:hover { background: rgba(255,255,255,.3); }
.zoom-prev { left: 1rem; }
.zoom-next { right: 1rem; }
.zoom-counter {
  position: absolute; bottom: 1.5rem; left: 50%; transform: translateX(-50%);
  color: rgba(255,255,255,.7); font-size: .9rem; font-weight: 500;
}

/* Back to top */
.back-to-top {
  position: fixed; bottom: 2rem; right: 2rem;
  width: 48px; height: 48px; border-radius: 50%;
  background: var(--blue); color: white; border: none;
  font-size: 1.4rem; cursor: pointer;
  opacity: 0; visibility: hidden; transition: all .3s;
  z-index: 999; box-shadow: 0 4px 15px rgba(0,0,0,.2);
}
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--green); transform: translateY(-3px); }

/* Mobile */
@media (max-width: 768px) {
  .hamburger { display: block; }
  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--blue); flex-direction: column; padding: 1rem 1.5rem; gap: 1rem;
    display: none;
  }
  .nav-links.open { display: flex; }
  .hero-content h1 { font-size: 2rem; }
  .subtitle { font-size: 1.05rem; }
  .flipbook-page img { width: 100%; }
  .flipbook-page img.page-right { display: none !important; }
  .contact-grid { grid-template-columns: 1fr; gap: 2rem; }
  h2 { font-size: 1.7rem; }
}
