#snt-atlas {
  --ink: #202020;
  --muted: #696969;
  --paper: #f7f6f2;
  --white: #ffffff;
  --line: #d9d6cf;
  --accent: #267b78;
  --accent-dark: #185c59;
  --shadow: 0 14px 36px rgba(0,0,0,.10);
}
#snt-atlas, #snt-atlas * { box-sizing: border-box; }

#snt-atlas {
  color: var(--ink); background: var(--paper); font-family: Arial, Helvetica, sans-serif;
  /* Permet à la mise en page de réagir à la largeur réelle du conteneur
     (colonne de contenu WordPress) plutôt qu'à celle du viewport : sur un
     écran large mais une colonne étroite, la @media (max-width) mobile
     ne se déclenche pas alors que le rendu est tout aussi à l'étroit. */
  container-type: inline-size;
}
#snt-atlas .site-header {
  min-height: 92px; padding: 20px clamp(20px, 4vw, 64px); background: var(--white);
  border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 24px;
}
#snt-atlas .brand { font-family: Georgia, 'Times New Roman', serif; font-size: 31px; color: var(--ink); text-decoration: none; }
#snt-atlas .tagline { margin-top: 3px; color: var(--muted); font-size: 14px; }
#snt-atlas .about-button, #snt-atlas .clear-button { font: inherit; cursor: pointer; }
#snt-atlas .about-button { border: 0; background: transparent; color: var(--accent-dark); font-weight: 700; padding: 10px 0; }
#snt-atlas .atlas-main { padding: 0 clamp(16px, 3vw, 48px) 48px; }
#snt-atlas .intro { max-width: 840px; padding: 26px 0 18px; }
#snt-atlas .eyebrow { margin: 0 0 7px; font-size: 12px; letter-spacing: .18em; font-weight: 800; color: var(--accent-dark); }
#snt-atlas h1 { margin: 0; font-family: Georgia, 'Times New Roman', serif; font-weight: 400; font-size: clamp(35px, 5vw, 61px); line-height: 1.02; }
#snt-atlas .lede { margin: 16px 0 0; font-family: Georgia, 'Times New Roman', serif; font-size: clamp(17px, 2vw, 21px); line-height: 1.5; color: #454545; }
#snt-atlas .atlas-shell { height: min(820px, calc(100vh - 195px)); min-height: 640px; display: grid; grid-template-columns: minmax(300px, 360px) 1fr; background: var(--white); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
#snt-atlas .sidebar { min-width: 0; display: flex; flex-direction: column; border-right: 1px solid var(--line); background: var(--white); z-index: 500; }
#snt-atlas .search-block { padding: 14px 20px 10px; border-bottom: 1px solid var(--line); flex: 0 0 auto; }
#snt-atlas .search-block label { display: block; margin: 0 0 3px; font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
#snt-atlas .search-block label:not(:first-child) { margin-top: 9px; }
#snt-atlas .input-wrap { display: flex; align-items: center; gap: 9px; border: 1px solid #bbb7af; padding: 0 10px; background: #fff; }
#snt-atlas .input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(38,123,120,.13); }
#snt-atlas .input-wrap span { color: var(--accent-dark); font-size: 17px; flex: 0 0 auto; }
#snt-atlas .input-wrap input { width: 100%; min-width: 0; border: 0; outline: 0; padding: 8px 0; font: inherit; background: transparent; }
#snt-atlas .clear-button { display: none; border: 0; background: transparent; color: var(--accent-dark); padding: 8px 0 0; font-weight: 700; font-size: 12px; }
#snt-atlas .sidebar-content { min-height: 0; flex: 1; overflow: auto; }
#snt-atlas .empty-state { text-align: center; padding: 56px 28px; color: var(--muted); }
#snt-atlas .empty-state h2 { font-family: Georgia, 'Times New Roman', serif; color: var(--ink); font-size: 25px; font-weight: 400; margin: 11px 0; }
#snt-atlas .empty-state p { line-height: 1.55; margin: 0; }
#snt-atlas .compass { color: var(--accent); font-size: 38px; }
/* Sous la carte et la recherche (pas dans la colonne de gauche) : bordure
   collée à celle de .atlas-shell juste au-dessus (margin-top négatif) pour
   ne pas doubler le trait de séparation. */
