/* ==========================================================================
   Thème : Les Paniers du Mont-Gargan (Inspiré de FarmFresh par HTML Codex)
   ========================================================================== */

:root {
  --primary: #2E7D32;       /* Vert champêtre haut contraste (WCAG AAA) */
  --primary-light: #34AD54; /* Vert FarmFresh */
  --secondary: #E65100;     /* Orange chaleureux */
  --secondary-light: #FF8F00;
  --dark: #1E252B;          /* Fond sombre footer */
  --light-bg: #F4F7F4;      /* Fond de page légèrement teinté */
  --card-bg: #FFFFFF;
  --text: #1C2321;          /* Texte sombre très lisible */
  --border: #C8D6C9;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 112.5%; /* Base à 18px pour une excellente lisibilité */
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.7;
  color: var(--text);
  background-color: var(--light-bg);
  overflow-wrap: anywhere; /* Empêche les e-mails et liens longs de dépasser de l'écran */
}

/* Liens d'évitement pour l'accessibilité */
.skip-link {
  position: absolute;
  left: 0;
  top: -60px;
  background: var(--secondary);
  color: #ffffff;
  padding: 0.8rem 1.2rem;
  font-weight: bold;
  z-index: 1000;
  text-decoration: none;
  border-radius: 0 0 0.5rem 0;
}

.skip-link:focus {
  top: 0;
}

/* Style du logo */
.site-logo {
  max-height: 200px; /* Définit la taille maximale pour qu'il ne soit pas trop grand */
  width: auto;       /* Conserve les proportions de l'image */
  position: absolute; /* Permet un positionnement précis par rapport au parent */
  top: 1.65rem;         /* Espace depuis le haut de l'en-tête */
  left: 9.2rem;         /* Espace depuis la gauche de l'en-tête */
  transform: scaleX(-1);
  /* Effet macaron */
  border-radius: 50%; /* Cercle parfait */
  background-color: #2E7D32;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25); /* Ombre douce pour le détacher */
  border: 3px solid var(--secondary); /* Fine bordure orange rappelant le thème */
}

