/* ==========================================================================
   Marche ADEPS — École du Fâ, Ferrières
   Feuille de style du site de téléchargement (GPX + PDF)
   ========================================================================== */

:root {
  --green-dark:  #1e4d2b;   /* vert forêt — en-tête, titres */
  --green:       #2e7d43;   /* vert accent — boutons */
  --green-soft:  #eaf4ec;   /* fond très clair */
  --ink:         #24302a;   /* texte courant */
  --muted:       #5f6f66;   /* texte secondaire */
  --paper:       #f7f6f2;   /* fond de page */
  --card:        #ffffff;
  --border:      #e3e2dc;
  --radius:      14px;
  --shadow:      0 2px 10px rgba(30, 77, 43, .08);
  --shadow-hover:0 8px 24px rgba(30, 77, 43, .16);
  --maxw:        1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}

.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px;
}

img { max-width: 100%; display: block; }

a { color: var(--green); }

/* ===== En-tête ===== */
.site-header {
  background: linear-gradient(135deg, var(--green-dark), #2a6238);
  color: #fff;
  padding: 22px 0;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-icon { font-size: 2.2rem; }

.brand h1 {
  margin: 0;
  font-size: 1.7rem;
  letter-spacing: .5px;
}

.brand-sub {
  margin: 2px 0 0;
  font-size: .95rem;
  opacity: .85;
}

.date-badge {
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .35);
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 600;
  white-space: nowrap;
}

/* ===== Héro / intro ===== */
.hero {
  background: var(--green-soft);
  border-bottom: 1px solid var(--border);
  text-align: center;
  padding: 44px 0 40px;
}

.hero h2 {
  margin: 0 0 12px;
  font-size: 1.9rem;
  color: var(--green-dark);
}

.hero p {
  max-width: 640px;
  margin: 0 auto 22px;
  color: var(--muted);
  font-size: 1.05rem;
}

/* ===== Boutons ===== */
.btn {
  display: inline-block;
  text-decoration: none;
  font-weight: 600;
  border-radius: 10px;
  transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
  cursor: pointer;
}

.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.btn:active { transform: translateY(0); }

.btn-hero {
  background: var(--green);
  color: #fff;
  padding: 12px 28px;
  font-size: 1.05rem;
}

.btn-gpx, .btn-pdf {
  flex: 1;
  text-align: center;
  padding: 10px 14px;
  font-size: .95rem;
}

.btn-gpx {
  background: var(--accent, var(--green));
  color: var(--accent-text, #fff);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
}

.btn-pdf {
  background: #fff;
  color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--accent, var(--green));
}

/* ===== Titres de section ===== */
.section-title {
  font-size: 1.6rem;
  color: var(--green-dark);
  margin: 48px 0 20px;
}

/* ===== Cartes parcours ===== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 22px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-top: 6px solid var(--accent);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: box-shadow .15s ease, transform .15s ease;
}

.card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}

.card-media {
  position: relative;
  background: #eceae4;
}

.card-media img {
  width: 100%;
  aspect-ratio: 297 / 210;
  object-fit: cover;
}

.card-distance {
  position: absolute;
  top: 10px;
  right: 10px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: .95rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}

.card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.card-body h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
  color: var(--green-dark);
}

.stats {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  font-size: .92rem;
}

.stats li {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px dashed var(--border);
}

.stats li:last-child { border-bottom: none; }

.stat-label { color: var(--muted); }
.stat-value { font-weight: 700; }

.card-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

/* ===== Carte globale ===== */
.global-map {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 26px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-top: 26px;
}

.global-map-media img {
  border-radius: 8px;
  border: 1px solid var(--border);
}

.global-map-body h2 {
  margin: 0 0 10px;
  color: var(--green-dark);
  font-size: 1.35rem;
}

.global-map-body p { color: var(--muted); margin: 0 0 14px; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 18px;
  font-weight: 600;
  font-size: .95rem;
}

.legend span { display: inline-flex; align-items: center; gap: 6px; }

.legend i {
  width: 22px;
  height: 6px;
  border-radius: 3px;
  display: inline-block;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.15);
}

/* ===== Infos pratiques ===== */
.infos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 18px;
}

.info-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
}

.info-box h3 {
  margin: 0 0 8px;
  font-size: 1.02rem;
  color: var(--green-dark);
}

.info-box p { margin: 0; color: var(--ink); }

/* ===== Aide GPX ===== */
.help {
  margin-top: 26px;
  background: var(--green-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
}

.help summary {
  font-weight: 700;
  color: var(--green-dark);
  cursor: pointer;
  font-size: 1.02rem;
}

.help p, .help li { color: var(--ink); }
.help code {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: .9em;
}

/* ===== Pied de page ===== */
.site-footer {
  margin-top: 56px;
  background: var(--green-dark);
  color: rgba(255, 255, 255, .9);
  text-align: center;
  padding: 26px 0;
  font-size: .92rem;
}

.site-footer a { color: #cfe8d6; }

.credits { opacity: .75; font-size: .82rem; margin-top: 6px; }

/* ===== Responsive ===== */
@media (max-width: 760px) {
  .global-map { grid-template-columns: 1fr; }
  .hero h2 { font-size: 1.5rem; }
  .header-inner { justify-content: center; text-align: center; }
}
