/* sped-near.css — special education & family support: map layer (js/sped-layer.js), List tab section
   and the hub module (js/sped-near.js). Class prefix: spn-. Uses the site tokens with fallbacks so the
   hub module also works on pages without css/style.css. Dark mode: html[data-theme="dark"]. */

.spn-hub, .spn-place, .spn-near-ctl, #spn-list-body {
  --spn-surface: var(--surface, #fff);
  --spn-text: var(--text, #1D2733);
  --spn-muted: var(--muted, #5B6878);
  --spn-border: var(--border, #DCE2E9);
  --spn-link: var(--blue-accent, #1F5F9C);
  --spn-focus: var(--focus, #F2B33D);
  --spn-chip: #EEF3F8;
}
html[data-theme="dark"] .spn-hub, html[data-theme="dark"] .spn-place, html[data-theme="dark"] .spn-near-ctl, html[data-theme="dark"] #spn-list-body {
  --spn-surface: var(--surface, #121F2D);
  --spn-text: var(--text, #E3EAF2);
  --spn-muted: var(--muted, #9AAABB);
  --spn-border: var(--border, #24374A);
  --spn-link: var(--blue-accent, #6CB0F0);
  --spn-chip: #1B2F43;
}

.spn-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.spn-ico { flex-shrink: 0; vertical-align: middle; stroke: none; }
.spn-ico text { stroke: none !important; }

/* ---------- map markers ---------- */
.spn-marker { background: none; border: none; }
.spn-marker .spn-ico { display: block; filter: drop-shadow(0 1px 1px rgba(0,0,0,.35)); }
.spn-marker .spn-lbl {
  display: none; position: absolute; left: 27px; top: 2px; white-space: nowrap; max-width: 220px; overflow: hidden; text-overflow: ellipsis;
  font: 600 11.5px/1.3 "Segoe UI", Arial, sans-serif; color: #111; background: rgba(255,255,255,.92);
  padding: 1px 5px; border-radius: 4px; border: 1px solid rgba(0,0,0,.18); pointer-events: none;
}
.spn-show-labels .spn-marker .spn-lbl { display: block; }
html[data-theme="dark"] .spn-marker .spn-lbl { color: #F2F6FA; background: rgba(12,22,33,.9); border-color: rgba(255,255,255,.25); }
.spn-cluster { background: none; }
.spn-cluster > span {
  display: grid; place-items: center; width: 30px; height: 30px; margin: 2px; border-radius: 5px; transform: rotate(45deg);
  background: #fff; border: 3px solid #D55E00; box-shadow: 0 1px 3px rgba(0,0,0,.35);
  font: 700 12px/1 "Segoe UI", Arial, sans-serif; color: #111;
}
.spn-cluster > span > b { transform: rotate(-45deg); }
.spn-cluster-sw { display: inline-block; width: 18px; height: 18px; }
.spn-cluster-sw > span { width: 12px; height: 12px; border-width: 2px; margin: 3px; }
html[data-theme="dark"] .spn-cluster > span { background: #1B2F43; color: #fff; border-color: #FF8A3D; }

/* ---------- popup + list items ---------- */
.spn-place { color: var(--spn-text); font-size: .86rem; line-height: 1.4; }
.spn-title { display: flex; align-items: flex-start; gap: 7px; font-size: .98rem; margin: 0 0 2px; line-height: 1.3; }
.spn-title .spn-ico { margin-top: 1px; }
.spn-name { font-weight: 700; }
button.spn-focus {
  background: none; border: none; padding: 0; margin: 0; text-align: left; color: var(--spn-link); font: inherit; font-weight: 700;
  min-height: 24px; cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.spn-type { color: var(--spn-muted); font-size: .8rem; margin-bottom: 4px; }
.spn-mi { color: var(--spn-text); }
.spn-desc { margin: 2px 0 4px; }
.spn-op, .spn-addr, .spn-dists { margin: 2px 0; }
.spn-note { color: var(--spn-muted); font-size: .8rem; margin: 3px 0; }
.spn-k { font-weight: 600; }
.spn-acts { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
a.spn-act {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 6px 12px; border-radius: 8px;
  border: 1px solid var(--spn-border); background: var(--spn-chip); color: var(--spn-link); font-weight: 600; text-decoration: none;
  font-size: .82rem; line-height: 1.2;
}
a.spn-act:hover { text-decoration: underline; }
a.spn-act .spn-k { color: var(--spn-muted); font-weight: 600; }
.spn-src { display: block; color: var(--spn-muted); font-size: .74rem; margin-top: 4px; }
.spn-src a { color: var(--spn-link); }
.spn-place a:focus-visible, .spn-place button:focus-visible, .spn-hub a:focus-visible, .spn-hub button:focus-visible,
.spn-hub input:focus-visible, .spn-near-ctl button:focus-visible, #spn-list-body summary:focus-visible {
  outline: 3px solid var(--spn-focus); outline-offset: 2px;
}
.leaflet-popup.spn-leaflet-popup .leaflet-popup-content { margin: 12px 14px; }
html[data-theme="dark"] .leaflet-popup.spn-leaflet-popup .leaflet-popup-content-wrapper,
html[data-theme="dark"] .leaflet-popup.spn-leaflet-popup .leaflet-popup-tip { background: #121F2D; color: #E3EAF2; }

.spn-list { list-style: none; margin: 4px 0 10px; padding: 0; }
.spn-list > li { padding: 10px 0; border-top: 1px solid var(--spn-border); }
.spn-list > li:first-child { border-top: none; }
.spn-h { display: flex; align-items: center; gap: 7px; font-size: .95rem; margin: 14px 0 4px; color: var(--spn-text); }
.spn-sub { font-size: .85rem; margin: 8px 0 2px; color: var(--spn-muted); text-transform: uppercase; letter-spacing: .3px; }
.spn-county { border: 1px solid var(--spn-border); border-radius: 10px; padding: 4px 12px 2px; margin: 10px 0; background: var(--spn-chip); }
.spn-county .spn-list > li { border-top-color: var(--spn-border); }
.spn-msg { color: var(--spn-muted); font-size: .85rem; margin: 8px 0; }
.spn-disclaimer { color: var(--spn-muted); font-size: .76rem; margin: 10px 0 0; line-height: 1.45; }
.spn-sources, .spn-unmapped { margin: 10px 0; font-size: .8rem; }
.spn-sources summary, .spn-unmapped summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; color: var(--spn-link); }
.spn-sources ul { margin: 4px 0 0 18px; }
.spn-sources li { margin: 3px 0; }
.spn-sources a { color: var(--spn-link); }
#spn-list-body { margin-top: 8px; }
.spn-legend-inline { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 10px; font-size: .8rem; margin: 6px 0; }
.spn-lg-item { gap: 6px; }

/* ---------- "Nearest to your address" map control ---------- */
.spn-near-ctl {
  background: var(--spn-surface); color: var(--spn-text); border: 1px solid var(--spn-border); border-radius: 10px;
  box-shadow: 0 4px 16px rgba(16,32,52,.18); max-width: 280px; font-size: .8rem; overflow: hidden;
}
.spn-near-head {
  display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; padding: 8px 12px;
  background: none; border: none; color: inherit; font: inherit; font-weight: 700; font-size: .85rem; cursor: pointer;
}
.spn-near-head .chev { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; transition: transform .15s; }
.spn-near-ctl.closed .spn-near-head .chev { transform: rotate(180deg); }
.spn-near-ctl.closed .spn-near-body { display: none; }
.spn-near-body { padding: 0 12px 10px; max-height: 38vh; overflow: auto; }
.spn-near-note { color: var(--spn-muted); margin: 0 0 4px; }
.spn-near-list { list-style: none; margin: 0; padding: 0; }
.spn-near-row {
  display: grid; grid-template-columns: 18px 1fr auto; align-items: center; gap: 6px; width: 100%; min-height: 44px;
  background: none; border: none; border-top: 1px solid var(--spn-border); padding: 4px 0; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.spn-near-row:hover .spn-near-name { text-decoration: underline; }
.spn-near-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spn-near-mi { color: var(--spn-muted); white-space: nowrap; }
.spn-near-county { margin: 6px 0; padding-top: 6px; border-top: 1px solid var(--spn-border); }
.spn-near-esit { margin: 2px 0 0 16px; padding: 0; }
.spn-near-esit a { color: var(--spn-link); display: inline-block; min-height: 24px; }
.spn-near-all {
  width: 100%; min-height: 44px; border: 1px solid var(--spn-border); border-radius: 8px; background: var(--spn-chip);
  color: var(--spn-link); font: inherit; font-weight: 600; cursor: pointer;
}
/* Phones: the map is a small strip above the panel; the List tab has the same "Nearest to your address". */
@media (max-width: 767px) { .spn-near-ctl { display: none; } }

/* ---------- hub module ---------- */
.spn-hub { color: var(--spn-text); font-size: 1rem; line-height: 1.5; }
.spn-hub-title { font-size: 1.3rem; margin: 0 0 4px; }
.spn-hub-desc { margin: 0 0 12px; color: var(--spn-muted); }
.spn-label { display: block; font-weight: 600; margin-bottom: 4px; }
.spn-row { display: flex; gap: 8px; flex-wrap: wrap; }
.spn-input {
  flex: 1 1 220px; min-width: 0; min-height: 44px; padding: 8px 12px; border-radius: 8px; border: 1px solid #7A8796;
  background: var(--spn-surface); color: var(--spn-text); font: inherit;
}
html[data-theme="dark"] .spn-input { border-color: #5E7186; }
.spn-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 8px 18px; border-radius: 8px;
  border: 1px solid transparent; background: var(--navy, #14324F); color: #fff; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none;
}
html[data-theme="dark"] .spn-btn { background: #24507D; }
.spn-btn-outline { background: var(--spn-surface); color: var(--spn-link); border-color: var(--spn-border); }
html[data-theme="dark"] .spn-btn-outline { background: var(--spn-surface); }
.spn-privacy { font-size: .8rem; color: var(--spn-muted); margin: 6px 0 0; }
.spn-status { min-height: 1.4em; margin: 8px 0; font-size: .9rem; }
.spn-status.spn-err { color: #B3261E; font-weight: 600; }
html[data-theme="dark"] .spn-status.spn-err { color: #FF8A7A; }
.spn-results:focus { outline: none; }
.spn-results:focus-visible { outline: 3px solid var(--spn-focus); outline-offset: 4px; }
.spn-res-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.spn-res-title { font-size: 1.05rem; margin: 0; overflow-wrap: anywhere; }
.spn-hub .spn-h-near { font-size: 1.05rem; margin-top: 18px; }
.spn-hub .spn-group .spn-h { font-size: .98rem; }
.spn-hub .spn-place { font-size: .92rem; }
.spn-hub .spn-title { font-size: 1rem; }
