/* ===== VARIABLES GLOBALES ===== */
:root {
  --bleu:    #1e88e5;
  --bleu-f:  #0d47a1;
  --accent:  #e53935;
  --blanc:   #ffffff;
  --noir:    #0a0a0a;
  --gris-f:  #111111;
  --gris-m:  #1a1a1a;
  --texte:   rgba(255,255,255,0.75);

  /* Tailles de police de base — plus grandes pour la lisibilité */
  --fs-xs:   0.85rem;   /* était 0.72-0.75 */
  --fs-sm:   0.95rem;   /* était 0.82-0.85 */
  --fs-base: 1.05rem;   /* était 1rem      */
  --fs-lg:   1.2rem;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  /* font-size de base plus grand pour tout le site */
  font-size: 17px;
}

html, body {
  height: 100%;
  font-family: 'Outfit', sans-serif;
  background: var(--noir);
  color: var(--blanc);
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%; /* empêche iOS de zoomer le texte */
}

/* ===== NAVIGATION ===== */
.main-nav {
  position: fixed;
  top: 0;
  width: 100%;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  padding: 0 20px;
  height: 52px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 28px;
  z-index: 2000;   /* au-dessus des contrôles Leaflet (z-index 1000) */
  border-bottom: 1px solid rgba(255,255,255,0.07);
  flex-wrap: nowrap;
  overflow: visible;
}

.main-nav a {
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: color 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.main-nav a:hover { color: var(--blanc); }
.main-nav a.active { color: var(--blanc); border-bottom: 2px solid var(--bleu); }

/* ===== BOUTONS PRINCIPAUX ===== */
.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 4px;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: all 0.25s ease;
  cursor: pointer;
  border: none;
  min-height: 48px; /* zone de tap mobile */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary, .btn { background: var(--bleu); color: var(--blanc); }
.btn-primary:hover, .btn:hover { background: var(--bleu-f); transform: translateY(-2px); }

.btn-secondary { background: #2e7d32; color: var(--blanc); }

.btn-outline {
  background: transparent;
  color: var(--blanc);
  border: 2px solid rgba(255,255,255,0.55);
}
.btn-outline:hover { border-color: var(--blanc); background: rgba(255,255,255,0.1); transform: translateY(-2px); }

/* ===== CARTE LEAFLET ===== */
#map { height: 100vh; margin-top: 0; }

/* ===== PANNEAUX LEAFLET ===== */
.custom-box {
  background: rgba(10,10,10,0.94);
  border: 1px solid rgba(255,255,255,0.12);
  padding: 14px;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.6);
  width: 220px;
  color: var(--blanc);
}

.custom-box h3 {
  margin: 0 0 12px;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--blanc);
}

.custom-box button {
  width: 100%;
  margin: 4px 0;
  padding: 10px 8px;       /* plus haut pour les doigts */
  border: none;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--bleu), var(--bleu-f));
  color: var(--blanc);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.88rem;      /* plus lisible */
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 40px;
}

.custom-box button:hover { transform: translateY(-2px); }

.toggle-btn {
  background: var(--accent) !important;
  width: 24px !important;
  height: 24px !important;
  border-radius: 50% !important;
  font-size: 1rem !important;
  line-height: 24px !important;
  text-align: center;
  padding: 0 !important;
  margin: 0 !important;
  min-height: unset !important;
}

.box-content { max-height: 500px; overflow: hidden; transition: max-height 0.4s ease; }
.box-content.closed { max-height: 0; }

/* Légende repliable — même comportement que box-content */
.legend-content { max-height: 400px; overflow: hidden; transition: max-height 0.4s ease; }
.legend-content.closed { max-height: 0; }

/* ===== BOUTONS TOGGLE CARTE ===== */
.pistes-btn {
  padding: 13px 20px;
  border-radius: 30px;
  background: #28a745;
  color: var(--blanc);
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 0.9rem;       /* plus lisible */
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.5);
  transition: all 0.25s ease;
  user-select: none;
  white-space: nowrap;
  min-height: 46px;
  display: flex;
  align-items: center;
}

