/* ========== VARIABLES ========== */
:root {
  --red: #e60000;
  --red-dark: #a80000;
  --black: #000;
  --gray-bg: #f3f3f3;
  --white: #fff;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  --radius: 12px;
}

/* ========== RESET & BASE ========== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Segoe UI', sans-serif;
  background: linear-gradient(to bottom, #4d0000, #B22222);
  color: var(--white);
  line-height: 1.6;
  padding-top: 80px;
}

/* ========== NAVBAR ========== */
.sticky-header {
  position: fixed;
  top: 0;
  width: 100%;
  background: var(--black);
  color: var(--white);
  z-index: 1000;
  box-shadow: var(--shadow);
}

.navbar {
  max-width: 1200px;
  margin: auto;
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.7rem;
  font-weight: bold;
  color: var(--red);
}

.logo-img {
  width: 45px;
  height: 45px;
  object-fit: contain;
}

.nav-links {
  display: flex;
  gap: 1rem;
  list-style: none;
}

.nav-links a {
  color: var(--white);
  text-decoration: none;
  font-weight: 600;
  padding: 0.4rem 0.8rem;
  border-radius: 6px;
  transition: background 0.3s;
}

.nav-links a:hover {
  background-color: var(--red);
}

/* ========== APROPOS ========== */
.apropos-section {
  background-color: rgba(0, 0, 0, 0.5);
  border-radius: var(--radius);
  padding: 2.5rem;
  margin: 2rem auto;
  max-width: 1000px;
  box-shadow: var(--shadow);
  color: var(--white);
}

.apropos-section h2 {
  font-size: 2rem;
  color: var(--red);
  margin-bottom: 1rem;
  border-left: 5px solid var(--red);
  padding-left: 1rem;
}

.apropos-section p {
  font-size: 1.1rem;
  line-height: 1.8;
  margin-bottom: 1rem;
  color: #f5f5f5;
}

.apropos-section ul {
  padding-left: 2rem;
  margin-top: 1rem;
}

.apropos-section ul li {
  margin-bottom: 0.75rem;
  color: var(--white);
  font-size: 1rem;
  position: relative;
}

.apropos-section ul li::before {
  content: "🏁";
  position: absolute;
  left: -1.5rem;
}

/* ========== TIMELINE ========== */
.timeline {
  position: relative;
  padding-left: 2rem;
  margin-top: 2rem;
  border-left: 4px solid var(--red);
}

.timeline-item {
  position: relative;
  margin-bottom: 2rem;
  padding-left: 1.5rem;
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -0.65rem;
  top: 0.25rem;
  width: 1.2rem;
  height: 1.2rem;
  background-color: var(--red);
  border-radius: 50%;
  border: 2px solid var(--white);
  box-shadow: 0 0 8px var(--red);
}

.timeline-date {
  font-weight: bold;
  color: var(--red);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.timeline-content h3 {
  font-size: 1.3rem;
  color: var(--white);
  margin-bottom: 0.3rem;
}

.timeline-content p {
  font-size: 1.05rem;
  color: #f0f0f0;
  line-height: 1.6;
}

/* ========== FOOTER ========== */
.sticky-footer {
  position: fixed;
  bottom: 0;
  width: 100%;
  background: var(--black);
  color: var(--white);
  display: flex;
  align-items: center;
  padding: 1rem;
  font-size: 0.9rem;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
  gap: 0.5rem;
}
.sticky-footer img {
  width: 30px;
}

/* ========== ANIMATIONS SCROLL ========== */
.fade-in, .slide-up, .slide-left {
  opacity: 0;
  transform: translateY(20px);
  transition: all 1s ease;
}

.slide-left {
  transform: translateX(-40px);
}

.slide-up {
  transform: translateY(40px);
}

.fade-in.appear, .slide-up.appear, .slide-left.appear {
  opacity: 1;
  transform: translateY(0);
}

/* ========== RESPONSIVE ========== */
@media screen and (max-width: 768px) {
  .navbar, .nav-links {
    flex-direction: column;
    align-items: center;
  }

  .apropos-section {
    padding: 1.5rem;
  }

  .apropos-section h2 {
    font-size: 1.5rem;
  }

  .timeline {
    padding-left: 1rem;
  }

  .timeline-item::before {
    left: -0.5rem;
    width: 1rem;
    height: 1rem;
  }

  .timeline-content h3 {
    font-size: 1.1rem;
  }

  .timeline-content p {
    font-size: 1rem;
  }
}
.section-image {
  width: 100%;
  max-width: 700px;
  height: auto;
  margin: 1rem 0;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  object-fit: cover;
}
/* ========== APROPOS LAYOUT ========== */
.horizontal-section {
  display: flex;
  align-items: center;
  gap: 2rem;
  flex-wrap: wrap;
}

.section-text {
  flex: 1 1 55%;
}

.section-image-wrapper {
  flex: 1 1 40%;
}

.section-image-wrapper img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  object-fit: cover;
}

