/* ---------------------------
   STYLE PRIMAIRE DYNAMIQUE
   --------------------------- */

/* Fond global avec dégradé animé multicolore */
body {
  margin: 0;
  font-family: "Poppins", Arial, sans-serif;
  background: linear-gradient(-45deg, #e3f2fd, #fef9e7, #f1f8e9, #fff3e0);
  background-size: 400% 400%;
  animation: bgAnim 15s ease infinite;
  color: #333;
  line-height: 1.6;
}

@keyframes bgAnim {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* HERO Primaire */
.hero {
  background: url('../images/primaire-bg.jpg') center/cover no-repeat;
  background-attachment: fixed; /* ✅ PC uniquement */
  position: relative;
  padding: 6rem 1rem;
  color: #fff;
  text-align: left;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(0, 102, 204, 0.25), rgba(255, 193, 7, 0.25));
  backdrop-filter: blur(0.5px);
  z-index: 0;
}

.hero .container {
  position: relative;
  z-index: 1;
}

/* 📱 MOBILE (Android + iPhone) */
@media (max-width: 768px) {
  .hero {
    background-image: linear-gradient(135deg, rgba(0,102,204,0.7), rgba(156,39,176,0.6)),
                      url('../images/primaire-bg.jpg');
    background-position: center center, center bottom; /* gradient centré, image ancrée en bas */
    background-size: auto, cover;                     /* gradient auto, image cover */
    background-repeat: no-repeat, no-repeat;
    background-attachment: scroll, scroll !important; /* ⚡ force scroll sur iOS/Android */
    padding: 4rem 1rem;
  }

  /* Supprimer le dégradé superposé sur mobile */
  .hero::before {
    background: none;
    backdrop-filter: none;
  }
}

/* 🛠 Hack spécial iOS Safari */
@supports (-webkit-touch-callout: none) {
  .hero {
    background-attachment: scroll !important;           /* désactive le fixed sur iOS */
    background-size: auto, cover !important;            /* force cover pour l’image */
    background-position: center center, center bottom !important; /* force position correcte */
  }
}

.hero .container {
  position: relative;
  z-index: 1;
  animation: fadeInUp 2s ease;
}

.hero .kicker {
  font-size: 1rem;
  text-transform: uppercase;
  color: #ffeb3b;
  font-weight: 600;
  letter-spacing: 2px;
  animation: pulse 2.5s infinite;
}

.hero h1 {
  font-size: 2.8rem;
  font-weight: 700;
  margin: 1rem 0;
  line-height: 1.2;
  background: linear-gradient(90deg, #ff4081, #00bcd4, #4caf50, #ff9800);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: gradientText 6s linear infinite;
}

@keyframes gradientText {
  to { background-position: 200% center; }
}

.hero .lead {
  font-size: 1.2rem;
  max-width: 650px;
  margin-bottom: 1.5rem;
}

/* Boutons */
.btn, .btn-outline {
  padding: .9rem 1.7rem;
  border-radius: 999px;
  font-weight: 600;
  transition: all .3s ease;
  text-decoration: none;
  font-size: 1rem;
}

.btn {
  background: linear-gradient(90deg, #0066cc, #00c853);
  color: #fff;
  border: none;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn:hover {
  transform: translateY(-3px);
  background: linear-gradient(90deg, #004c99, #009624);
}

.btn-outline {
  border: 2px solid #fff;
  color: #fff;
  background: transparent;
}

.btn-outline:hover {
  background: #fff;
  color: #0066cc;
}

/* Points dans le hero */
.hero-points {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-points li {
  background: rgba(255, 255, 255, 0.25);
  padding: .6rem 1rem;
  border-radius: 999px;
  font-size: .95rem;
  font-weight: 500;
  backdrop-filter: blur(2px);
  transition: transform .3s ease, background .3s ease;
}

.hero-points li:hover {
  transform: scale(1.05);
  background: rgba(255, 255, 255, 0.4);
}

/* Sections */
.section {
  padding: 4rem 1rem;
  position: relative;
}

.section.alt {
  background: linear-gradient(135deg, #f9fcff, #fffaf0);
}

/* Titres */
.section-head h2 {
  font-size: 2rem;
  margin-bottom: .5rem;
  background: linear-gradient(90deg, #ff5722, #3f51b5, #009688);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.section-head p {
  color: #666;
  max-width: 650px;
  margin: 0 auto;
}

/* Grilles de cartes */
.grid-3 {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  margin-top: 2rem;
}

.card.feat {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  padding: 2rem 1.5rem;
  text-align: center;
  transition: transform .3s ease, box-shadow .3s ease;
  border-top: 5px solid transparent;
  background-image: linear-gradient(#fff, #fff), linear-gradient(90deg, #ff4081, #00bcd4, #4caf50);
  background-origin: border-box;
  background-clip: content-box, border-box;
}

.card.feat:hover {
  transform: translateY(-6px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.15);
}

.card.feat .feat-emoji {
  font-size: 2.5rem;
  margin-bottom: .8rem;
  animation: float 3s ease-in-out infinite;
}

.card.feat h3 {
  color: #0066cc;
  margin-bottom: .5rem;
  font-size: 1.3rem;
}

/* CTA Section */
.section.center {
  text-align: center;
}

.section.center h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  background: linear-gradient(90deg, #673ab7, #2196f3, #ff9800);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Footer Primaire */
.site-footer {
  background: linear-gradient(135deg, #004c99, #0066cc, #009688);
  color: #fff;
  padding: 2rem 1rem;
  text-align: center;
}

.footer-nav a {
  color: #ffeb3b;
  text-decoration: none;
  margin-right: 1rem;
  transition: color .3s ease;
}

.footer-nav a:hover {
  color: #fff;
  text-decoration: underline;
}

/* ANIMATIONS UTILITAIRES */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .6; }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
