/* Carte des familles : contrôles compacts, filtres défilants et fiche ancrée. */
.community-map { --map-ink: #102641; --map-teal: #129fba; --map-sheet-height: 0px; --map-tools-bottom: 236px; --map-bottom: calc(var(--map-nav-clearance) + env(safe-area-inset-bottom)); color: var(--map-ink); }
.map-discovery-tools { position: absolute; z-index: 800; top: calc(64px + env(safe-area-inset-top)); left: 50%; display: grid; gap: 8px; width: min(720px, calc(100% - 24px)); transform: translateX(-50%); pointer-events: none; }
.map-discovery-tools > * { pointer-events: auto; }
.map-discovery-tools .map-overlay-panel { position: relative; inset: auto; transform: none; width: 100%; grid-template-columns: minmax(0, 1fr) 48px; gap: 8px 12px; padding: 10px 12px; border: 1px solid #fff; border-radius: 23px; background: #ffffffed; box-shadow: 0 7px 24px #254c5815; }
.map-discovery-tools .map-header { display: flex; align-items: center; gap: 12px; min-width: 0; }
.map-heading-icon { flex: 0 0 32px; width: 32px; height: 32px; color: var(--map-teal); stroke-width: 3; }
.map-discovery-tools .map-header h1 { margin: 0; font-size: clamp(1.2rem, 4.6vw, 1.6rem); line-height: 1.15; letter-spacing: -.04em; color: var(--map-ink); }
.map-discovery-tools .map-header p { margin: 2px 0 0; font-size: .9375rem; line-height: 1.2; color: #52657c; font-weight: 700; }
.map-discovery-tools .map-filter-control { justify-self: end; }
.map-discovery-tools .map-filter-trigger { display: grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: 16px; background: var(--map-teal); color: white; box-shadow: 0 5px 12px #129fba20; }
.map-filter-trigger > svg { width: 27px; height: 27px; }
.map-discovery-tools .map-filter-trigger .sr-only { position: absolute; padding: 0; }
.map-discovery-tools .map-filter-menu { left: auto; right: 0; transform: none; width: min(360px, calc(100vw - 48px)); animation: none; }
.map-discovery-tools .map-filter-menu::before { left: auto; right: 18px; }
.map-discovery-tools .map-filter-row { flex-wrap: wrap; }
.map-discovery-tools .map-filter-row button { min-height: 44px; }
.map-discovery-tools .map-action-buttons { grid-column: 1 / -1; justify-content: flex-end; }
.map-discovery-tools .map-action-buttons:not(:has(button:not([hidden]))) { display: none; }
.map-discovery-tools #mapActivityTotal { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.map-discovery-tools .map-action-buttons button { min-height: 44px; }
.map-discovery-categories { display: flex; gap: 7px; overflow-x: auto; padding: 2px 0 5px; scrollbar-width: none; overscroll-behavior-x: contain; }
.map-discovery-categories::-webkit-scrollbar { display: none; }
.map-discovery-categories button { display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 15px; border: 1px solid #e6ebea; border-radius: 28px; color: var(--map-ink); background: #fffffff5; box-shadow: 0 3px 8px #254c5814; font-size: .9375rem; font-weight: 800; white-space: nowrap; }
.map-discovery-categories button.is-active { color: white; background: var(--map-teal); border-color: white; }
.map-discovery-categories svg { width: 22px; height: 22px; }
.map-discovery-categories [data-map-category="Nature"] svg { color: #42af6a; }
.map-discovery-categories [data-map-category="Jeux"] svg { color: #9571d8; }
.map-discovery-categories [data-map-category="Créatif"] svg { color: #edaa4e; }
.map-discovery-categories button.is-active svg { color: inherit; }
.map-live-dot { display: inline-block; flex: 0 0 10px; width: 10px; height: 10px; border-radius: 50%; background: #29be63; }
.map-search-here { justify-self: center; display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 8px 21px; border: 1px solid #e8efef; border-radius: 26px; background: #fffffff5; color: #07859f; font-size: .9375rem; font-weight: 850; box-shadow: 0 6px 20px #254c5820; }
.map-search-here svg { width: 22px; height: 22px; }
.map-search-here[disabled] { opacity: .75; cursor: progress; }
.map-discovery-status { justify-self: center; margin: 0; max-width: 100%; padding: 7px 12px; border-radius: 14px; background: #fff; color: #52657c; font-size: .8125rem; box-shadow: 0 4px 12px #254c5814; }
.map-discovery-status[hidden] { display: none; }
.map-discovery-tools .map-profile-filters { position: static; width: 100%; margin: 8px 0 0; transform: none; overflow-x: auto; scrollbar-width: none; }
.map-view .community-map .leaflet-top, .map-view .community-map.has-profile-filters .leaflet-top { top: var(--map-tools-bottom); }
.community-map .leaflet-control-zoom { border-radius: 19px !important; margin-right: 12px; }
.community-map .leaflet-control-zoom a { width: 44px !important; height: 44px !important; color: #52657c !important; }
.community-map .locate-button, .community-map.has-activity-highlight .locate-button { top: calc(var(--map-tools-bottom) + 106px); right: 12px; bottom: auto; border-radius: 17px; }
.community-map .map-legend, .community-map.has-activity-highlight .map-legend { left: 50%; bottom: calc(var(--map-bottom) + var(--map-sheet-height) + 10px); transform: translateX(-50%); width: min(680px, calc(100% - 24px)); max-width: none; min-height: 38px; justify-content: space-around; flex-wrap: wrap; gap: 5px 9px; padding: 9px 12px; border-radius: 24px; color: #52657c; font-size: .75rem; font-weight: 750; background: #fffffff2; box-shadow: 0 5px 18px #254c581c; }
.community-map .map-legend i { width: 12px; height: 12px; background: #eb7198; }
.community-map .map-legend .legend-community { background: #24b9cf; }
.community-map .map-legend .legend-private { background: #9673db; }
.community-map .map-legend .legend-live { background: #29be63; }
.community-map .leaflet-bottom { bottom: var(--map-bottom); }
.community-map .leaflet-bottom.leaflet-left { bottom: calc(var(--map-bottom) + var(--map-sheet-height) + 58px); }
.community-map .leaflet-control-scale-line { border-color: #19394b; color: #19394b; background: #ffffffa8; font-size: .75rem; }
.community-map.has-activity-highlight .leaflet-control-attribution { max-width: 105px; font-size: 8px !important; }
.community-map .map-cluster { width: 58px; height: 58px; color: #102641; background: #86d4df; border: 4px solid white; box-shadow: 0 7px 20px #254c5840; }
.community-map .map-cluster::after, .community-map .map-cluster small { display: none; }
.community-map .map-cluster strong { font-size: 1.25rem; }
.community-map .pin-bubble { background: #eb7198; border-width: 3px; }
.community-map .pin-community .pin-bubble { background: #24b9cf; }
.community-map .pin-private .pin-bubble { background: #9673db; }
.map-pin-vector { width: 24px; height: 24px; transform: rotate(45deg); color: #fff; }
#leafletMap .pin-bubble > img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: 100%; object-fit: cover; border-radius: 50%; transform: rotate(45deg); }
.pin-marker.is-selected .pin-bubble { width: 58px; height: 58px; margin: -10px 0 0 -5px; box-shadow: 0 0 0 3px #eb7198, 0 8px 18px #254c5840; }
.pin-marker.is-selected .pin-label { opacity: 1; visibility: visible; display: block; top: 51px; max-width: 170px; border-radius: 20px; padding: 5px 9px; }
.map-pin-live { position: absolute; top: -12px; left: 33px; width: max-content; padding: 2px 6px; border: 2px solid white; border-radius: 12px; color: white; background: #24b962; font-size: .625rem; font-weight: 900; }
.community-map .map-activity-highlight { left: 50%; right: auto; bottom: var(--map-bottom); width: min(720px, 100%); max-width: none; min-height: 0; max-height: min(310px, 35dvh); margin: 0; padding: 20px 16px 16px; grid-template-columns: 31% minmax(0, 1fr); gap: 12px; border: 0; border-radius: 26px 26px 0 0; background: #fffffff7; box-shadow: 0 -8px 30px #254c581c; transform: translateX(-50%); animation: none; overflow-y: auto; overscroll-behavior: contain; }
.community-map .map-activity-highlight::before { content: ""; position: absolute; width: 36px; height: 4px; left: calc(50% - 18px); top: 6px; border-radius: 4px; background: #bcc4ca; }
.community-map .map-activity-highlight-visual { min-height: 145px; border-radius: 16px; }
.community-map .map-activity-highlight-copy { gap: 6px; padding: 2px 0 0; }
.community-map .map-activity-highlight-close { width: 32px; height: 32px; top: 10px; right: 8px; box-shadow: none; }
.community-map .map-activity-highlight-close::after { content: ""; position: absolute; inset: -6px; }
.community-map .map-activity-highlight-kicker { padding-right: 25px; font-size: .75rem; color: #537064; }
.community-map .map-activity-highlight-kicker .map-live-label { color: #20a853; text-transform: uppercase; }
.community-map .map-activity-highlight-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; white-space: normal; color: var(--map-ink); font-size: clamp(1.1rem, 4.4vw, 1.5rem); line-height: 1.16; }
.map-highlight-travel { display: flex; gap: 5px; align-items: start; margin: 0; color: #63758b; font-size: .8125rem; line-height: 1.25; }
.map-highlight-travel svg { flex: 0 0 16px; width: 16px; height: 18px; }
.community-map .map-activity-highlight-meta { font-size: .75rem; }
.community-map .map-activity-highlight-actions { grid-template-columns: 44px 44px minmax(0, 1fr); gap: 6px; }
.community-map .map-activity-highlight-actions :is(button, a) { min-height: 44px; padding: 6px; }
.community-map .map-activity-highlight-favorite, .community-map .map-activity-highlight-gps { width: 44px; }
.community-map .map-activity-highlight-favorite span, .community-map .map-activity-highlight-gps span:last-child { display: none; }
.community-map .map-activity-highlight-open { justify-content: flex-end; padding-inline: 0; background: transparent; box-shadow: none; color: #e56f94; font-size: .8125rem; white-space: normal; }
.community-map .map-activity-highlight-open span { overflow: visible; }
.community-map .map-activity-highlight-open svg { flex-shrink: 0; }
.community-map.is-placing-pin .map-discovery-tools { visibility: hidden; pointer-events: none; }
.map-discovery-tools :is(button, a):focus-visible, .map-activity-highlight :is(button, a):focus-visible { outline: 3px solid #129fba; outline-offset: 2px; }
body.map-active .support-widget:not(:has(.support-panel:not([hidden]))) { display: none; }
@media (max-width: 639px) {
  .community-map { --map-tools-bottom: calc(218px + env(safe-area-inset-top)); }
  .map-discovery-tools { gap: 6px; width: calc(100% - 20px); }
  .map-discovery-tools .map-overlay-panel {
    grid-template-columns: minmax(0, 1fr) 40px auto;
    gap: 6px;
    min-height: 58px;
    padding: 8px 9px;
    border-radius: 19px;
  }
  .map-discovery-tools .map-header { gap: 8px; }
  .map-heading-icon { flex-basis: 27px; width: 27px; height: 27px; }
  .map-discovery-tools .map-header h1 { font-size: 1.05rem; }
  .map-discovery-tools .map-header p { margin-top: 1px; font-size: .75rem; }
  .map-discovery-tools .map-filter-control { position: relative; grid-column: 2; grid-row: 1; }
  .map-discovery-tools .map-filter-trigger { width: 40px; height: 40px; min-height: 40px; border-radius: 13px; }
  .map-filter-trigger > svg { width: 21px; height: 21px; }
  .map-discovery-tools .map-action-buttons { grid-column: 3; grid-row: 1; gap: 4px; }
  .map-discovery-tools .map-action-buttons button,
  .map-discovery-tools :is(.car-mode-button, .add-place-button) { width: 40px; height: 40px; min-height: 40px; border-radius: 13px; }
  .map-discovery-tools :is(.car-mode-icon, .add-place-icon) { width: 40px; height: 40px; border-radius: 13px; }
  .map-discovery-categories { gap: 5px; padding: 0 0 3px; }
  .map-discovery-categories button { gap: 5px; min-height: 36px; padding: 6px 11px; border-radius: 20px; font-size: .78rem; }
  .map-discovery-categories svg { width: 17px; height: 17px; }
  .map-live-dot { flex-basis: 8px; width: 8px; height: 8px; }
  .map-search-here { gap: 7px; min-height: 38px; padding: 6px 15px; font-size: .78rem; }
  .map-search-here svg { width: 18px; height: 18px; }
  .community-map .leaflet-control-zoom a { width: 40px !important; height: 40px !important; }
  .community-map .locate-button,
  .community-map.has-activity-highlight .locate-button { top: calc(var(--map-tools-bottom) + 92px); }
  .community-map .map-legend,
  .community-map.has-activity-highlight .map-legend { min-height: 34px; padding: 7px 9px; font-size: .68rem; }
  .community-map .map-legend i { width: 9px; height: 9px; }
  .community-map .map-activity-highlight { bottom: calc(56px + env(safe-area-inset-bottom)); }
}
@media (max-width: 360px) { .map-discovery-tools { width: calc(100% - 16px); }.map-heading-icon { flex-basis: 26px; width: 26px; height: 26px; }.map-discovery-tools .map-header { gap: 8px; }.map-discovery-tools .map-header p { font-size: .8125rem; }.community-map .map-activity-highlight { padding-inline: 10px; grid-template-columns: 26% minmax(0, 1fr); gap: 8px; }.community-map .map-legend { font-size: .6875rem; padding-inline: 8px; gap: 4px; } }
@media (max-height: 700px) and (max-width: 639px) {
  .community-map .map-activity-highlight { max-height: 150px; padding-top: 16px; padding-bottom: 10px; }
  .community-map .map-activity-highlight-visual { min-height: 120px; }
  .community-map .map-activity-highlight-title { -webkit-line-clamp: 1; font-size: 1rem; }
  .community-map .map-activity-highlight-meta { display: none; }
  .community-map .map-activity-highlight-copy { gap: 3px; }
  .map-highlight-travel { font-size: .75rem; }
  .community-map .leaflet-control-zoom { display: flex; }
  .community-map .leaflet-control-zoom a + a { border-top: 0 !important; border-left: 1px solid #e2e9eb !important; }
  .community-map .locate-button, .community-map.has-activity-highlight .locate-button { top: calc(var(--map-tools-bottom) + 10px); right: 108px; }
  .community-map .map-legend, .community-map.has-activity-highlight .map-legend { flex-wrap: nowrap; font-size: .625rem; gap: 4px; }
  .community-map .map-legend i { width: 8px; height: 8px; }
}
@media (max-height: 600px) and (min-width: 640px) {
  .map-discovery-tools { left: 12px; width: 330px; transform: none; }
  .community-map .map-activity-highlight { left: auto; right: 12px; width: min(430px, calc(100% - 366px)); transform: none; max-height: 40dvh; }
  .community-map .map-activity-highlight-visual { min-height: 108px; }
  .community-map .map-activity-highlight-copy { gap: 3px; }
  .community-map .map-activity-highlight-title { -webkit-line-clamp: 1; font-size: 1.1rem; }
  .community-map .map-activity-highlight-meta { display: none; }
  .community-map .map-legend, .community-map.has-activity-highlight .map-legend { left: 12px; right: auto; width: 330px; transform: none; bottom: calc(var(--map-bottom) + 6px); font-size: .625rem; }
  .map-view .community-map .leaflet-top, .map-view .community-map.has-profile-filters .leaflet-top { top: 65px; }
  .community-map .leaflet-control-zoom { display: flex; }
  .community-map .leaflet-control-zoom a + a { border-top: 0 !important; border-left: 1px solid #e2e9eb !important; }
  .community-map .locate-button, .community-map.has-activity-highlight .locate-button { top: 75px; right: 108px; }
  .community-map .leaflet-bottom.leaflet-left { left: 355px; bottom: var(--map-bottom); }
}
html[data-theme="dark"] .community-map { --map-ink: #e1edf4; }
html[data-theme="dark"] .map-discovery-tools .map-overlay-panel, html[data-theme="dark"] .map-discovery-categories button:not(.is-active), html[data-theme="dark"] .map-discovery-tools .map-filter-menu, html[data-theme="dark"] .map-search-here, html[data-theme="dark"] .map-discovery-status, html[data-theme="dark"] .community-map .map-legend, html[data-theme="dark"] .community-map .map-activity-highlight { background: #19282df5; border-color: #31484e; color: #dfebf1; }
html[data-theme="dark"] .map-discovery-tools .map-header p, html[data-theme="dark"] .map-highlight-travel { color: #aec1ce; }