/* Responsive */
@media screen and (max-width: 768px) {
  .horizontal-section {
    flex-direction: column;
    text-align: center;
  }

  .section-text, .section-image-wrapper {
    flex: 1 1 100%;
  }
}
/* Variante pour inverser l'ordre image/texte */
.reverse-layout {
  flex-direction: row-reverse;
}

@media screen and (max-width: 768px) {
  .reverse-layout {
    flex-direction: column;
  }
}
/* ========== TABLEAU RESULTATS ========== */
.results-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.95rem;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.results-table th,
.results-table td {
  padding: 0.8rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.results-table th {
  background-color: var(--red);
  color: var(--white);
  text-transform: uppercase;
  font-weight: bold;
  letter-spacing: 0.5px;
}

.results-table tr:nth-child(even) {
  background-color: rgba(255, 255, 255, 0.07);
}

.results-table tr:hover {
  background-color: rgba(255, 255, 255, 0.12);
  transition: background 0.3s;
}
.menu-toggle {
  display: none;
  font-size: 2rem;
  color: var(--white);
  cursor: pointer;
}

/* Menu mobile masqué par défaut */
@media screen and (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: center;
    background-color: var(--black);
    padding: 1rem 0;
    border-top: 1px solid rgba(255,255,255,0.2);
  }

  .nav-links.show {
    display: flex;
  }

  .nav-links li {
    width: 100%;
    text-align: center;
  }

  .nav-links a {
    display: block;
    padding: 1rem;
    width: 100%;
    text-decoration: none;
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 600;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

  .nav-links a:hover {
    background-color: var(--red);
  }

  .navbar {
    flex-wrap: nowrap;
    justify-content: space-between;
  }
}
/* ======== CORRECTIONS AFFICHAGE MOBILE ======== */

/* Fixe la hauteur du header sur mobile et évite les débordements */
@media screen and (max-width: 768px) {
  body {
    padding-top: 70px; /* réduit l’espace pour mieux voir le contenu */
  }

  .sticky-header {
    padding: 0.5rem 1rem;
  }

  .logo {
    font-size: 1.3rem;
    gap: 6px;
  }

  .logo-img {
    width: 35px;
    height: 35px;
  }
}

/* Corrige le menu mobile pour qu’il soit visible par-dessus tout */
.nav-links {
  position: relative;
  z-index: 999;
}

@media screen and (max-width: 768px) {
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background-color: var(--black);
    flex-direction: column;
    align-items: center;
    display: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.5);
  }

  .nav-links.show {
    display: flex;
    animation: slideDown 0.3s ease forwards;
  }

  /* Animation fluide d’ouverture */
  @keyframes slideDown {
    from {
      opacity: 0;
      transform: translateY(-10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .nav-links a {
    padding: 1rem;
    font-size: 1.1rem;
    width: 100%;
    text-align: center;
  }

  .navbar {
    position: relative;
  }
}

/*  Empêche les sections de coller au menu sur mobile */
main section:first-of-type {
  margin-top: 1rem;
}
/* --- Correction responsive pour la section Histoire --- */
@media screen and (max-width: 768px) {
  /* La section s'affiche en colonne */
  #histoire-avbm .horizontal-section {
    flex-direction: column;
    gap: 1rem;
  }

  /* Timeline prend toute la largeur */
  #histoire-avbm .section-text {
    width: 100%;
  }

  /* Tableau et contenu à largeur auto */
  #histoire-avbm .section-image-wrapper {
    width: 100%;
  }

  /* Conteneur du tableau scrollable horizontalement si trop large */
  .results-table {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .results-table table {
    width: 100%;
    min-width: 500px; /* pour forcer le scroll horizontal si contenu trop large */
  }

  .apropos-section {
    margin: 1rem;
    padding: 1.2rem;
  }

  /* Réduction des marges et texte */
  .apropos-section h2, .apropos-section h3 {
    font-size: 1.3rem;
    text-align: center;
  }

  .results-table th, .results-table td {
    font-size: 0.85rem;
    padding: 0.6rem;
  }
}
.timeline {
  border-left: 3px solid var(--red);
  padding-left: 1rem;
}
