/* Couleurs de base */
body {
  margin: 0;
  font-family: 'Roboto', sans-serif;
  background-color: #f8f5f0; /* Blanc cassé */
  color: #333;
  overflow-x: auto; /* Permet le scroll horizontal */
}

/* En-tête */
header {
  background-color: #f2ede3; /* Ivoire */
  padding: 20px;
  text-align: center;
}

header h1 {
  margin: 0;
  font-size: 2em;
  color: #333;
}

nav {
  margin-top: 10px;
}

nav a {
  text-decoration: none;
  color: #333;
  margin: 0 10px;
  font-weight: bold;
  transition: color 0.3s ease;
}

nav a:hover,
nav a.active {
  color: #a68c5a; /* Beige doré noble */
}

/* Section principale */
.hero {
  background: url('../Image fond.jpg') center/cover no-repeat;
  padding: 80px 20px;
  text-align: center;
  color: #fff;
}

.hero-content {
  background-color: rgba(0, 0, 0, 0.4);
  padding: 40px;
  border-radius: 12px;
}

.hero h2 {
  font-size: 2.5em;
  margin-bottom: 10px;
}

.hero p {
  font-size: 1.2em;
  margin-bottom: 20px;
}

.buttons button {
  margin: 10px;
  padding: 12px 24px;
  font-size: 1em;
  background-color: #a68c5a;
  border: none;
  border-radius: 8px;
  color: #fff;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.buttons button:hover {
  background-color: #8f7747;
}

/* Section biographie */
.biographie-links {
  padding: 40px 20px;
  max-width: 800px;
  margin: auto;
}

.biographie-links h2 {
  font-size: 2em;
  margin-bottom: 20px;
  color: #333;
}

.biographie-links ul {
  list-style: none;
  padding: 0;
}

.biographie-links li {
  margin-bottom: 15px;
}

.biographie-links a {
  color: #000;
  text-decoration: none;
  font-weight: normal;
  font-size: 1.1em;
}

.biographie-links a:hover {
  color: #a68c5a;
  text-decoration: underline;
}

/* Footer */
footer {
  background-color: #f2ede3;
  color: #333;
  text-align: center;
  padding: 30px 20px;
  font-size: 0.9em;
  line-height: 1.5;
}

footer .discret {
  font-size: 0.8em;
  opacity: 0.8;
  margin-top: 10px;
}

/* Responsive */
@media (max-width: 600px) {
  nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }

  nav a {
    margin: 5px 10px;
  }

  .hero h2 {
    font-size: 2em;
  }

  .hero p {
    font-size: 1em;
  }

  .buttons button {
    width: 100%;
    max-width: 300px;
  }
}

.centered-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 80vh;
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  padding: 2rem;
  line-height: 1.6;
  color: #333;
}

/* ===== Style spécifique Arbre Généalogique ===== */

.scroll-wrapper {
  overflow-x: auto;
  width: 100%;
}

.arbre-container {
  background-color: #fdfcf7;
  padding: 30px 20px;
  min-width: max-content;
  margin: 40px auto;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(166, 140, 90, 0.2);
  font-size: 1rem;
  color: #4a4a4a;
  user-select: none;
  position: relative;
  z-index: 1;
}

.arbre-scrollable ul.gen-4,
.arbre-scrollable ul.gen-5 {
  flex-wrap: nowrap;
  width: max-content;
}

.arbre-container ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
  display: flex;
  justify-content: center;
  gap: 40px;
  flex-wrap: nowrap;
}

.arbre-container ul.gen-1,
.arbre-container ul.gen-2,
.arbre-container ul.gen-3 {
  flex-direction: column;
  align-items: center;
}

.arbre-container ul.gen-4,
.arbre-container ul.gen-5 {
  flex-direction: row;
  align-items: flex-start;
}

.arbre-container li {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Boîte représentant une personne */
.personne {
  background-color: #a68c5a20;
  border: 2px solid #a68c5a;
  border-radius: 12px;
  padding: 12px 20px;
  min-width: 140px;
  max-width: 180px;
  box-shadow: 1px 1px 6px rgba(166, 140, 90, 0.3);
  text-align: center;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

.personne:hover {
  background-color: #a68c5a40;
}

/* Traits verticaux entre générations */
.arbre-container li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  width: 2px;
  height: 30px;
  background-color: #a68c5a;
  transform: translateX(-50%);
  z-index: -1;
}

/* Traits horizontaux pour générations 4+ */
.arbre-container ul.gen-4 > li:not(:first-child)::before,
.arbre-container ul.gen-5 > li:not(:first-child)::before {
  content: "";
  position: absolute;
  top: 50%;
  left: -40px;
  width: 40px;
  height: 2px;
  background-color: #a68c5a;
  transform: translateY(-50%);
  z-index: -1;
}

/* Cacher les descendants par défaut */
.arbre-container ul ul {
  display: none;
  margin-top: 30px;
  gap: 40px;
}

/* Afficher descendants quand li est actif */
.arbre-container li.active > ul {
  display: flex;
}

/* Fix position sticky menu */
header.header-fixe {
  position: sticky;
  top: 0;
  z-index: 1000;
  background-color: #f2ede3;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

header nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 15px;
  margin-top: 15px;
}

/* Responsive généalogie */
@media (max-width: 768px) {
  .scroll-wrapper {
    padding-bottom: 20px;
  }

  .arbre-scrollable ul.gen-4,
  .arbre-scrollable ul.gen-5 {
    gap: 20px;
  }

  .arbre-container .personne {
    min-width: 110px;
    max-width: 140px;
  }
}