/* around.css: "What's around this school" (js/around.js): 1-mile ring, category pins, chips, card strip. */
:root {
  --ar-cc: #7B3FB3;      /* child care: violet */
  --ar-tr: #34495E;      /* transit: slate */
  --ar-lb: #0E7C66;      /* libraries & community centers: teal */
  --ar-ft: #F2B33D;      /* featured / sponsored: gold */
  --ar-ft-ink: #3A2800;
  --ar-ring: #6A4BC4;
  --ar-ring-casing: #FFFFFF;
  --ar-mask: #1B2633;
  --ar-mask-op: .22;
  --ar-pin-edge: #FFFFFF;
}
:root[data-theme="dark"] {
  --ar-cc: #A877E6;
  --ar-tr: #6F87A0;
  --ar-lb: #2FA58C;
  --ar-ft: #F5C45E;
  --ar-ring: #B9A2F5;
  --ar-ring-casing: #0B1520;
  --ar-mask: #000000;
  --ar-mask-op: .42;
  --ar-pin-edge: #0B1520;
}

/* ---------- ring ---------- */
.ar-ring-label span {
  display: inline-block; transform: translate(-50%, -50%); white-space: nowrap;
  font: 800 .78rem/1 var(--font, system-ui); color: #fff; letter-spacing: .02em;
  background: var(--ar-ring); border: 2px solid var(--ar-ring-casing); border-radius: 999px; padding: 4px 9px;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
:root[data-theme="dark"] .ar-ring-label span { color: #0B1520; }
.ar-chips .ar-radius, .ar-radius {
  width: auto; max-width: none; flex: 0 0 auto; margin: 0; box-sizing: border-box; line-height: 1.2;
  font: inherit; font-size: .78rem; font-weight: 700; color: var(--ink); cursor: pointer;
  min-height: 32px; padding: 3px 24px 3px 10px; border-radius: 999px; border: 1.5px solid var(--ar-ring);
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M3 4.5l3 3 3-3' fill='none' stroke='%236A4BC4' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 8px center / 11px;
  -webkit-appearance: none; appearance: none;
}
.ar-radius:hover { background-color: color-mix(in srgb, var(--ar-ring) 10%, var(--surface)); }
.ar-radius:focus-visible { outline: 3px solid var(--focus, #1F5F9E); outline-offset: 1px; }

/* ---------- pins ---------- */
.leaflet-marker-icon.ar-pin { background: none; border: none; }
.ar-pin .ar-pin-body {
  position: absolute; left: 1px; top: 0; width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); transform-origin: 50% 50%;
  background: var(--ar-c, #555); border: 2px solid var(--ar-pin-edge); box-shadow: 0 2px 6px rgba(0,0,0,.35);
  transition: transform .12s ease, box-shadow .12s ease;
}
.ar-pin .ar-pin-body svg { width: 14px; height: 14px; transform: rotate(45deg); fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ar-pin-cc { --ar-c: var(--ar-cc); }
.ar-pin-cc .ar-pin-body svg { fill: #fff; stroke: none; }
.ar-pin-tr { --ar-c: var(--ar-tr); }
.ar-pin-tr .ar-pin-body { border-radius: 7px 7px 7px 2px; }
.ar-pin-lb { --ar-c: var(--ar-lb); }
.ar-pin-ft { --ar-c: var(--ar-ft); }
.ar-pin-ft .ar-pin-body { width: 30px; height: 30px; left: -1px; top: -4px; box-shadow: 0 0 0 3px rgba(242,179,61,.35), 0 2px 8px rgba(0,0,0,.4); }
.ar-pin-ft .ar-pin-body svg { fill: var(--ar-ft-ink); stroke: var(--ar-ft-ink); stroke-width: 1; width: 16px; height: 16px; }
.ar-pin-up .ar-pin-body { box-shadow: 0 0 0 3px var(--ar-ft), 0 2px 6px rgba(0,0,0,.35); }
.ar-pin-tag {
  position: absolute; left: 50%; top: 30px; transform: translateX(-50%); white-space: nowrap;
  font: 800 .6rem/1 var(--font, system-ui); text-transform: uppercase; letter-spacing: .05em;
  color: var(--ar-ft-ink); background: var(--ar-ft); border: 1.5px solid var(--ar-pin-edge); border-radius: 4px; padding: 2px 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,.3);
}
.ar-pin:focus { outline: none; }
.ar-pin:focus-visible .ar-pin-body { outline: 3px solid var(--focus, #1F5F9E); outline-offset: 2px; }
.ar-pin.ar-hot .ar-pin-body, .ar-pin:hover .ar-pin-body { transform: rotate(-45deg) scale(1.25); box-shadow: 0 0 0 4px rgba(255,255,255,.65), 0 4px 12px rgba(0,0,0,.45); }
[data-theme="dark"] .ar-pin.ar-hot .ar-pin-body, [data-theme="dark"] .ar-pin:hover .ar-pin-body { box-shadow: 0 0 0 4px rgba(255,255,255,.35), 0 4px 12px rgba(0,0,0,.6); }

/* ---------- pin card (an interactive Leaflet tooltip, so the school popup stays open) ---------- */
.leaflet-tooltip.ar-pop {
  padding: 0; border: 1px solid var(--border, #DFE5EC); border-radius: 12px; background: var(--surface, #fff); color: var(--text, #1B2633);
  box-shadow: var(--shadow, 0 8px 24px rgba(16,32,52,.18)); white-space: normal; width: 250px; max-width: calc(100vw - 40px); cursor: auto;
}
.leaflet-tooltip.ar-pop::before { border-top-color: var(--surface, #fff); }
.ar-pop-in { position: relative; padding: 11px 13px 11px; font-size: .8rem; line-height: 1.35; }
.ar-pop-x {
  position: absolute; top: 4px; right: 4px; width: 30px; height: 30px; border: none; background: none; border-radius: 8px;
  font-size: 1.15rem; line-height: 1; color: var(--muted, #5A6878); cursor: pointer;
}
.ar-pop-x:hover { background: var(--hover, #EEF4FB); color: var(--text); }
.ar-pop-x:focus-visible { outline: 3px solid var(--focus, #1F5F9E); outline-offset: 0; }
.ar-p-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-right: 26px; }
.ar-p-name { font-weight: 700; font-size: .92rem; color: var(--ink, #12304D); margin: 3px 0 1px; padding-right: 18px; }
.ar-p-d { font-size: .74rem; color: var(--muted); font-weight: 600; }
.ar-p-meta { margin-top: 5px; color: var(--text); }
.ar-p-addr { color: var(--muted); margin-top: 2px; }
.ar-p-blurb { margin: 6px 0 0; }
.ar-p-src { margin-top: 7px; font-size: .7rem; color: var(--muted); }
.ar-claim { display: inline-block; margin-top: 7px; font-size: .74rem; font-weight: 600; color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
.ar-claim:hover { color: var(--text); }

/* labels shared by cards and the pin card */
.ar-k { font-size: .66rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.ar-tag {
  display: inline-block; font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; line-height: 1;
  padding: 3px 5px; border-radius: 4px; background: var(--ar-ft); color: var(--ar-ft-ink);
}
.ar-tag-sponsored { background: transparent; color: var(--text); border: 1px solid var(--ar-ft); box-shadow: inset 0 0 0 1px var(--ar-ft); }
.ar-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.ar-links a { font-size: .74rem; font-weight: 600; text-decoration: none; border-radius: 999px; padding: 4px 9px; min-height: 26px; display: inline-flex; align-items: center; }
.ar-link { color: var(--text); border: 1px solid var(--border); background: var(--surface); }
.ar-link:hover { border-color: var(--ar-ring); }
.ar-cta { background: var(--ar-ft); color: var(--ar-ft-ink); border: 1px solid transparent; }
.ar-cta:hover { filter: brightness(1.05); text-decoration: underline; }
.ar-links a:focus-visible, .ar-claim:focus-visible { outline: 3px solid var(--focus, #1F5F9E); outline-offset: 1px; }

/* ---------- chips (top of the map) ---------- */
.ar-chips {
  position: absolute; z-index: 510; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; max-width: calc(100% - 24px);
  padding: 5px 5px 5px 12px; border-radius: 999px; background: var(--glass, rgba(255,255,255,.9)); color: var(--text);
  border: 1px solid var(--border); box-shadow: var(--shadow); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-size: .78rem; box-sizing: border-box;
}
.ar-chips[hidden], .ar-strip[hidden], .ar-pill[hidden] { display: none; }
.ar-chips.ar-side { border-radius: 14px; }
.ar-title { font-weight: 800; color: var(--ink); white-space: nowrap; margin-right: 2px; }
.ar-title small { font-weight: 600; color: var(--muted); font-size: .72rem; margin-left: 2px; }
.ar-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 3px 10px 3px 4px; border-radius: 999px;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
}
.ar-chip b { font-variant-numeric: tabular-nums; font-weight: 800; }
.ar-chip[aria-pressed="true"] { border-color: var(--ar-c); background: color-mix(in srgb, var(--ar-c) 12%, var(--surface)); }
.ar-chip[aria-pressed="false"] { color: var(--muted); }
.ar-chip[aria-pressed="false"] .ar-dot { background: var(--track, #E4E9EF); }
.ar-chip[aria-pressed="false"] .ar-dot svg { stroke: var(--muted); }
.ar-chip[aria-pressed="false"] .ar-cl { text-decoration: line-through; text-decoration-thickness: 1px; }
.ar-chip:hover { border-color: var(--ar-c); }
.ar-chip-cc, .ar-dot-cc, .ar-card-cc { --ar-c: var(--ar-cc); }
.ar-chip-tr, .ar-dot-tr, .ar-card-tr { --ar-c: var(--ar-tr); }
.ar-chip-lb, .ar-dot-lb, .ar-card-lb { --ar-c: var(--ar-lb); }
.ar-chip-ft, .ar-dot-ft, .ar-card-ft { --ar-c: var(--ar-ft); }
.ar-dot, .ar-ico {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--ar-c); flex-shrink: 0;
}
.ar-dot svg, .ar-ico svg { width: 13px; height: 13px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.ar-chip-cc .ar-dot svg, .ar-dot-cc svg, .ar-card-cc .ar-ico svg { fill: #fff; stroke: none; }
.ar-chip-ft .ar-dot svg, .ar-dot-ft svg, .ar-card-ft .ar-ico svg { fill: var(--ar-ft-ink); stroke: var(--ar-ft-ink); stroke-width: 1; }
.ar-chip-ft[aria-pressed="false"] .ar-dot svg { fill: var(--muted); stroke: var(--muted); }
.ar-fit, .ar-x, .ar-collapse {
  display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: none; background: transparent;
  color: var(--muted); cursor: pointer; padding: 0;
}
.ar-fit:hover, .ar-x:hover, .ar-collapse:hover { background: var(--hover); color: var(--text); }
.ar-fit svg, .ar-x svg, .ar-collapse svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ar-collapse { display: none; }
.ar-compact .ar-collapse { display: inline-grid; }
.ar-chip:focus-visible, .ar-fit:focus-visible, .ar-x:focus-visible, .ar-collapse:focus-visible, .ar-pill:focus-visible {
  outline: 3px solid var(--focus, #1F5F9E); outline-offset: 2px;
}

/* ---------- card strip (bottom of the map) ---------- */
.ar-strip {
  position: absolute; z-index: 505; box-sizing: border-box; display: flex; flex-direction: column; gap: 4px;
  padding: 8px; border-radius: 16px; background: var(--glass, rgba(255,255,255,.9)); border: 1px solid var(--border);
  box-shadow: var(--shadow); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.ar-cards {
  display: flex; gap: 8px; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x proximity; overscroll-behavior: contain;
  scrollbar-width: thin; padding: 2px 2px 4px;
}
.ar-card {
  flex: 0 0 236px; box-sizing: border-box; display: flex; gap: 9px; align-items: flex-start; scroll-snap-align: start;
  padding: 9px 10px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); cursor: pointer;
  box-shadow: inset 3px 0 0 var(--ar-c); transition: border-color .12s ease, transform .12s ease, box-shadow .12s ease;
}
.ar-card:hover, .ar-card.ar-hot { border-color: var(--ar-c); box-shadow: inset 3px 0 0 var(--ar-c), 0 4px 14px rgba(16,32,52,.14); }
.ar-card.ar-sel { border-color: var(--ar-c); box-shadow: inset 3px 0 0 var(--ar-c), 0 0 0 2px var(--ar-c); }
.ar-card:focus-visible { outline: 3px solid var(--focus, #1F5F9E); outline-offset: 1px; }
.ar-card-ft { background: color-mix(in srgb, var(--ar-ft) 10%, var(--surface)); border-color: color-mix(in srgb, var(--ar-ft) 55%, var(--border)); }
.ar-card-up { border-color: color-mix(in srgb, var(--ar-ft) 55%, var(--border)); }
.ar-c-body { min-width: 0; flex: 1; }
.ar-c-top { display: flex; align-items: center; gap: 6px; }
.ar-c-top .ar-k { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar-c-d { margin-left: auto; font-size: .72rem; font-weight: 700; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ar-c-name {
  font-weight: 700; font-size: .84rem; line-height: 1.25; color: var(--ink); margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ar-c-meta { font-size: .73rem; color: var(--muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar-card .ar-links { margin-top: 5px; }
.ar-card .ar-links a { padding: 2px 8px; min-height: 24px; font-size: .7rem; }
.ar-empty { padding: 10px 6px; color: var(--muted); font-size: .8rem; }
.ar-foot { font-size: .66rem; color: var(--muted); padding: 0 4px; line-height: 1.3; }

/* side mode: the popup covers the middle, so cards stack in the free column */
.ar-strip.ar-side .ar-cards { flex-direction: column; overflow-x: hidden; overflow-y: auto; scroll-snap-type: y proximity; }
.ar-strip.ar-side .ar-card { flex: 0 0 auto; width: 100%; }

/* ---------- compact: pill + panel at the top (phones; desktop when the popup leaves no room) ---------- */
.ar-pill {
  position: absolute; z-index: 820; display: inline-flex; align-items: center; gap: 7px; min-height: 40px; padding: 4px 13px 4px 6px;
  border-radius: 999px; border: 1px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-size: .82rem; font-weight: 700; box-shadow: var(--shadow); cursor: pointer;
}
.ar-pill b { background: var(--ar-ring); color: var(--surface); border-radius: 999px; padding: 2px 7px; font-size: .74rem; font-variant-numeric: tabular-nums; }
.ar-pill-dots { display: inline-flex; }
.ar-pill-dots .ar-dot { width: 22px; height: 22px; border: 2px solid var(--surface); margin-left: -6px; }
.ar-pill-dots .ar-dot:first-child { margin-left: 0; }
.ar-compact .ar-chips { z-index: 821; border-radius: 14px; }
.ar-compact .ar-strip { z-index: 821; padding: 6px; }
.ar-compact .ar-card { flex-basis: 214px; }
.ar-compact .ar-foot { display: none; }

/* ---------- "Show on map" view: the school popup / phone card shrinks to a name label ---------- */
.ar-mini { display: none; }
.ar-min .popup-school > :not(.ar-mini) { display: none !important; }
.ar-min .ar-mini { display: flex; align-items: center; gap: 10px; }
.ar-mini-name { min-width: 0; flex: 1; display: flex; flex-direction: column; line-height: 1.2; }
.ar-mini-name b { color: var(--ink); font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ar-mini-name small { color: var(--muted); font-size: .72rem; font-weight: 600; margin-top: 2px; }
.ar-mini-open {
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0; min-height: 34px; padding: 4px 11px; border-radius: 999px;
  border: 1.5px solid var(--ar-ring); background: var(--surface); color: var(--ink); font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer;
}
.ar-mini-open:hover { background: color-mix(in srgb, var(--ar-ring) 12%, var(--surface)); }
.ar-mini-open svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.ar-mini-open:focus-visible, .ar-showmap:focus-visible { outline: 3px solid var(--focus, #1F5F9E); outline-offset: 2px; }
.leaflet-popup.ar-min .leaflet-popup-content { width: auto !important; min-width: 0; max-width: 330px; padding: 9px 44px 9px 12px; }
.leaflet-popup.ar-min .leaflet-popup-content-wrapper { border-radius: 14px; }
.leaflet-popup.ar-min .leaflet-popup-scrolled { height: auto !important; overflow: visible; }
.leaflet-popup.ar-min a.leaflet-popup-close-button { top: 50%; transform: translateY(-50%); }
.ar-mapview .ar-strip .ar-foot { display: none; }
.ar-mapview .ar-strip { padding: 6px; }
@media (max-width: 767px) {
  #mobile-card.ar-min { max-height: none; padding: 10px 12px; }
  #mobile-card.ar-min .mobile-card-close { position: absolute; float: none; top: 50%; right: 8px; transform: translateY(-50%); }
  #mobile-card.ar-min .ar-mini { padding-right: 44px; }
  .ar-mapview .ar-card { flex-basis: 70%; }
}
.ar-showmap {
  display: flex; align-items: center; gap: 8px; width: 100%; box-sizing: border-box; margin: 2px 0 10px; padding: 9px 12px;
  border-radius: 12px; border: 1.5px solid var(--ar-ring); background: color-mix(in srgb, var(--ar-ring) 9%, var(--surface));
  color: var(--ink); font: inherit; font-size: .84rem; font-weight: 700; cursor: pointer; text-align: left;
}
.ar-showmap:hover { background: color-mix(in srgb, var(--ar-ring) 16%, var(--surface)); }
.ar-showmap svg { width: 18px; height: 18px; fill: none; stroke: var(--ar-ring); stroke-width: 2; stroke-linejoin: round; flex-shrink: 0; }
.ar-showmap span { flex: 1; }
.ar-showmap b { background: var(--ar-ring); color: #fff; border-radius: 999px; padding: 1px 7px; font-size: .72rem; }
[data-theme="dark"] .ar-showmap b { color: #0B1520; }

/* ---------- "Nearby 16" badge on the popup tab ---------- */
.ar-tab-n {
  display: inline-block; margin-left: 5px; min-width: 18px; padding: 1px 5px; border-radius: 999px; box-sizing: border-box;
  background: var(--ar-ring); color: #fff; font-size: .66rem; font-weight: 800; line-height: 1.35; text-align: center;
  font-variant-numeric: tabular-nums; vertical-align: 1px;
}
[data-theme="dark"] .ar-tab-n { color: #0B1520; }

@media (max-width: 767px) {
  .ar-title small { display: none; }
  .ar-chips { padding: 4px 4px 4px 10px; gap: 5px; }
  .ar-chip { min-height: 34px; padding: 3px 9px 3px 4px; }
  .ar-radius { min-height: 34px; }
  .ar-chip .ar-cl { max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .ar-fit { display: none; }
  .ar-card { flex-basis: 78%; max-width: 250px; }
  .leaflet-tooltip.ar-pop { width: 230px; }
}
@media (prefers-reduced-motion: reduce) {
  .ar-pin .ar-pin-body, .ar-card { transition: none; }
}
@media print {
  .ar-chips, .ar-strip, .ar-pill, .ar-showmap { display: none !important; }
}
