* {
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  margin: 0;
  padding: 0;
  background-image: url('./IMGs/andorre-background.jpg');
  /* Remplacez par une image de fond andorrane */
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: fixed;
  background-position: center;
  overflow-x: hidden;
  width: 100%;
  color: #333;
  /* Couleur de texte plus naturelle */
}

h1 {
  text-align: center;
  margin: 20px;
  color: aliceblue;
}

.subtitle {
  text-align: center;
  font-size: 1.5em;
  color: #0078e0;
  margin-bottom: 20px;
  /* Espace entre le sous-titre et le reste du contenu */
  font-family: 'Dancing Script', cursive;
}
.description {
  font-family: 'Arial', sans-serif;
  /* Choisissez une police lisible et simple */
  font-size: 1.1em;
  /* Taille de police légèrement augmentée pour une meilleure lisibilité */
  color: #333;
  /* Couleur de texte foncée pour un bon contraste */
  text-align: center;
  /* Centrer le texte pour une meilleure présentation */
  margin: 20px auto;
  /* Marge autour du paragraphe pour l'espacer des autres éléments */
  max-width: 80%;
  /* Largeur maximale pour éviter que le texte ne soit trop large sur les grands écrans */
  line-height: 1.6;
  /* Hauteur de ligne pour améliorer la lisibilité */
  background-color: rgba(255, 255, 255, 0.8);
  /* Fond légèrement transparent pour se démarquer de l'arrière-plan */
  padding: 15px;
  /* Espacement intérieur pour aérer le texte */
  border-radius: 8px;
  /* Coins arrondis pour un look moderne */
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  /* Ombre légère pour donner de la profondeur */
}

.title {
  font-family: 'Great Vibes', cursive;
  font-size: 3em;
  color: #2a5c35;
  /* Vert foncé pour évoquer les forêts */
  text-align: center;
  text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff;
  background: linear-gradient(90deg, #2a5c35 0%, #fff 50%, #5c8a8a 100%);
  /* Dégradé de vert et bleu */
  padding: 10px 30px;
  border-radius: 10px;
  border: 2px solid #bebebe;
  position: relative;
  margin-left: auto;
  margin-right: auto;
  width: fit-content;
}

.title::before {
  content: '🌲';
  /* Emoji d'arbre pour évoquer la nature */
  font-size: 1.5em;
  position: absolute;
  left: -55px;
  top: 50%;
  transform: translateY(-50%);
  text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff;
}

.title::after {
  content: '⛰️';
  /* Emoji de montagne */
  font-size: 1.5em;
  position: absolute;
  right: -55px;
  top: 50%;
  transform: translateY(-50%);
  color: #5c8a8a;
  text-shadow: -1px -1px 0 #fff, 1px -1px 0 #fff, -1px 1px 0 #fff, 1px 1px 0 #fff;
}

h2 {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px auto 10px;
  /* Centrer le bloc h2 */
  max-width: 90%;
  color: #2a5c35;
  /* Vert foncé */
  font-size: 2em;
  /* Augmenter la taille de la police */
  font-weight: bold;
  /* Utiliser une police plus épaisse */
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
  /* Ajouter une ombre pour améliorer le contraste */
  background-color: rgba(255, 255, 255, 0.7);
  /* Fond semi-transparent pour améliorer la lisibilité */
  padding: 10px;
  /* Ajouter un peu d'espace autour du texte */
  border-radius: 5px;
  /* Coins légèrement arrondis pour le fond */
}

.contour {
  text-shadow:
    0 20px 0 #000,
    20px 0 0 #000,
    0 -20px 0 #000,
    -20px 0 0 #000;
}

.french-flag-text {
  font-family: 'Atma', system-ui;
  font-size: 2.8em;
  font-weight: bold;
  letter-spacing: 2px;
  text-align: center;

  background: linear-gradient(90deg,
      #0039a4 0%,
      #0039a4 33.33%,
      #bebebe 33.33%,
      #bebebe 66.66%,
      #ef4135 66.66%,
      #ef4135 100%);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;

  /* Simule une bordure autour du texte sans le remplir */

}

h2::before {
  content: '';
  width: 32px;
  height: 32px;
  background: url('./IMGs/note-musicale.png') no-repeat center/contain;
  pointer-events: none;
  /* L'icône ne gêne pas l'interaction avec le texte */
  margin-right: 10px;
  /* Espace entre l'image et le texte */
}

h2 span {
  text-align: center;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  padding: 20px;
  grid-auto-rows: 250px;
}

.photo {
  background: white;
  border: 1px solid #ccc;
  border-radius: 5px;
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  /* Ombre légère pour un effet naturel */
}

.photo img:hover {
  transform: scale(1.05);
  transition: transform 0.3s ease-in-out;
}

.photo img {
  object-fit: cover;
  /* Remplit bien la cellule sans déformation */
  width: 100%;
  height: 100%;
  /* S'adapte à la hauteur des lignes */
}

.photo.landscape {
  grid-column: span 2;
  /* Les photos paysage occupent 2 colonnes */
}

button {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #5c8a8a;
  /* Bleu-vert pour les boutons */
  color: white;
  border: none;
  cursor: pointer;
  font-size: 16px;
  padding: 10px 0;
}

button:hover {
  background-color: #2a5c35;
  /* Vert foncé au survol */
}

.pied {
  padding-bottom: 50px;
}

/* Fenêtre modale */
#modal {
  display: none;
  /* Cachée par défaut */
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100vw;
  /* Largeur complète */
  height: 100vh;
  /* Hauteur complète */
  background-color: rgba(0, 0, 0, 0.8);
  /* Fond semi-transparent */
  justify-content: center;
  /* Centre horizontalement */
  align-items: center;
  /* Centre verticalement */
}

#modal-image {
  max-width: 90%;
  /* L'image occupe jusqu'à 90% de la largeur */
  max-height: 90%;
  /* L'image occupe jusqu'à 90% de la hauteur */
  top: 100%;
  border-radius: 10px;
  /* Arrondi des coins */
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
  /* Effet d'ombre */
}

