/* Réinitialisation des styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Variables de couleurs */
:root {
  --color-primary: #0a5e9a;
  --color-secondary: #f9a826;
  --color-accent: #e76f51;
  --color-light: #f8f9fa;
  --color-dark: #2b3a42;
  --color-lagoon: #48cae4;
  --color-sand: #fff1d0;
  --color-foliage: #38b000;
  --font-primary: 'Montserrat', sans-serif;
  --font-secondary: 'Lora', serif;
  --header-height: 120px; /* Hauteur estimée de l'en-tête, à ajuster selon votre design */
}

/* Typographie */
@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,700;1,400&family=Montserrat:wght@300;400;600;700&display=swap');

html {
  font-size: 16px;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-height); /* SOLUTION POUR LE DÉCALAGE DES ANCRES */
}

body {
  font-family: var(--font-primary);
  line-height: 1.6;
  color: var(--color-dark);
  background: linear-gradient(to bottom, #f8f9fa, #e0f7fa);
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-secondary);
  margin-bottom: 1rem;
  color: var(--color-primary);
}

/* En-tête */
header {
  background: linear-gradient(to right, var(--color-primary), var(--color-lagoon));
  color: white;
  padding: 1rem 0;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
  height: var(--header-height); /* Définir une hauteur fixe pour l'en-tête */
  display: flex;
  flex-direction: column;
  justify-content: center;
}

header h1 {
  text-align: center;
  font-size: 2.5rem;
  color: white;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
  margin: 0.5rem 0;
}

nav ul {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  list-style: none;
  padding: 0.5rem 0;
}

nav li {
  margin: 0 0.5rem;
}

nav a {
  color: white;
  text-decoration: none;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 25px;
  transition: all 0.3s ease;
}

nav a:hover {
  background-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* Contenu principal */
main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
  padding-top: 1rem; /* Réduit pour compenser le scroll-padding */
}

/* Solution alternative pour le décalage des ancres */
section {
  margin-bottom: 4rem;
  background-color: white;
  border-radius: 12px;
  padding: 2rem;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease;
  position: relative; /* Nécessaire pour le positionnement de l'ancre */
}

/* Créer un point d'ancrage positionné avant le contenu réel de la section */
section::before {
  content: "";
  display: block;
  height: 0;
  margin-top: calc(-1 * var(--header-height));
  position: absolute;
  top: 0;
  visibility: hidden;
  pointer-events: none;
}

section:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

section h2 {
  position: relative;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  font-size: 1.8rem;
}

section h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 3px;
  background-color: var(--color-secondary);
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1rem 0;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

img:hover {
  transform: scale(1.02);
}

/* Introduction */
#introduction {
  position: relative;
  padding-top: 3rem;
}

#introduction::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('images/polynesie_pattern.png');
  opacity: 0.05;
  pointer-events: none;
}

/* Listes */
ul {
  list-style-position: inside;
  margin: 1rem 0;
}

ul li {
  margin-bottom: 0.5rem;
  padding-left: 1rem;
}

/* Îles à ne pas manquer */
#iles ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1.5rem;
  list-style: none;
}

#iles li {
  background-color: var(--color-sand);
  padding: 1.5rem;
  border-radius: 8px;
  border-left: 4px solid var(--color-accent);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

#iles li:hover {
  transform: translateX(5px);
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* Gastronomie */
#gastronomie ul {
  list-style-type: none;
}

#gastronomie li {
  padding: 0.75rem 0;
  border-bottom: 1px dashed #ddd;
  position: relative;
  padding-left: 1.5rem;
}

#gastronomie li::before {
  content: '🍴';
  position: absolute;
  left: 0;
  top: 0.75rem;
}

/* Histoire */
#histoire p {
  text-align: justify;
}

/* Climat */
#climat {
  background: linear-gradient(to bottom right, white, var(--color-sand));
}

#climat p {
  font-size: 1.05rem;
}

/* Liens rapides */
.quick-links {
  display: flex;
  justify-content: space-around;
  margin: 2rem 0;
  flex-wrap: wrap;
}

.quick-link {
  background-color: var(--color-primary);
  color: white;
  padding: 1rem 2rem;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  text-align: center;
  width: 200px;
  margin: 0.5rem;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.quick-link i {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.quick-link:hover {
  background-color: var(--color-secondary);
  transform: translateY(-5px);
  box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

/* Footer */
footer {
    background-color: #333; /* Couleur de fond plus appropriée */
    color: white;
    text-align: center;
    padding: 2rem 1rem;
    margin-top: 3rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    text-align: left;
}

.footer-section {
    padding: 0.5rem; /* Ajout d'un espacement interne */
}

.footer-section h3 {
    margin-bottom: 1rem;
    color: #FFA500; /* Couleur accentuée - Orange */
}

.footer-section h4 {
    margin-bottom: 1rem;
    color: #FFA500; /* Couleur accentuée - Orange */
}


.footer-section ul {
    list-style: none;
    padding-left: 0; /* Supprimer le padding par défaut de la liste */
}

.footer-section li {
    margin-bottom: 0.5rem;
}

.footer-section a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: #FFA500; /* Couleur accentuée - Orange */
}

.copyright {
    margin-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1rem;
}

/* Media query pour les petits écrans */
@media (max-width: 768px) {
    .footer-content {
        grid-template-columns: 1fr; /* Empiler les sections sur mobile */
        text-align: center; /* Centrer le texte sur mobile */
    }

    .footer-section {
        padding: 1rem; /* Augmenter le padding pour plus d'espace sur mobile */
    }
}
/* Animation pour les sections au scroll */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

section {
  animation: fadeInUp 0.6s ease-out;
}

/* Media queries */
@media screen and (max-width: 768px) {
  :root {
    --header-height: 180px; /* Ajuster pour l'en-tête mobile qui sera plus grand */
  }

  header h1 {
    font-size: 1.8rem;
  }
  
  nav ul {
    flex-direction: column;
    align-items: center;
  }
  
  nav li {
    margin: 0.3rem 0;
  }
  
  section {
    padding: 1.5rem;
  }
  
  #iles ul {
    grid-template-columns: 1fr;
  }
  
  .quick-link {
    width: 100%;
    margin: 0.5rem 0;
  }
}

/* Améliorations pour l'accessibilité */
:focus {
  outline: 3px solid var(--color-secondary);
  outline-offset: 3px;
}

/* Bouton retour en haut */
.back-to-top {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: var(--color-primary);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  font-size: 1.5rem;
  opacity: 0;
  transition: all 0.3s ease;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  z-index: 900;
}

.back-to-top.visible {
  opacity: 0.8;
}

.back-to-top:hover {
  opacity: 1;
  transform: translateY(-3px);
}

/* Mode sombre */
@media (prefers-color-scheme: dark) {
  :root {
    --color-light: #2b3a42;
    --color-dark: #f8f9fa;
    --color-sand: #3a3a3a;
  }
  
  body {
    background: linear-gradient(to bottom, #1a1a2e, #16213e);
  }
  
  section {
    background-color: #242526;
  }
  
  #climat {
    background: linear-gradient(to bottom right, #242526, #16213e);
  }
}