/* RESET utile */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background: #f5f5f5;
  color: #222;
  font-family: system-ui, sans-serif;
  line-height: 1.6;
}

/* Mise en page générale */
main {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1rem;
}

.text-green {
  color: #8dc63f;
}

/* Titres */
h1,
h2,
h3 {
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 1px;
}

/* ================= */
/* ===== HERO ====== */
/* ================= */

.hero-image {
  width: 100%;
  height: 450px;
  background-image: url("../img/trail.webp");
  background-size: cover;
  background-position: center -50px;
  background-repeat: no-repeat;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 2rem;
  position: relative;
}

.hero-image::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
}

.hero-content {
  position: relative;
  z-index: 2;
  color: white;
  text-align: center;
}

.hero-content h1 {
  font-size: 5rem;
}

.hero-subtitle {
  font-size: 2.5rem;
  font-family: "Bebas Neue", sans-serif;
  letter-spacing: 1px;
  margin-top: 0.5rem;
  color: #e0e0e0;
}

/* ========================= */
/* === SECTION INTRO TRAIL ==*/
/* ========================= */

.intro-trail {
  width: 100%;
  margin: 3rem 0;
  padding: 0 1rem;
}

.intro-wide {
  display: flex;
  align-items: center;
  gap: 3rem;
  padding: 2rem 0;
}

.intro-text {
  flex: 1;
}

.intro-text h2 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.intro-text p {
  font-size: 1.15rem;
  line-height: 1.85;
  margin-bottom: 0.8rem;
}

/* IMAGE large à droite */
.intro-image-frame {
  flex: 0 0 40%;
  aspect-ratio: 5/5;
  border-radius: 30px;
  overflow: hidden;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.25);
}

.intro-image-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Responsive INTRO */
@media (max-width: 900px) {
  /* On garde la dispo en ligne pour l'intro */
  .intro-wide {
    align-items: center;
    gap: 1.5rem;
  }

  .intro-text h2 {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
  }

  .intro-text p {
    font-size: 1rem;
    line-height: 1.4;
  }

  .intro-image-frame {
    flex: 0 0 35%; /* L'image prend 35% */
    width: auto;
    max-width: none;
    aspect-ratio: 1/1; /* Carré */
  }
}

/* ========================= */
/* ====== NOS COURSES ====== */
/* ========================= */

.courses-section {
  margin: 3rem 0 4rem;
}

.courses-title {
  font-size: 4rem;
  text-align: center;
  margin-bottom: 2.5rem;
}

.courses-title span {
  color: #8dc63f;
}

.course-card {
  background: #ffffff;
  border-radius: 32px;
  padding: 2.2rem 2.4rem;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  margin-bottom: 2.2rem;

  display: flex;
  flex-direction: column;
}

.course-content {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
  margin-bottom: 1.8rem;
}

.course-left {
  flex: 1;
}

.course-right {
  flex: 1;
}

.course-left h3 {
  margin-top: 0;
  font-size: 3rem;
}

.course-distance-main {
  font-size: 1.1rem;
  font-weight: 600;
  color: #8dc63f;
  margin-bottom: 0.4rem;
}

.course-meta {
  font-size: 0.95rem;
  color: #555;
  margin-bottom: 0.8rem;
}

.course-meta span+span::before {
  content: "•";
  margin: 0 0.4rem;
}

.course-description {
  font-size: 0.98rem;
  color: #444;
  line-height: 1.7;
}

/* Carte GPX */
.course-map {
  width: 100%;
  height: 320px;
  border-radius: 20px;
  overflow: hidden;
  position: relative;
  background: #f0f0f0;
}

