/* ===== PAGE NOS GARES — Styles spécifiques ===== */

/* Hero "Nos gares" */
.hero--gares {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background-image: url('../assets/images/hero/hero_carte.png');
  background-size: cover;
  background-position: center;
  aspect-ratio: 1024 / 287;
  max-height: 280px;
}

.hero--gares::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0.4) 0%,
    rgba(0, 0, 0, 0.15) 40%,
    rgba(0, 0, 0, 0) 75%
  );
  pointer-events: none;
}

.gares-hero__title {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(28px, 5vw, 48px);
  font-weight: 700;
  color: #000;
  text-shadow: 0 0 8px rgba(255, 255, 255, 1), 0 0 16px rgba(255, 255, 255, 0.9), 0 1px 4px rgba(255, 255, 255, 0.8);
  margin: 0;
  pointer-events: none;
  z-index: 2;
}

/* Layout principal : sidebar + carte */
.gares-main {
  display: flex;
  min-height: 320px;
  max-height: 58vh;
}

.gares-sidebar {
  width: 340px;
  min-width: 280px;
  flex-shrink: 0;
  background: var(--white);
  border-right: 1px solid #e8e8e8;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.gares-sidebar__title {
  font-family: 'Baloo 2', cursive;
  font-size: 20px;
  font-weight: 600;
  color: var(--grey-title);
  padding: 24px 20px 16px;
  margin: 0;
  line-height: 1.3;
}

/* Champ de recherche */
.gares-search {
  position: relative;
  padding: 0 20px 16px;
}

.gares-search__icon {
  position: absolute;
  left: 36px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--grey-title);
  font-size: 16px;
  opacity: 0.7;
  pointer-events: none;
}

.gares-search__input {
  width: 100%;
  padding: 12px 16px 12px 40px;
  font-family: 'Roboto', sans-serif;
  font-size: 15px;
  color: var(--grey-body);
  border: 1px solid #ddd;
  border-radius: 8px;
  background: var(--white);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.gares-search__input::placeholder {
  color: #999;
}

.gares-search__input:focus {
  outline: none;
  border-color: var(--blue-secondary);
  box-shadow: 0 0 0 3px rgba(162, 218, 250, 0.3);
}

/* Liste des lieux */
.gares-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 20px 20px;
  margin: 0;
  list-style: none;
}

.gares-list__item {
  padding: 14px 12px;
  margin-bottom: 4px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.2s;
  border-left: 3px solid transparent;
}

.gares-list__item:hover {
  background: rgba(196, 231, 251, 0.35);
}

.gares-list__item.is-active {
  background: rgba(196, 231, 251, 0.5);
  border-left-color: var(--blue-secondary);
}

.gares-list__item.is-hidden {
  display: none;
}

.gares-list__name {
  display: block;
  font-family: 'Baloo 2', cursive;
  font-weight: 600;
  font-size: 15px;
  color: var(--grey-title);
  margin-bottom: 4px;
}

.gares-list__address {
  display: block;
  font-size: 13px;
  color: #666;
  line-height: 1.4;
}

/* Carte */
.gares-map-wrap {
  flex: 1;
  min-width: 0;
  position: relative;
}

.gares-map {
  width: 100%;
  height: 100%;
  min-height: 320px;
  background: #e8e8e8;
}

/* Message aucun résultat */
.gares-list__empty {
  padding: 24px 20px;
  text-align: center;
  font-size: 14px;
  color: #888;
  display: none;
}

.gares-list__empty.is-visible {
  display: block;
}

/* Marqueurs Leaflet personnalisés */
.gares-marker {
  background: none !important;
  border: none !important;
}

.gares-marker__pin {
  display: block;
  width: 28px;
  height: 28px;
  background: var(--blue-secondary);
  border: 3px solid var(--white);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.leaflet-popup-content-wrapper {
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.leaflet-popup-content {
  margin: 12px 16px;
  font-family: 'Roboto', sans-serif;
  min-width: 180px;
}

.gares-popup strong {
  font-family: 'Baloo 2', cursive;
  font-size: 15px;
  color: var(--grey-title);
}

.gares-popup__address {
  font-size: 13px;
  color: #666;
  margin-top: 4px;
  display: block;
}

/* Responsive */
@media (max-width: 900px) {
  .gares-main {
    flex-direction: column;
    max-height: none;
    min-height: auto;
  }

  .gares-sidebar {
    width: 100%;
    min-width: 0;
    max-height: 45vh;
    border-right: none;
    border-bottom: 1px solid #e8e8e8;
  }

  .gares-map {
    min-height: 55vh;
  }
}

@media (max-width: 768px) {
  .hero--gares {
    max-height: 200px;
  }

  .gares-sidebar {
    max-height: 40vh;
  }

  .gares-sidebar__title {
    font-size: 18px;
    padding: 16px 16px 12px;
  }

  .gares-search {
    padding: 0 16px 12px;
  }

  .gares-search__icon {
    left: 32px;
  }

  .gares-list {
    padding: 0 8px 16px 16px;
  }
}