#snt-atlas .corpus-meta {
  border: 1px solid var(--line);
  border-top: 0;
  margin-top: -1px;
  padding: 9px 20px;
  background: #fbfaf7;
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 3px 8px;
}
#snt-atlas .corpus-meta strong { color: var(--ink); }
#snt-atlas .corpus-meta span:not(:empty)::before { content: '·'; margin-right: 8px; color: var(--line); }
#snt-atlas .map-wrap { position: relative; min-width: 0; }
#snt-atlas #map { width: 100%; height: 100%; background: #e7e4dc; }
#snt-atlas .demo-badge { position: absolute; z-index: 450; right: 12px; bottom: 12px; background: rgba(255,255,255,.92); border: 1px solid var(--line); padding: 8px 10px; font-size: 11px; color: var(--muted); box-shadow: 0 5px 16px rgba(0,0,0,.08); }
#snt-atlas .leaflet-control-attribution { font-size: 9px; }
#snt-atlas .custom-dot { border-radius: 50%; border: 3px solid white; }
#snt-atlas .address-panel { padding: 23px; }
#snt-atlas .address-panel .back { border: 0; background: transparent; padding: 0; color: var(--accent-dark); font-weight: 700; cursor: pointer; margin-bottom: 17px; }
#snt-atlas .address-panel h2 { margin: 0; font: 400 28px/1.15 Georgia, 'Times New Roman', serif; }
#snt-atlas .address-summary { color: var(--muted); margin: 7px 0 21px; }
#snt-atlas .mention { padding: 16px 0; border-top: 1px solid var(--line); }
#snt-atlas .mention:first-of-type { border-top: 0; }
#snt-atlas .mention-year { color: var(--accent-dark); font-size: 12px; font-weight: 800; letter-spacing: .08em; }
#snt-atlas .mention-name { font: 700 17px/1.25 Georgia, 'Times New Roman', serif; margin: 5px 0; }
#snt-atlas .mention-details { font-size: 13px; line-height: 1.45; color: #4e4e4e; }
#snt-atlas .search-results { padding: 12px 20px 0; }
#snt-atlas .search-results h2 { font: 400 17px Georgia, 'Times New Roman', serif; margin: 0 0 2px; }
#snt-atlas .result-count { color: var(--muted); font-size: 11.5px; margin-bottom: 6px; }
#snt-atlas .result-item { width: 100%; text-align: left; border: 0; border-top: 1px solid var(--line); background: transparent; padding: 10px 0; cursor: pointer; }
#snt-atlas .result-item strong { display: block; font-size: 15px; color: var(--ink); }
#snt-atlas .result-item span { display: block; color: var(--muted); margin-top: 3px; font-size: 12px; }
#snt-atlas dialog { max-width: 580px; width: calc(100% - 32px); border: 0; padding: 36px; box-shadow: var(--shadow); color: var(--ink); }
#snt-atlas dialog::backdrop { background: rgba(0,0,0,.45); }
#snt-atlas dialog h2 { font: 400 32px Georgia, 'Times New Roman', serif; margin: 0 0 18px; }
#snt-atlas dialog p { line-height: 1.6; }
#snt-atlas .dialog-close { position: absolute; top: 10px; right: 14px; border: 0; background: transparent; font-size: 30px; cursor: pointer; color: var(--muted); }
@media (max-width: 820px) {
  #snt-atlas .site-header { min-height: 75px; padding: 14px 18px; }
  #snt-atlas .brand { font-size: 25px; }
  #snt-atlas .tagline { font-size: 12px; }
  #snt-atlas .atlas-main { padding: 0 0 26px; }
  #snt-atlas .intro { padding: 28px 20px 22px; }
  #snt-atlas .atlas-shell { height: auto; min-height: 0; display: flex; flex-direction: column; border-left: 0; border-right: 0; }
  #snt-atlas .sidebar { order: 1; border-right: 0; }
  #snt-atlas .map-wrap { order: 2; border-top: 1px solid var(--line); height: 55vh; min-height: 390px; }
  #snt-atlas .about-button { font-size: 12px; }
}

/* Même repli en mode "empilé" quand le CONTENEUR est étroit (ex. colonne
   de contenu WordPress) même si le viewport, lui, est large. */
@container (max-width: 820px) {
  #snt-atlas .atlas-shell { height: auto; min-height: 0; display: flex; flex-direction: column; border-left: 0; border-right: 0; }
  #snt-atlas .sidebar { order: 1; border-right: 0; }
  #snt-atlas .map-wrap { order: 2; border-top: 1px solid var(--line); height: 55vh; min-height: 390px; }
}

