* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Segoe UI', Arial, sans-serif;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
}

/* Barre du haut (titre + filtres) */
#interface {
  background: #145692;
  color: white;
  padding: 12px 20px;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

#entete h1 { font-size: 1.3em; }
#entete p { font-size: 0.9em; opacity: 0.9; margin-top: 2px; }

/* Barre de recherche libre */
#recherche-bloc { margin-top: 10px; }
#filtre-recherche {
  width: 100%;
  max-width: 420px;
  padding: 8px 12px;
  border-radius: 20px;
  border: none;
  font-size: 0.9em;
  font-family: inherit;
}
#filtre-recherche:focus { outline: 2px solid #7fd1ff; }

/* Filtres : mis en ligne avec flexbox */
/* doc utilisée : https://css-tricks.com/snippets/css/a-guide-to-flexbox/ */
#filtres {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

#filtres select,
#filtres button {
  font-family: inherit;
  font-size: 0.85em;
  padding: 6px 10px;
  border-radius: 6px;
  border: none;
  cursor: pointer;
}

#filtres select {
  background: white;
  color: #145692;
}

#filtres button {
  background: #0d3f6e;
  color: white;
  border: 1px solid rgba(255,255,255,0.3);
}
#filtres button:hover { background: #0a3255; }

#label-toggle-lieux {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85em;
  cursor: pointer;
}

/* La carte prend tout l'espace restant */
#map {
  flex: 1;
  z-index: 1;
  position: relative;
}

/* Message affiché pendant le chargement des 2 fichiers geojson */
#chargement {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: white;
  padding: 14px 22px;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.25);
  z-index: 2000;
  font-size: 0.95em;
  color: #145692;
}

/* Légende (repliable via <details>) */

#legende {
  position: absolute;
  bottom: 30px;
  right: 10px;
  z-index: 1000;
  background: white;
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
  max-width: 260px;
  max-height: 60vh;
  overflow-y: auto;
  font-size: 0.85em;
}

#legende summary {
  font-weight: bold;
  color: #145692;
  cursor: pointer;
  margin-bottom: 6px;
  list-style: none; /* on enlève le triangle par défaut du navigateur */
}
#legende summary::-webkit-details-marker { display: none; }
#legende summary::before { content: "▸ "; }
#legende[open] summary::before { content: "▾ "; }

.legende-titre {
  font-size: 0.8em;
  color: #555;
  text-transform: uppercase;
  margin-top: 8px;
  margin-bottom: 4px;
  grid-column: 1 / -1; /* le titre prend toute la largeur, au-dessus des 2 colonnes */
}

.legende-note {
  font-size: 0.72em;
  color: #777;
  margin-top: 8px;
  font-style: italic;
  grid-column: 1 / -1;
}

/* Grille à 2 colonnes : la légende prend moins de hauteur à l'écran */
#legende .legende-grille {
  display: grid;
  grid-template-columns: 1fr 1fr;
  column-gap: 10px;
}

.legende-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
  color: #222;
}

/* Pastille de couleur : ronde pour une fresque, carrée pour un lieu */
.point {
  display: inline-block;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border: 2px solid white;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.25);
}
.point.rond  { border-radius: 50%; }
.point.carre { border-radius: 3px; }

/* Pastille à pictogramme pour les lieux patrimoniaux */
.icone-lieu {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 14px;
  border: 2px solid white;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.3);
}
.icone-lieu.icone-lieu-mini {
  width: 16px;
  height: 16px;
  font-size: 9px;
  border-width: 1px;
}

/* Contenu des popups             */

.popup-fresque { max-width: 240px; }
.popup-fresque img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-radius: 4px;
}

.popup-fresque .badge-type {
  display: inline-block;
  font-size: 0.7em;
  background: #145692;
  color: white;
  padding: 2px 8px;
  border-radius: 10px;
  margin-top: 6px;
}

.popup-fresque h3 { margin: 6px 0 4px; }
.popup-fresque .accroche { font-style: italic; margin-bottom: 6px; }
.popup-fresque .details { font-size: 0.85em; color: #333; margin-bottom: 6px; }

.btn-lire-plus {
  background: none;
  border: none;
  color: #145692;
  font-size: 0.8em;
  cursor: pointer;
  padding: 0;
  margin-bottom: 6px;
}

.description-complete {
  display: none;
  font-size: 0.85em;
  color: #333;
  margin-bottom: 6px;
}

.popup-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 4px 10px;
  font-size: 0.8em;
  border-top: 1px solid #eee;
  padding-top: 6px;
}

/* Bulle de cluster (regroupement de marqueurs) */
.cluster-bulle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #003b73;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  border: none;
}


/* Responsive : écrans étroits (mobile / tablette) */

@media (max-width: 800px) {

  #entete h1 { font-size: 1.1em; }

  #legende {
    max-width: 180px;
    font-size: 0.78em;
    bottom: 10px;
    right: 6px;
  }
}
