/* RESET - Remise à zéro du navigateur */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Définit les variables globales */
:root {
  /* Couleurs */
  --color-primary: #467D63;                   /* Fond global, Menu, bouton */
  --color-secondary: #8faea0;                 /* Fond du menu */
  --color-mot: #5AA685;                       /* Pour partie de texte */
  --color-text-dark: #2f4f45;                 /* Texte principal */
  --color-text-light: #4b6a5e;                /* Texte secondaire */
  --color-heading: #3f5f52;                   /* Menu */
  --color-background-light: #f8fbf9;          /* Fond du corps */
  --color-white: #ffffff;                     /* Blanc */
  --color-shadow-light: rgba(0, 0, 0, 0.08);  /* Ombre légère */
  --color-shadow-medium: rgba(0, 0, 0, 0.10); /* Ombre moyenne */
  --color-shadow-dark: rgba(0, 0, 0, 0.15);   /* Ombre foncée */

  /* Polices */
  --font-body: "Segoe UI", Arial, sans-serif;    /* Corps */
  --font-heading: "Segoe UI", Arial, sans-serif; /* Menu */

  /* Espacements */
  --spacing-xs: 10px;
  --spacing-sm: 15px;
  --spacing-md: 20px;
  --spacing-lg: 40px;
  --spacing-xl: 60px;
  --spacing-xxl: 80px;
  --spacing-section-py: 120px;      /* Espacement au-dessus et en-dessous des sections */
  --spacing-section-py-hero: 100px; /* Idem pour hero */

  /* Arrondi des coins des boîtes */
  --border-radius-sm: 8px;
  --border-radius-md: 14px;
  --border-radius-lg: 16px;
  --border-radius-pill: 30px;

  /* Hauteur du menu */
  --header-height: 75px;
}

/* Style de base pour le corps */
body {
  font-family: var(--font-body);
  line-height: 1.7;
  background: var(--color-background-light);
  color: var(--color-text-dark);
  /* pour améliorer l'affichage des polices de caractères, rendant le texte plus fluide et lisible */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  scroll-behavior: smooth; /* Permet un défilement fluide lors d'un clic sur un lien d'ancrage (ex: menu vers section). */
  font-size: 100%;
}

/* Accessibilité: Par défaut masque le lien et le montre si l'utilisateur le met en focus avec tabulation par ex */
.skip-link {
  position: absolute;
  top: -9999px;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 9999;
  background-color: var(--color-white); /* Contraste élevé */
  color: var(--color-primary);
  padding: var(--spacing-sm);
  border: 1px solid var(--color-primary);
  text-decoration: none;
}

.skip-link:focus {
  top: var(--spacing-sm);
  left: var(--spacing-sm);
  width: auto;
  height: auto;
  text-align: center;
}

/* Menu */

/* Masque la checkbox et l'icône sur écran d'ordinateur */
.menu-toggle, .hamburger {
  display: none;
}

header {
  position: sticky;                             /* Reste fixé en haut de l'écran lors du défilement */
  top: 0;
  left: 0;
  width: 100%;
  background: var(--color-secondary);
  color: var(--color-white);
  display: flex;                                /* Aligne le logo à gauche et la navigation à droite */
  justify-content: space-between;               /* Aligne le logo à gauche et la navigation à droite */
  align-items: center;
  padding: var(--spacing-sm) var(--spacing-lg);
  height: var(--header-height);
  z-index: 1000;                                /* S'assure que le menu passe au-dessus de tout le reste du contenu */
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);    /* Ombre discrète pour le menu */
  gap: var(--spacing-md);                       /* Ajoute un petit espace entre les éléments si space-between ne suffit pas ou si les écrans sont petits */
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  font-size: 1.3rem;        /* Rem = taille standard de police */
  font-weight: 600;
}

header img {
  height: 45px;
  flex-shrink: 0; /* Empêche l'image de se réduire dans un conteneur flexible */
}

/* Style des liens du menu avec une transition (0.3s) pour un changement de couleur fluide au survol. */
nav a {
  color: var(--color-white);
  text-decoration: none;
  margin-left: var(--spacing-md);
  font-weight: 500;
  transition: color 0.3s ease-in-out;   /* Effet de survol fluide */
}

nav a:hover,
nav a:focus {
  color: rgba(255, 255, 255, 0.8);      /* S'éclaircie au survol */
}

