@font-face {
  font-family: "Poppins";
  src: url("../font/Poppins/Poppins-Bold.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

@font-face {
  font-family: "Avenir";
  src: url("../font/Avenir.ttc") format("truetype");
  font-weight: normal;
  font-style: normal;
}

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

body {
  background-color: #f1f8ff;
  font-family: "Poppins", sans-serif;
  overflow-x: hidden;
  margin: 0;
}

span {
  color: #ff7f00;
}

.text-muted {
  display: flex;
  justify-content: center;
  text-align: center;
  margin-top: 0;
  padding: 0 15px;
  color: #002798;
}

/* ============================================================
   HEADER
   ============================================================ */
header {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 100000;
  width: 100%;
  min-height: 100px;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: #002798 5px solid;
  border-top: #002798 5px solid;
  padding: 8px clamp(10px, 3vw, 20px);
  background-color: #f1f8ff;
  color: #f1f8ff;
}

/* Header du dashboard / admin (logo et titre directement dans <header>) */
header > img {
  width: clamp(40px, 8vw, 80px);
  height: clamp(40px, 8vw, 80px);
  flex-shrink: 0;
}
header > h1 {
  flex: 1;
  margin: 0 0 0 clamp(8px, 2vw, 20px);
  font-size: clamp(15px, 3vw, 28px);
}

/* Logo de campagne seul, en haut à gauche */
.logo-campagne {
  display: flex;
  align-items: center;
  min-width: 0;
}
.logo-campagne img {
  display: block;
  height: clamp(48px, 9vw, 84px);
  width: auto;
  max-width: 55vw;
  object-fit: contain;
}

main {
  width: 100%;
  display: flex;
  flex-direction: column;
  margin-top: 100px;
  padding: 20px clamp(18px, 3vw, 20px) 70px;
}

/* ============================================================
   GRILLE DES PROJETS
   ≥ 1024px : 3 colonnes (3 cartes + [1 carte | bandeau sur 2 col.])
   640–1023 : 2 colonnes (bandeau sur toute la largeur)
   < 640    : 1 colonne
   ============================================================ */
.allprojet {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  width: 100%;
  max-width: 1400px;
  margin: 0 auto 20px;
  color: #002798;
}

/* Double classe : l'emporte sur review.css sans dépendre de l'ordre */
.allprojet .projet-cta {
  grid-column: span 2;
}

/* ============================================================
   CARTE PROJET : photo en bandeau (hauteur fixe), titre + bouton,
   tracé large en dessous
   ============================================================ */
.projet {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  min-width: 0;
  padding: 14px;
  border: 5px solid #002798;
  border-radius: 20px;
  background-color: #fff;
  opacity: 0;
  animation: cardIn 0.6s ease forwards;
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}

.projet:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 28px rgba(0, 39, 152, 0.18);
}

.allprojet .projet:nth-child(1) {
  animation-delay: 0.05s;
}
.allprojet .projet:nth-child(2) {
  animation-delay: 0.15s;
}
.allprojet .projet:nth-child(3) {
  animation-delay: 0.25s;
}
.allprojet .projet:nth-child(4) {
  animation-delay: 0.35s;
}
.allprojet .projet:nth-child(5) {
  animation-delay: 0.45s;
}

/* "translate" (et pas "transform") pour ne pas bloquer le survol */
@keyframes cardIn {
  from {
    opacity: 0;
    translate: 0 24px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

/* Cadre photo : pleine largeur, hauteur FIXE identique partout */
.projet img,
.projet__noimg {
  display: block;
  width: 100%;
  height: 180px;
  object-fit: cover;
  border: 5px solid #002798;
  border-radius: 12px;
}

.projet__noimg {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e4edf9;
  color: #7b8fc2;
  font-size: 14px;
  text-align: center;
}

.droite {
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.top p {
  margin: 0;
  min-width: 0;
  font-size: clamp(17px, 1.5vw, 22px);
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.top a {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 16px;
  border: 2px solid #002798;
  border-radius: 100px;
  background-color: #f1f8ff;
  color: #002798;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.top a:hover {
  background-color: #002798;
  color: #f2f2f2;
}

/* Projet phare (orange) */

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media screen and (max-width: 1023px) {
  .allprojet {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .allprojet .projet-cta {
    grid-column: 1 / -1;
  }
}

@media screen and (max-width: 899px) {
  header {
    min-height: 80px;
  }
  main {
    margin-top: 80px;
  }
}

@media screen and (max-width: 639px) {
  .allprojet {
    grid-template-columns: minmax(0, 1fr);
    max-width: 520px;
  }
  .projet img,
  .projet__noimg {
    height: 170px;
  }
}

/* Très petit écran : le bouton passe sous le titre */
@media screen and (max-width: 360px) {
  .top {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .projet {
    animation: none;
    opacity: 1;
  }
  .projet:hover {
    transform: none;
  }
}
