/* ==========================================================================
   Voyage Islande — feuille de style
   ========================================================================== */

:root {
  --bg:        #0f1720;
  --bg-panel:  #16212e;
  --bg-card:   #1c2a38;
  --border:    #2a3a4a;
  --text:      #e6edf3;
  --text-dim:  #9fb0c0;
  --accent:    #38bdf8;
  --accent-2:  #f59e0b;
  --radius:    12px;
  --shadow:    0 2px 10px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

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

/* ---- En-tête ---- */
header.hero {
  padding: 28px 20px 20px;
  text-align: center;
  background: linear-gradient(160deg, #12212e, #0f1720);
  border-bottom: 1px solid var(--border);
}
header.hero h1 { margin: 0 0 4px; font-size: 1.7rem; letter-spacing: .5px; }
header.hero p  { margin: 0; color: var(--text-dim); font-size: .95rem; }

/* ---- Navigation collante ---- */
nav.mainnav {
  position: sticky;
  top: 0;
  z-index: 1000;
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 10px;
  background: rgba(15,23,32,.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--border);
}
nav.mainnav a {
  color: var(--text);
  text-decoration: none;
  font-size: .9rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: background .15s, border-color .15s;
}
nav.mainnav a:hover { background: #24384a; border-color: var(--accent); }

/* ---- Sections ---- */
main { max-width: 1100px; margin: 0 auto; padding: 8px 16px 60px; }
section { padding-top: 26px; scroll-margin-top: 70px; }
section > h2 {
  font-size: 1.35rem;
  margin: 0 0 14px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

/* ---- Carte ---- */
#map {
  height: clamp(420px, 72vh, 820px);
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: .85rem;
}
.legend-item { display: flex; align-items: center; gap: 6px; color: var(--text-dim); }
.legend-dot { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; flex: 0 0 auto; }
.legend-line { width: 22px; height: 0; border-top: 3px solid; flex: 0 0 auto; }

/* ---- Grille de cartes ---- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  transition: transform .12s, border-color .12s;
}
.card.clickable { cursor: pointer; }
.card.clickable:hover { transform: translateY(-2px); border-color: var(--accent); }
.card h3 { margin: 0 0 6px; font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.card p  { margin: 6px 0; font-size: .9rem; color: var(--text-dim); }
.card a  { color: var(--accent); font-size: .85rem; }

/* Puce catégorie / type */
.badge {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  color: #fff;
  vertical-align: middle;
}
.card .meta { font-size: .82rem; color: var(--text-dim); }
.card .meta strong { color: var(--text); }

/* Regroupement POI par catégorie */
.cat-group { margin-bottom: 22px; }
.cat-group > h3.cat-title {
  font-size: 1rem;
  margin: 0 0 10px;
  color: var(--text);
  display: flex; align-items: center; gap: 8px;
}

/* Avertissement mis en avant */
.warn {
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(245,158,11,.12);
  border-left: 3px solid var(--accent-2);
  border-radius: 6px;
  font-size: .84rem;
  color: #f8d489;
}

/* ---- Pied de page ---- */
footer {
  text-align: center;
  padding: 24px 16px 40px;
  color: var(--text-dim);
  font-size: .82rem;
  border-top: 1px solid var(--border);
}

/* Marqueur POI : badge emoji cerclé de la couleur de la catégorie */
.poi-icon { background: none; border: none; }
.poi-pin {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 23px;
  line-height: 1;
  background: #ffffff;
  border: 2px solid #757575;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .45);
}

/* Marqueur station-service */
.fuel-icon { background: none; border: none; }
.fuel-pin {
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  line-height: 1;
  background: #ffffff;
  border: 2px solid #1565C0;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, .4);
}

/* Popups Leaflet lisibles sur thème sombre laissés par défaut (fond blanc). */
.leaflet-popup-content { font-size: .88rem; }
.leaflet-popup-content h4 { margin: 0 0 4px; }
.leaflet-popup-content a { color: #0b74c4; }

/* ---- Bouton discret de mise à jour des données ---- */
.btn-maj {
  margin-top: 10px;
  font: inherit;
  font-size: .78rem;
  color: var(--text-dim);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
  cursor: pointer;
  transition: color .15s, border-color .15s, background .15s;
}
.btn-maj:hover:not(:disabled) { color: var(--text); border-color: var(--accent); background: var(--bg-card); }
.btn-maj:disabled { opacity: .6; cursor: progress; }
.maj-status { display: inline-block; margin-left: 8px; font-size: .78rem; color: var(--text-dim); }

/* ---- Responsive (mobile) ---- */
@media (max-width: 600px) {
  /* En-tête compact pour laisser la place à la carte */
  header.hero { padding: 16px 14px 12px; }
  header.hero h1 { font-size: 1.2rem; }
  header.hero p { font-size: .82rem; }

  nav.mainnav { padding: 8px; gap: 5px; }
  nav.mainnav a { padding: 6px 12px; font-size: .82rem; }

  main { padding: 6px 12px 50px; }

  /* Carte : grande et bord à bord (déborde le padding de main) */
  #map {
    height: 80vh;
    margin-left: -12px;
    margin-right: -12px;
    width: auto;
    border-left: none;
    border-right: none;
    border-radius: 0;
  }
  section#carte { scroll-margin-top: 58px; }

  /* Contrôles Leaflet un peu plus gros pour le tactile */
  .leaflet-touch .leaflet-bar a { width: 34px; height: 34px; line-height: 34px; }
  .leaflet-control-layers { font-size: .82rem; }

  /* Une seule colonne de fiches, plus confortable */
  .grid { grid-template-columns: 1fr; }
}
