/* Home hero map — colored layer toggles (all on by default) + locate + map frame. */
.hm-wrap { max-width: 1100px; margin: 0 auto; }

.hm-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  justify-content: center;
  align-items: center;
  margin: 0 0 .9rem;
}
.hm-pill {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  padding: .55rem 1.05rem;
  font-size: .95rem;
  font-weight: 600;
  line-height: 1;
  color: #0f172a;
  background: #fff;
  border: 1.5px solid #cbd5e1;
  border-radius: 999px;
  cursor: pointer;
  transition: opacity .15s, border-color .15s, box-shadow .15s;
}
.hm-pill:hover { border-color: #94a3b8; }
.hm-pill .hm-dotlabel {
  width: 12px; height: 12px; border-radius: 50%; display: inline-block; flex: 0 0 auto;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .15);
}
/* Red = burglaries · Green = alarms · Blue = insurance brokers. */
.hm-pill[data-layer="cambriolages"] .hm-dotlabel { background: #ef4444; }
.hm-pill[data-layer="alarme"]       .hm-dotlabel { background: #16a34a; }
.hm-pill[data-layer="assurance"]    .hm-dotlabel { background: #2563eb; }
.hm-pill[data-layer="cambriolages"].on, .hm-pill[data-layer="cambriolages"]:not(.off) { border-color: #ef4444; }
.hm-pill[data-layer="alarme"]:not(.off)    { border-color: #16a34a; }
.hm-pill[data-layer="assurance"]:not(.off) { border-color: #2563eb; }
/* Toggled off → dimmed. */
.hm-pill.off {
  opacity: .4;
  border-color: #cbd5e1 !important;
  text-decoration: line-through;
}
.hm-pill.off .hm-dotlabel { background: #94a3b8 !important; }

.hm-locate {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  margin-left: .35rem;
  padding: .55rem 1.05rem;
  font-size: .92rem;
  font-weight: 600;
  line-height: 1;
  color: #fff;
  background: #0f172a;
  border: 1.5px solid #0f172a;
  border-radius: 999px;
  cursor: pointer;
}
.hm-locate:hover { background: #1e293b; }
.hm-locate[disabled] { opacity: .6; cursor: progress; }
.hm-locate.loading::after {
  content: ""; width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .4); border-top-color: #fff;
  display: inline-block; animation: hm-spin .7s linear infinite;
}
@keyframes hm-spin { to { transform: rotate(360deg); } }

.hm-mapbox {
  position: relative;
  border-radius: .9rem;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 14px rgba(15, 23, 42, .08);
}
.hm-map {
  width: 100%;
  height: var(--hm-height, 520px);
  background: #eef2f6;
}
.hm-map.leaflet-container { font: inherit; }

.hm-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem 1.2rem;
  margin: .8rem 0 0;
}
.hm-hint { margin: 0; font-size: .88rem; color: #64748b; flex: 1 1 280px; }
.hm-ctas { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; }
.hm-ctas a {
  font-size: .9rem; font-weight: 600; text-decoration: none; color: #2563eb; white-space: nowrap;
}
.hm-ctas a:hover { text-decoration: underline; }

/* Provider dot markers (alarme/assurance). */
.hm-dot span {
  display: block;
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, .25);
}

/* Numbered bubbles (≥4 things), tinted per layer by inline background (set in JS). */
.hm-bubble, .hm-cluster { background: transparent; }
.hm-cl {
  border-radius: 50%;
  color: #fff;
  font-weight: 700;
  font-size: .82rem;
  text-align: center;
  border: 2px solid rgba(255, 255, 255, .9);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .35);
  cursor: pointer;
}

/* Fullscreen control button. */
.hm-fs a {
  font-size: 18px; font-weight: 700; line-height: 30px; text-align: center;
  width: 30px; height: 30px; display: block; color: #0f172a; background: #fff; cursor: pointer;
}
.hm-fs a:hover { background: #f1f5f9; }
/* When the map element is fullscreen, it fills the screen (overrides the 56vh mobile height). */
#bh-map.bh-map-fs, #bh-map:fullscreen, #bh-map:-webkit-full-screen {
  width: 100% !important; height: 100% !important; max-height: none !important;
}

@media (max-width: 680px) {
  .hm-map { height: 64vh; min-height: 340px; }
  .hm-footer { flex-direction: column; align-items: stretch; }
  .hm-locate { margin-left: 0; }
  /* The choropleth legend overlays and hides the map on small screens — drop it on
     the home map (it stays on /carte/, which isn't in providers mode). */
  .bh-providers .bh-legend { display: none; }
  /* Full-bleed map on mobile: break the map row out of the page padding to 100% width. */
  .bh-providers .bh-layout {
    width: 100vw;
    max-width: 100vw;
    margin-left: 50%;
    transform: translateX(-50%);
  }
  .bh-providers .bh-map { border-radius: 0; }
}