/* ACCUEIL */
/* La section principale en haut de page avec un dégradé linéaire allant du vert clair au vert foncé */
.hero {
  position: relative;
  min-height: 90vh;     /* Utilise 100% de la hauteur de la fenêtre */
  padding: var(--spacing-section-py-hero) var(--spacing-md) var(--spacing-section-py-hero);
  text-align: center;
  color: var(--color-white);
  background: linear-gradient(180deg, #6f8f80, var(--color-primary));
  overflow: hidden;
  /* Assure que le contenu est sous le menu */
  padding-top: calc(var(--spacing-section-py-hero) - 60px);
  padding-bottom: calc(var(--spacing-section-py-hero) - 60px);
}

/* Utilise un pseudo-élément pour afficher l'image en arrière-plan avec une opacité réduite (0.14) et un flou (blur(2px)) pour ne pas gêner la lecture du texte */
.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url("Medias/Arbre-de-vie.webp");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  opacity: 0.14;
  filter: blur(2px);
  z-index: 0;
}

/* Container et text : Organisent le contenu de l'accueil en colonnes */
.hero-container {
  display: flex;
  flex-direction: row;            /* Aligne les éléments horizontalement */
  align-items: flex-start;        /* Aligne vers le haut */
  justify-content: space-between;
  width: 90%;
  margin-left: 5%;
}

.hero-text {
  text-align: left;           /* Aligne tout le texte à gauche */
  display: flex;
  flex-direction: column;     /* Empile les titres verticalement */
  align-items: flex-start;    /* Aligne les blocs à gauche si vous utilisez flex */
  flex: 2;                    /* Prend 2/3 de l'espace */
  padding: 20px;
  box-sizing: border-box;
}

.hero h1 span {
  display: block;     /* Force le passage à la ligne */
  margin-top: 5px;    /* Ajoute un petit espace entre les deux lignes */
  font-size: 0.9em;   /* Rend le sous-titre légèrement plus petit */
}

.hero h1 {
  font-size: clamp(1rem, 8vw, 4rem);         /* Taille fluide selon l'écran */
  text-shadow: 2px 2px 10px rgba(0,0,0,0.3); /* Meilleure lisibilité sur l'image */
  letter-spacing: 1px;
  margin-left: 0;                            /* Supprime les marges automatiques qui pourraient centrer */
  width: 100%;                               /* S'assure que le titre prend toute la place disponible */
  margin-bottom: var(--spacing-sm);          /* Added spacing */
  position: relative;                        /* Place le texte au-dessus */
  margin-top: 0;
  z-index: 2;
}

/* Style du sous-titre dans la section Hero */
.hero-subtitle {
  font-size: clamp(1rem, 5vw, 2rem);        /* Taille fluide : s'adapte à l'écran */
  text-shadow: 1px 1px 8px rgba(0,0,0,0.2); /* Ombre légère pour décoller du fond */
  font-weight: 500;                         /* Poids moyen pour la lisibilité */
  color: var(--color-white);                /* Utilise le blanc défini dans tes variables */
  max-width: 800px;                         /* Évite que le texte ne s'étale trop sur grand écran */
  margin-top: var(--spacing-sm);            /* Espace avec le titre H1 */
  line-height: 1.4;                         /* Interligne aéré */
  opacity: 0.9;                             /* Un léger effet de transparence pour le style */
  z-index: 2;                               /* Pour rester au-dessus de l'image de fond */
}

/* Marge générale pour éviter que le contenu soit masqué par un menu fixe */
section {
  padding-top: var(--spacing-section-py);
  padding-bottom: var(--spacing-section-py);
  scroll-margin-top: var(--header-height);  /* Prendre en compte un menu fixe lors du défilement vers des identifiants de section */
}

/* SERVICES */

.services {
  max-width: 1000px;
  margin: var(--spacing-xl) auto;
  display: flex;
  flex-direction: column;
  gap: var(--spacing-xl);
  padding: 0 var(--spacing-md);
}

.service-box {
  background: var(--color-white);
  padding: var(--spacing-xl);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 18px 40px var(--color-shadow-medium);
  border-top: 5px solid var(--color-primary);
  transition: transform 0.35s ease;
  scroll-margin-top: 100px;                    /* A ajuster selon la hauteur du menu */
}

.service-box:hover {
  transform: translateY(-6px);
  box-shadow: 0 30px 60px var(--color-shadow-dark);
}

/* Le conteneur du texte et de l'image. */
.service-content {
  display: flow-root; 
  margin-top: var(--spacing-md);
}

/* --- GESTION DES IMAGES ET VIDÉOS (L'habillage du texte) --- */