#snt-atlas .result-meta { color: var(--accent-dark); font-weight: 700; }
#snt-atlas .mention.is-match { background: rgba(38,123,120,.08); margin-inline: -10px; padding-inline: 10px; border-left: 3px solid var(--accent); }
#snt-atlas .mention-result strong { font-family: Georgia, 'Times New Roman', serif; font-size: 16px; }
#snt-atlas { width: 100vw; max-width: none; margin-left: calc(50% - 50vw); }
#snt-atlas .atlas-main { width: 100%; max-width: none; }


/* v0.3 : carte plus lisible et fiche centrée sur la mention sélectionnée */
#snt-atlas .leaflet-tile-pane {
  filter: saturate(.28) contrast(.91) brightness(1.08);
}
#snt-atlas .leaflet-overlay-pane {
  filter: grayscale(.35);
}
/* Point simple : couleur pleine, léger relief, pas de halo coloré (rendait
   les points flous plutôt que nets). */
#snt-atlas .custom-dot {
  background: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,.4);
}
#snt-atlas .mention.is-selected {
  margin: 12px 0 0;
  padding: 18px;
  border: 1px solid rgba(38,123,120,.30);
  border-left: 5px solid var(--accent);
  background: rgba(38,123,120,.075);
}
#snt-atlas .mention-focus-panel .focus-kicker {
  margin-top: 4px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}
#snt-atlas .focus-address {
  margin: 10px 0 24px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-weight: 700;
}
#snt-atlas .other-mentions h3 {
  margin: 0 0 6px;
  font: 400 19px/1.25 Georgia, 'Times New Roman', serif;
}
#snt-atlas .other-mentions > p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}
#snt-atlas .other-mention-link {
  width: 100%;
  padding: 12px 0;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
#snt-atlas .other-mention-link strong,
#snt-atlas .other-mention-link span {
  display: block;
}
#snt-atlas .other-mention-link span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}
/* v0.4 : trois recherches distinctes et mise en évidence cartographique */
#snt-atlas .field-help{margin:4px 0 0;color:var(--muted);font-size:10.5px;line-height:1.3}
#snt-atlas .search-button{flex:0 0 auto;border:0;background:var(--accent-dark);color:#fff;padding:7px 12px;font-size:12px;font-weight:700;cursor:pointer}
#snt-atlas .map-status{position:absolute;z-index:450;right:12px;top:12px;background:rgba(255,255,255,.94);border:1px solid var(--line);padding:8px 11px;font-size:12px;font-weight:700;color:var(--accent-dark);box-shadow:0 4px 14px rgba(0,0,0,.08)}
#snt-atlas .custom-dot{transition:opacity .15s}
/* Résultat de recherche : même point net, juste plus foncé (pas de halo,
   pas d'agrandissement supplémentaire — la taille fixe vient déjà du JS).
   Liseré fin et semi-transparent (pas la bordure blanche pleine de
   .custom-dot) : sur un quartier dense sans clustering, les points se
   chevauchent souvent, et une bordure épaisse et opaque découpait un
   "croissant" bien visible dans le point d'à côté. Un trait plus fin et
   translucide donne quand même du relief à chaque point sans créer cet
   effet de morsure une fois superposé. */
#snt-atlas .marker-match{background:var(--accent-dark);border:1px solid rgba(255,255,255,.55);box-shadow:0 2px 10px rgba(0,0,0,.45)}

/* Résultats de recherche : on grise nettement le reste des données pour que
   les points pertinents ressortent, plutôt qu'une simple baisse d'opacité
   (trop discrète, les points redevenaient invisibles dans la masse).
   Opacité pleine (pas de transparence) : sur une recherche à nombreux
   résultats, des adresses proches se superposent à l'écran — des points
   translucides s'additionnent alors en un nuage flou plutôt que de rester
   nets. */
