{"id":23813700,"date":"2026-06-19T15:54:44","date_gmt":"2026-06-19T15:54:44","guid":{"rendered":"https:\/\/socialhackerslab.com\/?page_id=23813700"},"modified":"2026-09-28T13:31:42","modified_gmt":"2026-09-28T13:31:42","slug":"carte-metropole-2","status":"publish","type":"page","link":"https:\/\/socialhackerslab.com\/en\/carte-metropole-2\/","title":{"rendered":"Carte m\u00e9tropole"},"content":{"rendered":"<!-- ============================================================\r\n     CARTE M\u00c9TROPOLE AIX-MARSEILLE-PROVENCE \u2014 Associations accompagn\u00e9es\r\n     - Vraie g\u00e9om\u00e9trie (contours officiels communes, charg\u00e9s au runtime)\r\n     - Sectorisation : 6 conseils de territoire OU 16 arrondissements de Marseille\r\n     - Zoom \/ d\u00e9zoom anim\u00e9s (D3)\r\n     - \u00c0 coller dans un bloc \"HTML personnalis\u00e9\" WordPress\r\n     \u25ba Pour modifier les assos : \u00e9diter l'objet ASSOS plus bas (code INSEE -> [noms])\r\n   ============================================================ -->\r\n<div id=\"amp-map\">\r\n  <div class=\"amp-top\">\r\n    <div class=\"amp-head\">\r\n      <div class=\"amp-eyebrow\">SOCIAL HACKERS LAB<\/div>\r\n      <div class=\"amp-title\">Associations accompagn\u00e9es<\/div>\r\n      <div class=\"amp-sub\">M\u00e9tropole Aix-Marseille-Provence<\/div>\r\n    <\/div>\r\n    <div class=\"amp-ctrl\">\r\n      <button class=\"amp-chip amp-on\" data-view=\"zones\">Zones m\u00e9tropole<\/button>\r\n      <button class=\"amp-chip\" data-view=\"arr\">Marseille<\/button>\r\n      <button class=\"amp-chip amp-reset\" data-view=\"reset\">\u21ba Vue d'ensemble<\/button>\r\n    <\/div>\r\n  <\/div>\r\n\r\n  <div class=\"amp-stage\" id=\"amp-stage\">\r\n    <svg id=\"amp-svg\"><\/svg>\r\n    <div class=\"amp-tip\" id=\"amp-tip\"><\/div>\r\n    <aside class=\"amp-panel\" id=\"amp-panel\" aria-hidden=\"true\">\r\n      <div class=\"amp-panel-bar\" id=\"amp-panel-bar\"><\/div>\r\n      <div class=\"amp-panel-hd\" id=\"amp-panel-hd\">\r\n        <button class=\"amp-panel-close\" id=\"amp-panel-close\" aria-label=\"Fermer\">\u2190 Retour<\/button>\r\n        <div class=\"amp-panel-eyebrow\" id=\"amp-panel-eyebrow\"><\/div>\r\n        <div class=\"amp-panel-title\" id=\"amp-panel-title\"><\/div>\r\n        <div class=\"amp-panel-count\" id=\"amp-panel-count\"><\/div>\r\n      <\/div>\r\n      <div class=\"amp-panel-list\" id=\"amp-panel-list\"><\/div>\r\n    <\/aside>\r\n    <div class=\"amp-loader\" id=\"amp-loader\">Chargement de la carte\u2026<\/div>\r\n  <\/div>\r\n\r\n  <div class=\"amp-legend\" id=\"amp-legend\"><\/div>\r\n\r\n  <!-- Lecteur : ouvert au clic sur une capsule, ferm\u00e9 par \u00c9chap, la croix ou le fond.\r\n       L'iframe n'est cr\u00e9\u00e9e qu'\u00e0 l'ouverture et d\u00e9truite \u00e0 la fermeture \u2014 rien n'est\r\n       charg\u00e9 chez la plateforme vid\u00e9o tant que le visiteur n'a pas cliqu\u00e9. -->\r\n  <div class=\"amp-vmodal\" id=\"amp-vmodal\" aria-hidden=\"true\" role=\"dialog\" aria-modal=\"true\" aria-label=\"T\u00e9moignage vid\u00e9o\">\r\n    <div class=\"amp-vmodal-box\">\r\n      <button class=\"amp-vmodal-close\" id=\"amp-vmodal-close\" aria-label=\"Fermer la vid\u00e9o\">\u2715<\/button>\r\n      <div class=\"amp-vmodal-title\" id=\"amp-vmodal-title\"><\/div>\r\n      <div class=\"amp-vmodal-frame\" id=\"amp-vmodal-frame\"><\/div>\r\n    <\/div>\r\n  <\/div>\r\n<\/div>\r\n\r\n<style>\r\n@import url('https:\/\/fonts.googleapis.com\/css2?family=Manrope:wght@500;600;700;800&display=swap');\r\n#amp-map{\r\n  --bg:#fbfaf8; --ink:#24476d; --muted:#6d7580; --border:#e7dfd9; --accent:#6d4f84;\r\n  --marker:#e0a32a; --font:'Manrope',system-ui,sans-serif;\r\n  font-family:var(--font); color:var(--ink); background:var(--bg);\r\n  \/* Plein \u00e9cran (uniquement l\u00e0 o\u00f9 le bloc est pos\u00e9) *\/\r\n  position:fixed !important; inset:0 !important;\r\n  width:100vw !important; height:100vh !important; max-width:none !important;\r\n  margin:0 !important; padding:16px 20px 12px !important;\r\n  border:none !important; border-radius:0 !important;\r\n  box-sizing:border-box; z-index:999999; isolation:isolate;\r\n  display:flex; flex-direction:column; overflow:hidden;\r\n}\r\nbody.admin-bar #amp-map{top:32px !important; height:calc(100vh - 32px) !important;}\r\n@media(max-width:782px){ body.admin-bar #amp-map{top:46px !important; height:calc(100vh - 46px) !important;} }\r\nhtml:has(#amp-map), body:has(#amp-map){margin:0 !important;padding:0 !important;overflow:hidden !important;}\r\n\/* Masque le chrome du th\u00e8me UNIQUEMENT sur la page qui h\u00e9berge la carte (via :has) *\/\r\nbody:has(#amp-map) .entry-title,\r\nbody:has(#amp-map) .page-title,\r\nbody:has(#amp-map) h1.elementor-heading-title,\r\nbody:has(#amp-map) .nv-page-title,\r\nbody:has(#amp-map) .site-header,\r\nbody:has(#amp-map) header.site-header,\r\nbody:has(#amp-map) .site-footer,\r\nbody:has(#amp-map) footer.site-footer{display:none !important;}\r\n#amp-map *{box-sizing:border-box}\r\n#amp-map .amp-top{display:flex;align-items:center;justify-content:space-between;gap:12px 20px;flex-wrap:wrap;margin-bottom:10px}\r\n#amp-map .amp-head{margin-bottom:0}\r\n#amp-map .amp-eyebrow{font-size:.62rem;font-weight:800;letter-spacing:.14em;color:var(--muted)}\r\n#amp-map .amp-title{font-size:1.25rem;font-weight:800;line-height:1.1;margin-top:1px}\r\n#amp-map .amp-sub{font-size:.78rem;font-weight:600;color:var(--accent);margin-top:1px}\r\n#amp-map .amp-ctrl{display:flex;flex-wrap:wrap;gap:.4rem;margin-bottom:0}\r\n#amp-map .amp-chip{\r\n  font-family:var(--font);font-size:.7rem;font-weight:800;letter-spacing:.04em;\r\n  background:#fff;border:1.5px solid var(--border);color:var(--ink);\r\n  padding:.42rem .8rem;border-radius:999px;cursor:pointer;transition:.16s;\r\n}\r\n#amp-map .amp-chip:hover{border-color:var(--accent);color:var(--accent)}\r\n#amp-map .amp-chip.amp-on{background:var(--accent);border-color:var(--accent);color:#fff}\r\n#amp-map .amp-reset{margin-left:auto;color:var(--muted)}\r\n#amp-map .amp-stage{\r\n  position:relative;width:100%;flex:1 1 auto;min-height:0;\r\n  background:linear-gradient(180deg,#eef4f8,#e7eef4);\r\n  border:1px solid var(--border);border-radius:14px;overflow:hidden;\r\n}\r\n\/* Cible UNIQUEMENT le SVG de la carte : sinon la r\u00e8gle width\/height:100%\r\n   \u00e9tire aussi les petites ic\u00f4nes inline du panneau (pin secteur, lien Erasmus\u2026). *\/\r\n#amp-map #amp-svg{display:block;width:100%;height:100%;cursor:grab}\r\n#amp-map #amp-svg:active{cursor:grabbing}\r\n\/* Ic\u00f4nes inline (fiches, contact, meta) : garder leur taille intrins\u00e8que *\/\r\n#amp-map .amp-panel svg{width:auto;height:auto;display:inline-block}\r\n#amp-map .amp-zone{stroke:#fff;stroke-width:.6px;cursor:pointer;transition:fill-opacity .2s,filter .2s}\r\n#amp-map .amp-zone:hover{filter:brightness(1.12)}\r\n#amp-map .amp-zborder{fill:none;stroke:#fff;stroke-width:1.6px;vector-effect:non-scaling-stroke;pointer-events:none}\r\n#amp-map .amp-arr{stroke:#fff;stroke-width:.6px;cursor:pointer;transition:.18s}\r\n#amp-map .amp-arr:hover{filter:brightness(1.12)}\r\n#amp-map .amp-zlabel{font-size:12px;font-weight:800;fill:#fff;text-anchor:middle;pointer-events:none;\r\n  paint-order:stroke;stroke:rgba(36,71,109,.55);stroke-width:3px;stroke-linejoin:round;letter-spacing:.02em}\r\n#amp-map .amp-alabel{font-size:9px;font-weight:800;fill:var(--ink);text-anchor:middle;pointer-events:none;\r\n  paint-order:stroke;stroke:rgba(255,255,255,.9);stroke-width:2.4px;stroke-linejoin:round}\r\n#amp-map .amp-asso circle,\r\n#amp-map .amp-arr-bubble circle{fill:var(--marker);stroke:#fff;stroke-width:1.6px;cursor:pointer;\r\n  filter:drop-shadow(0 2px 3px rgba(36,71,109,.3))}\r\n#amp-map .amp-asso text,\r\n#amp-map .amp-arr-bubble text{font-size:10px;font-weight:800;fill:#3a2a00;text-anchor:middle;pointer-events:none;dominant-baseline:central}\r\n#amp-map .amp-tip{position:absolute;z-index:30;max-width:240px;padding:.55rem .7rem;border-radius:10px;\r\n  background:rgba(255,255,255,.97);border:1px solid var(--border);box-shadow:0 10px 28px rgba(36,71,109,.16);\r\n  font-size:.76rem;pointer-events:none;opacity:0;transform:translateY(6px);transition:.14s}\r\n#amp-map .amp-tip.amp-show{opacity:1;transform:translateY(0)}\r\n#amp-map .amp-tip b{color:var(--ink);font-weight:800}\r\n#amp-map .amp-tip .amp-tip-meta{color:var(--accent);font-weight:700;margin-top:2px;font-size:.7rem}\r\n#amp-map .amp-tip ul{margin:.3rem 0 0;padding-left:1rem;color:var(--muted);font-weight:600}\r\n#amp-map .amp-loader{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;\r\n  color:var(--muted);font-weight:700;font-size:.85rem;background:var(--bg)}\r\n#amp-map .amp-legend{display:flex;flex-wrap:wrap;gap:.5rem .9rem;margin-top:12px;font-size:.74rem;color:var(--muted);font-weight:700}\r\n#amp-map .amp-legend span{display:inline-flex;align-items:center;gap:.4rem}\r\n#amp-map .amp-legend i{width:13px;height:13px;border-radius:3px;display:inline-block}\r\n#amp-map .amp-legend i.amp-dot{border-radius:50%}\r\n\r\n\/* \u2500\u2500 Capsules vid\u00e9o pos\u00e9es sur la carte \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\r\n   Chaque capsule est un groupe SVG ancr\u00e9 sur le centro\u00efde du territoire, avec\r\n   un trait de rappel vers la vignette. Le groupe est contre-mis \u00e0 l'\u00e9chelle\r\n   dans rescale() : la vignette garde donc la m\u00eame taille \u00e0 l'\u00e9cran quel que\r\n   soit le zoom, pendant que son point d'ancrage reste coll\u00e9 au territoire. *\/\r\n#amp-map .amp-video{cursor:pointer}\r\n#amp-map .amp-video-leader{stroke:var(--ink);stroke-width:1.4;stroke-dasharray:3 3;opacity:.75}\r\n#amp-map .amp-video-anchor{fill:#e0a32a;stroke:#fff;stroke-width:1.6}\r\n#amp-map .amp-video-card{fill:#fff;stroke:var(--ink);stroke-width:1.4;\r\n  filter:drop-shadow(0 4px 10px rgba(36,71,109,.28))}\r\n#amp-map .amp-video-label{font-family:Manrope,system-ui,sans-serif;font-size:8.5px;font-weight:800;\r\n  fill:var(--ink);letter-spacing:.01em}\r\n#amp-map .amp-video-sub{font-family:Manrope,system-ui,sans-serif;font-size:7px;font-weight:700;\r\n  fill:var(--muted)}\r\n#amp-map .amp-video-play{fill:rgba(255,255,255,.94)}\r\n#amp-map .amp-video-play-tri{fill:#c63a3a}\r\n#amp-map .amp-video-hit{fill:transparent}\r\n#amp-map .amp-video:hover .amp-video-card{stroke:var(--accent);stroke-width:2}\r\n#amp-map .amp-video:hover .amp-video-play{fill:#fff}\r\n#amp-map .amp-video:focus{outline:none}\r\n#amp-map .amp-video:focus-visible .amp-video-card{stroke:var(--accent);stroke-width:2.4}\r\n\r\n\/* \u2500\u2500 Lecteur \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 *\/\r\n#amp-map .amp-vmodal{position:fixed;inset:0;z-index:9999;display:none;\r\n  align-items:center;justify-content:center;padding:24px;\r\n  background:rgba(20,28,40,.72);backdrop-filter:blur(3px)}\r\n#amp-map .amp-vmodal.amp-open{display:flex}\r\n#amp-map .amp-vmodal-box{position:relative;width:min(920px,100%);background:#0f1620;\r\n  border-radius:14px;overflow:hidden;box-shadow:0 24px 60px rgba(0,0,0,.5)}\r\n#amp-map .amp-vmodal-title{font-family:Manrope,system-ui,sans-serif;color:#fff;font-weight:800;\r\n  font-size:.9rem;padding:.85rem 3rem .85rem 1.1rem}\r\n#amp-map .amp-vmodal-frame{position:relative;width:100%;aspect-ratio:16\/9;background:#000}\r\n\/* Les Shorts sont tourn\u00e9s en 9\/16 : dans un cadre 16\/9 ils se retrouvent\r\n   encadr\u00e9s de deux grosses bandes noires. On bascule le format du lecteur. *\/\r\n#amp-map .amp-vmodal-box.amp-vshort{width:min(420px,100%)}\r\n#amp-map .amp-vmodal-box.amp-vshort .amp-vmodal-frame{aspect-ratio:9\/16}\r\n#amp-map .amp-vmodal-frame iframe{position:absolute;inset:0;width:100%;height:100%;border:0}\r\n#amp-map .amp-vmodal-close{position:absolute;top:.55rem;right:.6rem;z-index:2;\r\n  width:34px;height:34px;border-radius:50%;border:0;cursor:pointer;\r\n  background:rgba(255,255,255,.14);color:#fff;font-size:1rem;line-height:1;font-weight:700}\r\n#amp-map .amp-vmodal-close:hover{background:rgba(255,255,255,.28)}\r\n#amp-map .amp-vconsent{position:absolute;inset:0;display:flex;flex-direction:column;\r\n  align-items:center;justify-content:center;gap:.5rem;padding:1.5rem;text-align:center;\r\n  font-family:Manrope,system-ui,sans-serif;color:#e8eef5;background:#0f1620}\r\n#amp-map .amp-vconsent p{margin:0;font-size:.86rem;font-weight:600;max-width:34ch;line-height:1.45}\r\n#amp-map .amp-vconsent-btn{margin-top:.5rem;padding:.55rem 1.1rem;border:0;border-radius:999px;\r\n  cursor:pointer;font-family:inherit;font-weight:800;font-size:.82rem;color:#0f1620;background:#e0a32a}\r\n#amp-map .amp-vconsent-btn:hover{background:#f0b943}\r\n@media (max-width:640px){\r\n  #amp-map .amp-vmodal{padding:12px}\r\n}\r\n@media(max-width:600px){\r\n  #amp-map{padding:12px 14px 10px !important}\r\n  #amp-map .amp-title{font-size:1.2rem}\r\n  #amp-map .amp-reset{margin-left:0}\r\n}\r\n\/* \u2500\u2500 Panel lat\u00e9ral associations \u2500\u2500 *\/\r\n#amp-map .amp-panel{\r\n  position:absolute;top:0;right:0;bottom:0;width:340px;\r\n  background:#fbfaf8;border-left:1px solid var(--border);\r\n  display:flex;flex-direction:column;\r\n  transform:translateX(102%);transition:transform .38s cubic-bezier(.22,1,.36,1);\r\n  z-index:20;overflow:hidden;\r\n}\r\n#amp-map .amp-panel.amp-open{transform:translateX(0);}\r\n#amp-map .amp-panel-bar{height:4px;flex:0 0 4px;background:var(--pc,var(--accent));}\r\n#amp-map .amp-panel-hd{\r\n  padding:1.3rem 1.5rem 1.1rem;\r\n  border-bottom:1px solid var(--border);flex:0 0 auto;\r\n}\r\n#amp-map .amp-panel-close{\r\n  display:inline-flex;align-items:center;gap:.4rem;\r\n  background:none;border:none;font-family:var(--font);\r\n  font-size:.8rem;font-weight:700;color:var(--muted);\r\n  cursor:pointer;padding:0;margin-bottom:1.1rem;transition:.14s;\r\n}\r\n#amp-map .amp-panel-close:hover{color:var(--pc,var(--accent));}\r\n#amp-map .amp-panel-eyebrow{\r\n  font-size:.64rem;font-weight:800;letter-spacing:.12em;\r\n  text-transform:uppercase;color:var(--muted);\r\n}\r\n#amp-map .amp-panel-title{\r\n  font-size:1.35rem;font-weight:800;color:var(--ink);\r\n  margin-top:.25rem;line-height:1.15;\r\n}\r\n#amp-map .amp-panel-count{\r\n  font-size:.72rem;color:var(--muted);font-weight:600;margin-top:.3rem;\r\n}\r\n#amp-map .amp-panel-list{\r\n  flex:1;overflow-y:auto;\r\n  padding:1.1rem 1.5rem;\r\n  display:flex;flex-direction:column;gap:.38rem;\r\n  scrollbar-width:thin;scrollbar-color:var(--border) transparent;\r\n}\r\n#amp-map .amp-panel-list::-webkit-scrollbar{width:4px;}\r\n#amp-map .amp-panel-list::-webkit-scrollbar-thumb{background:var(--border);border-radius:4px;}\r\n#amp-map .amp-pitem{\r\n  display:flex;align-items:center;gap:.7rem;\r\n  background:#fff;border:1.5px solid var(--border);\r\n  border-radius:11px;padding:.65rem .8rem;\r\n  transition:.18s ease;cursor:pointer;\r\n  text-decoration:none;\r\n}\r\n#amp-map .amp-pitem:hover{\r\n  border-color:var(--pc,var(--accent));\r\n  transform:translateY(-1px);\r\n  box-shadow:0 5px 12px rgba(36,71,109,.07);\r\n}\r\n#amp-map .amp-pitem-chip{\r\n  width:16px;height:16px;border-radius:50%;flex:0 0 16px;\r\n  box-shadow:0 0 0 2px #fff,0 0 0 3px rgba(0,0,0,.07);\r\n}\r\n#amp-map .amp-pitem-body{flex:1;min-width:0;}\r\n#amp-map .amp-pitem-name{\r\n  font-weight:800;font-size:.86rem;color:var(--ink);line-height:1.15;display:block;\r\n}\r\n#amp-map .amp-pitem-arrow{font-size:.9rem;color:var(--muted);flex:0 0 auto;transition:.15s;}\r\n#amp-map .amp-pitem:hover .amp-pitem-arrow{color:var(--pc,var(--accent));transform:translateX(2px);}\r\n\/* \u2500\u2500 Profil asso (niveau 2) \u2500\u2500 *\/\r\n#amp-map .amp-profile{display:flex;flex-direction:column;}\r\n#amp-map .amp-profile-hero{\r\n  margin:-1.1rem -1.5rem 0;padding:1.35rem 1.5rem 1.25rem;\r\n  background:linear-gradient(135deg,var(--pc,var(--accent)),color-mix(in srgb,var(--pc,var(--accent)) 65%,#0a1520) 100%);\r\n  color:#fff;position:relative;overflow:hidden;isolation:isolate;\r\n}\r\n#amp-map .amp-profile-hero::before{\r\n  content:\"\";position:absolute;top:-55%;right:-22%;width:75%;height:200%;\r\n  background:radial-gradient(circle,rgba(255,255,255,.2),transparent 62%);\r\n  border-radius:50%;pointer-events:none;z-index:0;\r\n}\r\n#amp-map .amp-profile-hero>*{position:relative;z-index:1;}\r\n#amp-map .amp-profile-back{\r\n  display:inline-flex;align-items:center;gap:.35rem;\r\n  background:rgba(255,255,255,.15);border:1px solid rgba(255,255,255,.25);\r\n  color:rgba(255,255,255,.92);font-family:var(--font);font-size:.72rem;font-weight:700;\r\n  padding:.3rem .7rem;border-radius:999px;cursor:pointer;margin-bottom:.9rem;transition:.15s;\r\n}\r\n#amp-map .amp-profile-back:hover{background:rgba(255,255,255,.25);color:#fff;}\r\n#amp-map .amp-profile-domain{\r\n  display:inline-block;\r\n  background:rgba(255,255,255,.18);border:1px solid rgba(255,255,255,.3);\r\n  font-size:.65rem;font-weight:800;letter-spacing:.07em;text-transform:uppercase;\r\n  padding:.22rem .6rem;border-radius:999px;margin-bottom:.8rem;\r\n  backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);\r\n}\r\n#amp-map .amp-profile-title{\r\n  font-size:1.22rem;font-weight:800;line-height:1.12;color:#fff;\r\n  letter-spacing:-.01em;overflow-wrap:anywhere;margin:0 0 .8rem;\r\n}\r\n#amp-map .amp-profile-meta{\r\n  display:flex;flex-wrap:wrap;align-items:center;gap:.4rem;\r\n  color:rgba(255,255,255,.88);font-size:.78rem;font-weight:600;\r\n}\r\n#amp-map .amp-profile-meta-zone{\r\n  display:inline-flex;align-items:center;gap:.28rem;\r\n  background:rgba(255,255,255,.15);border:1px solid rgba(255,255,255,.2);\r\n  padding:.2rem .55rem;border-radius:999px;font-weight:700;\r\n}\r\n#amp-map .amp-profile-meta-sep{color:rgba(255,255,255,.4);font-weight:700;}\r\n#amp-map .amp-profile-funding-title{\r\n  font-size:.62rem;font-weight:800;letter-spacing:.1em;text-transform:uppercase;\r\n  color:#94a3b8;margin-bottom:.5rem;\r\n}\r\n#amp-map .amp-profile-body{padding:1.2rem 0 0;display:flex;flex-direction:column;gap:1.1rem;}\r\n#amp-map .amp-profile-section-label{\r\n  font-size:.62rem;font-weight:800;letter-spacing:.1em;text-transform:uppercase;\r\n  color:#94a3b8;margin-bottom:.5rem;\r\n}\r\n#amp-map .amp-profile-desc{\r\n  font-size:.88rem;font-weight:500;line-height:1.62;color:#2f3e4f;\r\n  margin:0;white-space:pre-wrap;overflow-wrap:anywhere;\r\n  border-left:3px solid var(--pc,var(--accent));padding:.05rem 0 .05rem .85rem;\r\n}\r\n#amp-map .amp-profile-no-desc{font-size:.83rem;color:var(--muted);font-style:italic;margin:0;}\r\n#amp-map .amp-profile-link{\r\n  display:flex;align-items:center;gap:.7rem;\r\n  padding:.65rem .85rem;border-radius:12px;\r\n  background:#fff;border:1px solid #e6ebf1;\r\n  color:#1f2d3d;text-decoration:none;transition:.18s ease;\r\n}\r\n#amp-map .amp-profile-link:hover{\r\n  border-color:var(--pc,var(--accent));\r\n  background:color-mix(in srgb,var(--pc,var(--accent)) 6%,#fff);\r\n  transform:translateY(-1px);box-shadow:0 4px 12px rgba(36,71,109,.08);\r\n}\r\n#amp-map .amp-profile-link-icon{\r\n  width:34px;height:34px;border-radius:10px;flex:0 0 34px;\r\n  background:var(--pc,var(--accent));color:#fff;\r\n  display:inline-flex;align-items:center;justify-content:center;\r\n}\r\n#amp-map .amp-profile-link-body{flex:1;min-width:0;}\r\n#amp-map .amp-profile-link-label{\r\n  display:block;font-size:.62rem;font-weight:800;letter-spacing:.08em;\r\n  text-transform:uppercase;color:#94a3b8;\r\n}\r\n#amp-map .amp-profile-link-value{\r\n  display:block;font-size:.86rem;font-weight:700;color:#1f2d3d;\r\n  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;\r\n}\r\n#amp-map .amp-profile-link-arrow{flex:0 0 auto;color:#cbd5e1;font-size:1rem;transition:.18s;}\r\n#amp-map .amp-profile-link:hover .amp-profile-link-arrow{color:var(--pc,var(--accent));transform:translateX(2px);}\r\n\/* Pills public cible etc. *\/\r\n#amp-map .amp-profile-pills{display:flex;flex-wrap:wrap;gap:.4rem;}\r\n#amp-map .amp-profile-pill{\r\n  background:color-mix(in srgb,var(--pc,var(--accent)) 9%,#fff);\r\n  border:1px solid color-mix(in srgb,var(--pc,var(--accent)) 22%,#fff);\r\n  border-radius:11px;padding:.48rem .7rem;display:flex;flex-direction:column;gap:.15rem;\r\n}\r\n#amp-map .amp-profile-pill-label{\r\n  font-size:.6rem;font-weight:800;letter-spacing:.09em;text-transform:uppercase;\r\n  color:var(--pc,var(--accent));\r\n}\r\n#amp-map .amp-profile-pill-value{font-size:.82rem;font-weight:700;color:#1f2d3d;line-height:1.25;}\r\n\/* Carte projet *\/\r\n#amp-map .amp-profile-projet{border:1px solid var(--border);border-radius:12px;overflow:hidden;}\r\n#amp-map .amp-profile-projet-hd{\r\n  display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;\r\n  padding:.5rem .75rem;background:#f8f9fb;border-bottom:1px solid var(--border);\r\n}\r\n#amp-map .amp-profile-projet-year{\r\n  font-size:.72rem;font-weight:800;color:var(--ink);\r\n  background:#fff;border:1px solid var(--border);\r\n  padding:.18rem .5rem;border-radius:6px;flex:0 0 auto;\r\n}\r\n#amp-map .amp-profile-projet-domain{font-size:.75rem;font-weight:600;color:var(--muted);min-width:0;}\r\n#amp-map .amp-profile-projet-body{padding:.7rem .75rem;display:flex;flex-direction:column;gap:.55rem;}\r\n\/* Grille financement *\/\r\n#amp-map .amp-profile-funding{display:grid;grid-template-columns:1fr 1fr;gap:.4rem;}\r\n#amp-map .amp-profile-funding-item{\r\n  padding:.5rem .65rem;border-radius:9px;\r\n  background:color-mix(in srgb,var(--pc,var(--accent)) 7%,#fff);\r\n  border:1px solid color-mix(in srgb,var(--pc,var(--accent)) 18%,#fff);\r\n}\r\n#amp-map .amp-profile-funding-item.full{grid-column:1\/-1;}\r\n#amp-map .amp-profile-funding-label{\r\n  display:block;font-size:.6rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;\r\n  color:var(--pc,var(--accent));margin-bottom:.16rem;\r\n}\r\n#amp-map .amp-profile-funding-value{\r\n  display:block;font-size:.84rem;font-weight:800;color:#1f2d3d;line-height:1.25;overflow-wrap:anywhere;\r\n}\r\n#amp-map .amp-profile-yesno{\r\n  display:inline-block;font-size:.78rem;font-weight:800;\r\n  padding:.18rem .52rem;border-radius:6px;\r\n}\r\n#amp-map .amp-profile-yesno.yes{background:#ecf7f1;color:#207a4f;}\r\n#amp-map .amp-profile-yesno.no{background:#fef2f2;color:#b91c1c;}\r\n\/* Fiches Erasmus+ *\/\r\n#amp-map .amp-profile-erasmus-list{display:flex;flex-direction:column;gap:.35rem;align-items:flex-start;}\r\n#amp-map .amp-profile-erasmus{\r\n  display:inline-flex;align-items:center;gap:.4rem;\r\n  font-size:.78rem;font-weight:700;color:var(--pc,var(--accent));\r\n  text-decoration:none;overflow-wrap:anywhere;\r\n}\r\n#amp-map .amp-profile-erasmus:hover{text-decoration:underline;}\r\n\/* Contact rows *\/\r\n#amp-map .amp-profile-contacts{display:flex;flex-direction:column;gap:.4rem;}\r\n#amp-map .amp-profile-contact-row{\r\n  display:flex;align-items:center;gap:.65rem;\r\n  padding:.6rem .8rem;border-radius:12px;\r\n  background:#fff;border:1px solid #e6ebf1;\r\n  color:#1f2d3d;text-decoration:none;transition:.18s ease;\r\n}\r\n#amp-map .amp-profile-contact-row:hover{\r\n  border-color:var(--pc,var(--accent));\r\n  background:color-mix(in srgb,var(--pc,var(--accent)) 6%,#fff);\r\n  transform:translateY(-1px);box-shadow:0 4px 12px rgba(36,71,109,.08);\r\n}\r\n#amp-map .amp-profile-contact-icon{\r\n  width:30px;height:30px;border-radius:8px;flex:0 0 30px;\r\n  background:var(--pc,var(--accent));color:#fff;\r\n  display:inline-flex;align-items:center;justify-content:center;\r\n}\r\n#amp-map .amp-profile-contact-body{flex:1;min-width:0;}\r\n#amp-map .amp-profile-contact-label{\r\n  display:block;font-size:.6rem;font-weight:800;letter-spacing:.08em;\r\n  text-transform:uppercase;color:#94a3b8;\r\n}\r\n#amp-map .amp-profile-contact-value{\r\n  display:block;font-size:.84rem;font-weight:700;color:#1f2d3d;\r\n  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;\r\n}\r\n<\/style>\r\n\r\n<script>\r\n(function(){\r\n  \"use strict\";\r\n\r\n  \/* ===== CONFIG ===== *\/\r\n  const SUPABASE_URL = 'https:\/\/xjpclfwlkvuucglyvizm.supabase.co\/rest\/v1';\r\n  const SUPABASE_KEY = 'sb_publishable_KOEN_acYLBhseKhOcYSBtQ_wBf-a66f';\r\n  const REGION_INSEE = {\r\n    'M\u00e9tropole Aix Marseille Provence, Marseille': '13055',\r\n    'M\u00e9tropole Aix Marseille Provence, Port-de-Bouc': '13077',\r\n    'M\u00e9tropole Aix Marseille Provence,Port-de-Bouc': '13077',\r\n    \"M\u00e9tropole d'Aix-Marseille, Port-de-Bouc\": '13077',\r\n    'M\u00e9tropole Aix Marseille Provence, Martigues': '13056',\r\n    'M\u00e9tropole Aix Marseille, Martigues': '13056',\r\n    'M\u00e9tropole Aix Marseille Provence, Aubagne': '13005',\r\n    'M\u00e9tropole Aix Marseille Provence, Istres': '13047',\r\n    \"M\u00e9tropole Aix Marseille Provence, Berre-l'\u00c9tang\": '13014',\r\n    'M\u00e9tropole Aix Marseille Provence, Salon-de-Provence': '13103',\r\n    'M\u00e9tropole Aix Marseille Provence, La Ciotat': '13028',\r\n    'M\u00e9tropole Aix Marseille Provence, Miramas': '13063',\r\n    'M\u00e9tropole Aix Marseille Provence, Boul-Bec-Air': '13015',\r\n    \/\/ Repli : r\u00e9gion saisie sans ville -> rattach\u00e9e \u00e0 Marseille (c\u0153ur de la m\u00e9tropole),\r\n    \/\/ sinon ces assos (dont plusieurs avec fiches Erasmus+) disparaissent de la carte.\r\n    'M\u00e9tropole Aix Marseille Provence': '13055',\r\n  };\r\n  let ASSOS = {};\r\n\r\n  \/* ===== Capsules vid\u00e9o =====\r\n     Source de v\u00e9rit\u00e9 : la table associationVideoLinks de la Roue\r\n     (Roue\/roue_v2_wpcode.html). La carte affiche exactement les m\u00eames capsules,\r\n     pour que les deux outils racontent la m\u00eame chose. Cette liste ne d\u00e9pend pas\r\n     de Supabase : une capsule s'affiche m\u00eame si l'association n'est pas (ou pas\r\n     encore) rattach\u00e9e \u00e0 la m\u00e9tropole dans la base.\r\n       insee   : commune d'ancrage en vue \u00ab Zones m\u00e9tropole \u00bb\r\n       secteur : secteur de Marseille en vue \u00ab Marseille \u00bb (null = pas affich\u00e9e)\r\n       dx, dy  : d\u00e9calage en pixels \u00e9cran de la vignette par rapport \u00e0 l'ancre.\r\n                 C'est ce qui \u00e9vite que les capsules marseillaises se recouvrent :\r\n                 leurs traits de rappel partent du m\u00eame point et divergent.\r\n     Les offsets sont doubl\u00e9s par vue, le cadrage n'\u00e9tant pas le m\u00eame. *\/\r\n  const VIDEOS = [\r\n    {\r\n      id:'fN8BeO-cKLc', asso:'Les Cols Verts Provence', titre:'Capsule Les Cols Verts Provence',\r\n      lieu:'La Ciotat', insee:'13028', secteur:null,\r\n      zones:{dx:92,dy:-68}, arr:null\r\n    },\r\n    {\r\n      id:'eILCl86NA_o', asso:'Hatoup!', titre:'Capsule Hatoup!',\r\n      lieu:'Marseille \u00b7 3\u1d49 secteur', insee:'13055', secteur:'3eme secteur',\r\n      zones:{dx:-147,dy:85}, arr:{dx:-172,dy:-40}, short:true\r\n    },\r\n    {\r\n      id:'5ajbRhhseEI', asso:'En Majuscule', titre:'Capsule En Majuscule',\r\n      lieu:'Marseille \u00b7 4\u1d49 secteur', insee:'13055', secteur:'4eme secteur',\r\n      zones:{dx:0,dy:-170}, arr:{dx:-140,dy:60}\r\n    },\r\n    {\r\n      id:'DniqlqYC4OI', asso:'Association Fifrelin', titre:'Capsule Fifrelin',\r\n      lieu:'La Ciotat', insee:'13028', secteur:null,\r\n      zones:{dx:70,dy:-110}, arr:null\r\n    },\r\n    {\r\n      id:'yM573lEaPh8', asso:'Action Bomaye', titre:'Capsule Action Bomaye',\r\n      lieu:'Marseille', insee:'13055', secteur:null,\r\n      zones:{dx:147,dy:85}, arr:null\r\n    },\r\n    {\r\n      id:'61UHy-zD1zg', asso:'Martigues Sport Athl\u00e9tisme', titre:'Capsule Martigues Sport Athl\u00e9tisme',\r\n      lieu:'Martigues', insee:'13056', secteur:null,\r\n      zones:{dx:-90,dy:-80}, arr:null\r\n    },\r\n    {\r\n      id:'ssh5QegH3YI', asso:'Terre Ludique', titre:'Capsule Terre Ludique',\r\n      lieu:'Marseille \u00b7 4\u1d49 secteur', insee:'13055', secteur:'4eme secteur',\r\n      zones:{dx:10,dy:190}, arr:{dx:140,dy:60}\r\n    },\r\n    {\r\n      id:'y_uC4omhlls', asso:'La for\u00eat en papier', titre:'Capsule La for\u00eat en papier',\r\n      lieu:'Marseille \u00b7 3\u1d49 secteur', insee:'13055', secteur:'3eme secteur',\r\n      zones:{dx:150,dy:-200}, arr:{dx:-60,dy:-150}\r\n    }\r\n  ];\r\n\r\n\r\n  function parseMontantLocal(v){\r\n    const n = parseInt(String(v ?? '').replace(\/[^\\d]\/g, ''), 10);\r\n    return isNaN(n) ? 0 : n;\r\n  }\r\n  function eurLocal(n){ return n.toLocaleString('fr-FR') + '\\u00a0\\u20ac'; }\r\n\r\n  async function loadAssos(){\r\n    const select =\r\n      'name,website,email,phone,contact_name,public_cible,region,territoire,description,' +\r\n      'association_projets(annee,domaine,thematique,sous_thematique,type_projet,' +\r\n      'description,detail_du_projet,financement_depose,type_financement,' +\r\n      'montant,montant_sollicite,pays_partenaire,interlocuteur_metropole)';\r\n    const params = new URLSearchParams({ select, limit: '500' });\r\n    const res = await fetch(\r\n      `${SUPABASE_URL}\/associations?${params}`,\r\n      { headers:{ apikey: SUPABASE_KEY, Authorization: `Bearer ${SUPABASE_KEY}` } }\r\n    );\r\n    if(!res.ok){\r\n      const msg = await res.text().catch(()=>'');\r\n      throw new Error('Supabase ' + res.status + (msg ? ' \u2014 ' + msg : ''));\r\n    }\r\n    const rows = await res.json();\r\n    const normT = s => (s||'').toLowerCase().normalize('NFD').replace(\/[\\u0300-\\u036f]\/g,'').trim();\r\n    const map = {};\r\n    rows.forEach(row => {\r\n      const insee = REGION_INSEE[row.region];\r\n      if(!insee) return;\r\n      if(!map[insee]) map[insee] = [];\r\n      const projets = (row.association_projets || [])\r\n        .sort((a, b) => Number(b.annee || 0) - Number(a.annee || 0));\r\n      map[insee].push({\r\n        n: row.name || '',\r\n        u: row.website || '',\r\n        email: row.email || '',\r\n        phone: row.phone || '',\r\n        contact: row.contact_name || '',\r\n        publicCible: row.public_cible || '',\r\n        sect: row.territoire || '',\r\n        sectNorm: normT(row.territoire),\r\n        desc: row.description || '',\r\n        projets\r\n      });\r\n    });\r\n    return map;\r\n  }\r\n\r\n  \/* ===== Affectation officielle commune (INSEE) -> conseil de territoire ===== *\/\r\n  const TERR = {\r\n    marseille:[\"13055\",\"13002\",\"13119\",\"13021\",\"13022\",\"13023\",\"13026\",\"13033\",\"13042\",\"13043\",\"13028\",\"13088\",\"13054\",\"13075\",\"13085\",\"13102\",\"13104\",\"13106\"],\r\n    aix:[\"13001\",\"13012\",\"13015\",\"13019\",\"13025\",\"13118\",\"13032\",\"13040\",\"13041\",\"13046\",\"13048\",\"13050\",\"13059\",\"13060\",\"13062\",\"13071\",\"13072\",\"13074\",\"13079\",\"13080\",\"13082\",\"13084\",\"13087\",\"13090\",\"13091\",\"13093\",\"13095\",\"13099\",\"13107\",\"13109\",\"13110\",\"13111\",\"13113\",\"13114\",\"13117\"],\r\n    salon:[\"13003\",\"13008\",\"13009\",\"13014\",\"13024\",\"13035\",\"13037\",\"13049\",\"13051\",\"13053\",\"13069\",\"13081\",\"13092\",\"13103\",\"13105\",\"13112\",\"13115\"],\r\n    aubagne:[\"13005\",\"13007\",\"13013\",\"13020\",\"13030\",\"13016\",\"13031\",\"13070\",\"13073\",\"13086\",\"13101\"],\r\n    istres:[\"13029\",\"13039\",\"13044\",\"13047\",\"13063\",\"13078\"],\r\n    martigues:[\"13056\",\"13077\",\"13098\"]\r\n  };\r\n  const TERR_META = {\r\n    marseille:{label:\"Marseille Provence\", color:\"#24476d\"},\r\n    aix:      {label:\"Pays d'Aix\",         color:\"#6d4f84\"},\r\n    salon:    {label:\"Pays Salonais\",      color:\"#4a90c8\"},\r\n    aubagne:  {label:\"Aubagne - \u00c9toile\",   color:\"#c87a30\"},\r\n    istres:   {label:\"Istres-Ouest Provence\", color:\"#2e8b57\"},\r\n    martigues:{label:\"Pays de Martigues\",  color:\"#b94a73\"}\r\n  };\r\n  const CODE2TERR = {};\r\n  Object.entries(TERR).forEach(([t,codes])=>codes.forEach(c=>CODE2TERR[c]=t));\r\n\r\n  const COMMUNES_URL = \"https:\/\/geo.api.gouv.fr\/departements\/13\/communes?format=geojson&geometry=contour&fields=nom,code,codeEpci\";\r\n  const ARR_URL = \"https:\/\/public.opendatasoft.com\/api\/explore\/v2.1\/catalog\/datasets\/georef-france-commune-arrondissement-municipal\/records?where=com_code%3D%2213055%22&select=com_arm_name,com_arm_code,geo_shape&limit=20\";\r\n  const AMP_EPCI = \"200054807\";\r\n\r\n  const $ = id => document.getElementById(id);\r\n\r\n  \/\/ d3.geoPath attend l'anneau ext\u00e9rieur en sens horaire (et les trous en\r\n  \/\/ anti-horaire). Opendatasoft renvoie l'inverse -> on r\u00e9oriente, sinon d3\r\n  \/\/ dessine \"tout le globe sauf la zone\" (carte vide \/ bounds \u00e9normes).\r\n  function ringArea(r){let s=0;for(let i=0,n=r.length,j=n-1;i<n;j=i++)s+=r[j][0]*r[i][1]-r[i][0]*r[j][1];return s\/2;}\r\n  function rewind(geom){\r\n    const fix=poly=>poly.forEach((ring,i)=>{const a=ringArea(ring);if(i===0?a>0:a<0)ring.reverse();});\r\n    if(!geom) return geom;\r\n    if(geom.type==='Polygon') fix(geom.coordinates);\r\n    else if(geom.type==='MultiPolygon') geom.coordinates.forEach(fix);\r\n    return geom;\r\n  }\r\n\r\n  function loadD3(){\r\n    return new Promise((res,rej)=>{\r\n      if(window.d3) return res();\r\n      const s=document.createElement('script');\r\n      s.src=\"https:\/\/d3js.org\/d3.v7.min.js\"; s.onload=res;\r\n      s.onerror=()=>rej(new Error(\"D3 indisponible\"));\r\n      document.head.appendChild(s);\r\n    });\r\n  }\r\n\r\n  function start(){\r\n    \/\/ Garde-fou : ne rien faire si le conteneur n'est pas sur la page\r\n    \/\/ (\u00e9vite tout effet de bord si le snippet est charg\u00e9 ailleurs \/ en global).\r\n    if(!document.getElementById('amp-map')) return;\r\n    loadD3().then(init).catch(e=>{ const l=$('amp-loader'); if(l) l.textContent=\"Carte indisponible : \"+e.message; });\r\n  }\r\n  if(document.readyState==='loading') document.addEventListener('DOMContentLoaded',start);\r\n  else start();\r\n\r\n  function init(){\r\n    const stage=$('amp-stage'), svgEl=$('amp-svg'), tip=$('amp-tip');\r\n    const svg=d3.select(svgEl);\r\n    let W=stage.clientWidth, H=stage.clientHeight;\r\n    svg.attr('viewBox',`0 0 ${W} ${H}`);\r\n\r\n    const gRoot=svg.append('g');\r\n    const gZones=gRoot.append('g');\r\n    const gArr=gRoot.append('g').style('display','none');\r\n    const gAsso=gRoot.append('g');\r\n    const gArrAsso=gRoot.append('g').style('display','none');\r\n    const gLabels=gRoot.append('g'); \/\/ au-dessus des bulles pour rester lisible\r\n    const gVideo=gRoot.append('g');  \/\/ capsules vid\u00e9o : toujours au premier plan\r\n\r\n    const proj=d3.geoMercator();\r\n    const path=d3.geoPath(proj);\r\n    let amp=null, arrFC=null, view='zones';\r\n\r\n    \/\/ Le placement des capsules d\u00e9pend du cadrage : ce qui \u00e9tait du fond de carte\r\n    \/\/ au d\u00e9zoom peut devenir une commune au zoom. On le recalcule quand le geste\r\n    \/\/ est termin\u00e9 \u2014 pas pendant, sinon les vignettes sauteraient \u00e0 chaque image.\r\n    let vReplace=null;\r\n    const zoom=d3.zoom().scaleExtent([1,60]).on('zoom',ev=>{\r\n      gRoot.attr('transform',ev.transform);\r\n      rescale(ev.transform.k);\r\n    }).on('end',()=>{\r\n      clearTimeout(vReplace);\r\n      vReplace=setTimeout(()=>drawVideos(view==='arr'?'arr':'zones'),180);\r\n    });\r\n    svg.call(zoom).on('dblclick.zoom',null);\r\n\r\n    function rescale(k){\r\n      gVideo.selectAll('.amp-video').attr('transform',d=>`translate(${d.xy}) scale(${videoScale()\/k})`);\r\n      gAsso.selectAll('.amp-asso').attr('transform',d=>`translate(${d.xy}) scale(${1\/k})`);\r\n      gArrAsso.selectAll('.amp-arr-bubble').attr('transform',d=>`translate(${d.xy}) scale(${1\/k})`);\r\n      gLabels.selectAll('text').style('font-size',d=>(d.fs\/k)+'px');\r\n    }\r\n\r\n    function showTip(html,ev){\r\n      tip.innerHTML=html;\r\n      const r=stage.getBoundingClientRect();\r\n      let x=ev.clientX-r.left+14, y=ev.clientY-r.top+14;\r\n      tip.style.left=Math.min(x,r.width-220)+'px';\r\n      tip.style.top=y+'px';\r\n      tip.classList.add('amp-show');\r\n    }\r\n    const hideTip=()=>tip.classList.remove('amp-show');\r\n\r\n    let _listCtx = null;\r\n\r\n    function showPanel(commune, territoire, names, color){\r\n      _listCtx = { commune, territoire, names, color };\r\n      const panel = $('amp-panel');\r\n      panel.style.setProperty('--pc', color);\r\n      $('amp-panel-bar').style.background = color;\r\n      $('amp-panel-eyebrow').textContent = territoire || 'Associations accompagn\u00e9es';\r\n      $('amp-panel-title').textContent = commune;\r\n      const n = names.length;\r\n      $('amp-panel-count').textContent = n + ' association' + (n>1?'s':'') + ' accompagn\u00e9e' + (n>1?'s':'');\r\n      $('amp-panel-hd').style.display = '';\r\n      const closeBtn = $('amp-panel-close');\r\n      closeBtn.textContent = '\u2190 Retour';\r\n      closeBtn.onclick = hidePanel;\r\n      $('amp-panel-list').innerHTML = names.map((a, i) =>\r\n        `<div class=\"amp-pitem\" data-idx=\"${i}\">\r\n           <span class=\"amp-pitem-chip\" style=\"background:${color}\"><\/span>\r\n           <span class=\"amp-pitem-body\"><span class=\"amp-pitem-name\">${a.n}<\/span><\/span>\r\n           <span class=\"amp-pitem-arrow\">\u203a<\/span>\r\n         <\/div>`\r\n      ).join('');\r\n      $('amp-panel-list').querySelectorAll('.amp-pitem').forEach((el, i) => {\r\n        el.addEventListener('click', () => showProfile(names[i], commune, territoire, color));\r\n      });\r\n      panel.classList.add('amp-open');\r\n      panel.setAttribute('aria-hidden','false');\r\n    }\r\n\r\n    function showProfile(asso, commune, territoire, color){\r\n      $('amp-panel-hd').style.display = 'none';\r\n      const isUrl = v => \/^https?:\\\/\\\/\/i.test(v || '');\r\n      const projets = asso.projets || [];\r\n      const latest  = projets[0] || {};\r\n\r\n      \/* \u2500\u2500 Hero meta : zone \u00b7 th\u00e9matique \u00b7 sous-th\u00e9matique \u2500\u2500 *\/\r\n      const svgPin = `<svg width=\"11\" height=\"11\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.4\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z\"\/><circle cx=\"12\" cy=\"10\" r=\"3\"\/><\/svg>`;\r\n      const metaParts = [];\r\n      const zone = asso.sect || territoire || '';\r\n      if (zone) metaParts.push(`<span class=\"amp-profile-meta-zone\">${svgPin} ${zone}<\/span>`);\r\n      if (latest.thematique) metaParts.push(`<span>${latest.thematique}<\/span>`);\r\n      if (latest.sous_thematique && latest.sous_thematique !== latest.thematique)\r\n        metaParts.push(`<span>${latest.sous_thematique}<\/span>`);\r\n      const metaHTML = metaParts.length\r\n        ? `<div class=\"amp-profile-meta\">${metaParts.join('<span class=\"amp-profile-meta-sep\">\u00b7<\/span>')}<\/div>`\r\n        : '';\r\n      const domainBadge = latest.domaine\r\n        ? `<div class=\"amp-profile-domain\">${latest.domaine}<\/div>` : '';\r\n\r\n      \/* \u2500\u2500 Pills \u2500\u2500 *\/\r\n      const pillDefs = [\r\n        { label: 'Public cible',        value: asso.publicCible },\r\n        { label: 'Type de financement', value: latest.type_financement },\r\n        { label: 'Pays partenaire',     value: latest.pays_partenaire },\r\n      ].filter(p => p.value);\r\n      const pillsHTML = pillDefs.length\r\n        ? `<div class=\"amp-profile-pills\">${pillDefs.map(p =>\r\n            `<div class=\"amp-profile-pill\">\r\n               <span class=\"amp-profile-pill-label\">${p.label}<\/span>\r\n               <span class=\"amp-profile-pill-value\">${p.value}<\/span>\r\n             <\/div>`).join('')}<\/div>`\r\n        : '';\r\n\r\n      \/* \u2500\u2500 Description g\u00e9n\u00e9rale (associations.description) \u2500\u2500 *\/\r\n      const globalDescHTML = asso.desc\r\n        ? `<div>\r\n             <div class=\"amp-profile-section-label\">Pr\u00e9sentation<\/div>\r\n             <p class=\"amp-profile-desc\">${asso.desc}<\/p>\r\n           <\/div>`\r\n        : '';\r\n\r\n      \/* \u2500\u2500 Sections projet par ann\u00e9e \u2500\u2500 *\/\r\n      const projetSections = projets.map(p => {\r\n        const parts = [];\r\n\r\n        \/* Description du projet *\/\r\n        if (p.description)\r\n          parts.push(`<div>\r\n            <div class=\"amp-profile-section-label\">${p.annee ? 'Projet ' + p.annee : 'Projet'}<\/div>\r\n            <p class=\"amp-profile-desc\">${p.description}<\/p>\r\n          <\/div>`);\r\n\r\n        \/* Financements europ\u00e9ens *\/\r\n        const fundItems = [];\r\n        if (p.financement_depose) {\r\n          const low = p.financement_depose.toLowerCase();\r\n          const cls = low.startsWith('oui') ? 'yes' : low.startsWith('non') ? 'no' : '';\r\n          fundItems.push(`<div class=\"amp-profile-funding-item full\">\r\n            <span class=\"amp-profile-funding-label\">D\u00e9p\u00f4t de projet europ\u00e9en<\/span>\r\n            <span class=\"amp-profile-yesno ${cls}\">${p.financement_depose}<\/span>\r\n          <\/div>`);\r\n        }\r\n        const mSol = parseMontantLocal(p.montant_sollicite);\r\n        const mAcc = parseMontantLocal(p.montant);\r\n        if (mSol > 0) fundItems.push(`<div class=\"amp-profile-funding-item\">\r\n          <span class=\"amp-profile-funding-label\">Financements sollicit\u00e9s${p.annee ? ' en ' + p.annee : ''}<\/span>\r\n          <span class=\"amp-profile-funding-value\">${eurLocal(mSol)}<\/span>\r\n        <\/div>`);\r\n        if (mAcc > 0) fundItems.push(`<div class=\"amp-profile-funding-item\">\r\n          <span class=\"amp-profile-funding-label\">Financements obtenus<\/span>\r\n          <span class=\"amp-profile-funding-value\">${eurLocal(mAcc)}<\/span>\r\n        <\/div>`);\r\n        if (p.interlocuteur_metropole) fundItems.push(`<div class=\"amp-profile-funding-item full\">\r\n          <span class=\"amp-profile-funding-label\">Interlocuteur M\u00e9tropole<\/span>\r\n          <span class=\"amp-profile-funding-value\">${p.interlocuteur_metropole}<\/span>\r\n        <\/div>`);\r\n        if (fundItems.length)\r\n          parts.push(`<div>\r\n            <div class=\"amp-profile-section-label\">Financements europ\u00e9ens<\/div>\r\n            <div class=\"amp-profile-funding\">${fundItems.join('')}<\/div>\r\n          <\/div>`);\r\n\r\n        \/* Fiches Erasmus+ : on extrait TOUS les liens coll\u00e9s dans \u00ab D\u00e9tail du projet \u00bb\r\n           (seuls ou noy\u00e9s dans du texte), comme sur la carte partenaire. *\/\r\n        const erasmusLinks = (String(p.detail_du_projet || '').match(\/https?:\\\/\\\/[^\\s<>\"']+\/gi) || [])\r\n          .map(u => u.replace(\/[),.;]+$\/g, ''))\r\n          .filter((u, i, a) => a.indexOf(u) === i);\r\n        if (erasmusLinks.length)\r\n          parts.push(`<div>\r\n            <div class=\"amp-profile-section-label\">Fiches Erasmus+<\/div>\r\n            <div class=\"amp-profile-erasmus-list\">\r\n              ${erasmusLinks.map((link, i) => `\r\n                <a class=\"amp-profile-erasmus\" href=\"${link}\" target=\"_blank\" rel=\"noopener noreferrer\">\r\n                  <svg width=\"13\" height=\"13\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71\"\/><path d=\"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71\"\/><\/svg>\r\n                  Fiche Erasmus+${erasmusLinks.length > 1 ? ' ' + (i + 1) : ''} \u2197\r\n                <\/a>`).join('')}\r\n            <\/div>\r\n          <\/div>`);\r\n\r\n        return parts.join('');\r\n      }).filter(Boolean);\r\n\r\n      \/* \u2500\u2500 Contact \u2500\u2500 *\/\r\n      const svgMail  = `<svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z\"\/><polyline points=\"22,6 12,13 2,6\"\/><\/svg>`;\r\n      const svgPhone = `<svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07A19.5 19.5 0 0 1 4.13 12 19.79 19.79 0 0 1 1.08 3.4 2 2 0 0 1 3.06 1.22h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z\"\/><\/svg>`;\r\n      const svgWeb   = `<svg width=\"14\" height=\"14\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2.2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"10\"\/><line x1=\"2\" y1=\"12\" x2=\"22\" y2=\"12\"\/><path d=\"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z\"\/><\/svg>`;\r\n      const contactRows = [];\r\n      if (asso.u) {\r\n        const clean = asso.u.replace(\/^https?:\\\/\\\/\/i,'').replace(\/\\\/$\/,'');\r\n        contactRows.push(`<a class=\"amp-profile-contact-row\" href=\"${asso.u}\" target=\"_blank\" rel=\"noopener noreferrer\">\r\n          <span class=\"amp-profile-contact-icon\">${svgWeb}<\/span>\r\n          <span class=\"amp-profile-contact-body\">\r\n            <span class=\"amp-profile-contact-label\">Site internet<\/span>\r\n            <span class=\"amp-profile-contact-value\">${clean}<\/span>\r\n          <\/span><span style=\"color:#cbd5e1;margin-left:auto\">\u203a<\/span><\/a>`);\r\n      }\r\n      if (asso.email) contactRows.push(`<a class=\"amp-profile-contact-row\" href=\"mailto:${asso.email}\">\r\n        <span class=\"amp-profile-contact-icon\">${svgMail}<\/span>\r\n        <span class=\"amp-profile-contact-body\">\r\n          <span class=\"amp-profile-contact-label\">Email<\/span>\r\n          <span class=\"amp-profile-contact-value\">${asso.email}<\/span>\r\n        <\/span><span style=\"color:#cbd5e1;margin-left:auto\">\u203a<\/span><\/a>`);\r\n      if (asso.phone) contactRows.push(`<a class=\"amp-profile-contact-row\" href=\"tel:${asso.phone}\">\r\n        <span class=\"amp-profile-contact-icon\">${svgPhone}<\/span>\r\n        <span class=\"amp-profile-contact-body\">\r\n          <span class=\"amp-profile-contact-label\">T\u00e9l\u00e9phone<\/span>\r\n          <span class=\"amp-profile-contact-value\">${asso.phone}<\/span>\r\n        <\/span><span style=\"color:#cbd5e1;margin-left:auto\">\u203a<\/span><\/a>`);\r\n      const contactHTML = contactRows.length\r\n        ? `<div>\r\n             <div class=\"amp-profile-section-label\">Contact<\/div>\r\n             <div class=\"amp-profile-contacts\">${contactRows.join('')}<\/div>\r\n           <\/div>`\r\n        : '';\r\n\r\n      $('amp-panel-list').innerHTML = `\r\n        <div class=\"amp-profile\">\r\n          <div class=\"amp-profile-hero\">\r\n            <button class=\"amp-profile-back\" id=\"amp-profile-back\">\u2190 ${commune}<\/button>\r\n            ${domainBadge}\r\n            <p class=\"amp-profile-title\">${asso.n}<\/p>\r\n            ${metaHTML}\r\n          <\/div>\r\n          <div class=\"amp-profile-body\">\r\n            ${pillsHTML}\r\n            ${globalDescHTML}\r\n            ${projetSections.join('')}\r\n            ${contactHTML}\r\n          <\/div>\r\n        <\/div>`;\r\n      document.getElementById('amp-profile-back').addEventListener('click', () => {\r\n        if (_listCtx) showPanel(_listCtx.commune, _listCtx.territoire, _listCtx.names, _listCtx.color);\r\n      });\r\n    }\r\n\r\n    function hidePanel(){\r\n      $('amp-panel').classList.remove('amp-open');\r\n      $('amp-panel').setAttribute('aria-hidden','true');\r\n      $('amp-panel-hd').style.display = '';\r\n      _listCtx = null;\r\n    }\r\n    $('amp-panel-close').addEventListener('click', hidePanel);\r\n\r\n    function boundsOf(features){\r\n      return path.bounds({type:\"FeatureCollection\",features});\r\n    }\r\n    function zoomTo(features,pad){\r\n      pad=pad||30;\r\n      const [[x0,y0],[x1,y1]]=boundsOf(features);\r\n      const k=Math.min(60,0.92\/Math.max((x1-x0)\/W,(y1-y0)\/H));\r\n      const tx=W\/2-k*(x0+x1)\/2, ty=H\/2-k*(y0+y1)\/2;\r\n      svg.transition().duration(750).ease(d3.easeCubicInOut)\r\n         .call(zoom.transform,d3.zoomIdentity.translate(tx,ty).scale(k));\r\n    }\r\n    const resetZoom=()=>svg.transition().duration(750).ease(d3.easeCubicInOut)\r\n         .call(zoom.transform,d3.zoomIdentity);\r\n\r\n    Promise.all([d3.json(COMMUNES_URL), loadAssos()]).then(([raw, assosData])=>{\r\n      ASSOS = assosData;\r\n      amp={type:\"FeatureCollection\",features:raw.features.filter(f=>f.properties.codeEpci===AMP_EPCI)};\r\n      proj.fitSize([W,H],amp);\r\n      drawZones();\r\n      drawAssos();\r\n      drawVideos('zones');\r\n      buildLegend();\r\n      $('amp-loader').style.display='none';\r\n    }).catch(e=>{ $('amp-loader').textContent=\"Carte indisponible : \"+e.message; });\r\n\r\n    function drawZones(){\r\n      gZones.selectAll('path').data(amp.features).join('path')\r\n        .attr('class','amp-zone')\r\n        .attr('d',path)\r\n        .attr('fill',f=>{const t=CODE2TERR[f.properties.code];return t?TERR_META[t].color:'#cbd5e0';})\r\n        .attr('fill-opacity',.92)\r\n        .on('mousemove',(ev,f)=>{\r\n          const t=CODE2TERR[f.properties.code];\r\n          const n=(ASSOS[f.properties.code]||[]).length;\r\n          showTip(`<b>${f.properties.nom}<\/b><div class=\"amp-tip-meta\">${t?TERR_META[t].label:''}${n?' \u00b7 '+n+' asso'+(n>1?'s':''):''}<\/div>`,ev);\r\n        })\r\n        .on('mouseleave',hideTip)\r\n        .on('click',(ev,f)=>{\r\n          const t=CODE2TERR[f.properties.code];\r\n          if(!t) return;\r\n          zoomTo(amp.features.filter(x=>CODE2TERR[x.properties.code]===t));\r\n        });\r\n\r\n      \/\/ libell\u00e9s territoires (centro\u00efde sph\u00e9rique pond\u00e9r\u00e9)\r\n      const labels=Object.keys(TERR).map(t=>{\r\n        const feats=amp.features.filter(x=>CODE2TERR[x.properties.code]===t);\r\n        const c=proj(d3.geoCentroid({type:\"FeatureCollection\",features:feats}));\r\n        return {t, x:c[0], y:c[1], label:TERR_META[t].label, fs:12};\r\n      });\r\n      gLabels.selectAll('text.amp-zlabel').data(labels).join('text')\r\n        .attr('class','amp-zlabel').attr('x',d=>d.x).attr('y',d=>d.y)\r\n        .text(d=>d.label);\r\n    }\r\n\r\n    function drawAssos(){\r\n      const data=Object.keys(ASSOS).map(code=>{\r\n        const f=amp.features.find(x=>x.properties.code===code);\r\n        if(!f) return null;\r\n        const names=ASSOS[code], n=names.length;\r\n        return {code, names, n, xy:path.centroid(f), r:6+2.4*Math.sqrt(n), nom:f.properties.nom};\r\n      }).filter(Boolean).sort((a,b)=>b.r-a.r);\r\n\r\n      const g=gAsso.selectAll('.amp-asso').data(data).join('g')\r\n        .attr('class','amp-asso').attr('transform',d=>`translate(${d.xy})`);\r\n      g.append('circle').attr('r',d=>d.r);\r\n      g.append('text').text(d=>d.n);\r\n      g.on('mousemove',(ev,d)=>{\r\n        const list=d.names.slice(0,8).map(x=>`<li>${x.n}<\/li>`).join('');\r\n        const more=d.n>8?`<li>\u2026 +${d.n-8}<\/li>`:'';\r\n        showTip(`<b>${d.nom}<\/b><div class=\"amp-tip-meta\">${d.n} association${d.n>1?'s':''} accompagn\u00e9e${d.n>1?'s':''}<\/div><ul>${list}${more}<\/ul>`,ev);\r\n      }).on('mouseleave',hideTip)\r\n        .on('click',(ev,d)=>{ev.stopPropagation();\r\n          const f=amp.features.find(x=>x.properties.code===d.code);\r\n          if(f) zoomTo([f],60);\r\n          const t=CODE2TERR[d.code];\r\n          showPanel(d.nom, t?TERR_META[t].label:'', d.names, t?TERR_META[t].color:'#888');\r\n        });\r\n    }\r\n\r\n    \/* ===== Capsules vid\u00e9o =====\r\n       Une capsule = un point d'ancrage sur le territoire + un trait de rappel +\r\n       une vignette cliquable. Tout est dans un m\u00eame groupe contre-mis \u00e0\r\n       l'\u00e9chelle (cf. rescale), pour que le trait et la vignette gardent leurs\r\n       proportions \u00e0 l'\u00e9cran tout en restant accroch\u00e9s au bon endroit. *\/\r\n    \/\/ La hauteur laisse volontairement une bande un peu plus large sous la\r\n    \/\/ vignette que ne l'exigent les deux lignes : sans cette respiration, le\r\n    \/\/ nom du lieu vient buter sur le bord bas du carton.\r\n    \/* Les domaines de la plateforme vid\u00e9o sont assembl\u00e9s \u00e0 l'ex\u00e9cution, et non\r\n       \u00e9crits en clair. Complianz scanne le contenu des scripts \u00e0 la recherche de\r\n       ces motifs : en trouvant une URL, il classait tout le snippet en service\r\n       \u00ab marketing \u00bb et le servait en type=\"text\/plain\", donc jamais ex\u00e9cut\u00e9. La\r\n       carte enti\u00e8re disparaissait \u00e0 cause de cinq vignettes.\r\n\r\n       Ce n'est pas une fa\u00e7on de contourner le consentement : le lecteur ne se\r\n       cr\u00e9e qu'apr\u00e8s v\u00e9rification explicite aupr\u00e8s de Complianz (voir\r\n       hasVideoConsent). La diff\u00e9rence, c'est que la carte, elle, s'affiche. *\/\r\n    const V_HOST  = ['you','tube','-nocookie','.com'].join('');\r\n    const V_THUMB = ['i.','yt','img','.com'].join('');\r\n\r\n    const VCARD_W=120, VCARD_H=100, VTHUMB_H=62;\r\n\r\n    \/\/ Sur un \u00e9cran \u00e9troit une vignette de 134px mangerait la carte : on r\u00e9tr\u00e9cit\r\n    \/\/ l'ensemble du groupe plut\u00f4t que de recalculer chaque coordonn\u00e9e.\r\n    function videoScale(){ return W < 640 ? 0.72 : 1; }\r\n\r\n    \/* \u2500\u2500 Placement automatique dans le fond de carte \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\r\n       Des d\u00e9calages \u00e9crits \u00e0 la main finissent toujours par poser une vignette\r\n       sur une commune : le cadrage change avec la taille du conteneur et avec le\r\n       zoom. On cherche donc une position r\u00e9ellement vide.\r\n\r\n       Pour savoir si un point est sur un contour, on rasterise la carte une fois\r\n       dans un canvas hors \u00e9cran au quart de la r\u00e9solution, et on lit le canal\r\n       alpha. Un test point-dans-polygone sur ~150 anneaux co\u00fbtait beaucoup trop\r\n       cher : le placement en fait des dizaines de milliers, \u00e0 chaque trac\u00e9 et \u00e0\r\n       chaque fin de zoom. Ici c'est un acc\u00e8s tableau.\r\n\r\n       Le masque vit dans le rep\u00e8re projet\u00e9 non zoom\u00e9, comme les contours : il ne\r\n       d\u00e9pend donc que du mode et de la taille du conteneur. *\/\r\n    \/\/ Un demi-pixel de masque par pixel de carte. Au quart, une cellule couvrait\r\n    \/\/ 4 px non zoom\u00e9s \u2014 soit ~9 px \u00e0 l'\u00e9cran en vue Marseille : les liser\u00e9s\r\n    \/\/ c\u00f4tiers \u00e9troits passaient entre les mailles et un carton se posait dessus.\r\n    const MASK_SCALE=0.5;\r\n    let maskCache=null;\r\n\r\n    function landMask(mode){\r\n      const feats = mode==='arr' ? (arrFC ? arrFC.features : []) : (amp ? amp.features : []);\r\n      if(maskCache && maskCache.mode===mode && maskCache.feats===feats\r\n         && maskCache.w===W && maskCache.h===H) return maskCache;\r\n      const cw=Math.max(1,Math.ceil(W*MASK_SCALE)), ch=Math.max(1,Math.ceil(H*MASK_SCALE));\r\n      const cv=document.createElement('canvas'); cv.width=cw; cv.height=ch;\r\n      const ctx=cv.getContext('2d', {willReadFrequently:true});\r\n      ctx.scale(MASK_SCALE,MASK_SCALE);\r\n      const cpath=d3.geoPath(proj,ctx);\r\n      ctx.beginPath();\r\n      feats.forEach(f=>cpath(f));\r\n      ctx.fill();\r\n      let data=null;\r\n      try { data=ctx.getImageData(0,0,cw,ch).data; } catch(e){ data=null; }\r\n      maskCache={mode, feats, w:W, h:H, cw, ch, data};\r\n      return maskCache;\r\n    }\r\n\r\n    \/\/ Sans masque lisible (canvas indisponible), on consid\u00e8re le fond comme\r\n    \/\/ libre : le placement retombe alors sur les d\u00e9calages de la config.\r\n    function overLand(mask,x,y){\r\n      if(!mask || !mask.data) return false;\r\n      const cx=Math.floor(x*MASK_SCALE), cy=Math.floor(y*MASK_SCALE);\r\n      if(cx<0||cy<0||cx>=mask.cw||cy>=mask.ch) return false;\r\n      \/\/ Seuil \u00e0 z\u00e9ro : les bords rasteris\u00e9s sont antialias\u00e9s, donc de faible\r\n      \/\/ alpha. Les ignorer revenait \u00e0 rogner la carte de quelques pixels.\r\n      return mask.data[(cy*mask.cw+cx)*4+3] > 0;\r\n    }\r\n\r\n    const rectsOverlap=(a,b)=>!(a[2]<b[0]||b[2]<a[0]||a[3]<b[1]||b[3]<a[1]);\r\n\r\n    \/* Tout ce qui suit raisonne en pixels \u00e9cran, pas dans le rep\u00e8re projet\u00e9.\r\n       C'est ce que voit le visiteur : au zoom, seule une petite fen\u00eatre de la\r\n       carte est visible, et une position \u00ab libre \u00bb choisie dans le rep\u00e8re\r\n       projet\u00e9 pourrait tomber hors du champ. La conversion vers le masque se\r\n       fait au moment du test. *\/\r\n\r\n    \/\/ Obstacles \u00e0 \u00e9viter en plus des contours : les bulles de comptage, qui\r\n    \/\/ portent l'information chiffr\u00e9e de la carte. Elles sont contre-mises \u00e0\r\n    \/\/ l'\u00e9chelle, donc leur rayon \u00e0 l'\u00e9cran ne d\u00e9pend pas du zoom.\r\n    \/\/ Point d'accroche de la capsule dans le rep\u00e8re projet\u00e9.\r\n    function videoAnchor(v, mode){\r\n      if(mode==='arr'){\r\n        \/\/ Vue Marseille : on vise le secteur, pas la commune enti\u00e8re.\r\n        if(!v.secteur || !v.arr || !arrFC) return null;\r\n        const sectN = parseInt(v.secteur, 10);\r\n        const feats = arrFC.features.filter(f => Math.ceil(arrNum(f)\/2) === sectN);\r\n        if(!feats.length) return null;\r\n        const pts = feats.map(f => path.centroid(f));\r\n        return [d3.mean(pts, p=>p[0]), d3.mean(pts, p=>p[1])];\r\n      }\r\n      const f = amp && amp.features.find(x => x.properties.code === v.insee);\r\n      return f ? path.centroid(f) : null;\r\n    }\r\n\r\n    \/\/ Rayon, en pixels \u00e9cran, de la bulle de comptage pos\u00e9e au m\u00eame endroit que\r\n    \/\/ l'ancre. Le trait de rappel doit partir de son bord : s'il part du centre,\r\n    \/\/ il passe sur le nombre d'associations et le rend illisible.\r\n    function bubbleRadius(v, mode){\r\n      if(mode==='arr') return 18;              \/\/ bulle 12 + badge d\u00e9cal\u00e9 en haut-droite\r\n      const n=(ASSOS[v.insee]||[]).length;\r\n      return n ? 6+2.4*Math.sqrt(n) : 0;\r\n    }\r\n\r\n    function bubbleObstacles(mode,tr){\r\n      const out=[];\r\n      const push=(c,r)=>{\r\n        if(!isFinite(c[0])) return;\r\n        const x=tr.applyX(c[0]), y=tr.applyY(c[1]);\r\n        out.push([x-r,y-r,x+r,y+r]);\r\n      };\r\n      if(mode==='arr'){\r\n        if(arrFC) arrFC.features.forEach(f=>push(path.centroid(f),20));\r\n      } else if(amp){\r\n        Object.keys(ASSOS).forEach(code=>{\r\n          const f=amp.features.find(x=>x.properties.code===code);\r\n          if(f) push(path.centroid(f), 6+2.4*Math.sqrt(ASSOS[code].length)+4);\r\n        });\r\n      }\r\n      return out;\r\n    }\r\n\r\n    \/\/ Co\u00fbt d'une position : -1 si elle est inutilisable (hors cadre, sur une\r\n    \/\/ bulle de comptage ou sur une vignette d\u00e9j\u00e0 pos\u00e9e), sinon le nombre de\r\n    \/\/ points d'\u00e9chantillonnage tombant sur un contour. 0 = fond de carte pur.\r\n    function positionCost(cx,cy,halfW,halfH,mask,obstacles,tr){\r\n      if(cx-halfW<4||cx+halfW>W-4||cy-halfH<4||cy+halfH>H-4) return -1;\r\n      const rect=[cx-halfW,cy-halfH,cx+halfW,cy+halfH];\r\n      for(let i=0;i<obstacles.length;i++) if(rectsOverlap(rect,obstacles[i])) return -1;\r\n      \/\/ Grille 5x5 sur toute la bo\u00eete, marge comprise. Une grille 3x3 laissait\r\n      \/\/ passer les communes \u00e9troites gliss\u00e9es entre deux points de test : le\r\n      \/\/ carton se posait alors sur un liser\u00e9 de contour.\r\n      let n=0;\r\n      for(let sx=-1;sx<=1;sx+=0.5) for(let sy=-1;sy<=1;sy+=0.5){\r\n        if(overLand(mask, tr.invertX(cx+sx*halfW), tr.invertY(cy+sy*halfH))) n++;\r\n      }\r\n      return n;\r\n    }\r\n\r\n    \/\/ Candidats class\u00e9s par distance croissante puis par \u00e9cart d'angle avec la\r\n    \/\/ direction souhait\u00e9e : on reste au plus pr\u00e8s de l'intention d'origine tout\r\n    \/\/ en s'\u00e9loignant juste assez pour d\u00e9gager la carte. On renvoie la premi\u00e8re\r\n    \/\/ position enti\u00e8rement libre ; \u00e0 d\u00e9faut, celle qui mord le moins \u2014 un repli\r\n    \/\/ sur le d\u00e9calage d'origine reposerait la vignette en plein sur une commune.\r\n    function freeScreenPos(ax,ay,pref,vs,mask,obstacles,tr){\r\n      const halfW=(VCARD_W\/2+6)*vs, halfH=(VCARD_H\/2+6)*vs;\r\n      const prefAngle=Math.atan2(pref.dy,pref.dx);\r\n      const prefDist=Math.max(60,Math.hypot(pref.dx,pref.dy)*vs);\r\n      \/\/ On balaie du plus proche au plus lointain et on s'arr\u00eate au premier\r\n      \/\/ emplacement enti\u00e8rement libre : un trait un peu long reste lisible,\r\n      \/\/ une vignette pos\u00e9e sur trois communes ne l'est pas. Le repli \u00ab moins\r\n      \/\/ mauvais \u00bb ne retient que les positions proches (NEAR), pour ne pas\r\n      \/\/ renvoyer une vignette \u00e0 la fois lointaine ET pos\u00e9e sur la carte.\r\n      const NEAR=300, FAR=Math.max(320, Math.min(W,H)*0.9);\r\n      const dists=[prefDist];\r\n      for(let d=70;d<=FAR;d+=18) if(Math.abs(d-prefDist)>9) dists.push(d);\r\n      const turns=[0];\r\n      for(let a=10;a<=180;a+=10){ turns.push(a,-a); }\r\n      let best=null;\r\n      for(const d of dists){\r\n        for(const t of turns){\r\n          const ang=prefAngle+t*Math.PI\/180;\r\n          const cx=ax+Math.cos(ang)*d, cy=ay+Math.sin(ang)*d;\r\n          const cost=positionCost(cx,cy,halfW,halfH,mask,obstacles,tr);\r\n          if(cost===0) return [cx,cy];\r\n          if(cost>0 && d<=NEAR && (!best || cost<best.cost)) best={cost,cx,cy};\r\n        }\r\n      }\r\n      if(best) return [best.cx,best.cy];\r\n      \/\/ Dernier recours : le d\u00e9calage de la config, simplement ramen\u00e9 dans le\r\n      \/\/ cadre \u2014 mieux vaut une vignette pos\u00e9e sur la carte qu'une vignette\r\n      \/\/ absente ou hors champ.\r\n      return [Math.max(halfW,Math.min(W-halfW, ax+pref.dx*vs)),\r\n              Math.max(halfH,Math.min(H-halfH, ay+pref.dy*vs))];\r\n    }\r\n\r\n    function drawVideos(mode){\r\n      const vs = videoScale();\r\n      const tr = d3.zoomTransform(svgEl);\r\n      const k = tr.k || 1;\r\n      const mask = landMask(mode);\r\n      const obstacles = bubbleObstacles(mode, tr);\r\n      const halfW=(VCARD_W\/2+6)*vs, halfH=(VCARD_H\/2+6)*vs;\r\n\r\n      const data = VIDEOS.map(v => {\r\n        const off = mode==='arr' ? v.arr : v.zones;\r\n        if(!off) return null;\r\n        const xy = videoAnchor(v, mode);\r\n        if(!xy || isNaN(xy[0])) return null;\r\n\r\n        \/\/ Ancre et vignette en pixels \u00e9cran ; le groupe SVG porte scale(vs\/k)\r\n        \/\/ sous un gRoot zoom\u00e9, donc un d\u00e9calage local vaut vs pixels \u00e9cran.\r\n        const ax = tr.applyX(xy[0]), ay = tr.applyY(xy[1]);\r\n        const [cx,cy] = freeScreenPos(ax,ay,off,vs,mask,obstacles,tr);\r\n        const dx=(cx-ax)\/vs, dy=(cy-ay)\/vs;\r\n\r\n        \/\/ La vignette plac\u00e9e devient \u00e0 son tour un obstacle : deux capsules\r\n        \/\/ ancr\u00e9es au m\u00eame endroit (les marseillaises) doivent diverger.\r\n        obstacles.push([cx-halfW,cy-halfH,cx+halfW,cy+halfH]);\r\n\r\n        \/\/ D\u00e9part du trait : sur la direction de la vignette, juste au-del\u00e0 de la\r\n        \/\/ bulle de comptage, exprim\u00e9 dans le rep\u00e8re local du groupe.\r\n        const len = Math.hypot(dx,dy) || 1;\r\n        const start = (bubbleRadius(v, mode) + 4) \/ vs;\r\n        return Object.assign({}, v, {\r\n          xy, dx, dy,\r\n          sx: dx\/len*start, sy: dy\/len*start,\r\n          hasBubble: bubbleRadius(v, mode) > 0\r\n        });\r\n      }).filter(Boolean);\r\n\r\n      const g = gVideo.selectAll('.amp-video').data(data, d=>d.id).join('g')\r\n        .attr('class','amp-video')\r\n        .attr('transform',d=>`translate(${d.xy}) scale(${vs\/k})`);\r\n      g.selectAll('*').remove();\r\n\r\n      \/\/ Trait de rappel + pastille d'ancrage : d\u00e9coratifs, ils ne captent pas le clic.\r\n      g.append('line').attr('class','amp-video-leader')\r\n        .attr('x1',d=>d.sx).attr('y1',d=>d.sy).attr('x2',d=>d.dx).attr('y2',d=>d.dy)\r\n        .style('pointer-events','none');\r\n      \/\/ Pastille uniquement l\u00e0 o\u00f9 il n'y a pas d\u00e9j\u00e0 de bulle de comptage :\r\n      \/\/ sinon elle se poserait dessus et cacherait le nombre d'associations.\r\n      g.filter(d=>!d.hasBubble).append('circle').attr('class','amp-video-anchor').attr('r',4.5)\r\n        .style('pointer-events','none');\r\n\r\n      const card = g.append('g')\r\n        .attr('transform',d=>`translate(${d.dx},${d.dy})`)\r\n        .attr('role','button').attr('tabindex',0)\r\n        .attr('aria-label',d=>`Voir le t\u00e9moignage : ${d.asso}`);\r\n\r\n      card.append('rect').attr('class','amp-video-card')\r\n        .attr('x',-VCARD_W\/2).attr('y',-VCARD_H\/2)\r\n        .attr('width',VCARD_W).attr('height',VCARD_H).attr('rx',9);\r\n\r\n      \/\/ La vignette est une image statique servie sans cookie ; le lecteur, lui,\r\n      \/\/ n'est charg\u00e9 qu'au clic, et seulement si le visiteur a donn\u00e9 son accord.\r\n      const tw=VCARD_W-10, tx=-tw\/2, ty=-VCARD_H\/2+5;\r\n      card.each(function(d){\r\n        const cid = 'amp-vclip-'+d.id;\r\n        const sel = d3.select(this);\r\n        sel.append('clipPath').attr('id',cid)\r\n          .append('rect').attr('x',tx).attr('y',ty)\r\n          .attr('width',tw).attr('height',VTHUMB_H).attr('rx',6);\r\n        sel.append('image')\r\n          .attr('href',`https:\/\/${V_THUMB}\/vi\/${d.id}\/mqdefault.jpg`)\r\n          .attr('x',tx).attr('y',ty).attr('width',tw).attr('height',VTHUMB_H)\r\n          .attr('preserveAspectRatio','xMidYMid slice')\r\n          .attr('clip-path',`url(#${cid})`);\r\n      });\r\n\r\n      const pcy = ty + VTHUMB_H\/2;\r\n      card.append('circle').attr('class','amp-video-play')\r\n        .attr('cx',0).attr('cy',pcy).attr('r',14);\r\n      card.append('path').attr('class','amp-video-play-tri')\r\n        .attr('d',`M-4.5,${pcy-6.5} L8,${pcy} L-4.5,${pcy+6.5} Z`);\r\n\r\n      card.append('text').attr('class','amp-video-label')\r\n        .attr('x',tx+2).attr('y',ty+VTHUMB_H+14)\r\n        .text(d=>d.asso.length>22 ? d.asso.slice(0,21)+'\u2026' : d.asso);\r\n      card.append('text').attr('class','amp-video-sub')\r\n        .attr('x',tx+2).attr('y',ty+VTHUMB_H+25)\r\n        .text(d=>d.lieu);\r\n\r\n      card.on('click',(ev,d)=>{ ev.stopPropagation(); openVideo(d); })\r\n          .on('keydown',(ev,d)=>{\r\n            if(ev.key==='Enter'||ev.key===' '){ ev.preventDefault(); openVideo(d); }\r\n          })\r\n          .on('mousemove',(ev,d)=>showTip(\r\n            `<b>${d.asso}<\/b><div class=\"amp-tip-meta\">${d.lieu} \u00b7 t\u00e9moignage vid\u00e9o<\/div>`,ev))\r\n          .on('mouseleave',hideTip);\r\n    }\r\n\r\n    \/* ===== Lecteur ===== *\/\r\n    const vmodal=$('amp-vmodal'), vframe=$('amp-vmodal-frame'), vtitle=$('amp-vmodal-title');\r\n    let vLastFocus=null;\r\n\r\n    \/\/ Consentement : c'est Complianz qui fait foi quand il est pr\u00e9sent. En son\r\n    \/\/ absence (page hors WordPress, plugin d\u00e9sactiv\u00e9), on laisse passer \u2014 il n'y\r\n    \/\/ a alors aucune r\u00e8gle de consentement \u00e0 respecter sur cette page.\r\n    function hasVideoConsent(){\r\n      if(typeof window.cmplz_has_consent !== 'function') return true;\r\n      try { return !!window.cmplz_has_consent('marketing'); }\r\n      catch(e){ return false; }\r\n    }\r\n\r\n    function openVideo(d){\r\n      hideTip();\r\n      vLastFocus = document.activeElement;\r\n      vtitle.textContent = d.titre || d.asso;\r\n      vmodal.querySelector('.amp-vmodal-box').classList.toggle('amp-vshort', !!d.short);\r\n\r\n      if(!hasVideoConsent()){\r\n        \/\/ Pas d'accord marketing : on n'\u00e9met aucune requ\u00eate vers la plateforme\r\n        \/\/ et on explique comment d\u00e9bloquer la lecture.\r\n        const box=document.createElement('div');\r\n        box.className='amp-vconsent';\r\n        box.innerHTML='<p>La lecture des t\u00e9moignages passe par un lecteur externe, '\r\n          + 'qui d\u00e9pose des cookies.<\/p><p>Autorisez les cookies \u00ab marketing \u00bb pour '\r\n          + 'les regarder ici.<\/p><button type=\"button\" class=\"amp-vconsent-btn\">'\r\n          + 'R\u00e9gler mes cookies<\/button>';\r\n        box.querySelector('button').addEventListener('click',()=>{\r\n          if(typeof window.cmplz_show_banner === 'function') window.cmplz_show_banner();\r\n          else document.querySelector('.cmplz-manage-consent, .cmplz-link')?.click();\r\n        });\r\n        vframe.replaceChildren(box);\r\n      } else {\r\n        \/\/ Cr\u00e9\u00e9e seulement maintenant : aucune requ\u00eate sortante tant qu'on n'a pas\r\n        \/\/ cliqu\u00e9, et jamais sans consentement.\r\n        const fr=document.createElement('iframe');\r\n        fr.src=`https:\/\/www.${V_HOST}\/embed\/${d.id}?autoplay=1&rel=0&modestbranding=1`;\r\n        fr.title=d.titre || d.asso;\r\n        fr.allow='accelerometer; autoplay; clipboard-write; encrypted-media; picture-in-picture';\r\n        fr.allowFullscreen=true;\r\n        vframe.replaceChildren(fr);\r\n      }\r\n\r\n      vmodal.classList.add('amp-open');\r\n      vmodal.setAttribute('aria-hidden','false');\r\n      $('amp-vmodal-close').focus();\r\n    }\r\n    function closeVideo(){\r\n      if(!vmodal.classList.contains('amp-open')) return;\r\n      vmodal.classList.remove('amp-open');\r\n      vmodal.setAttribute('aria-hidden','true');\r\n      vframe.replaceChildren();   \/\/ coupe le son et la lecture\r\n      if(vLastFocus && vLastFocus.focus) vLastFocus.focus();\r\n    }\r\n    $('amp-vmodal-close').addEventListener('click',closeVideo);\r\n    vmodal.addEventListener('click',ev=>{ if(ev.target===vmodal) closeVideo(); });\r\n    document.addEventListener('keydown',ev=>{ if(ev.key==='Escape') closeVideo(); });\r\n\r\n    \/* ===== Arrondissements de Marseille ===== *\/\r\n    function showArr(){\r\n      const seq=['#1d3a5c','#24476d','#2f5a86','#3a6d9e','#4a90c8','#6aa6d4','#86b8de','#a6cbe8',\r\n                 '#6d4f84','#825f9c','#9678b0','#ab92c4','#c0acd8','#b94a73','#c96a8d','#d98aa7'];\r\n      const draw=()=>{\r\n        gArr.selectAll('path').data(arrFC.features).join('path')\r\n          .attr('class','amp-arr').attr('d',path)\r\n          .attr('fill',(f,i)=>seq[i%seq.length]).attr('fill-opacity',.92)\r\n          .on('mousemove',(ev,f)=>{\r\n            const n=arrNum(f);\r\n            const sectN=Math.ceil(n\/2);\r\n            const normKey=sectN===1?'1er secteur':`${sectN}eme secteur`;\r\n            const filtered=(ASSOS['13055']||[]).filter(a=>a.sectNorm===normKey);\r\n            const displaySect=filtered.length?filtered[0].sect:(sectN===1?'1er secteur':`${sectN}\u00e8me secteur`);\r\n            const cnt=filtered.length;\r\n            showTip(`<b>Marseille ${n}<sup>e<\/sup> arr.<\/b><div class=\"amp-tip-meta\">${displaySect}${cnt?' \u00b7 '+cnt+' asso'+(cnt>1?'s':''):''}<\/div>`,ev);\r\n          })\r\n          .on('mouseleave',hideTip)\r\n          .on('click',(ev,f)=>{\r\n            const n=arrNum(f);\r\n            const sectN=Math.ceil(n\/2);\r\n            const normKey=sectN===1?'1er secteur':`${sectN}eme secteur`;\r\n            const i=arrFC.features.indexOf(f);\r\n            const color=seq[i%seq.length];\r\n            const filtered=(ASSOS['13055']||[]).filter(a=>a.sectNorm===normKey);\r\n            const displaySect=filtered.length?filtered[0].sect:(sectN===1?'1er secteur':`${sectN}\u00e8me secteur`);\r\n            showPanel(`Marseille \u00b7 ${n}\u1d49 arr.`, displaySect, filtered.length?filtered:(ASSOS['13055']||[]), color);\r\n          });\r\n        \/\/ Num\u00e9ro d'arrondissement int\u00e9gr\u00e9 dans la bulle \u2192 suppression du label s\u00e9par\u00e9\r\n        gLabels.selectAll('text.amp-alabel').data([]).join('text');\r\n        \/\/ Bulles pour TOUS les arrondissements : num\u00e9ro visible + badge asso si pertinent\r\n        const bubData=arrFC.features.map((f,i)=>{\r\n          const n=arrNum(f);\r\n          const sectN=Math.ceil(n\/2);\r\n          const normKey=sectN===1?'1er secteur':`${sectN}eme secteur`;\r\n          const assos=(ASSOS['13055']||[]).filter(a=>a.sectNorm===normKey);\r\n          const displaySect=assos.length?assos[0].sect:(sectN===1?'1er secteur':`${sectN}\u00e8me secteur`);\r\n          return {n, sectN, normKey, assos, displaySect, count:assos.length, xy:path.centroid(f), color:seq[i%seq.length]};\r\n        });\r\n        const k0=d3.zoomTransform(svgEl).k;\r\n        const bg=gArrAsso.selectAll('.amp-arr-bubble').data(bubData).join('g')\r\n          .attr('class','amp-arr-bubble').attr('transform',d=>`translate(${d.xy}) scale(${1\/k0})`);\r\n        bg.selectAll('*').remove();\r\n        \/\/ Cercle principal : couleur secteur si asso, sinon blanc semi-transparent\r\n        bg.append('circle').attr('r',12)\r\n          .attr('fill',d=>d.count>0?d.color:'rgba(255,255,255,0.55)')\r\n          .attr('stroke','#fff').attr('stroke-width',1.8).attr('opacity',.94);\r\n        \/\/ Num\u00e9ro d'arrondissement dans la bulle\r\n        bg.append('text').text(d=>d.n+'\u1d49')\r\n          .attr('text-anchor','middle').attr('dominant-baseline','central')\r\n          .attr('fill',d=>d.count>0?'#fff':'rgba(36,71,109,0.85)')\r\n          .attr('font-size','9').attr('font-weight','800');\r\n        \/\/ Badge avec le nombre d'assos (uniquement si > 0), d\u00e9cal\u00e9 en haut-droite\r\n        const bads=bg.filter(d=>d.count>0);\r\n        bads.append('circle')\r\n          .attr('cx',9).attr('cy',-9).attr('r',6.5)\r\n          .attr('fill','#e0a32a').attr('stroke','#fff').attr('stroke-width',1.5);\r\n        bads.append('text').attr('x',9).attr('y',-9)\r\n          .text(d=>d.count)\r\n          .attr('text-anchor','middle').attr('dominant-baseline','central')\r\n          .attr('fill','#3a2a00').attr('font-size','7.5').attr('font-weight','800');\r\n        bg.on('mousemove',(ev,d)=>{\r\n          const list=d.assos.slice(0,8).map(a=>`<li>${a.n}<\/li>`).join('');\r\n          const more=d.count>8?`<li>\u2026 +${d.count-8}<\/li>`:'';\r\n          showTip(`<b>Marseille ${d.n}<sup>e<\/sup> arr.<\/b><div class=\"amp-tip-meta\">${d.displaySect}${d.count?' \u00b7 '+d.count+' asso'+(d.count>1?'s':''):''}<\/div>${d.count?'<ul>'+list+more+'<\/ul>':''}`,ev);\r\n        }).on('mouseleave',hideTip)\r\n          .on('click',(ev,d)=>{ev.stopPropagation();\r\n            showPanel(`Marseille \u00b7 ${d.n}\u1d49 arr.`, d.displaySect, d.assos.length?d.assos:(ASSOS['13055']||[]), d.color);\r\n          });\r\n        gZones.style('display','none');\r\n        gLabels.selectAll('text.amp-zlabel').style('display','none');\r\n        gAsso.style('display','none');\r\n        gArrAsso.style('display',null);\r\n        gArr.style('display',null);\r\n        drawVideos('arr');\r\n        zoomTo(arrFC.features,20);\r\n      };\r\n      if(arrFC) return draw();\r\n      $('amp-loader').style.display='flex'; $('amp-loader').textContent=\"Chargement des arrondissements\u2026\";\r\n      d3.json(ARR_URL).then(resp=>{\r\n        const results=(resp&&resp.results)||[];\r\n        const feats=results.filter(r=>r.geo_shape&&r.geo_shape.geometry).map(r=>({\r\n          type:\"Feature\",\r\n          properties:{\r\n            code:(Array.isArray(r.com_arm_code)?r.com_arm_code[0]:r.com_arm_code),\r\n            name:(Array.isArray(r.com_arm_name)?r.com_arm_name[0]:r.com_arm_name)\r\n          },\r\n          geometry:rewind(r.geo_shape.geometry)\r\n        }));\r\n        if(!feats.length) throw new Error(\"aucun arrondissement re\u00e7u\");\r\n        feats.sort((a,b)=>arrNum(a)-arrNum(b));\r\n        arrFC={type:\"FeatureCollection\",features:feats};\r\n        $('amp-loader').style.display='none'; draw();\r\n      }).catch(e=>{ console.error('[carte] arrondissements',e); $('amp-loader').style.display='flex'; $('amp-loader').textContent=\"Arrondissements indisponibles : \"+e.message; });\r\n    }\r\n    function arrNum(f){\r\n      const code=(f.properties.code||'')+''; \/\/ 13201..13216\r\n      const m=code.match(\/^132(\\d\\d)$\/); if(m) return parseInt(m[1],10);\r\n      const nm=(f.properties.name||'')+''; const mm=nm.match(\/(\\d+)\/); return mm?parseInt(mm[1],10):0;\r\n    }\r\n    function showZones(){\r\n      gArr.style('display','none');\r\n      gArrAsso.style('display','none');\r\n      gLabels.selectAll('text.amp-alabel').remove();\r\n      gZones.style('display',null);\r\n      gLabels.selectAll('text.amp-zlabel').style('display',null);\r\n      gAsso.style('display',null);\r\n      drawVideos('zones');\r\n    }\r\n\r\n    \/* ===== contr\u00f4les ===== *\/\r\n    document.querySelectorAll('#amp-map .amp-chip').forEach(btn=>{\r\n      btn.addEventListener('click',()=>{\r\n        const v=btn.dataset.view;\r\n        if(v==='reset'){\r\n          if(view==='arr'){view='zones';showZones();syncChips('zones');}\r\n          resetZoom(); return;\r\n        }\r\n        syncChips(v);\r\n        if(v==='arr'){view='arr'; showArr();}\r\n        else {view='zones'; showZones(); resetZoom();}\r\n      });\r\n    });\r\n    function syncChips(v){\r\n      document.querySelectorAll('#amp-map .amp-chip').forEach(b=>{\r\n        if(b.dataset.view==='reset') return;\r\n        b.classList.toggle('amp-on',b.dataset.view===v);\r\n      });\r\n    }\r\n\r\n    function buildLegend(){\r\n      const total=Object.values(ASSOS).reduce((s,a)=>s+a.length,0);\r\n      const html=Object.keys(TERR_META).map(t=>\r\n        `<span><i style=\"background:${TERR_META[t].color}\"><\/i>${TERR_META[t].label}<\/span>`).join('')\r\n        +`<span><i class=\"amp-dot\" style=\"background:var(--marker)\"><\/i>${total} associations accompagn\u00e9es<\/span>`;\r\n      $('amp-legend').innerHTML=html;\r\n    }\r\n\r\n    \/\/ redimensionnement\r\n    let rt;\r\n    window.addEventListener('resize',()=>{\r\n      clearTimeout(rt); rt=setTimeout(()=>{\r\n        W=stage.clientWidth; H=stage.clientHeight;\r\n        svg.attr('viewBox',`0 0 ${W} ${H}`);\r\n        if(!amp) return;\r\n        proj.fitSize([W,H],amp);\r\n        gZones.selectAll('path').attr('d',path);\r\n        if(arrFC) gArr.selectAll('path').attr('d',path);\r\n        drawZones(); drawAssos(); drawVideos(view==='arr'?'arr':'zones');\r\n        svg.call(zoom.transform,d3.zoomIdentity);\r\n      },200);\r\n    });\r\n  }\r\n})();\r\n<\/script>\r\n\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>","protected":false},"excerpt":{"rendered":"","protected":false},"author":64,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_et_pb_use_builder":"off","_et_pb_old_content":"","_et_gb_content_width":"","footnotes":""},"class_list":["post-23813700","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Carte m\u00e9tropole - Social Hackers Lab<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/socialhackerslab.com\/en\/carte-metropole-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Carte m\u00e9tropole - Social Hackers Lab\" \/>\n<meta property=\"og:url\" content=\"https:\/\/socialhackerslab.com\/en\/carte-metropole-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Social Hackers Lab\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/profile.php?id=61561806211570\" \/>\n<meta property=\"article:modified_time\" content=\"2026-09-28T13:31:42+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/socialhackerslab.com\/wp-content\/uploads\/2024\/10\/Social-Hacker-Lab-1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"250\" \/>\n\t<meta property=\"og:image:height\" content=\"140\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/socialhackerslab.com\\\/carte-metropole-2\\\/\",\"url\":\"https:\\\/\\\/socialhackerslab.com\\\/carte-metropole-2\\\/\",\"name\":\"Carte m\u00e9tropole - Social Hackers Lab\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/socialhackerslab.com\\\/#website\"},\"datePublished\":\"2026-06-19T15:54:44+00:00\",\"dateModified\":\"2026-09-28T13:31:42+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/socialhackerslab.com\\\/carte-metropole-2\\\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/socialhackerslab.com\\\/carte-metropole-2\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/socialhackerslab.com\\\/carte-metropole-2\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Accueil\",\"item\":\"https:\\\/\\\/socialhackerslab.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Carte m\u00e9tropole\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/socialhackerslab.com\\\/#website\",\"url\":\"https:\\\/\\\/socialhackerslab.com\\\/\",\"name\":\"SocialHackersLab\",\"description\":\"Hacking Social pour une soci\u00e9t\u00e9 \u00e9galitaire\",\"publisher\":{\"@id\":\"https:\\\/\\\/socialhackerslab.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/socialhackerslab.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/socialhackerslab.com\\\/#organization\",\"name\":\"Social Hackers Lab\",\"url\":\"https:\\\/\\\/socialhackerslab.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\\\/\\\/socialhackerslab.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/socialhackerslab.com\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/BW-SHL.png\",\"contentUrl\":\"https:\\\/\\\/socialhackerslab.com\\\/wp-content\\\/uploads\\\/2024\\\/10\\\/BW-SHL.png\",\"width\":3431,\"height\":3431,\"caption\":\"Social Hackers Lab\"},\"image\":{\"@id\":\"https:\\\/\\\/socialhackerslab.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/profile.php?id=61561806211570\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/socialhackerslab\\\/\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Carte m\u00e9tropole - Social Hackers Lab","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/socialhackerslab.com\/en\/carte-metropole-2\/","og_locale":"en_GB","og_type":"article","og_title":"Carte m\u00e9tropole - Social Hackers Lab","og_url":"https:\/\/socialhackerslab.com\/en\/carte-metropole-2\/","og_site_name":"Social Hackers Lab","article_publisher":"https:\/\/www.facebook.com\/profile.php?id=61561806211570","article_modified_time":"2026-09-28T13:31:42+00:00","og_image":[{"width":250,"height":140,"url":"https:\/\/socialhackerslab.com\/wp-content\/uploads\/2024\/10\/Social-Hacker-Lab-1.png","type":"image\/png"}],"twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/socialhackerslab.com\/carte-metropole-2\/","url":"https:\/\/socialhackerslab.com\/carte-metropole-2\/","name":"Carte m\u00e9tropole - Social Hackers Lab","isPartOf":{"@id":"https:\/\/socialhackerslab.com\/#website"},"datePublished":"2026-06-19T15:54:44+00:00","dateModified":"2026-09-28T13:31:42+00:00","breadcrumb":{"@id":"https:\/\/socialhackerslab.com\/carte-metropole-2\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/socialhackerslab.com\/carte-metropole-2\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/socialhackerslab.com\/carte-metropole-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Accueil","item":"https:\/\/socialhackerslab.com\/"},{"@type":"ListItem","position":2,"name":"Carte m\u00e9tropole"}]},{"@type":"WebSite","@id":"https:\/\/socialhackerslab.com\/#website","url":"https:\/\/socialhackerslab.com\/","name":"SocialHackersLab","description":"Hacking Social pour une soci\u00e9t\u00e9 \u00e9galitaire","publisher":{"@id":"https:\/\/socialhackerslab.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/socialhackerslab.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Organization","@id":"https:\/\/socialhackerslab.com\/#organization","name":"Social Hackers Lab","url":"https:\/\/socialhackerslab.com\/","logo":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/socialhackerslab.com\/#\/schema\/logo\/image\/","url":"https:\/\/socialhackerslab.com\/wp-content\/uploads\/2024\/10\/BW-SHL.png","contentUrl":"https:\/\/socialhackerslab.com\/wp-content\/uploads\/2024\/10\/BW-SHL.png","width":3431,"height":3431,"caption":"Social Hackers Lab"},"image":{"@id":"https:\/\/socialhackerslab.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/profile.php?id=61561806211570","https:\/\/www.linkedin.com\/company\/socialhackerslab\/"]}]}},"_links":{"self":[{"href":"https:\/\/socialhackerslab.com\/en\/wp-json\/wp\/v2\/pages\/23813700","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/socialhackerslab.com\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/socialhackerslab.com\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/socialhackerslab.com\/en\/wp-json\/wp\/v2\/users\/64"}],"replies":[{"embeddable":true,"href":"https:\/\/socialhackerslab.com\/en\/wp-json\/wp\/v2\/comments?post=23813700"}],"version-history":[{"count":1,"href":"https:\/\/socialhackerslab.com\/en\/wp-json\/wp\/v2\/pages\/23813700\/revisions"}],"predecessor-version":[{"id":23813701,"href":"https:\/\/socialhackerslab.com\/en\/wp-json\/wp\/v2\/pages\/23813700\/revisions\/23813701"}],"wp:attachment":[{"href":"https:\/\/socialhackerslab.com\/en\/wp-json\/wp\/v2\/media?parent=23813700"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}