.pistes-btn:hover { transform: scale(1.04); }

/* ===== POPUPS LEAFLET ===== */
.leaflet-popup-content-wrapper {
  background: var(--gris-m);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
}

.leaflet-popup-tip { background: var(--gris-m); }

.leaflet-popup-content {
  margin: 0;
  color: var(--blanc);
  font-size: 1rem; /* popup text plus grand */
}

.popup-card { width: 230px; text-align: center; font-family: 'Outfit', sans-serif; }
.popup-card img { width: 100%; height: 130px; object-fit: cover; }
.popup-card h4 { margin: 12px 0 6px; font-size: 1.05rem; font-weight: 700; color: var(--blanc); }

.popup-badge {
  display: inline-block;
  margin-bottom: 14px;
  padding: 5px 14px;
  border-radius: 20px;
  background: var(--bleu);
  color: var(--blanc);
  font-size: 0.85rem;
  font-weight: 600;
}

.base-active { background: linear-gradient(135deg, #0d47a1, #08306b) !important; }

/* ===== LÉGENDE ===== */
.legend-box { width: 210px; }

.legend-items { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.88rem;    /* plus lisible qu'avant */
  color: rgba(255,255,255,0.88);
}

.legend-dot {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-block;
}

/* ===== HERO (accueil) ===== */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  background: var(--noir);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 20px;
  overflow: hidden;
}

#snowCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.hero-content { position: relative; z-index: 1; }

.hero-buttons {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 28px;
}

/* ===== PAGE STATIONS ===== */
.stations-page {
  padding: 100px 40px 60px;
  background: var(--noir);
  min-height: 100vh;
}

.stations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
  margin-top: 16px;
}

.station-card {
  background: var(--gris-m);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
  text-align: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.station-card:hover { transform: translateY(-6px); box-shadow: 0 12px 32px rgba(0,0,0,0.6); }
.station-card img { width: 100%; height: 170px; object-fit: cover; }

.station-card h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.5rem;    /* plus grand */
  letter-spacing: 0.05em;
  margin: 14px 0 6px;
  color: var(--blanc);
}

.station-card p { color: var(--texte); font-size: 0.95rem; margin-bottom: 12px; }

/* =====================================================
   RESPONSIVE MOBILE / TABLETTE
   ===================================================== */

/* ===== NAVIGATION MOBILE ===== */
@media (max-width: 700px) {
  .main-nav {
    padding: 0 6px;
    gap: 6px 10px;
    height: 52px;
    flex-wrap: nowrap;
  }
  .main-nav a {
    font-size: 0.6rem;
    letter-spacing: 0.02em;
  }
}

/* ===== CARTE MOBILE =====
   Solution propre : on décale TOUTE la zone de contrôle Leaflet
   vers le bas pour qu'elle commence sous la nav fixe */

/* Desktop : nav = 52px */
.leaflet-top {
  top: 52px;
}

/* Mobile : nav = 52px aussi (height fixe) */
@media (max-width: 700px) {
  .leaflet-top {
    top: 52px;
  }

  /* Panneaux étroits côte à côte */
  .custom-box {
    width: 115px !important;
    padding: 8px !important;
    font-size: 0.78rem !important;
  }

  .custom-box h3 {
    font-size: 0.76rem !important;
    margin-bottom: 2px !important;
    white-space: nowrap;
  }

  .custom-box button {
    font-size: 0.72rem !important;
    padding: 6px 4px !important;
    min-height: 30px !important;
    margin: 3px 0 !important;
  }

  .legend-box {
    width: 115px !important;
  }

  .legend-item {
    font-size: 0.72rem !important;
    gap: 6px !important;
  }

  .legend-dot {
    width: 11px !important;
    height: 11px !important;
  }

  /* Boutons toggle bas-droite */
  .pistes-btn {
    font-size: 0.76rem !important;
    padding: 8px 11px !important;
    min-height: 36px !important;
  }
}

