@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Caveat:wght@500;600;700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&display=swap');

:root {
  /* Palette culturel Italie-Madagascar */
  --green-italy: #008C45;      /* vert drapeau Italie */
  --red-italy: #CD212A;        /* rouge drapeau Italie */
  --green-madagascar: #009B3A; /* vert drapeau Madagascar (approximation) */
  --red-madagascar: #EF3340;   /* rouge drapeau Madagascar */
  --white: #FFFFFF;
  --cream: #F8F4E9;
  --terracotta: #E2725B;       /* terre cuite Madagascar */
  --olive: #6B8E23;            /* olive verte */
  --sand: #EDC9AF;             /* sable */
  --slate: #2F4F4F;            /* ardoise */

  /* Couleurs dérivées pour l'interface */
  --primary: var(--green-italy);
  --secondary: var(--red-italy);
  --accent: var(--terracotta);
  --background: var(--cream);
  --surface: rgba(255, 255, 255, 0.85);
  --surface-dark: rgba(0, 0, 0, 0.6);
  --text: var(--slate);
  --text-light: var(--white);
  --text-muted: #666;

  /* Rayons et transitions */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 18px;
  --radius-full: 9999px;
  --transition-default: 0.35s ease;
  --transition-slow: 0.6s ease;
}

/* Reset et base */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background-color: var(--background);
  line-height: 1.6;
  overflow-x: hidden;
}

body {
  position: relative;
}

/* Animations globales */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); }
  100% { transform: scale(1); }
}

body > * {
  animation: fadeInUp 0.8s forwards ease-out;
}
body > *:nth-child(1) { animation-delay: 0.1s; }
body > *:nth-child(2) { animation-delay: 0.2s; }
body > *:nth-child(3) { animation-delay: 0.3s; }
body > *:nth-child(4) { animation-delay: 0.4s; }

/* ============ HÉROS ============ */
.hero {
  position: relative;
  text-align: center;
  padding: 120px 24px 80px;
  overflow: hidden;
}

/* Fond vidéo existant conservé */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: -20;
  overflow: hidden;
}
.page-bg video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.page-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.3) 100%);
}

/* Overlay culturel : mélange de motifs */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -10;
  background-image:
    radial-gradient(circle at 20% 30%, rgba(0, 140, 69, 0.15) 0%, transparent 20%),
    radial-gradient(circle at 80% 70%, rgba(205, 33, 42, 0.15) 0%, transparent 20%),
    url('/theme/ita1.jpeg');
  background-size: cover, cover, 400px;
  background-repeat: no-repeat, no-repeat, repeat;
  background-position: center, center, center;
  opacity: 0.6;
  pointer-events: none;
}

/* Petite bande tricolore (Italie-Madagascar fusion) */
.hero-flag-bar {
  display: flex;
  width: 120px;
  height: 6px;
  border-radius: 999px;
  overflow: hidden;
  margin: 0 auto 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
}
.hero-flag-bar span {
  flex: 1;
}
.hero-flag-bar span:nth-child(1) { background: var(--green-italy); }
.hero-flag-bar span:nth-child(2) { background: var(--white); }
.hero-flag-bar span:nth-child(3) { background: var(--red-italy); }
.hero-flag-bar span:nth-child(4) { background: var(--green-madagascar); }
.hero-flag-bar span:nth-child(5) { background: var(--red-madagascar); }