/* Boutons */
.course-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.course-btn {
  padding: 0.6rem 1.8rem;
  border-radius: 999px;
  border: 2px solid #8dc63f;
  background: #fff;
  cursor: pointer;
  text-decoration: none;
  color: #8dc63f;
  font-size: 0.98rem;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.course-btn.primary {
  background: #8dc63f;
  color: #fff;
}

.course-btn:hover {
  transform: translateY(-1px);
}

.course-btn.primary:hover {
  background: #222;
}

.course-btn.secondary:hover {
  background: #f5f5f5;
}

.course-btn.small {
  padding: 0.4rem 1.1rem;
  font-size: 0.9rem;
}

.download-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

/* ========================= */
/* === INFOS PRATIQUES ===== */
/* ========================= */

.infos-pratiques {
  margin: 4rem 0;
}

.infos-container {
  display: flex;
  gap: 3rem;
  align-items: stretch;
}

.infos-image {
  flex: 0 0 35%;
  border-radius: 30px;
  overflow: hidden;
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
  min-height: 400px;
}

.infos-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.infos-grid {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.5rem;
}

.info-card {
  flex: 1 1 300px;
  background: white;
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease;
  
  /* Flex ROW layout: Icon left, text right */
  display: flex;
  align-items: flex-start; /* Align icon with top of text */
  gap: 1rem;
}

.info-card:hover {
  transform: translateY(-3px);
}

.info-icon {
  font-size: 1.5rem; /* Smaller icon size */
  background: #f0f9e8;
  width: 50px; /* Fixed width */
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8dc63f;
  flex-shrink: 0; /* Prevent shrinking */
  margin-bottom: 0; /* Remove bottom margin to align side-by-side */
}

/* Wrapper for text content inside card if needed, but since HTML structure is direct, we might need a wrapper or handle children. 
   Wait, the HTML is currently: .info-card > .info-icon, h3, p. 
   So flex row will put icon then h3 then p horizontal. That's wrong.
   We need to wrap text content in a div or use grid. But I cannot change HTML easily everywhere without regex.
   Let's try Grid for .info-card.
*/
.info-card {
  flex: 1 1 300px;
  background: white;
  border-radius: 20px;
  padding: 1.5rem;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.2s ease;
  
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 0 1rem; /* Column gap 1rem, Row gap 0 */
  align-items: start;
}

.info-icon {
  grid-column: 1;
  grid-row: 1 / span 3; /* Span multiple rows just in case */
  font-size: 1.8rem;
  margin-bottom: 0;
  background: #f0f9e8;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #8dc63f;
}

.info-card h3 {
  grid-column: 2;
  margin: 0 0 0.5rem 0; /* Reduce bottom margin */
  font-size: 1.4rem; /* Slightly smaller to fit better */
  align-self: center; /* Center title vertically with icon top part if needed, or just start */
}

.info-card p, .info-card ul, .info-card .info-sub, .info-card .info-note {
  grid-column: 2;
  margin: 0; /* Reset margins */
}
/* Re-add spacing between text elements if multiple */
.info-card > *:not(.info-icon):not(h3) {
    margin-bottom: 0.5rem;
}



.info-card p,
.info-card li {
  font-size: 0.95rem;
  color: #555;
  line-height: 1.6;
}

.info-card ul {
  list-style: none;
  margin: 0.5rem 0;
  padding-left: 0.5rem;
}

.info-card li::before {
  content: "›";
  color: #8dc63f;
  font-weight: bold;
  margin-right: 0.5rem;
}

.info-sub {
  margin-top: 0.8rem;
  font-weight: 600;
  color: #8dc63f;
}

.info-note {
  margin-top: 0.8rem;
  font-size: 0.85rem;
  font-style: italic;
  color: #777;
}

/* ============================= */
/* ======= RESPONSIVE ========== */
/* ============================= */

@media (max-width: 900px) {
  .course-content {
    flex-direction: column;
  }

  .course-right {
    width: 100%;
  }

  .course-map {
    height: 260px;
  }

  .infos-container {
    flex-direction: column;
  }

  .infos-image {
    height: 300px;
    min-height: auto;
  }
}

@media (max-width: 600px) {
  .hero-image {
    height: 300px;
    background-position: center;
  }

  .hero-content h1 {
    font-size: 2rem;
    line-height: 1.1;
  }

  .hero-subtitle {
    font-size: 1.2rem;
  }

  /* Ajustements Intro Mobile pour garder 2 colonnes */
  .intro-text h2 {
    font-size: 1.5rem; /* Beaucoup plus petit */
    line-height: 1.1;
  }
  
  .intro-text p {
    font-size: 0.85rem; /* Texte compact */
    line-height: 1.3;
    margin-bottom: 0.5rem;
  }
  
  .intro-image-frame {
     flex: 0 0 40%; /* Image un peu plus grande en proportion */
  }

  .courses-title {
    font-size: 3rem;
  }

  .course-left h3 {
    font-size: 2.4rem;
  }

  .course-card {
    padding: 1.7rem 1.6rem;
  }
  
  /* Responsive Infos Pratiques Grid */
  .info-icon {
      width: 40px;
      height: 40px;
      font-size: 1.2rem;
  }
  
  .info-card {
      padding: 1rem;
      gap: 0 0.8rem;
  }
  
  .info-card h3 {
      font-size: 1.2rem;
  }
}

/* Loading Spinner for Maps */
.course-map.loading::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 30px;
  height: 30px;
  margin-top: -15px;
  margin-left: -15px;
  border: 3px solid #ddd;
  border-top-color: #8dc63f;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  z-index: 10;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ========================= */
/* ====== BENEVOLES ======= */
/* ========================= */
.volunteers-section {
  margin: 4rem 0;
  padding: 0;
  background: white;
  border-radius: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.volunteers-container {
  display: flex;
  flex-direction: column; /* Stack vertically for better landscape image view */
}

.volunteers-image {
  width: 100%;
  height: 400px; /* Fixed height for consistent look */
}

.volunteers-image img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* Cover ensures no distortion, but landscape aspect is more respected in wide container */
}

.volunteers-content {
  padding: 3rem 4rem;
  text-align: center;
}

.volunteers-content h2 {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  color: #222;
}

.volunteers-content p {
  font-size: 1.15rem;
  color: #555;
  margin-bottom: 2rem;
  line-height: 1.8;
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
}

.volunteer-btn {
  display: inline-block;
  padding: 1rem 2.5rem;
  background-color: #8dc63f;
  color: white;
  font-size: 1.2rem;
  font-weight: bold;
  text-decoration: none;
  border-radius: 50px;
  transition: all 0.3s ease;
  box-shadow: 0 5px 15px rgba(141, 198, 63, 0.4);
}

.volunteer-btn:hover {
  background-color: #222;
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

@media (max-width: 900px) {
  .volunteers-image {
    height: 300px;
  }

  .volunteers-content {
    padding: 2rem;
  }
}

@media (max-width: 600px) {
  .volunteers-content h2 {
    font-size: 2.5rem;
  }
  
  .volunteer-btn {
    padding: 0.8rem 2rem;
    font-size: 1.1rem;
  }
}

/* ========================= */
/* ==== RECONNAISSANCE ==== */
/* ========================= */
.recon-section {
  margin: 4rem 0;
  background: white;
  border-radius: 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.recon-container {
  display: flex;
  align-items: stretch;
  flex-direction: row;
}

.recon-content {
  flex: 1;
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.recon-content h2 {
  font-size: 3rem;
  margin-bottom: 1.5rem;
  color: #222;
}

.recon-content p {
  font-size: 1.1rem;
  color: #555;
  margin-bottom: 1.5rem;
  line-height: 1.7;
}

.recon-dates h3 {
  font-size: 1.5rem;
  color: #8dc63f;
  margin-bottom: 0.8rem;
}

.recon-dates ul {
  list-style: none;
  padding: 0;
  margin-bottom: 1rem;
}

.recon-dates li {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  padding-left: 1.5rem;
  position: relative;
}

.recon-dates li::before {
  content: "📅";
  position: absolute;
  left: 0;
}

.recon-join {
  font-style: italic;
  color: #888;
}

.recon-image {
  flex: 1;
  min-height: 400px;
}

.recon-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

@media (max-width: 900px) {
  .recon-container {
    flex-direction: column-reverse; /* Put content below, image on top by reversing logic or just column. Let's try column with image first if I order HTML appropriately */
    flex-direction: column;
  }

  .recon-image {
    height: 300px;
    min-height: auto;
  }
  
  .recon-content {
    text-align: center;
    padding: 2rem;
  }
  
  .recon-dates li {
    text-align: left;
    display: inline-block;
  }
}

@media (max-width: 600px) {
  .recon-content h2 {
    font-size: 2.2rem;
  }
}