/*
 * Stylesheet pour le site du constructeur de maison.
 * Thème sombre avec une couleur d’accent chaude.
 */

/* Définition des variables de couleur pour une personnalisation aisée */
:root {
  --primary: #1e90ff; /* bleu vif pour les éléments interactifs */
  --dark-bg: #121212; /* fond principal sombre */
  --secondary: #1e1e1e; /* fond secondaire pour les cartes */
  --light-text: #f5f5f5; /* couleur du texte principal */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Montserrat', sans-serif;
  background-color: var(--dark-bg);
  color: var(--light-text);
  line-height: 1.6;
  scroll-behavior: smooth;
}

a {
  color: var(--light-text);
  text-decoration: none;
}

/* Barre de navigation */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 10%;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 10;
  background: rgba(18, 18, 18, 0.8);
  backdrop-filter: blur(5px);
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
}

.logo span {
  color: var(--primary);
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 30px;
}

.nav-links li a {
  font-weight: 500;
  transition: color 0.3s;
}

.nav-links li a:hover {
  color: var(--primary);
}

/* Section hero */
#hero {
  height: 100vh;
  /* On laisse une image de fond par défaut au cas où le slider ne se charge pas. */
  background: url('images/hero.jpg') center/cover no-repeat fixed;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--light-text);
}

#hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.7); /* assombrir davantage pour améliorer le contraste avec le slider */
  z-index: 1;
}

/* Slider d’images pour la section hero. Les images se superposent et
   disparaissent/ apparaissent avec une transition d’opacité. */
.hero-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  z-index: 0;
}

.hero-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}

.hero-slide.active {
  opacity: 1;
}

.hero-content {
  position: relative;
  max-width: 800px;
  padding: 0 20px;
  z-index: 2;
}

.hero-content h1 {
  font-size: 3rem;
  margin-bottom: 20px;
  font-weight: 700;
}

.hero-content p {
  font-size: 1.2rem;
  margin-bottom: 30px;
  color: #ddd;
}

/* Boutons */
.btn {
  display: inline-block;
  padding: 12px 30px;
  border-radius: 30px;
  font-weight: 600;
  border: 2px solid var(--primary);
  color: var(--primary);
  transition: background 0.3s, color 0.3s;
  cursor: pointer;
}

.btn.primary-btn {
  background: var(--primary);
  color: var(--dark-bg);
}

.btn.primary-btn:hover {
  background: transparent;
  color: var(--primary);
}

/* Bouton secondaire (ex : numéro de téléphone) */
.btn.secondary-btn {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
  margin-left: 15px;
}

.btn.secondary-btn:hover {
  background: var(--primary);
  color: var(--dark-bg);
}

/* Conteneur des boutons d’appel à l’action dans le hero */
.cta-buttons {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.section {
  padding: 80px 10%;
}

.section h2 {
  font-size: 2rem;
  margin-bottom: 40px;
  text-align: center;
  font-weight: 600;
  position: relative;
}

/* Services */
.services-wrapper {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
}

.service-card {
  background: var(--secondary);
  padding: 30px;
  border-radius: 10px;
  text-align: center;
  transition: transform 0.3s, box-shadow 0.3s;
}

.service-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.6);
}

.service-card .icon {
  margin-bottom: 20px;
  color: var(--primary);
  font-size: 3rem;
}

.service-card .icon-svg {
  width: 50px;
  height: 50px;
  display: inline-block;
}

.service-card h3 {
  font-size: 1.3rem;
  margin-bottom: 15px;
  font-weight: 600;
}

.service-card p {
  font-size: 0.95rem;
  line-height: 1.5;
  color: #ccc;
}

/* Galerie / Slider */
#gallery .slider {
  position: relative;
  max-width: 100%;
  margin: auto;
  overflow: hidden;
  border-radius: 10px;
}

/* Section des terrains */
/* Slider horizontal pour les villes disponibles. Chaque élément est centré et la ville
   au centre est mise en avant avec une couleur et une taille plus grandes. */
#terrains .terrain-slider {
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  margin: 0 auto;
  width: 100%;
  height: 100px;
  transition: transform 0.6s ease;
}