/* Par défaut */
.close {
  position: absolute;
  top: 30px;
  right: 40px;
  color: white;
  font-size: 48px;
  font-weight: bold;
  cursor: pointer;
  z-index: 1003;
}

.close:hover,
.close:focus {
  color: #bbb;
  text-decoration: none;
}

/* Style pour le bouton flottant */
#downloadAllButton {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #007BFF;
  color: white;
  border: none;
  padding: 15px 25px;
  border-radius: 5px;
  cursor: pointer;
  z-index: 1000;
}

#downloadAllButton:hover {
  background-color: #0056b3;
}

/* Style pour le message de confirmation */
#confirmationMessage {
  display: none;
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
  padding: 15px;
  border-radius: 5px;
  z-index: 1001;
}

.modal {
  display: none;
  position: relative;
  z-index: 1000;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.9);
  justify-content: center;
  align-items: center;
  flex-direction: column;
}

.modal-loader {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border: 8px solid #f3f3f3;
  border-top: 8px solid #555;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  animation: spin 1s linear infinite;
  z-index: 1001;
  display: none;
}

@keyframes spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }

  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.modal-content {
  max-width: 90%;
  max-height: 90%;
  display: none;
  border-radius: 10px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.7);
  z-index: 1002;
}

.prev,
.next {
  cursor: pointer;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100px;
  height: 100px;
  font-size: 28px;
  background-color: rgba(0, 0, 0, 0.6);
  color: white;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1003;
}

.prev {
  left: 5%;
}

.next {
  right: 5%;
}

.prev:hover,
.next:hover,
.close:hover {
  background-color: rgba(255, 255, 255, 0.2);
}

.download-button {
  position: absolute;
  bottom: 20px;
  width: 100px;
  left: 90%;
  height: 100px;
  background-color: rgba(0, 0, 0, 0.6);
  border: none;
  border-radius: 50%;
  color: white;
  font-size: 48px;
  cursor: pointer;
  z-index: 1004;
  display: none;
  align-items: center;
  justify-content: center;
  transition: background-color 0.3s;
}

.download-button:hover {
  background-color: rgba(255, 255, 255, 0.3);
}

@media screen and (max-width: 600px) {
  body {
    width: 100%;
    padding: 0 10px;
    background-position: center;
    background-size: cover;
    overflow-x: hidden;
  }

  .title {
    font-size: 2em;
    padding: 10px 15px;
    margin: 10px auto;
    text-align: center;
    flex-direction: column;
    width: auto;
  }

  .title::before,
  .title::after {
    display: none;
  }

  .subtitle {
    font-size: 1.2em;
    margin: 10px 0;
    padding: 0 5px;
  }

  h1 {
    font-size: 1.5em;
    margin: 15px 0;
  }

  h2 {
    display: block;
    font-size: 1.2em;
    text-align: center;
    margin: 10px auto;
    padding: 0 10px;
    line-height: 1.4;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
  }

  h2::before {
    display: inline-block;
    vertical-align: middle;
    width: 24px;
    height: 24px;
    margin-right: 6px;
    background-size: contain;
  }

  h2 span {
    display: inline;
  }

  .french-flag-text {
    font-size: 1.5em;
    letter-spacing: 1px;
    padding: 0 5px;
  }

  .gallery {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 8px;
    padding: 10px;
    grid-auto-rows: 180px;
  }

  .photo.landscape {
    grid-column: span 1;
  }

  .modal-content {
    max-width: 90vw;
    max-height: 75vh;
  }

  .close {
    font-size: 28px;
    top: 15px;
    right: 15px;
  }

  .prev,
  .next {
    width: 35px;
    height: 35px;
    font-size: 20px;
    top: 45%;
  }

  .prev {
    left: 5px;
  }

  .next {
    right: 5px;
  }

  .download-button {
    width: 40px;
    height: 40px;
    font-size: 18px;
    bottom: 10px;
    right: 10px;
  }

  #downloadAllButton {
    padding: 10px 15px;
    font-size: 14px;
    bottom: 15px;
    right: 15px;
    border-radius: 4px;
  }

  #confirmationMessage {
    font-size: 14px;
    top: 10px;
    right: 10px;
    padding: 10px;
  }
}