/* Titre principal */
.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2.8rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Tagline manuscrite */
.hero-tagline {
  font-family: 'Caveat', cursive;
  font-size: 2.4rem;
  font-weight: 600;
  font-style: italic;
  color: var(--secondary);
  margin: 16px auto 24px;
  max-width: 500px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* Sous-titre */
.hero-sub {
  font-size: 1.15rem;
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

/* ============ CAROUSEL D'ÉQUIPE (CONSERVÉ) ============ */
/* Le carousel (accordion horizontal) est conservé tel quel, avec quelques raffinements de couleurs culturelles */
.acc-wrap {
  width: 100%;
  max-width: 960px;
  height: 34rem;
  display: flex;
  flex-direction: row;
  gap: 16px;
  margin: 0 auto 40px;
  padding: 0 16px;
}

.acc-panel {
  position: relative;
  min-width: 3.75rem;
  min-height: 0;
  flex: 1 1 0%;
  overflow: hidden;
  border-radius: var(--radius-lg);
  cursor: pointer;
  /* Dégradés basés sur les couleurs culturelles */
  background: linear-gradient(135deg, var(--primary), var(--surface-dark));
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
  border: 1px solid rgba(255,255,255,0.15);
  transition:
    flex-grow 0.7s cubic-bezier(.22,1,.36,1),
    border-color var(--transition-default),
    box-shadow var(--transition-default),
    background-position var(--transition-slow);
}
.acc-panel:nth-child(3n+2) {
  background: linear-gradient(135deg, var(--secondary), var(--surface-dark));
}
.acc-panel:nth-child(3n) {
  background: linear-gradient(135deg, var(--accent), var(--surface-dark));
}

.acc-panel[data-active="true"] {
  flex: 6 1 0%;
  border-color: var(--accent);
  box-shadow:
    0 0 30px rgba(226, 114, 91, 0.4),
    0 12px 24px rgba(0,0,0,0.2);
  background-position: center;
}

/* Image membre */
.acc-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.75;
  transform: scale(1.05);
  transition: transform 0.7s ease, opacity 0.7s ease;
}
.acc-panel[data-active="true"] .acc-img {
  opacity: 1;
  transform: scale(1);
}

/* Overlay sur l'image */
.acc-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.7) 0%,
    rgba(0,0,0,0.2) 50%,
    rgba(0,0,0,0.4) 100%
  );
}

/* Trigger actif (horizontal en haut) */
.acc-trigger {
  position: absolute;
  inset: 0 0 auto 0;
  height: 4rem;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 22px;
  background: none;
  border: none;
  color: var(--text-light);
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 600;
}
.acc-trigger:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

/* Trigger replié (vertical) */
.acc-panel[data-active="false"] .acc-trigger {
  inset: 0;
  height: 100%;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 22px 0;
}
.acc-panel[data-active="false"] .acc-name {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 0.95rem;
  letter-spacing: 0.5px;
}
.acc-panel[data-active="false"] .acc-chevron { display: none; }

/* Indicateur */
.acc-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.4s ease;
  flex-shrink: 0;
}
.acc-panel[data-active="true"] .acc-dot { opacity: 1; }

/* Nom du membre */
.acc-name {
  font-weight: 700;
  font-size: 1.15rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-light);
}

/* Chevron */
.acc-chevron {
  margin-left: auto;
  width: 20px;
  height: 20px;
  transition: transform 0.4s ease;
}
.acc-panel[data-active="true"] .acc-chevron { transform: rotate(-90deg); }

/* Corps du panel */
.acc-body {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  min-width: 20rem;
  max-width: 38rem;
  padding: 26px 28px;
  color: var(--text-light);
  opacity: 0;
  transform: translateX(-12px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
  background: linear-gradient(
    to top,
    rgba(0,0,0,0.4) 0%,
    transparent 40%
  );
}
.acc-panel[data-active="true"] .acc-body {
  opacity: 1;
  transform: translateX(0);
  transition-delay: 0.25s;
  pointer-events: auto;
}

/* Rôle et bio */
.acc-role {
  display: block;
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  margin-bottom: 8px;
}
.acc-bio {
  margin: 16px 0 0;
  color: rgba(255,255,255,0.95);
  line-height: 1.7;
  font-size: 1rem;
}

/* ============ SECTION AVANTAGES ============ */
.advantages {
  position: relative;
  max-width: 1200px;
  margin: 0 auto 80px;
  padding: 0 24px;
  text-align: center;
}

/* Fond avec image Madagascar */
.advantages::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image: url('/theme/mada1.jpeg');
  background-size: cover;
  background-position: center;
  opacity: 0.15;
  pointer-events: none;
}

/* Overlay subtil */
.advantages::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(255,255,255,0.6);
  pointer-events: none;
}

.adv-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 12px;
  position: relative;
  display: inline-block;
}
.adv-title::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -8px;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: var(--accent);
  border-radius: 2px;
}

.adv-intro {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto 40px;
  line-height: 1.7;
}

.adv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 28px;
  margin-bottom: 40px;
}

.adv-card {
  position: relative;
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  border: 1px solid rgba(0,0,0,0.05);
  transition:
    transform var(--transition-default),
    box-shadow var(--transition-default),
    border-color var(--transition-default);
}
.adv-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 28px rgba(0,0,0,0.12);
  border-color: var(--accent);
}