/* ===== HERO MOBILE ===== */
@media (max-width: 768px) {
  .hero h1 { font-size: clamp(3rem, 12vw, 6rem); }
  .hero p { font-size: 1rem; padding: 0 10px; }
  .hero-buttons { flex-direction: column; align-items: center; }
  .btn { width: 100%; max-width: 300px; }
}

/* ===== STATS ===== */
@media (max-width: 768px) {
  .stats-bar { display: grid; grid-template-columns: 1fr 1fr; }
  .stat-item { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.07); padding: 18px 16px; }
}
@media (max-width: 480px) {
  .stat-item { padding: 14px 10px; }
  .stat-number { font-size: 2.2rem; }
}

/* ===== INTRO ===== */
@media (max-width: 900px) {
  .intro { flex-direction: column; padding: 60px 24px; gap: 40px; }
  .features { max-width: 100%; width: 100%; }
}
@media (max-width: 480px) { .features { grid-template-columns: 1fr; } }

/* ===== MINI CARDS ===== */
@media (max-width: 600px) {
  .stations-preview { padding: 50px 0; }
  .stations-row { padding: 0 16px 16px; gap: 12px; }
  .section-header h2 { font-size: 2.2rem; }
}

/* ===== CTA ===== */
@media (max-width: 600px) {
  .cta-section { padding: 50px 20px; }
  .cta-section h2 { font-size: 2rem; }
}

/* ===== GRILLE STATIONS ===== */
@media (max-width: 1100px) { .stations-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 750px)  { .stations-grid { grid-template-columns: repeat(2, 1fr); } .stations-page { padding: 90px 20px 40px; } }
@media (max-width: 480px)  { .stations-grid { grid-template-columns: 1fr; } .stations-page { padding: 80px 12px 30px; } }

/* ===== NAVIGATION MOBILE ===== */
@media (max-width: 700px) {
  .main-nav {
    padding: 0 8px;
    gap: 6px 12px;
    justify-content: center;
    flex-wrap: nowrap;
    height: 52px;
  }
  .main-nav a {
    font-size: 0.62rem;
    letter-spacing: 0.02em;
    white-space: nowrap;
  }
}

@media (max-width: 430px) {
  .main-nav { gap: 4px 8px; }
  .main-nav a { font-size: 0.56rem; }
}

/* ===== CONTRÔLES LEAFLET =====
   Force les contrôles top à commencer sous la nav (52px)
   sur TOUS les écrans — desktop et mobile */
.leaflet-top.leaflet-left,
.leaflet-top.leaflet-right {
  top: 52px !important;
}

/* ===== CARTE MOBILE ===== */
@media (max-width: 768px) {

  /* Panneaux compacts */
  .custom-box {
    width: 130px !important;
    padding: 8px !important;
  }

  .custom-box h3 {
    font-size: 0.82rem !important;
    margin-bottom: 2px !important;
    white-space: nowrap;
  }

  .custom-box button {
    font-size: 0.75rem !important;
    padding: 6px 5px !important;
    min-height: 30px !important;
    margin: 2px 0 !important;
  }

  /* Légende : texte sur une seule ligne */
  .legend-box { width: 150px !important; }

  .legend-item {
    font-size: 0.72rem !important;
    white-space: nowrap !important;
    gap: 6px !important;
  }

  .legend-dot {
    width: 11px !important;
    height: 11px !important;
    flex-shrink: 0 !important;
  }

  /* Boutons toggle bas-droite */
  .pistes-btn {
    font-size: 0.78rem !important;
    padding: 8px 12px !important;
    min-height: 36px !important;
  }
}

@media (max-width: 480px) {
  .custom-box { width: 115px !important; }
  .legend-box { width: 135px !important; }
  .pistes-btn { font-size: 0.73rem !important; padding: 7px 9px !important; }
}