/* En-tête principal */
.site-header {
  position: relative; /* Indispensable pour que .site-logo soit positionné par rapport à cet en-tête */
  background-color: var(--primary);
  background: linear-gradient(135deg, #1b5e20 0%, #34ad54 100%);
  color: #ffffff;
  padding: 3rem 1.5rem;
  text-align: center;
  border-bottom: 5px solid var(--secondary);
}

.site-header h1 {
  margin: 0;
  font-size: 2.5rem;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.site-header p {
  font-size: 1.25rem;
  margin-top: 0.5rem;
  color: #E8F5E9;
}

/* Styles pour l'encart de contact */
.contact-info {
  position: relative; /* Changé de absolute à relative pour un flux normal */
  margin: 1rem auto; /* Centré horizontalement avec une marge au-dessus */
  width: 80%; /* Ajuster si nécessaire */
  max-width: 1000px; /* Limite la largeur maximale pour un bon centrage */
  background-color: rgba(255,143,0, 0.8);
  padding: 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  font-size: 0.85rem;
  line-height: 1.3;
  text-align: center; /* Centrer le texte à l'intérieur de l'encart */
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  overflow-wrap: anywhere; /* Permet de couper l'email proprement s'il est trop long */
}

.contact-info p {
  margin: 0.2rem 0;
}

.contact-info strong {
  color: var(--dark);
}

/* Barre de navigation */
.main-nav {
  background-color: var(--dark);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.main-nav ul {
  list-style: none;
  padding: 0.5rem;
  margin: 0 auto;
  max-width: 65rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
}

.main-nav a {
  display: inline-block;
  font-weight: bold;
  text-decoration: none;
  padding: 0.75rem 1.15rem;
  color: #ffffff;
  background-color: transparent;
  border-radius: 0.4rem;
  transition: background-color 0.2s;
}

.main-nav a:hover,
.main-nav a:focus {
  background-color: var(--primary-light);
  color: #ffffff;
  outline: 3px solid var(--secondary);
}

.main-nav .adhesion-nav-btn a {
  background-color: #c63f00; /* Couleur orange spécifiée */
  color: #ffffff;
}

.main-nav .adhesion-nav-btn a:hover,
.main-nav .adhesion-nav-btn a:focus {
  background-color: var(--secondary);
  outline: 3px solid var(--primary);
}

/* Zone principale de contenu */
main {
  max-width: 65rem;
  margin: 2.5rem auto;
  padding: 0 1rem;
  scroll-padding-top: 18rem; /* Ajouté pour le centrage des sections par rapport à la nav fixe */
}

/* Style des cartes de sections */
section {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-top: 5px solid var(--primary);
  border-radius: 0.75rem;
  margin-bottom: 2rem;
  padding: 2rem;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
  scroll-margin-top: 18rem; /* Ajouté pour le centrage des sections */
}

.section-tag {
  display: inline-block;
  text-transform: uppercase;
  color: var(--primary-light);
  font-weight: bold;
  font-size: 0.9rem;
  letter-spacing: 1px;
  margin-bottom: 0.25rem;
}

h2 {
  margin-top: 0;
  font-size: 1.8rem;
  color: var(--primary);
}

h3 {
  font-size: 1.35rem;
  color: var(--dark);
  margin-top: 1.5rem;
}

p {
  font-size: 1.1rem;
}

/* Boutons d'action */
.cta {
  display: inline-block;
  font-weight: bold;
  font-size: 1.15rem;
  text-decoration: none;
  background-color: var(--secondary);
  color: #ffffff;
  padding: 0.85rem 1.5rem;
  border-radius: 0.5rem;
  margin-top: 1rem;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
  transition: background-color 0.2s;
}

.cta:hover,
.cta:focus {
  background-color: #c63f00;
  color: #ffffff;
  outline: 3px solid var(--primary);
}

/* Zone de téléchargement des PDF */
.downloads {
  list-style: none;
  padding: 0;
  margin-top: 1.25rem;
  display: grid;
  gap: 1rem;
}

.downloads a {
  display: flex;
  align-items: center;
  font-weight: bold;
  font-size: 1.1rem;
  text-decoration: none;
  color: var(--primary);
  background-color: #E8F5E9;
  border: 2px solid var(--primary-light);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  transition: all 0.2s;
}

.downloads a:hover,
.downloads a:focus {
  background-color: var(--primary);
  color: #ffffff;
  outline: 3px solid var(--secondary);
}

/* Pied de page (Footer) */
.site-footer {
  background-color: var(--dark);
  color: #ffffff;
  margin-top: 4rem;
  padding: 2.5rem 1rem 1.5rem 1rem;
  border-top: 5px solid var(--primary-light);
}

.footer-content {
  max-width: 65rem;
  margin: 0 auto;
  text-align: center;
  font-size: 1rem;
}

.footer-content a {
  color: var(--secondary-light);
  font-weight: bold;
  text-decoration: underline;
}

.footer-content a:hover,
.footer-content a:focus {
  color: #ffffff;
}

/* Crédits de licence HTML Codex & ThemeWagon */
.credits {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #343a40;
  font-size: 0.85rem;
  color: #adb5bd;
}

.credits a {
  color: #26a69a;
  text-decoration: none;
}

.credits a:hover,
.credits a:focus {
  text-decoration: underline;
}

/* ==========================================================================
   MÉDIA QUERIES - RÉACTIVITÉ (TABLETTES ET TÉLÉPHONES)
   ========================================================================== */

/* Pour les écrans de taille moyenne (petits ordinateurs portables, tablettes en mode paysage) */
@media (max-width: 1024px) {
  .site-logo {
    /* On retire le positionnement absolu pour intégrer le logo naturellement au flux */
    position: relative;
    top: 0;
    left: 0;
    margin: 0 auto 1.5rem auto;
    display: block;
    max-height: 150px;
  }
}

/* Pour les tablettes et smartphones */
@media (max-width: 768px) {
  .site-header {
    padding: 2rem 1rem; /* On réduit le padding géant de la version PC */
  }

  .site-header h1 {
    font-size: 1.8rem;
  }

  .site-header p {
    font-size: 1.1rem;
  }

  .contact-info {
    width: 95%; /* Prend plus de largeur sur mobile */
    padding: 0.6rem;
    font-size: 0.85rem;
  }

  section {
    padding: 1.2rem;
  }

  .downloads a {
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
  }
}

/* Pour ajuster la barre de navigation sur les écrans fins (téléphones) */
@media (max-width: 48rem) {
  .main-nav {
    position: static; /* Annule le menu collant : il défile désormais naturellement avec la page */
  }

  .main-nav ul {
    flex-direction: column; /* Alignement vertical des liens */
  }

  .main-nav a {
    text-align: center;
    width: 100%;
  }

  /* Le menu ne reste plus en haut, on remet une marge d'ancrage classique */
  main {
    scroll-padding-top: 1.5rem;
  }

  section {
    scroll-margin-top: 1.5rem;
  }
}