/* Icône avec cercle culturel */
.adv-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 30%, var(--accent) 0%, transparent 40%),
    radial-gradient(circle at 70% 70%, var(--primary) 0%, transparent 40%);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.adv-icon::before {
  content: "";
  position: absolute;
  width: 40%;
  height: 40%;
  border: 2px dashed var(--white);
  border-radius: 50%;
  opacity: 0.6;
}
.adv-icon svg {
  width: 40px;
  height: 40px;
  color: var(--white);
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

/* Contenu de la carte */
.adv-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.adv-card h3::before {
  content: "";
  width: 4px;
  height: 4px;
  background: var(--secondary);
  border-radius: 50%;
}
.adv-card p {
  font-size: 1.05rem;
  color: var(--text);
  line-height: 1.7;
  margin: 0;
}

/* Pied de section avec motif tricolore étendu */
.adv-flag-footer {
  display: flex;
  width: 100%;
  max-width: 420px;
  height: 5px;
  border-radius: 999px;
  overflow: hidden;
  margin: 40px auto 0;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
}
.adv-flag-footer span {
  flex: 1;
}
.adv-flag-footer span:nth-child(1) { background: var(--green-italy); }
.adv-flag-footer span:nth-child(2) { background: var(--white); }
.adv-flag-footer span:nth-child(3) { background: var(--red-italy); }
.adv-flag-footer span:nth-child(4) { background: var(--green-madagascar); }
.adv-flag-footer span:nth-child(5) { background: var(--red-madagascar); }

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .acc-wrap {
    height: 30rem;
    gap: 12px;
  }
  .acc-panel { min-width: 3.25rem; }
  .acc-panel[data-active="true"] { flex: 5 1 0%; }
  .acc-trigger { height: 3.5rem; padding: 0 18px; font-size: 1rem; }
  .acc-panel[data-active="false"] .acc-trigger { padding: 18px 0; }
  .acc-panel[data-active="false"] .acc-name { font-size: 0.9rem; }
  .acc-body { min-width: 16rem; padding: 20px 22px; }
  .hero { padding: 100px 20px 60px; }
  .hero h1 { font-size: 2.4rem; }
  .hero-tagline { font-size: 2.2rem; }
}
@media (max-width: 600px) {
  .acc-wrap {
    height: 26rem;
    gap: 8px;
  }
  .acc-panel { min-width: 2.75rem; border-radius: var(--radius-md); }
  .acc-panel[data-active="true"] { flex: 4 1 0%; }
  .acc-trigger { height: 3rem; padding: 0 14px; font-size: 0.95rem; }
  .acc-panel[data-active="false"] .acc-trigger { padding: 14px 0; }
  .acc-panel[data-active="false"] .acc-name { font-size: 0.85rem; }
  .acc-body { min-width: 14rem; padding: 16px 18px; font-size: 0.95rem; }
  .hero { padding: 80px 16px 50px; }
  .hero h1 { font-size: 2rem; }
  .hero-tagline { font-size: 1.8rem; }
  .advantages { margin: 0 auto 60px; padding: 0 16px; }
  .adv-grid { grid-template-columns: 1fr; gap: 20px; }
  .adv-card { padding: 28px 20px 24px; }
  .adv-title { font-size: 1.7rem; }
  .adv-intro { font-size: 1rem; }
  .adv-flag-footer { max-width: 300px; height: 4px; margin-top: 24px; }
}
@media (max-width: 400px) {
  .hero { padding: 70px 12px 40px; }
  .hero h1 { font-size: 1.7rem; }
  .hero-tagline { font-size: 1.5rem; }
  .hero-sub { font-size: 1rem; }
}

/* ============ ACCESSIBILITÉ & PERFORMANCE ============ */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* Focus visible global */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Liens */
a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-default);
}
a:hover {
  color: var(--secondary);
  text-decoration: underline;
}

/* Formulaires (si présents) */
input, textarea, select {
  font-family: inherit;
  font-size: 1rem;
  padding: 0.8rem 1rem;
  border: 2px solid rgba(0,0,0,0.1);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.7);
  color: var(--text);
  transition:
    border-color var(--transition-default),
    background var(--transition-default),
    box-shadow var(--transition-default);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
  background: rgba(255,255,255,0.9);
  box-shadow: 0 0 0 3px rgba(226,114,91,0.2);
}

/* ============ DIVISEURS DÉCORATIFS ============ */
.divider-cultural {
  height: 2px;
  background: linear-gradient(
    to right,
    var(--green-italy) 0%,
    var(--white) 20%,
    var(--red-italy) 40%,
    var(--green-madagascar) 60%,
    var(--red-madagascar) 80%,
    var(--white) 100%
  );
  margin: 24px auto;
  width: 180px;
  opacity: 0.8;
}

/* ============ ÉTAT VIDE ============ */
.empty-state {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 40px 20px;
}