/* La Carte de la Basse Vision — prototype v2 (store locator plein écran) */

:root {
  --ink: #16233b;
  --ink-soft: #4a5670;
  --paper: #f7f8fa;
  --card: #ffffff;
  --line: #dfe4ee;
  --accent: #1d4ed8;
  --accent-ink: #163ea8;
  --gold: #ffd166;

  --c-association: #2563eb;
  --c-bibliotheque-sonore: #7c3aed;
  --c-reeducation: #0d9488;
  --c-chiens-guides: #b45309;
  --c-services-publics: #475569;
  --c-sport-loisirs: #dc2626;
  --c-professionnel: #db2777;

  --topbar-h: 62px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.45;
  overflow: hidden;
}

.skip-link {
  position: absolute; left: -9999px; top: 0;
  background: var(--ink); color: #fff; padding: .6rem 1rem; z-index: 3000;
}
.skip-link:focus { left: 0; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- barre haute ---------- */
.topbar {
  height: var(--topbar-h);
  display: flex; align-items: center; gap: 1.2rem;
  padding: 0 1.1rem;
  background: linear-gradient(90deg, #16233b, #1d3a6e);
  color: #fff;
}
.brand {
  display: flex; align-items: center; gap: .5rem; margin: 0;
  font-weight: 800; letter-spacing: .03em; font-size: .95rem;
  text-transform: uppercase; white-space: nowrap;
}
.brand-mark {
  width: 1rem; height: 1rem; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--gold) 0 28%, #fff 30% 40%, var(--gold) 42% 100%);
  box-shadow: 0 0 0 3px rgba(255,255,255,.22);
}
.tagline { margin: 0; font-size: .85rem; opacity: .85; flex: 1; min-width: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stats { margin: 0; font-size: .8rem; font-weight: 700; color: var(--gold); white-space: nowrap; }

/* ---------- app plein écran ---------- */
.app { position: relative; height: calc(100vh - var(--topbar-h)); }
#map { position: absolute; inset: 0; background: #e8ecf3; }
.leaflet-container { font: inherit; }

/* ---------- panneau ---------- */
.panel {
  position: absolute; z-index: 1000;
  top: 14px; left: 14px;
  max-height: calc(100% - 28px);
  width: 390px; max-width: calc(100vw - 28px);
  display: flex; flex-direction: column;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(6px);
  border: 1px solid var(--line);
  border-radius: .9rem;
  box-shadow: 0 12px 40px rgba(22,35,59,.18);
  overflow: hidden;
}
.panel-head { padding: .9rem .9rem .6rem; }
.panel-list:not([hidden]) ~ .panel-foot, .panel-head { border-bottom: 1px solid var(--line); }
.panel-list[hidden] { display: none; }

.country-switch { display: flex; gap: .35rem; margin-bottom: .6rem; }
.cbtn {
  flex: 1; padding: .38rem .5rem;
  border: 1.5px solid var(--line); background: #fff; border-radius: .55rem;
  font: inherit; font-size: .88rem; font-weight: 700; color: var(--ink-soft);
  cursor: pointer;
}
.cbtn.on { background: #16233b; border-color: #16233b; color: #fff; }
.cbtn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
#search {
  width: 100%; font-size: 1rem; padding: .6rem .85rem;
  border: 2px solid var(--line); border-radius: .6rem; background: #fff;
}
#search:focus { outline: 3px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }

.filters { border: 0; margin: .6rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .35rem; }
.chip {
  display: inline-flex; align-items: center; gap: .32rem;
  border: 1.5px solid var(--line); background: #fff;
  border-radius: 2rem; padding: .22rem .6rem .22rem .4rem;
  font-size: .8rem; font-weight: 600; color: var(--ink-soft);
  cursor: pointer; user-select: none;
}
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip .ico {
  width: 1.25rem; height: 1.25rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .78rem; background: color-mix(in srgb, var(--dot) 15%, #fff);
}
.chip.on { border-color: var(--dot); color: var(--ink); background: color-mix(in srgb, var(--dot) 9%, #fff); }
.chip:not(.on) { opacity: .55; }
.chip:has(input:focus-visible) { outline: 3px solid var(--accent); outline-offset: 2px; }

.result-count { margin: .55rem 0 0; font-size: .8rem; color: var(--ink-soft); }

.panel-list { flex: 1; overflow-y: auto; padding: .5rem .6rem .8rem; scroll-behavior: smooth; }

.row {
  display: flex; gap: .6rem; align-items: flex-start;
  width: 100%; text-align: left;
  background: #fff; border: 1px solid var(--line); border-radius: .65rem;
  padding: .55rem .65rem; margin-bottom: .45rem;
  cursor: pointer; font: inherit; color: inherit;
}
.row:hover, .row:focus-visible { border-color: var(--dot, var(--accent)); box-shadow: 0 2px 10px rgba(22,35,59,.10); }
.row:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.row .ico {
  flex: none; width: 2rem; height: 2rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; font-size: 1.05rem;
  background: color-mix(in srgb, var(--dot) 14%, #fff);
  border: 2px solid var(--dot);
}
.row .txt { min-width: 0; }
.row h3 { margin: 0; font-size: .92rem; line-height: 1.25; }
.row .meta { margin: .1rem 0 0; font-size: .8rem; color: var(--ink-soft); }
.row .contact { margin: .15rem 0 0; font-size: .8rem; }
.row .contact a { color: var(--accent-ink); font-weight: 600; margin-right: .7rem; }
.empty { padding: 1rem .5rem; color: var(--ink-soft); font-size: .9rem; }

.olga-mini {
  display: flex; align-items: center; gap: .65rem;
  margin: .5rem .6rem;
  padding: .55rem .7rem;
  background: linear-gradient(115deg, #16233b, #1d3a6e);
  border-radius: .7rem;
  color: #fff; text-decoration: none;
  font-size: .84rem; line-height: 1.35;
}
.olga-mini:hover { background: linear-gradient(115deg, #1a2a47, #24478a); }
.olga-mini img {
  flex: none; width: 46px; height: 46px; object-fit: cover;
  border-radius: .5rem;
}
.olga-mini strong { color: var(--gold); }
.olga-mini .by {
  display: block; margin-bottom: .2rem;
  font-size: .7rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--gold);
}

.panel-foot {
  padding: .55rem .9rem; border-top: 1px solid var(--line);
  font-size: .78rem; color: var(--ink-soft); background: #fbfcfe;
}
.panel-foot a { color: var(--accent-ink); font-weight: 600; }
.panel-foot .credit { opacity: .85; }

/* ---------- marqueurs (carré arrondi + pointe centrée) ---------- */
.pin {
  position: relative;
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 27%;
  background: #fff;
  border: 2.5px solid var(--dot);
  box-shadow: 0 2px 5px rgba(0,0,0,.32);
  font-size: 17px;
}
.pin::after {   /* la pointe */
  content: ''; position: absolute; bottom: -8px; left: 50%; transform: translateX(-50%);
  border-left: 6px solid transparent; border-right: 6px solid transparent;
  border-top: 8px solid var(--dot);
}
.pin.active { outline: 3px solid var(--gold); }
.pin .logo { width: 82%; height: 82%; object-fit: contain; border-radius: 16%; }
.pin .logo.full { width: 100%; height: 100%; object-fit: cover; border-radius: 22%; }
.row .ico img { width: 22px; height: 22px; object-fit: contain; border-radius: 3px; }
.cluster {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  background: #16233b; color: #fff;
  border-radius: 50%; border: 3px solid #fff;
  font-weight: 700; font-size: .82rem;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.leaflet-tooltip.name-tip {
  font-weight: 600; font-size: .82rem; color: var(--ink);
  border-radius: .45rem; border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(22,35,59,.18); padding: .25rem .55rem;
}

.leaflet-popup-content-wrapper { border-radius: .7rem; }
.leaflet-popup-content { margin: .9rem 1rem; font-size: .92rem; line-height: 1.4; }
.popup h3 { margin: 0 0 .2rem; font-size: 1rem; line-height: 1.3; }
.popup .badge {
  display: inline-block; font-size: .68rem; font-weight: 700;
  letter-spacing: .03em; text-transform: uppercase;
  color: #fff; background: var(--dot, #666);
  border-radius: .3rem; padding: .08rem .4rem; margin-bottom: .35rem;
}
.popup p { margin: .15rem 0; }
.popup a { color: var(--accent-ink); }
.popup .claim { font-size: .78rem; margin-top: .45rem; color: var(--ink-soft); }

/* ---------- mobile ---------- */
@media (max-width: 720px) {
  body { overflow: auto; }
  .tagline, .stats { display: none; }
  .app { height: auto; }
  #map { position: relative; height: 52vh; }
  .panel {
    position: relative; inset: auto; width: auto; max-width: none;
    margin: .6rem; height: 60vh;
  }
}

.pin-native { }  /* ombre retirée : les vieux PNG l'ont déjà intégrée (fin du doublon) */

/* ---------- dialogue de contribution ---------- */
dialog#contrib {
  border: 0; border-radius: .9rem; padding: 0;
  width: min(480px, calc(100vw - 2rem));
  box-shadow: 0 24px 70px rgba(22,35,59,.35);
}
dialog#contrib::backdrop { background: rgba(22,35,59,.45); }
#contrib-form { padding: 1.2rem 1.4rem 1.1rem; font-size: .95rem; }
#contrib-form h3 { margin: 0 0 .8rem; font-size: 1.15rem; color: #16233b; }
#contrib-form label { display: block; margin: .6rem 0 .2rem; font-weight: 600; font-size: .88rem; color: #16233b; }
#contrib-form input:not(.hp), #contrib-form select, #contrib-form textarea {
  width: 100%; font: inherit; padding: .5rem .7rem;
  border: 1.5px solid #cbd3e1; border-radius: .5rem; margin-top: .25rem;
}
#contrib-form input:focus, #contrib-form select:focus, #contrib-form textarea:focus {
  outline: 3px solid #1d4ed8; outline-offset: 1px;
}
#contrib-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
#contrib-form .contrib-status { min-height: 1.2em; font-weight: 600; color: #1d7a3d; margin: .6rem 0 .2rem; }
#contrib-form .contrib-actions { margin: .4rem 0 0; }
#contrib-form .btn {
  display: inline-block; background: #1d4ed8; color: #fff; border: 0;
  border-radius: .55rem; padding: .5rem 1rem; font: inherit;
  font-weight: 700; cursor: pointer; margin-right: .5rem;
}
#contrib-form .btn.ghost { background: transparent; color: #163ea8; border: 2px solid #1d4ed8; }

.place-dot {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--gold); border: 3px solid #16233b;
  box-shadow: 0 0 0 4px rgba(255, 209, 102, .35), 0 2px 6px rgba(0,0,0,.4);
}