/* On définit ce qui doit flotter (Image, Vidéo, Lien Flyer ou Groupe Vidéo+Titre) */
.service-content > img, 
.service-content > video,
.service-content > a,
.media-container {
  float: left;
  width: 40%;
  max-width: 400px;
  margin: 0 var(--spacing-lg) var(--spacing-sm) 0;
}

/* Inversion pour les lignes paires */
.service-box:nth-of-type(even) .service-content > img,
.service-box:nth-of-type(even) .service-content > video,
.service-box:nth-of-type(even) .service-content > a,
.service-box:nth-of-type(even) .media-container {
  float: right;
  margin: 0 0 var(--spacing-sm) var(--spacing-lg);
}

/* --- TRÈS IMPORTANT : Empêcher le débordement (Fixe le Flyer et la Vidéo) --- */
.service-content img, 
.service-content video {
  width: 100% !important;       /* Force l'image à remplir ses 40% et pas plus */
  height: auto;
  display: block;
  border-radius: var(--border-radius-md);
  box-shadow: 0 10px 25px var(--color-shadow-medium);
}
  img[src*="Medias/Medaillon.webp"] {
  box-shadow: none !important;                                 /* Enlève le cadre rectangulaire */
  filter: drop-shadow(0 10px 15px var(--color-shadow-medium)); /* Crée une ombre qui suit la forme du cercle */
}

/* Style du titre de la vidéo quand il est dans son conteneur */
.video-title {
  display: block;
  color: var(--color-primary);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 10px;
  text-align: center;         /* Centré par rapport à la vidéo */
}

/* --- TITRES ET TEXTES --- */

.service-box h2 {
  width: 100%;
  display: block;
  text-align: center;
  color: var(--color-heading);
  font-size: 1.625rem;
  margin-top: 20px;
  margin-bottom: var(--spacing-sm);
}

.service-box p {
  font-size: 1.125rem;
  color: var(--color-text-light);
  margin-bottom: var(--spacing-md);
  text-align: justify;
  hyphens: auto;            /* Autorise les traits d'union automatiques */
  -webkit-hyphens: auto;    /* Pour la compatibilité Safari/Chrome */
  -ms-hyphens: auto;        /* Pour Edge */
  word-spacing: -1px;       /* Resserre légèrement les mots pour éviter les "trous" */
  word-break: break-word;   /* Évite que les mots longs ne dépassent du cadre */
}

.service-box .ligne-coloree {
  color: var(--color-primary);
  font-weight: 600;
}

.service-box .mot-colore {
  color: var(--color-mot);
  font-weight: 600;
}

/* Listes */
.service-box ul, 
.service-box ol {
  margin-bottom: var(--spacing-md);
  padding-left: var(--spacing-lg);
}

.service-box li {
  font-size: 1.125rem;
  color: var(--color-text-light);
  line-height: 1.7;
  margin-bottom: var(--spacing-xs);
  text-align: justify;
  hyphens: auto;            /* Autorise les traits d'union automatiques */
  -webkit-hyphens: auto;    /* Pour la compatibilité Safari/Chrome */
  -ms-hyphens: auto;        /* Pour Edge */
  word-spacing: -1px;       /* Resserre légèrement les mots pour éviter les "trous" */
  word-break: break-word;   /* Évite que les mots longs ne dépassent du cadre */
}

/* SECTION AVIS */

/* Style spécifique pour centrer les images dans la box Avis */
#avis .service-content {
  display: flex;
  flex-direction: column; /* Aligne les éléments verticalement */
  align-items: center;    /* Centre horizontalement tout le contenu */
  text-align: center;
}

#avis .service-content .img-avis {
  float: none !important;                           /* Annule le float: left ou right */
  margin: 0 auto var(--spacing-md) auto !important; /* Centre l'image et ajoute de l'espace en bas */
  width: 95% !important;                            /* Largeur plus importante pour la lisibilité */
  max-width: 800px;                                 /* Limite la taille sur très grand écran */
  border: 1px solid #eee;                           /* Ajoute un léger contour si le fond de l'avis est blanc */
  display: block;
  image-rendering: -webkit-optimize-contrast;       /* Améliore la netteté du texte sur les captures */
}

/* On s'assure que le texte reste aussi centré dans cette box spécifique */
#avis .text-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
}

/* Ajustement pour que les boutons ne soient pas trop larges au centre */
#avis .calendly-button-header {
  margin-left: 0 !important;
  width: fit-content;
}

