/* BNEI Réseau : carte + liste des BDE (design V3). */
.bnei-bde {
	--bnei-navy: #152C55;
	--bnei-blue: #2568B0;
	--bnei-yellow: #FFEB5F;
	--bnei-ink: #1D2141;
	--bnei-muted: #5B6674;
	--bnei-line: #E3E8F0;
	--bnei-soft: #F3F6FB;
	--bnei-tint: #EAF1FB;
	--bnei-shadow: 0 8px 24px rgba(21, 44, 85, .08);
	font-family: "Open Sans", system-ui, sans-serif;
	color: var(--bnei-ink);
}
.bnei-bde *, .bnei-bde *::before, .bnei-bde *::after { box-sizing: border-box; }
.bnei-bde__layout { display: flex; flex-wrap: wrap; gap: 16px; align-items: stretch; }
.bnei-bde__mapcard { flex: 3 1 560px; min-width: 0; background: #fff; border-radius: 24px; padding: 16px; box-shadow: var(--bnei-shadow); display: flex; flex-direction: column; gap: 12px; }
.bnei-bde--nolist .bnei-bde__mapcard { flex-basis: 100%; }
.bnei-bde__map { width: 100%; border-radius: 18px; overflow: hidden; background: var(--bnei-soft); z-index: 0; }
.bnei-bde__legend { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: var(--bnei-muted); padding: 0 6px; }
.bnei-bde__legend span { display: inline-flex; align-items: center; gap: 6px; }
.bnei-bde__legend i { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }
.bnei-bde__legend i.is-l { background: var(--bnei-navy); }
.bnei-bde__legend i.is-m { background: var(--bnei-blue); }
.bnei-bde__legend i.is-s { background: #fff; border: 2px solid var(--bnei-blue); }

.bnei-bde__panel { flex: 2 1 360px; min-width: 0; background: #fff; border-radius: 24px; padding: 24px; box-shadow: var(--bnei-shadow); display: flex; flex-direction: column; gap: 14px; }
.bnei-bde__label { font-family: Montserrat, "Open Sans", sans-serif; font-weight: 700; font-size: 15px; color: var(--bnei-ink); }
.bnei-bde__search { position: relative; color: var(--bnei-muted); }
.bnei-bde__search svg { position: absolute; left: 18px; top: 50%; transform: translateY(-50%); }
.bnei-bde .bnei-bde__q { width: 100%; height: 50px; border: 1px solid var(--bnei-line); border-radius: 999px; padding: 0 18px 0 46px; font: inherit; font-size: 15px; color: var(--bnei-ink); background: #F7F9FC; }
.bnei-bde .bnei-bde__q:focus { outline: 3px solid rgba(37, 104, 176, .35); border-color: var(--bnei-blue); background: #fff; }
.bnei-bde__q::-webkit-search-cancel-button { cursor: pointer; }
.bnei-bde__filters { display: flex; gap: 8px; flex-wrap: wrap; }
.bnei-bde__filters select { flex: 1 1 140px; height: 44px; border: 1px solid var(--bnei-line); border-radius: 999px; padding: 0 14px; font: inherit; font-size: 14px; color: var(--bnei-ink); background-color: #F7F9FC; }
.bnei-bde__meta { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; min-height: 34px; }
.bnei-bde__count { font-size: 13px; font-weight: 600; color: var(--bnei-muted); }
.bnei-bde .bnei-bde__reset { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 7px 12px; background: var(--bnei-tint); color: var(--bnei-navy); font: 700 12px Montserrat, sans-serif; cursor: pointer; }
.bnei-bde .bnei-bde__reset[hidden] { display: none; }
.bnei-bde__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; overflow-y: auto; overscroll-behavior: contain; }
.bnei-bde__item { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 14px; margin: 0; }
.bnei-bde__item { cursor: pointer; transition: background .15s ease; }
.bnei-bde__item:hover, .bnei-bde__item.is-active { background: var(--bnei-soft); }
.bnei-bde__item:hover .bnei-bde__locate { background: var(--bnei-navy); color: #fff; border-color: var(--bnei-navy); }
.bnei-bde__item.is-active { box-shadow: inset 3px 0 0 var(--bnei-blue); }
.bnei-bde__avatar { width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--bnei-tint); color: var(--bnei-navy); font: 800 12px Montserrat, sans-serif; display: flex; align-items: center; justify-content: center; object-fit: cover; }
.bnei-bde__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.bnei-bde .bnei-bde__name { all: unset; font-family: Montserrat, sans-serif; font-weight: 600; font-size: 14px; line-height: 1.3; color: var(--bnei-ink); cursor: pointer; }
.bnei-bde__item:hover .bnei-bde__name { color: var(--bnei-blue); }
.bnei-bde .bnei-bde__name:focus-visible { outline: 3px solid rgba(37, 104, 176, .45); outline-offset: 2px; border-radius: 4px; }
.bnei-bde__school, .bnei-bde__place { font-size: 12px; color: var(--bnei-muted); }
.bnei-bde .bnei-bde__locate { width: 34px; height: 34px; flex: none; border-radius: 50%; border: 1px solid var(--bnei-line); background: #fff; color: var(--bnei-navy); display: inline-flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.bnei-bde__empty { margin: 0; font-size: 14px; color: var(--bnei-muted); line-height: 1.5; }
.bnei-bde__all { margin-top: auto; align-self: flex-start; display: inline-flex; align-items: center; gap: 10px; padding: 6px 6px 6px 18px; border-radius: 999px; background: var(--bnei-navy); color: #fff !important; text-decoration: none !important; font: 700 14px Montserrat, sans-serif; }
.bnei-bde__all span { width: 32px; height: 32px; border-radius: 50%; background: var(--bnei-yellow); color: var(--bnei-navy); display: inline-flex; align-items: center; justify-content: center; }
.bnei-bde__all:hover { background: var(--bnei-blue); }
.bnei-bde__tabs { display: none; }
.bnei-bde__static { columns: 2; }

/* Groupes (clusters) et repères */
.bnei-cluster { border-radius: 50%; display: flex !important; align-items: center; justify-content: center; font: 800 13px Montserrat, sans-serif; border: 2px solid #fff; box-shadow: 0 0 0 7px rgba(37, 104, 176, .16); transition: transform .15s ease; }
.bnei-cluster:hover { transform: scale(1.08); }
.bnei-cluster span { line-height: 1; }
.bnei-cluster.is-l { background: var(--bnei-navy, #152C55); color: #fff; font-size: 15px; }
.bnei-cluster.is-m { background: var(--bnei-blue, #2568B0); color: #fff; }
.bnei-cluster.is-s { background: #fff; color: var(--bnei-navy, #152C55); border-color: var(--bnei-blue, #2568B0); }
.bnei-pin span { display: block; width: 24px; height: 24px; border-radius: 50%; background: var(--bnei-blue, #2568B0); border: 3px solid #fff; box-shadow: 0 0 0 5px rgba(37, 104, 176, .2), 0 4px 10px rgba(21, 44, 85, .35); }
.leaflet-marker-icon.bnei-pin:focus span, .bnei-pin:hover span { background: var(--bnei-navy, #152C55); }
.bnei-bde .leaflet-popup-content-wrapper { border-radius: 16px; box-shadow: 0 12px 30px rgba(21, 44, 85, .18); }
.bnei-bde .leaflet-control-zoom { border: 0 !important; box-shadow: 0 4px 12px rgba(21, 44, 85, .12) !important; border-radius: 999px !important; overflow: hidden; }
.bnei-bde .leaflet-control-zoom a { width: 40px; height: 40px; line-height: 40px; color: #152C55; }
.bnei-bde .leaflet-container { font-family: "Open Sans", sans-serif; }

/* Fonds de carte : plan IGN adouci pour coller à la charte. */
.bnei-bde__map.is-tiles-gris .leaflet-tile-pane { filter: grayscale(1) brightness(1.06) contrast(.9); }
.bnei-bde__map.is-tiles-doux .leaflet-tile-pane { filter: saturate(.4) brightness(1.04) contrast(.93); }

/* Fiche BDE : bulle de la carte et fenêtre. */
.bnei-bde__map.has-popup .leaflet-control-zoom { opacity: 0; pointer-events: none; }
.bnei-bde .bnei-popup .leaflet-popup-content-wrapper { border-radius: 20px; padding: 18px 18px 16px; box-shadow: 0 18px 40px rgba(21, 44, 85, .22); }
.bnei-bde .bnei-popup .leaflet-popup-content { margin: 0; }
.bnei-bde .bnei-popup a.leaflet-popup-close-button { top: 8px; right: 8px; width: 28px; height: 28px; font: 400 20px/26px sans-serif; color: #5B6674; border-radius: 50%; }
.bnei-bde .bnei-popup a.leaflet-popup-close-button:hover { background: #F5F7FB; color: #152C55; }
.bnei-pop { display: flex; flex-direction: column; gap: 12px; font-family: "Open Sans", system-ui, sans-serif; color: #1D2141; }
.bnei-pop__head { display: flex; align-items: center; gap: 12px; padding-right: 22px; }
.bnei-pop__head > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.bnei-pop__avatar { width: 44px; height: 44px; flex: none; border-radius: 50%; background: #EAF1FB; color: #152C55; font: 800 13px Montserrat, sans-serif; display: flex; align-items: center; justify-content: center; object-fit: cover; }
.bnei-pop__name { font: 700 16px/1.25 Montserrat, sans-serif; color: #1D2141; }
.bnei-pop__school { font-size: 13px; color: #5B6674; }
.bnei-pop__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.bnei-pop__tag { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: #F5F7FB; color: #5B6674; }
.bnei-pop__tag.is-member { background: #FFEB5F; color: #152C55; }
.bnei-pop__rows { list-style: none; margin: 0; padding: 12px 0 0; border-top: 1px solid #E3E8F0; display: flex; flex-direction: column; gap: 8px; }
.bnei-pop__rows li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.45; color: #5B6674; margin: 0; }
.bnei-pop__tel { color: #152C55 !important; font-weight: 700; text-decoration: none !important; white-space: nowrap; }
.bnei-pop__tel:hover { color: #2568B0 !important; text-decoration: underline !important; }
.bnei-pop__rows svg { flex: none; margin-top: 2px; color: #2568B0; }
.bnei-pop__links { display: flex; flex-wrap: wrap; gap: 6px; }
.bnei-pop__links a { display: inline-flex; align-items: center; gap: 6px; font: 700 12px/1 Montserrat, sans-serif; padding: 8px 12px; border-radius: 999px; border: 1px solid #E3E8F0; color: #152C55 !important; background: #fff; text-decoration: none !important; transition: background .15s ease, border-color .15s ease; }
.bnei-pop__links a:hover { border-color: #152C55; }
.bnei-pop__links a.is-main { background: #152C55; border-color: #152C55; color: #fff !important; }
.bnei-pop__links a.is-main:hover { background: #2568B0; border-color: #2568B0; }

.bnei-bde__modal { position: fixed; inset: 0; z-index: 99999; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(21, 44, 85, .45); }
.bnei-bde__modal[hidden] { display: none; }
.bnei-bde__modal-card { position: relative; width: min(380px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: 22px; padding: 22px 20px 18px; box-shadow: 0 24px 60px rgba(21, 44, 85, .3); }
.bnei-bde__modal .bnei-bde__modal-close { all: unset; position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 22px; color: #5B6674; cursor: pointer; }
.bnei-bde__modal .bnei-bde__modal-close:hover { background: #F5F7FB; color: #152C55; }
.bnei-bde__modal .bnei-bde__modal-close:focus-visible { outline: 3px solid rgba(37, 104, 176, .45); }

@media (max-width: 767px) {
	.bnei-bde__tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: 12px; background: #E3E8F0; border-radius: 999px; }
	.bnei-bde__tabs button { height: 44px; border: 0; border-radius: 999px; background: transparent; color: var(--bnei-navy); font: 700 15px Montserrat, sans-serif; cursor: pointer; }
	.bnei-bde__tabs button[aria-selected="true"] { background: var(--bnei-navy); color: #fff; }
	.bnei-bde:not(.bnei-bde--nolist) .bnei-bde__panel { display: none; }
	.bnei-bde.is-list-view .bnei-bde__panel { display: flex; }
	.bnei-bde.is-list-view .bnei-bde__mapcard { display: none; }
	.bnei-bde__mapcard { padding: 10px; border-radius: 20px; }
	.bnei-bde__map { height: 440px !important; }
	.bnei-bde__panel { padding: 18px; border-radius: 20px; }
	.bnei-bde__list { max-height: none !important; }
	.bnei-bde__static { columns: 1; }
}
@media (prefers-reduced-motion: reduce) {
	.bnei-cluster { transition: none; }
}