#snt-atlas .map-wrap.search-active .atlas-marker-normal .custom-dot {
  background: #b7b3a8;
  box-shadow: 0 0 0 2px rgba(255,255,255,.6);
}
#snt-atlas .record-link,#snt-atlas .same-record-link{width:100%;padding:13px 0;border:0;border-top:1px solid var(--line);background:transparent;text-align:left;cursor:pointer}
#snt-atlas .record-link strong,#snt-atlas .record-link span,#snt-atlas .same-record-link strong,#snt-atlas .same-record-link span{display:block}
#snt-atlas .record-link span,#snt-atlas .same-record-link span{margin-top:3px;color:var(--muted);font-size:12px}
#snt-atlas .same-record{margin:0 0 22px;padding:16px;background:#f5f8f7;border-left:4px solid var(--accent)}
#snt-atlas .same-record h3,#snt-atlas .other-mentions h3{margin:0 0 5px;font:400 19px Georgia,'Times New Roman',serif}
#snt-atlas .same-record p{margin:0 0 8px;color:var(--muted);font-size:12px}

/* v0.5 : défilement des résultats et adresse cliquable */
#snt-atlas .search-results {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#snt-atlas .results-scroll {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding-right: 8px;
  scrollbar-gutter: stable;
}
#snt-atlas .results-scroll::-webkit-scrollbar { width: 9px; }
#snt-atlas .results-scroll::-webkit-scrollbar-thumb {
  background: #c8c4bb;
  border-radius: 999px;
  border: 2px solid #fff;
}
#snt-atlas .results-scroll::-webkit-scrollbar-track { background: transparent; }
#snt-atlas .focus-address.address-link {
  width: 100%;
  margin: 10px 0 24px;
  padding: 13px 14px;
  border: 1px solid rgba(38,123,120,.28);
  border-left: 4px solid var(--accent);
  background: #f7faf9;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
#snt-atlas .focus-address.address-link:hover,
#snt-atlas .focus-address.address-link:focus-visible {
  background: #eef6f4;
  border-color: rgba(38,123,120,.48);
  outline: none;
}
#snt-atlas .focus-address.address-link span,
#snt-atlas .focus-address.address-link strong { display: block; }
#snt-atlas .focus-address.address-link span {
  margin-bottom: 4px;
  color: var(--accent-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
#snt-atlas .focus-address.address-link strong {
  font: 700 16px/1.3 Georgia, 'Times New Roman', serif;
}

/* Défilement interne des résultats : les champs de recherche restent visibles. */
#snt-atlas .sidebar-content {
  overflow: hidden;
}
#snt-atlas .search-results {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
}
#snt-atlas .results-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding-right: 8px;
  padding-bottom: 16px;
}
#snt-atlas .results-scroll::-webkit-scrollbar { width: 10px; }
#snt-atlas .results-scroll::-webkit-scrollbar-track { background: #efede7; }
#snt-atlas .results-scroll::-webkit-scrollbar-thumb { background: #aaa69d; border-radius: 8px; border: 2px solid #efede7; }

/* Commit 0002 : corpus réel */
#snt-atlas .loading-spinner {
  width: 34px;
  height: 34px;
  margin: 0 auto 18px;
  border: 3px solid #d8d5ce;
  border-top-color: var(--accent-dark);
  border-radius: 50%;
  animation: atlas-spin .8s linear infinite;
}
@keyframes atlas-spin { to { transform: rotate(360deg); } }
#snt-atlas .technical-note { margin-top: 14px !important; font-size: 12px; color: var(--muted); }
#snt-atlas .error-state .compass { color: #9f2f2f; font-weight: 800; }
#snt-atlas .record-details {
  display: grid;
  grid-template-columns: minmax(90px, 115px) 1fr;
  gap: 7px 12px;
  margin: 14px 0 0;
  font-size: 13px;
  line-height: 1.4;
}
#snt-atlas .record-details dt { color: var(--muted); font-weight: 700; }
#snt-atlas .record-details dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
#snt-atlas .address-panel { height: 100%; min-height: 0; display: flex; flex-direction: column; }
#snt-atlas .address-results { margin-top: 4px; }
#snt-atlas .same-record .result-item { border-top-color: rgba(38,123,120,.22); }

/* Commit 0002 réel : liste d'immeubles et défilement garanti */
#snt-atlas .sidebar { min-height: 0; }
#snt-atlas .sidebar-content { min-height: 0; height: 100%; }
#snt-atlas .search-results { min-height: 0; height: 100%; overflow: hidden; }
#snt-atlas .results-scroll { display: block; min-height: 0; max-height: 100%; overflow-y: auto !important; }
#snt-atlas .address-result strong { font-family: Georgia, 'Times New Roman', serif; font-size: 16px; }
