/* 
  Styles pour la page contact
  Avec section d'informations de contact, carte et formulaire
*/

/* Styles pour la section info de contact & carte */
.contact-map-section {
  height: 80vh;
  width: 100%;
  margin-bottom: 5rem;
}

.contact-map-container {
  display: flex;
  height: 100%;
  width: 100%;
  padding: 0;
  max-width: 100%;
  box-sizing: border-box;
}

/* Styles pour la colonne d'informations (gauche) */
.contact-info {
  width: 35%;
  padding: 0 2rem 0 5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size : clamp(0.75rem, 1.5vw, 1.5rem);
  text-transform: uppercase;
}

.contact-info-block {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 80%;
  padding: 0 5%;
}

.contact-details p {
  text-transform: uppercase;
  white-space: nowrap;
}

.social-icons {
  display: flex;
  margin-top: 1.5rem;
}

.social-icon {
  display: flex;
  justify-content: center;
  align-items: center;
  width: clamp(40px, 2.5vw, 40px);
  height: clamp(40px, 2.5vw, 40px);
  border-radius: 50%;
  background-color: #000;
  margin-right: 1rem;
}

.social-icon img {
  width: 20px;
  height: 20px;
}

.address-title {
  font-size: clamp(0.7rem, 0.9vw, 1rem);
  margin: 0 0 0.5rem 0;
}

/* Styles pour la colonne carte (droite) */
.contact-map {
  width: 65%;
  position: relative;
  padding-right: 5rem;
}

#map {
  width: 100%;
  height: 100%;
}

/* Filtre noir et blanc pour les tuiles de la carte Leaflet */
.leaflet-tile-pane img,
.leaflet-layer img {
  filter: grayscale(100%) contrast(1.1);
}
#map { /* Assurer que le conteneur de la carte a un curseur par défaut */
  cursor: default;
}

/* Style pour les marqueurs personnalisés Leaflet */
.contact-marker-icon {
  cursor: pointer;
  /* L'icône SVG est stylée directement via ses attributs ou CSS interne si nécessaire */
}

/* Styles pour les popups Leaflet de la carte de contact */
.leaflet-popup-content-wrapper {
  border-radius: 0;
}
.leaflet-popup-content-wrapper .contact-popup-leaflet-container {
  padding: 0; /* Correspond à .maplibregl-popup-content */
  overflow: hidden; /* Correspond à .maplibregl-popup-content */
  min-width: 180px; /* Correspond à .maplibregl-popup-content */
  text-align: center; /* Correspond à .maplibregl-popup-content */
  background: white; /* Assurer un fond pour le conteneur */
}

.contact-popup-leaflet-container .contact-popup { /* Notre div interne */
  padding: 0;
}

.contact-popup-leaflet-container .contact-popup h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  color: #000;
  letter-spacing: 0.5px;
  line-height: 1.3;
}

/* Masquer la flèche/pointe du popup Leaflet par défaut */
.leaflet-popup-tip-container {
  display: none;
}

/* Le bouton de fermeture du popup Leaflet est géré via JS (popupOptions: { closeButton: false }) */

/* Style pour le lien d'attribution OpenStreetMap */
.leaflet-control-attribution a {
  color: black !important;
}

/* Styles pour la section formulaire de contact */
.contact-form-section {
  width: 100%;
  margin-bottom: 5rem;
  position: relative;
  padding: 5rem 0;
  overflow: visible;
}

/* Conteneur principal avec fond fixe */
.form-section-container {
  position: relative;
  width: 100%;
  min-height: 100%;
}

/* Conteneur du formulaire avec fond */
.form-container-wrapper {
  position: relative;
  width: 100%;
  min-height: 100%;
}

.form-container-wrapper::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image: url('/assets/images/pattern-lines.png');
  background-repeat: repeat-x;
  background-position: center center;
  z-index: 0;
}

.form-background {
  background-color: #F6F6F6;
  position: relative;
  padding: 5rem 0 2rem 0;
  width: 80vw;
  margin: 0 auto;
  z-index: 1;
  min-height: 600px; /* Hauteur minimale pour éviter les sauts */
}