#terrains .terrain-item {
  flex: 0 0 auto;
  margin: 0 20px;
  font-size: 1.2rem;
  font-weight: 600;
  color: #888;
  transition: transform 0.5s ease, color 0.5s ease;
  white-space: nowrap;
}

#terrains .terrain-item.active {
  transform: scale(1.3);
  color: var(--primary);
}

#terrains .terrain-desc {
  max-width: 800px;
  margin: 40px auto 0 auto;
  text-align: center;
  color: #ccc;
  font-size: 1rem;
}

#gallery .slides {
  display: flex;
  transition: transform 0.5s ease-in-out;
}

#gallery .slide {
  min-width: 100%;
  height: 400px;
  object-fit: cover;
}

#gallery .slider-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: var(--light-text);
  font-size: 2rem;
  padding: 10px;
  cursor: pointer;
  border-radius: 50%;
  z-index: 2;
  transition: background 0.3s;
}

#gallery .slider-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

#gallery .prev {
  left: 20px;
}

#gallery .next {
  right: 20px;
}

/* Formulaire de contact */
#contact form {
  max-width: 600px;
  margin: auto;
}

.form-group {
  margin-bottom: 20px;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 5px;
  background: var(--secondary);
  color: var(--light-text);
  font-size: 1rem;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: #999;
}

footer {
  text-align: center;
  padding: 20px 10%;
  background: #0e0e0e;
  font-size: 0.9rem;
  color: #777;
}

/* Révélation lors du scroll */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: all 0.6s ease-out;
}

/* ------------------------------------------------------------------ */
/*      Stylisation du carrousel Splide pour les terrains disponibles   */
/* Les éléments sont centrés et l’élément actif est agrandi et coloré */
#terrain-carousel {
  margin-bottom: 20px;
}

#terrain-carousel .splide__slide {
  padding: 0 20px;
  font-size: 1.2rem;
  font-weight: 600;
  color: #888;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: transform 0.5s ease, color 0.5s ease;
}

#terrain-carousel .splide__slide.is-active {
  transform: scale(1.3);
  color: var(--primary);
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* --------------------------------------------------------------- */
/* Navigation mobile : hamburger et menu déroulant */
.hamburger {
  display: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--primary);
  z-index: 11;
}

/* Les liens de navigation passent en colonne sur mobile et sont masqués par défaut */
.nav-links.open {
  display: flex !important;
}

/* Menu de filtre pour les réalisations */
.gallery-menu {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-bottom: 30px;
}

.filter-btn {
  padding: 10px 20px;
  border: 2px solid var(--primary);
  border-radius: 20px;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-weight: 600;
  transition: background 0.3s, color 0.3s;
}

.filter-btn.active,
.filter-btn:hover {
  background: var(--primary);
  color: var(--dark-bg);
}

/* Grille des réalisations */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  cursor: pointer;
  height: 250px;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

/* Lightbox (fenêtre modale pour agrandir l’image) */
.lightbox {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
  z-index: 999;
  padding: 20px;
}

.lightbox-img {
  max-width: 90%;
  max-height: 80%;
  border-radius: 10px;
}

.lightbox .close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2rem;
  color: #fff;
  cursor: pointer;
}

/* ------------------------------------------------------------------ */
/* Responsivité pour la navigation et la galerie */
@media (max-width: 768px) {
  /* Ajustements du hero */
  .hero-content h1 {
    font-size: 2.3rem;
  }
  .hero-content p {
    font-size: 1rem;
  }
  /* Menu mobile : masquage des liens par défaut */
  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    top: 70px;
    right: 10%;
    background: var(--secondary);
    padding: 20px;
    border-radius: 10px;
    width: 80%;
    gap: 15px;
    z-index: 10;
  }
  .hamburger {
    display: block;
  }
  /* Services en colonne */
  .services-wrapper {
    grid-template-columns: 1fr;
  }
  /* Ajustement de la hauteur des images dans la galerie sur mobile */
  .gallery-item {
    height: 200px;
  }
}

/* Responsivité */
@media (max-width: 768px) {
  .hero-content h1 {
    font-size: 2.3rem;
  }
  .hero-content p {
    font-size: 1rem;
  }
  .services-wrapper {
    grid-template-columns: 1fr;
  }
  #gallery .slide {
    height: 300px;
  }
}