/* --- Thème randonnée / nature --- */
* {
  box-sizing: border-box;
}

body {
  font-family: 'Cabin', sans-serif;
  margin: 0;
  padding: 0;
  color: #2b2b2b;
  position: relative;
  overflow-x: hidden;
}

/* Image de fond floutée */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url('./IMGs/rando.png');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  filter: blur(6px);
  transform: scale(1.05); /* évite les bords visibles */
  z-index: -1;
}

/* Titres principaux */
h1 {
  text-align: center;
  margin: 20px 0 10px;
  color: #264027;
  font-family: 'Playfair Display', serif;
  font-size: 2.5em;
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.3);
}

.subtitle {
  text-align: center;
  font-size: 1.3em;
  color: #4d6b47;
  background-color: white;
  border-radius: 7px;
  border-left: 6px solid #6b8e23;
  border-right: 6px solid #6b8e23;
  padding: 10px 20px;
  margin: 25px auto;
  width: fit-content;
  font-family: 'Dancing Script', cursive;
  margin-bottom: 25px;
}

/* Bandeau titre */
.title {
  text-align: center;
  background: linear-gradient(90deg, #8ebf66 0%, #5a8a4e 50%, #3e6b3d 100%);
  color: #fff;
  padding: 12px 35px;
  border-radius: 12px;
  font-size: 2.5em;
  font-family: 'Playfair Display', serif;
  letter-spacing: 2px;
  margin: 20px auto;
  width: fit-content;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.title3 {
  text-align: center;
  background: linear-gradient(90deg, #8ebf66 0%, #5a8a4e 50%, #3e6b3d 100%);
  color: #fff;
  padding: 8px 25px;
  border-radius: 12px;
  font-size: 1.8em;
  font-family: 'Playfair Display', serif;
  letter-spacing: 1.5px;
  margin: 10px auto 20px auto;
  width: fit-content;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Sous-titres de section */
h2 {
  text-align: center;
  font-family: 'Dancing Script', cursive;
  color: #345e37;
  background: rgba(255, 255, 255, 0.8);
  border-left: 6px solid #6b8e23;
  padding: 10px 20px;
  border-radius: 8px;
  width: fit-content;
  margin: 25px auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.description {
  text-align: center;
  font-family: 'Cabin', sans-serif;
  color: #4d6b47;
  background: rgba(255, 255, 255, 0.9);
  padding: 8px 15px;
  border-radius: 8px;
  width: fit-content;
  margin: 0 auto 20px auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  font-size: 1.1em;
}

/* Galerie d'images */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 15px;
  padding: 20px;
}

.photo {
  background: #f8f5ef;
  border: 2px solid #c0a080;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.15);
  transition: transform 0.2s ease-in-out;
}

.photo:hover {
  transform: scale(1.03);
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Boutons */
button,
#downloadAllButton {
  background-color: #4d6b47;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 12px 20px;
  font-size: 1em;
  cursor: pointer;
  transition: background-color 0.3s;
}

button:hover,
#downloadAllButton:hover {
  background-color: #2f4f2f;
}

/* Pied de page */
.pied {
  background: rgba(85, 107, 47, 0.9);
  color: #f4f4f4;
  text-align: center;
  padding: 25px 0 40px 0;
  font-family: 'Dancing Script', cursive;
  font-size: 1.2em;
  border-top: 3px solid #3e6b3d;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.2);
  margin-top: 40px;
}

.pied a {
  color: #cbe3b5;
  text-decoration: none;
}

.pied a:hover {
  color: #fff;
}

/* Modale photo */
#modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

#modal-image {
  max-width: 90%;
  max-height: 85%;
  border-radius: 10px;
  box-shadow: 0 0 25px rgba(0, 0, 0, 0.6);
}

.close {
  position: absolute;
  top: 20px;
  right: 40px;
  color: #fff;
  font-size: 42px;
  cursor: pointer;
  transition: color 0.3s;
}

.close:hover {
  color: #b5d99c;
}

/* 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: 30px;
  left: 50%;
  transform: translateX(-50%);

  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 20px 35px;
  font-size: 26px;
  border: none;
  border-radius: 18px;
  cursor: pointer;

  display: none;
  z-index: 3000;
  backdrop-filter: blur(4px);
}

.download-button:hover {
  background: rgba(255, 255, 255, 0.25);
}

.share-button {
    position: absolute;
    bottom: 30px;
    right: 60px; /* Ajuste selon la position du bouton de téléchargement */
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    border-radius: 50%;
    width: 90px;
    height: 90px;
    font-size: 45px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.share-button:hover {
    background: rgba(0, 0, 0, 0.8);
}


@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 {
    padding: 14px 22px;
    font-size: 18px;
    bottom: 15px;
    border-radius: 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;
  }
}


.search-bar {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 20px;

  opacity: 0;
  transform: translateY(-10px);
  animation: fadeIn 0.6s ease forwards;
}

@keyframes fadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#searchInput {
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  display: block;
  transition: box-shadow 0.3s ease;
  width: 100%;
  /* prend toute la largeur possible de son conteneur */
  max-width: 300px;
  /* largeur maximale pour éviter que ça soit trop grand */
}

#searchInput:focus {
  outline: none;
  box-shadow: 0 0 10px rgba(255, 130, 0, 0.6);
}

/* élément caché discrètement */
.event {
  display: none;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.event.show {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

.message {
      text-align: center;
      font-size: 1.6em;
      color: #c41e3a;
      margin-top: 20px;
      margin-bottom: 40px;
      font-weight: bold;
      font-family: 'Dancing Script', cursive;
      animation: shimmer 2s infinite, float 3s ease-in-out infinite;
      text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
      letter-spacing: 2px;
    }

    @keyframes shimmer {
      0%, 100% { color: #c41e3a; text-shadow: 0 0 10px rgba(196, 30, 58, 0.5); }
      50% { color: #22c55e; text-shadow: 0 0 20px rgba(34, 197, 94, 0.7); }
    }

    @keyframes float {
      0%, 100% { transform: translateY(0px); }
      50% { transform: translateY(-10px); }
    }

/* Style pour la balise <details> */
details {
  margin: 25px auto;
  max-width: 90%;
  border: 2px solid #6b8e23;
  border-radius: 12px;
  padding: 0;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  overflow: hidden;
}

/* Style pour la balise <summary> */
summary {
  font-size: 1.6em;
  font-family: 'Dancing Script', cursive;
  color: #345e37;
  cursor: pointer;
  padding: 15px 25px;
  background: linear-gradient(90deg, #8ebf66 0%, #5a8a4e 100%);
  border-radius: 10px;
  margin: 0;
  list-style: none;
  display: block;
  transition: background 0.3s ease, color 0.3s ease;
  position: relative;
  border-left: 6px solid #4d6b47;
}

summary:hover {
  background: linear-gradient(90deg, #7cb35a 0%, #4a7a3e 100%);
  color: #f8f5ef;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "▼";
  position: absolute;
  right: 20px;
  font-size: 0.8em;
  transition: transform 0.3s ease;
}

details[open] summary::after {
  content: "▲";
  transform: rotate(180deg);
}

/* Style pour le contenu à l'intérieur de <details> */
details[open] .event {
  animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