.contact-form-container {
  display: flex;
  width: 90%;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* Styles pour la colonne d'intro (gauche) */
.form-intro {
  width: 35%;
  padding-right: 0rem;
}

.form-title {
  font-size: clamp(0.8rem, 0.9rem + 2.5vw, 3rem);
  margin: 0 0 2rem 0;
  line-height: 1.3;
  text-transform: uppercase;
}

.form-description {
  width: 75%;
  font-size: clamp(0.8rem, 0.6rem + 1vw, 1.1rem);
  line-height: 1.5;
}

/* Styles pour la colonne de formulaire (droite) */
.form-content {
  width: 65%;
}

.form-row {
  display: flex;
  gap: 1rem;
}

.form-group {
  margin-bottom: 1.7rem;
  width: 100%;
}

.form-group.half {
  width: calc(50% - 0.5rem);
}

input, textarea {
  width: 100%;
  padding: 1rem;
  border: 1px solid #000;
  font-size: 1rem;
  background-color: transparent;
  box-sizing: border-box;
  font-family: 'Victor Mono', monospace;
}

input::placeholder, textarea::placeholder {
  font-size: 1rem;
  text-transform: uppercase;
}

textarea {
  resize: none;
  height: 200px;
}

.submit-container {
  display: flex;
  justify-content: flex-end;
}

.submit-btn {
  background-color: #000;
  color: white;
  border: 1px solid #000;
  border-radius: 80px;
  padding: 0.5rem 2rem;
  font-size: clamp(0.8rem, 0.5rem + 2.5vw, 1.8rem);
  cursor: pointer;
  text-transform: uppercase;
  transition: all 0.3s ease;
  display: inline-block;
}

.submit-btn:hover {
  background-color: transparent;
  color: #000;
}

/* Message de succès ou d'erreur */
.form-message {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  margin: 0 auto 1rem auto;
  font-size: 1.1rem;
  line-height: 1.2;
  width: 80%;
}

.form-message.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.form-message.error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.form-message p {
  margin: 0.2rem 0;
}


/* Visually hide the Google reCAPTCHA badge */
.grecaptcha-badge {
  visibility: hidden !important;
}

/* Style for the reCAPTCHA privacy notice */
.recaptcha-notice {
  font-size: 12px;
  color: #777;
  margin-bottom: 25px;
  text-align: left;
}

.recaptcha-notice a {
  color: #555;
  text-decoration: underline;
}

.recaptcha-notice a:hover {
  color: #000;
}


/* Responsive */
@media (max-width: 768px) {

  .contact-info-block {
    height: 70dvh;
  }

  .contact-heading {
    text-align: center;
  }

  .address-title {
    margin: 0;
  }
  /* Section info de contact & carte */
  .contact-map-section {
    height: auto;
  }
  
  .contact-map-container {
    flex-direction: column;
  }

  .contact-heading {
    font-size : clamp(1.5rem, 1.5vw, 1.5rem);
    margin-top: 5%;
  }
  
  .contact-info {
    width: 100%;
    padding: 3rem 2rem;
    font-size : clamp(1.1rem, 1.5vw, 1.5rem);
  }
  
  .contact-map {
    width: 100%;
    height: 70vh; /* Augmentation de la hauteur pour qu'elle soit plus haute que large */
    padding: 0 2rem 3rem 2rem;
  }
  
  /* Section formulaire */
  .contact-form-container {
    flex-direction: column;
  }

  .form-background {
    padding: 3rem 0 1rem 0;
  }

  .form-title {
    text-align: center;
  }

  .form-description {
    width: 90%;
  }

  .form-intro {
    width: 100%;
    padding-right: 0;
    margin-bottom: 3rem;
  }
  
  .form-content {
    width: 100%;
  }
  
  .form-row {
    flex-direction: column;
    gap: 0;
  }
  
  .form-group.half {
    width: 100%;
  }

  .form-container-wrapper::before {
    display: none;
  }

  .contact-form-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('/assets/images/pattern-lines.png');
    background-size: 20% auto; /* Largeur 100%, hauteur proportionnelle (avant mise à l'échelle par 'round') */
    background-repeat: repeat round; /* Pas de répétition horizontale. Répétition verticale avec mise à l'échelle pour s'adapter parfaitement. */
    background-position: top left; /* S'assurer que ça commence en haut à gauche */
    z-index: 0;
  }
}