.google-reviews-section {
  max-width: 1000px;
  margin: var(--spacing-xl) auto;
  padding: var(--spacing-lg);
  background: var(--color-white);
  border-radius: var(--border-radius-lg);
  box-shadow: 0 10px 30px var(--color-shadow-medium);
  text-align: center;
}

/* SECTION ACTUALITE */

/* Style spécifique pour le bouton d'inscription dans les actualités */
#actualites .text-content .calendly-button-header {
  display: inline-block;
  margin-left: 0 !important;            /* Aligne le bouton à gauche du texte sur PC */
  margin-bottom: var(--spacing-md);
  transition: background-color 0.3s ease, transform 0.2s ease;
}

#actualites .text-content .calendly-button-header:hover {
  transform: translateY(-2px); /* Un soulèvement plus discret que le bouton du menu */
}

/* --- Style pour le bouton d'inscription Actualités --- */

/* Style pour centrer le bouton dans le flux du texte */

.btn-inscription-centree {
  display: inline-block !important; /* Permet l'alignement par le text-align du parent */
  margin: 0 !important;             /* On laisse le paragraphe parent gérer les marges */
  width: auto !important;
  text-align: center;
  padding: 12px 25px;
  white-space: nowrap;
}

/* Ajustement pour le texte qui suit le bouton */
#actualites .text-content p {
  clear: none;                      /* Force le texte à rester à côté de l'image même après le bouton */
}

#actualites img:hover {
  transform: scale(1.02);
  transition: transform 0.3s ease;
}

/* Styles pour Calendly */
.calendly-button-header {
  background-color: var(--color-primary);           /* Utilisez votre couleur primaire */
  color: var(--color-white);
  padding: var(--spacing-xs) var(--spacing-sm);
  border-radius: var(--border-radius-pill);         /* Coins arrondis */
  box-shadow: 0 4px 15px var(--color-shadow-light);
  text-decoration: none;
  font-weight: 500;
  transition: background-color 0.3s ease, transform 0.2s ease;
  margin-left: var(--spacing-md);                   /* Espace à gauche de la navigation */
  white-space: nowrap;                              /* Empêche le texte de se casser sur plusieurs lignes */
}

.calendly-button-header:active {
  transform: scale(0.95);           /* Effet de pression au clic */
}

.calendly-button-header:hover,
.calendly-button-header:focus {
  background-color: #4a675d;        /* Exemple de couleur plus foncée au survol */
  transform: scale(1.15);
}

/* CONTACT */
footer {
  width: 100%;
  background: var(--color-secondary);           /* Même vert que le menu */
  color: var(--color-white);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-sm) var(--spacing-lg);
  height: var(--header-height);                 /* Même hauteur que le menu */
  margin-top: 0;
}

/* Style des informations de contact dans le footer */
.footer-contact {
  display: flex;
  gap: var(--spacing-lg);
}

.footer-contact a {
  color: var(--color-white);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.3s;
}

.footer-contact a:hover {
  opacity: 0.8;
}

/* --- RESPONSIVE DESIGN --- */

/* Pour les tablettes et petits ordinateurs */
@media (max-width: 1024px) {
  .hero-container, .services {
    width: 95%;
  }
}

