/* =========================================================================
   style.css — Prix de l'Économie du Bien Commun
   Charte graphique Les EDC : bleu #2f456c + orange #fb822c,
   turquoise #4cbdcb (couleur dédiée au Prix). Typographie : Raleway.
   ========================================================================= */

:root {
  /* Couleurs EDC */
  --blue:      #2f456c;
  --blue-2:    #637792;
  --blue-3:    #8ea0b9;
  --blue-4:    #c7d1e0;
  --orange:    #fb822c;
  --orange-2:  #fdab70;
  --orange-3:  #ffc296;
  --orange-4:  #ffdece;
  --teal:      #4cbdcb;   /* couleur "Prix de l'économie du bien commun" */
  --teal-soft: #e3f4f6;

  --bg:        #f4f6fa;
  --card:      #ffffff;
  --ink:       #2b3444;
  --muted:     #667089;
  --line:      #e6eaf1;

  --shadow:    0 12px 34px rgba(47, 69, 108, 0.12);
  --shadow-sm: 0 6px 18px rgba(47, 69, 108, 0.09);
  --radius:    18px;
  --maxw:      1180px;
}

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

body {
  margin: 0;
  font-family: "Raleway", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: "Raleway", sans-serif; line-height: 1.18; font-weight: 800; }
img { display: block; max-width: 100%; }
a { color: inherit; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ------------------------------------------------------------- Bandeau */

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 70px;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-logo { height: 50px; width: auto; flex: 0 0 auto; display: block; }
/* Bloc "Prix" à droite */
.brand-prix { text-align: right; line-height: 1.2; }
.brand-prix-title { font-family: "Raleway", sans-serif; font-weight: 800; font-size: 0.98rem; color: var(--blue); letter-spacing: -0.01em; }
.brand-prix-title b { color: var(--teal); }
.brand-sub { display: block; font-size: .74rem; color: var(--muted); font-weight: 600; margin-top: 2px; }
/* Réutilisé dans le pied de page */
.brand-title { font-family: "Raleway", sans-serif; font-weight: 800; color: var(--blue); }
.brand-title b { color: var(--teal); }

/* ------------------------------------------- Bandeau "vous avez voté" */
.vote-banner { background: var(--teal-soft); border-bottom: 1px solid #cfe9ee; }
.vote-banner .container {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 6px 16px; padding: 10px 22px;
}
.vote-banner-txt { color: var(--blue); font-weight: 600; }
.vote-banner-btn {
  background: none; border: 0; color: var(--orange); font: inherit; font-weight: 800;
  cursor: pointer; text-decoration: underline; padding: 0;
}
.vote-banner-btn:hover { color: #d85e1a; }

/* ---------------------------------------------------------------- Hero */

.hero {
  position: relative; overflow: hidden;
  background: var(--blue);
  color: #fff;
  padding: 62px 0 120px;
  text-align: center;
}
.hero-inner { position: relative; z-index: 2; }
.hero .eyebrow {
  display: inline-block; background: var(--orange); color: #fff;
  font-weight: 700; font-size: .8rem; letter-spacing: .03em; text-transform: uppercase;
  padding: 7px 16px; border-radius: 999px; margin-bottom: 20px;
}
.hero h1 {
  font-size: clamp(2rem, 4.4vw, 3.15rem); margin: 0 auto 16px; max-width: 15ch;
  font-weight: 800; letter-spacing: -0.02em;
}
.hero h1 .accent { color: var(--teal); }
.hero p { max-width: 640px; margin: 0 auto; color: rgba(255,255,255,.82); font-size: 1.08rem; }
.hero .count-line {
  margin-top: 22px; display: inline-flex; gap: 10px; align-items: center;
  font-weight: 700; color: #fff;
  background: rgba(255,255,255,.10); border: 1px solid rgba(255,255,255,.18);
  padding: 9px 18px; border-radius: 999px; font-size: .95rem;
}
.hero .count-line b { color: var(--orange-2); }

/* Motif "gouttes" EDC */
.drops { position: absolute; z-index: 1; opacity: .9; }
.drops path { fill: var(--teal); }
.drops.drops-a { top: 54px; left: 8%; width: 46px; transform: rotate(-8deg); }
.drops.drops-b { bottom: 150px; right: 9%; width: 60px; transform: rotate(12deg); }
.drops.drops-b path { fill: var(--orange); }

/* Vague de transition bas de hero */
.hero-wave { position: absolute; left: 0; right: 0; bottom: -1px; z-index: 1; width: 100%; display: block; }
.hero-wave .w-back { fill: var(--blue-2); opacity: .35; }
.hero-wave .w-front { fill: var(--bg); }

/* --------------------------------------------------------------- Boutons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
  border: 2px solid transparent; border-radius: 999px;
  padding: 11px 20px; transition: transform .12s ease, background .2s, box-shadow .2s, opacity .2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary { background: var(--orange); color: #fff; }
.btn-primary:hover { background: #ef7418; box-shadow: 0 8px 18px rgba(251, 130, 44, .38); }

.btn-ghost { background: transparent; color: var(--blue); border-color: var(--blue-4); }
.btn-ghost:hover { background: #eef1f7; border-color: var(--blue-3); }

.btn.is-voted { background: var(--teal-soft); color: var(--blue); cursor: default; box-shadow: none; border-color: transparent; }
.btn.is-mine  { background: var(--teal); color: #fff; }
.btn:disabled { cursor: default; }

.btn-link {
  display: inline-block; margin-top: 12px; background: none; border: 0; padding: 0;
  color: var(--muted); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer;
}
.btn-link:hover { color: var(--orange); }

/* --------------------------------------------------------------- Grille */

.section-lead { text-align: center; margin: -70px auto 0; position: relative; z-index: 3; }

.grid {
  display: grid; gap: 24px; padding: 30px 0 80px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow-sm); display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.card-media {
  position: relative; border: 0; padding: 0; cursor: pointer;
  aspect-ratio: 4 / 3; overflow: hidden; background: var(--blue-4); display: block; width: 100%;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; transition: transform .35s ease; }
.card-media:hover img { transform: scale(1.05); }

.play-badge {
  position: absolute; inset: 0; margin: auto; width: 62px; height: 62px;
  display: grid; place-items: center; border-radius: 50%;
  background: rgba(255, 255, 255, .92); box-shadow: 0 6px 18px rgba(0,0,0,.28);
  transition: transform .18s ease;
}
.play-badge svg { width: 28px; height: 28px; fill: var(--orange); margin-left: 3px; }
.card-media:hover .play-badge { transform: scale(1.08); }

.media-hint {
  position: absolute; left: 10px; bottom: 10px;
  background: rgba(47, 69, 108, .82); color: #fff; font-size: .74rem; font-weight: 700;
  padding: 5px 11px; border-radius: 999px;
}

.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.pill {
  align-self: flex-start; background: var(--teal-soft); color: #1f7d8a;
  font-size: .72rem; font-weight: 800; padding: 5px 12px; border-radius: 999px;
  margin-bottom: 10px; letter-spacing: .01em; text-transform: uppercase;
}
.card-name { font-size: 1.18rem; margin: 0 0 2px; color: var(--blue); font-weight: 800; }
.card-company { margin: 0; color: var(--muted); font-weight: 700; font-size: .92rem; }
.card-punch {
  margin: 10px 0 16px; font-style: italic; color: var(--ink); font-weight: 500;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}

.card-actions { margin-top: auto; display: flex; gap: 10px; }
.card-actions .btn { flex: 1; padding: 10px 12px; font-size: .9rem; }

/* --------------------------------------------------------------- Fiche */

.fiche { padding: 26px 0 90px; }
.back-link { display: inline-block; color: var(--blue); font-weight: 700; text-decoration: none; margin-bottom: 22px; }
.back-link:hover { text-decoration: underline; }

.fiche-hero {
  display: grid; grid-template-columns: 320px 1fr; gap: 34px;
  align-items: center; margin-bottom: 44px;
}
.fiche-media {
  position: relative; border: 0; padding: 0; cursor: pointer;
  border-radius: var(--radius); overflow: hidden; aspect-ratio: 1 / 1;
  box-shadow: var(--shadow); background: var(--blue-4);
}
.fiche-media img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.fiche-media .play-badge { width: 70px; height: 70px; }
.fiche-head h1 { font-size: clamp(1.8rem, 3.6vw, 2.5rem); color: var(--blue); margin: 10px 0 4px; }
.fiche-company { margin: 0; color: var(--muted); font-weight: 800; font-size: 1.05rem; }
.fiche-punch { font-style: italic; font-size: 1.15rem; margin: 14px 0 22px; color: var(--ink); }

.fiche-section { margin: 0 auto 42px; max-width: 800px; }
.fiche-section h2 {
  font-size: 1.35rem; color: var(--blue); margin: 0 0 18px;
  padding-bottom: 10px; border-bottom: 3px solid var(--teal); display: inline-block;
}
.fiche-text { font-size: 1.07rem; color: #3a4457; }

.qa-list { display: grid; gap: 14px; }
.qa { background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--orange); border-radius: 14px; padding: 16px 18px; box-shadow: var(--shadow-sm); }
.qa-q { margin: 0 0 6px; font-weight: 800; color: var(--blue); }
.qa-a { margin: 0; color: #3a4457; }

.fiche-footer {
  max-width: 800px; margin: 0 auto; display: flex; gap: 14px; flex-wrap: wrap;
  justify-content: center; padding-top: 8px;
}

.notfound { text-align: center; padding: 80px 0; }
.notfound h1 { color: var(--blue); }

/* --------------------------------------------------- Vidéo responsive 16:9 */

.video-frame {
  position: relative; width: 100%; aspect-ratio: 16 / 9;
  border-radius: 14px; overflow: hidden; background: #000; box-shadow: var(--shadow);
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* Repli vidéo quand le site est ouvert en local (file://) */
.video-fallback {
  position: relative; display: block; width: 100%; aspect-ratio: 16 / 9;
  border-radius: 14px; overflow: hidden; background: #000; box-shadow: var(--shadow);
}
.video-fallback img { width: 100%; height: 100%; object-fit: cover; opacity: .7; }
.video-fallback .play-badge { width: 66px; height: 66px; }
.modal-video .video-fallback { border-radius: 14px; }

/* ------------------------------------------------------------- Modales */

.modal-backdrop {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center;
  background: rgba(24, 34, 54, .66); padding: 20px;
  opacity: 0; transition: opacity .2s ease;
}
.modal-backdrop.open { opacity: 1; }
.modal {
  position: relative; width: 100%; max-width: 900px;
  transform: translateY(12px) scale(.98); transition: transform .2s ease;
}
.modal-backdrop.open .modal { transform: translateY(0) scale(1); }

.modal-close {
  position: absolute; top: -44px; right: -4px; width: 38px; height: 38px;
  border: 0; border-radius: 50%; background: rgba(255,255,255,.92); color: var(--ink);
  font-size: 26px; line-height: 1; cursor: pointer; z-index: 2;
}
.modal-close:hover { background: #fff; }

.modal-video .video-frame { border-radius: 14px; }
.modal-video-meta { color: #fff; text-align: center; margin-top: 14px; }
.modal-video-meta strong { display: block; font-size: 1.1rem; }
.modal-video-meta span { color: rgba(255,255,255,.75); font-size: .9rem; }

.modal-backdrop--thanks .modal { max-width: 440px; }
.modal-thanks {
  background: #fff; border-radius: var(--radius); padding: 40px 30px 32px;
  text-align: center; box-shadow: var(--shadow);
}
.thanks-check {
  width: 76px; height: 76px; margin: 0 auto 18px; border-radius: 50%;
  background: var(--teal); color: #fff; font-size: 42px; font-weight: 800;
  display: grid; place-items: center;
  box-shadow: 0 8px 20px rgba(76, 189, 203, .45);
}
.thanks-check--info { background: var(--orange); box-shadow: 0 8px 20px rgba(251,130,44,.4); font-style: italic; font-family: Georgia, serif; }
.modal-thanks h2 { color: var(--blue); margin: 0 0 10px; }
.modal-thanks p { color: var(--muted); margin: 0 0 14px; }
.modal-thanks .thanks-note { font-size: .88rem; }
.modal-thanks .btn { margin-top: 6px; }

/* ---------------------------------------------- Bandeau cookies (discret) */
.cookie-banner {
  position: fixed; left: 16px; bottom: 16px; z-index: 60; max-width: 340px;
  background: #fff; color: var(--ink); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow); padding: 14px 16px;
  font-size: .86rem; opacity: 0; transform: translateY(16px);
  transition: opacity .25s ease, transform .25s ease;
}
.cookie-banner.show { opacity: 1; transform: translateY(0); }
.cookie-banner .cb-text { margin: 0 0 10px; color: var(--muted); line-height: 1.45; }
.cookie-banner .cb-text b { color: var(--blue); }
.cookie-banner .cb-actions { display: flex; gap: 8px; justify-content: flex-end; }
.cb-btn { font: inherit; font-weight: 700; font-size: .85rem; border-radius: 999px; padding: 7px 16px; cursor: pointer; border: 2px solid transparent; }
.cb-refuse { background: transparent; color: var(--muted); border-color: var(--line); }
.cb-refuse:hover { background: #f1f3f7; }
.cb-accept { background: var(--orange); color: #fff; }
.cb-accept:hover { background: #ef7418; }
@media (max-width: 480px) { .cookie-banner { left: 12px; right: 12px; bottom: 12px; max-width: none; } }

/* --------------------------------------------------------------- Footer */

.site-footer {
  background: var(--blue); color: rgba(255,255,255,.8);
  padding: 30px 0; text-align: center; font-size: .92rem; font-weight: 600;
}
.site-footer .brand-title { color: #fff; }
.site-footer .brand-title b { color: var(--teal); }

/* ---------------------------------------------------------- Responsive */

@media (max-width: 780px) {
  .brand-prix { display: none; }
  .fiche-hero { grid-template-columns: 1fr; text-align: center; }
  .fiche-media { max-width: 250px; margin: 0 auto; }
  .fiche-section h2 { display: block; }
  .fiche-cta .btn { width: 100%; }
  .modal-close { top: -42px; right: 0; }
  .section-lead { margin-top: -55px; }
}
@media (max-width: 420px) {
  .brand-logo { height: 40px; }
}