/* Pour les mobiles (Smartphones max 768px) */
@media (max-width: 768px) {
    
  /* Menu : pour garder Logo / Hamburger / Bouton alignés */
  header {
    flex-direction: row !important; /* Force l'alignement horizontal */
    justify-content: space-between;
    height: var(--header-height);
    padding: 0 var(--spacing-md);
  }

  /* L'icône Hamburger */
  .hamburger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 1001;
    order: 2; /* Place le menu entre le logo et le bouton */
  }

  .hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--color-white);
    border-radius: 3px;
    transition: 0.3s;
  }

  /* Réduit la taille du logo et du titre */
  .logo {
    font-size: 0.8rem; /* Réduit la taille du titre */
    gap: 8px;          /* Rapproche légèrement l'image du texte */
  }

  header img {
    height: 32px;   /* Réduit la taille du logo */
  }
    
  /* Le menu de navigation (caché par défaut) */
  nav {
    display: flex !important;               /* Active le mode Flexbox */
    flex-direction: column !important;      /* Aligne les liens les uns sous les autres */
    align-items: center;                    /* Centre les liens horizontalement */
    justify-content: flex-start;            /* Aligne les liens vers le haut */
    padding-top: var(--spacing-md);         /* Ajoute un petit espace propre en haut */  
    /* Styles pour l'affichage plein écran */
    position: fixed;
    top: var(--header-height);
    left: -100%;                            /* Caché à gauche par défaut */
    width: 100%;
    height: calc(100vh - var(--header-height));
    background: var(--color-secondary);     /* Utilise votre couleur de menu */
    transition: 0.3s ease-in-out;
    z-index: 999;
  }

  nav a {
    margin: 8px 0 !important;   /* Ajoute de l'espace entre chaque choix */
    font-size: 1.2rem;          /* Agrandit un peu le texte pour le tactile */
    width: 100%;                /* Permet de cliquer sur toute la largeur */
    text-align: center;
  }
    
  /* Bouton Calendly (fixe à droite) */
  header .calendly-button-header {
    order: 3;
    font-size: 0.75rem;
    padding: 6px 12px;
    margin-left: 5px;   /* Réduit l'espace à gauche pour éviter de pousser le hamburger */
  }

  /* LOGIQUE D'OUVERTURE (SANS JS) */
  .menu-toggle:checked ~ nav {
    left: 0;        /* Fait glisser le menu vers l'intérieur */
  }

  /* Animation du hamburger en "X" quand ouvert */
  .menu-toggle:checked ~ .hamburger span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
  }

  .menu-toggle:checked ~ .hamburger span:nth-child(2) {
    opacity: 0;
  }

  .menu-toggle:checked ~ .hamburger span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
  }

  .menu-toggle {
    display: none;
  }

  /* Hero (Accueil) : Centrage du texte */
  .hero-container {
    flex-direction: column;
    text-align: center;
    width: 90%;
  }

  .hero-text {
    align-items: center;
    text-align: center;
    padding: 0;
  }

  /* Services : On force l'empilement vertical propre sur mobile */
  .service-content {
    display: flex !important;           /* Indispensable pour que le texte passe sous l'image */
    flex-direction: column !important; 
    align-items: center;
    gap: var(--spacing-md);
  }

  /* On annule les flottements et on met TOUT à 100% (Images, Vidéos, Flyer et Conteneur Vidéo) */
  .service-content > img, 
  .service-content > video,
  .service-content > a,
  .media-container,
  .service-box:nth-of-type(even) .service-content > img,
  .service-box:nth-of-type(even) .service-content > video,
  .service-box:nth-of-type(even) .service-content > a,
  .service-box:nth-of-type(even) .media-container {
    float: none !important;
    width: 100% !important;
    max-width: 100% !important; /* Pour que la vidéo puisse s'élargir au-delà de 400px */
    margin: 0 0 var(--spacing-md) 0 !important;
  }
    
  /* On annule l'inversion gauche/droite pour que l'image reste toujours en haut */
  .service-box:nth-of-type(even) .service-content {
    flex-direction: column !important;
  }

  /* Réduit l'espace entre le bord de l'écran et la box */
  .services {
    /* Applique 20px en haut et en bas sur mobile pour correspondre au nouveau rythme */
    margin: var(--spacing-md) auto !important; 
    gap: var(--spacing-md) !important;
    padding: 0 var(--spacing-xs); /* Passe de 20px à 10px sur les côtés */
  }

  .service-box {
    padding: var(--spacing-md) var(--spacing-sm);   /* On réduit le padding interne de la box (60px -> 20px ou 15px) */
    scroll-margin-top: 80px !important;             /* On augmente la marge d'arrêt pour que le haut de la box (et pas juste le texte) soit bien sous le menu vert */
  }

  .service-box h2 {
    text-align: center;
    font-size: 1.4rem;
  }

  #actualites .text-content .calendly-button-header {
    display: block;
    width: 100%;
    text-align: center;
    margin-bottom: var(--spacing-lg);
  }

  .btn-inscription-centree {
    display: block !important;
    width: 100% !important;
    margin: 0 0 var(--spacing-md) 0 !important;
  }

  /* Correction : On utilise le même sélecteur précis qu'en haut */
  #avis .service-content .img-avis {
    width: 100% !important; 
    max-width: 100% !important;
    border-radius: var(--border-radius-sm);
    margin-bottom: var(--spacing-md) !important;
    padding: 0;                 /* On enlève les marges superflues pour gagner de l'espace */
  }

  /* Footer : Alignement vertical des coordonnées */
  footer {
    margin-top: 0 !important; /* On s'assure que le footer ne rajoute pas d'espace inutile */
    flex-direction: column;
    height: auto;
    padding: var(--spacing-lg) var(--spacing-md);
    gap: var(--spacing-md);
  }

  .footer-contact {
    flex-direction: column;
    gap: var(--spacing-sm);
    text-align: center;
  }
}