/* MCED Members Map V1 (0.17.142). Sections 1-3 are John Harris's original stylesheet (page 5173, element ykwliz), unchanged
   except where marked "V1:". Section 4 adds the approved data-driven parts (states, panel, CTA, counters, directory). */

/* 1. John's palette */
#mced-map {
  --paper: #F6F8F2;
  --ink: #2F3330;
  --ink-soft: #5E655F;
  --rule: #DCE2D5;
  --deep: #009245;      /* MGB Deep Green: member county */
  --lime: #A8CF45;      /* MGB Lime Green: county with member municipalities */
  --mid: #4EBB25;
  --none: #DCE3D5;      /* not a member */
  --edge: #FFFFFF;
  --tip-bg: #2F3330;
  --tip-fg: #FFFFFF;
  --font: "Montserrat", "Helvetica Neue", Arial, sans-serif;
  /* V1: unavailable (neutral hatch, only when the data cannot load), CTA */
  --unk: #D9DBD8;
  --unk-line: #9AA09A;
  --cta-bg: #FFF7E3;
  --cta-edge: #E4B85C;
  --deep-ink: #007A39;  /* V1: MGB green darkened for text / buttons on light backgrounds (AA 4.5:1; #009245 is 4.0:1 with white) */
}

/* 2. John's layout */
#mced-map { font-family: var(--font); color: var(--ink); background: var(--paper); width: 100%; max-width: 1400px; margin: 0 auto; padding: clamp(14px, 2vw, 28px); border-radius: 6px; position: relative; box-sizing: border-box; }
#mced-map * { box-sizing: border-box; }
#mced-map .mm-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
#mced-map .mm-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
#mced-map .mm-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 6px 20px; }
#mced-map .mm-eyebrow { font-size: 11px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--deep); margin: 0 0 4px; }
#mced-map h2 { font-size: clamp(19px, 2.2vw, 26px); font-weight: 800; line-height: 1.15; margin: 0; text-wrap: balance; color: var(--ink); }
#mced-map .mm-count { min-width: 0; }
#mced-map .mm-num { font-size: clamp(30px, 3.6vw, 48px); font-weight: 800; line-height: 1; color: var(--deep); font-variant-numeric: tabular-nums; letter-spacing: -.02em; display: inline-flex; align-items: baseline; }
#mced-map .mm-gt { font-weight: 600; opacity: 0; transition: opacity .4s ease; margin-left: .02em; }   /* John's sign, now a suffix: "300+" */
#mced-map .mm-gt.on { opacity: 1; }
#mced-map .mm-numlabel { display: block; font-size: 11px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-soft); margin-top: 4px; }
#mced-map .mm-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
#mced-map .mm-key { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; margin: 0; padding: 0; font-size: 12px; font-weight: 600; }
#mced-map .mm-key li { display: flex; align-items: center; gap: 7px; }
#mced-map .mm-sw { width: 16px; height: 12px; border-radius: 2px; display: inline-block; flex: none; }
#mced-map .mm-replay { font: 600 12px var(--font); color: var(--deep); background: transparent; border: 1.5px solid var(--deep); border-radius: 999px; padding: 6px 14px; cursor: pointer; min-height: 34px; }
#mced-map .mm-replay:hover { background: var(--deep); color: var(--paper); }
#mced-map .mm-replay:focus-visible, #mced-map path.mm-c:focus-visible { outline: 3px solid var(--mid); outline-offset: 2px; }
#mced-map .mm-stage { position: relative; min-width: 0; margin-inline: calc(-1 * clamp(6px, 1vw, 14px)); }
#mced-map svg#mm-svg { display: block !important; width: 100% !important; max-width: none !important; height: auto !important; aspect-ratio: var(--mm-ar); overflow: visible; }
#mced-map path.mm-c { fill: var(--none); stroke: var(--edge); stroke-width: .9; transition: fill .45s ease, opacity .45s ease; cursor: pointer; }
#mced-map path.mm-c.on.s-c { fill: var(--deep); }
#mced-map path.mm-c.on.s-m { fill: var(--lime); }
#mced-map path.mm-c.on.s-u, #mced-map path.mm-c.s-u { fill: url(#mm-hatch-u); }   /* V1 */
#mced-map path.mm-c.pre { opacity: .35; }
#mced-map path.mm-c:hover, #mced-map path.mm-c.sel { stroke: var(--ink); stroke-width: 2; }
#mced-map .mm-outline { fill: none; stroke: var(--ink-soft); stroke-width: 1.2; pointer-events: none; }
#mced-map .mm-tip { position: absolute; z-index: 5; pointer-events: none; background: var(--tip-bg); color: var(--tip-fg); border-radius: 6px; padding: 12px 14px; width: max-content; max-width: min(420px, 92%); box-shadow: 0 8px 24px rgba(0,0,0,.22); font-size: 12px; line-height: 1.45; }
#mced-map .mm-tip h3 { font-size: 15px; font-weight: 700; margin: 0 0 4px; }
#mced-map .mm-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 8px; }
#mced-map .mm-pill i { width: 10px; height: 10px; border-radius: 2px; display: inline-block; }
#mced-map .mm-tip ul { columns: 3 120px; column-gap: 16px; margin: 0; padding: 0; list-style: none; }
#mced-map .mm-tip li { break-inside: avoid; }
#mced-map .mm-more { margin-top: 6px; opacity: .75; font-style: italic; }
#mced-map .mm-detail { border-top: 1px solid var(--rule); padding-top: 12px; min-width: 0; }
#mced-map .mm-detail h3 { font-size: 16px; font-weight: 700; margin: 0 0 4px; }
#mced-map .mm-detail ul { columns: 3 130px; column-gap: 20px; margin: 6px 0 0; padding: 0; list-style: none; font-size: 12.5px; line-height: 1.55; }
#mced-map .mm-hint { font-size: 12.5px; color: var(--ink-soft); margin: 0; line-height: 1.5; }
#mced-map .mm-note { font-size: 10.5px; color: var(--ink-soft); margin: 12px 0 0; line-height: 1.5; }
@media (max-width: 899.98px) {
  #mced-map .mm-side { display: contents; }
  #mced-map .mm-head { order: 1; } #mced-map .mm-bar { order: 2; } #mced-map .mm-stage { order: 3; } #mced-map .mm-cta-main { order: 4; } #mced-map .mm-detail { order: 5; }
}
@media (min-width: 900px) {
  #mced-map .mm-grid { grid-template-columns: minmax(210px, 24%) 1fr; gap: clamp(16px, 2vw, 32px); align-items: start; }
  #mced-map .mm-side { gap: 16px; position: sticky; top: 16px; }
  #mced-map .mm-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  #mced-map .mm-bar { flex-direction: column; align-items: flex-start; }
  #mced-map .mm-key { flex-direction: column; }
  #mced-map .mm-detail { max-height: 46vh; overflow: auto; }
  #mced-map .mm-detail ul { columns: 2 100px; }
  #mced-map .mm-stage { margin-inline: 0; }
}
@media (prefers-reduced-motion: reduce) { #mced-map path.mm-c, #mced-map .mm-gt { transition: none; } }

/* 3. Legend swatches (John's three states) */
#mced-map .mm-sw-c { background: var(--deep); }
#mced-map .mm-sw-m { background: var(--lime); }
#mced-map .mm-sw-n { background: var(--none); box-shadow: inset 0 0 0 1px var(--rule); }

/* 4. V1 additions */
/* three labelled counters in John's typography */
@media (min-width: 900px) {
  /* the sidebar is sticky and capped at the viewport, so the detail panel and its invitation stay on screen */
  #mced-map .mm-side { max-height: calc(100vh - 32px); }
  #mced-map .mm-head, #mced-map .mm-bar, #mced-map .mm-cta-main { flex: none; }
}
#mced-map .mm-head > div:first-child { min-width: 0; }

/* detail panel */
#mced-map .mm-detail:focus { outline: none; }
#mced-map .mm-detail h3:focus { outline: 3px solid var(--mid); outline-offset: 2px; }
#mced-map .mm-sub { font-size: 12.5px; color: var(--ink-soft); margin: -2px 0 8px; }
#mced-map .mm-msg { font-size: 12.5px; line-height: 1.5; margin: 0 0 10px; }
#mced-map .mm-group { margin: 12px 0 0; }
#mced-map .mm-group > h4, #mced-map .mm-group > summary { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 2px; }
#mced-map .mm-group > summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; }
#mced-map .mm-detail ul.mm-plist { columns: 2 130px; }
#mced-map .mm-plist li { break-inside: avoid; }
#mced-map .mm-plink { font: inherit; color: var(--ink); background: none; border: 0; padding: 3px 0; margin: 0; text-align: left; cursor: pointer; text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 3px; min-height: 28px; }
#mced-map .mm-plink:hover, #mced-map .mm-plink:focus-visible { text-decoration-color: var(--deep-ink); color: var(--deep-ink); outline: none; }
#mced-map .mm-plink:focus-visible { box-shadow: 0 0 0 2px var(--mid); border-radius: 2px; }
#mced-map .mm-back { font: 600 12px var(--font); color: var(--deep-ink); background: none; border: 0; padding: 0; margin: 0 0 8px; cursor: pointer; min-height: 32px; }
#mced-map .mm-back:focus-visible { outline: 3px solid var(--mid); outline-offset: 2px; }

/* the nonmember invitation (prominent, inside the panel, above the lists) */
#mced-map .mm-cta-main { margin: 0; }
#mced-map .mm-msg-join { background: var(--cta-bg); border-left: 4px solid var(--cta-edge); padding: 8px 10px; border-radius: 4px; }
#mced-map .mm-cta { background: var(--cta-bg); border: 1.5px solid var(--cta-edge); border-radius: 6px; padding: 12px 14px; margin: 4px 0 10px; }
#mced-map .mm-cta-h { font-size: 15px; font-weight: 800; line-height: 1.25; margin: 0 0 6px; color: var(--ink); }
#mced-map .mm-cta p { font-size: 12.5px; line-height: 1.5; margin: 0 0 10px; }
#mced-map .mm-cta-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px; border-radius: 999px; background: var(--deep-ink); color: #fff !important; font: 700 14px var(--font); text-decoration: none !important; text-align: center; }
#mced-map .mm-cta-btn:hover { background: #00652F; }
#mced-map .mm-cta-btn:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
#mced-map .mm-cta small { display: block; font-size: 11px; color: var(--ink-soft); margin-top: 8px; line-height: 1.45; }
#mced-map .mm-msg a { color: var(--deep-ink); }
#mced-map .mm-unavail { background: #EEF0ED; border-left: 4px solid var(--unk-line); padding: 10px 12px; border-radius: 4px; font-size: 12.5px; line-height: 1.5; margin: 0 0 10px; }
@media (min-width: 900px) { #mced-map .mm-detail { max-height: none; flex: 1 1 auto; min-height: 180px; overflow: auto; } }

/* directory beneath the map */
#mced-map .mm-dir { border-top: 1px solid var(--rule); margin-top: 18px; padding-top: 16px; }
#mced-map .mm-dir-title { font-size: 18px; font-weight: 800; margin: 0 0 10px; }
#mced-map .mm-dir-tools { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: flex-end; }
#mced-map .mm-dir-tools label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); min-width: 0; }
#mced-map .mm-dir-search { flex: 1 1 260px; }
#mced-map .mm-dir-tools input, #mced-map .mm-dir-tools select { font: 500 14px var(--font); color: var(--ink); background: #fff; border: 1.5px solid var(--rule); border-radius: 6px; min-height: 44px; padding: 8px 10px; width: 100%; text-transform: none; letter-spacing: 0; }
#mced-map .mm-dir-tools input:focus-visible, #mced-map .mm-dir-tools select:focus-visible { outline: 3px solid var(--mid); outline-offset: 1px; border-color: var(--deep); }
#mced-map .mm-dir-filter { flex: 0 1 300px; }
#mced-map .mm-dir-count { font-size: 12.5px; color: var(--ink-soft); margin: 10px 0 6px; }
#mced-map .mm-dir-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 6px 16px; }
#mced-map .mm-dir-item { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; font: inherit; text-align: left; cursor: pointer; color: var(--ink); }
#mced-map .mm-dir-item:hover { background: #fff; border-color: var(--rule); }
#mced-map .mm-dir-item:focus-visible { outline: 3px solid var(--mid); outline-offset: 1px; }
#mced-map .mm-dir-item i { width: 10px; height: 10px; border-radius: 2px; flex: none; }
#mced-map .mm-dir-item span { display: flex; flex-direction: column; min-width: 0; }
#mced-map .mm-dir-item b { font-size: 13.5px; font-weight: 700; overflow-wrap: anywhere; }
#mced-map .mm-dir-item em { font-size: 11.5px; font-style: normal; color: var(--ink-soft); }
#mced-map .mm-dir-more { margin-top: 10px; font: 600 13px var(--font); color: var(--deep-ink); background: transparent; border: 1.5px solid var(--deep-ink); border-radius: 999px; padding: 8px 18px; min-height: 44px; cursor: pointer; }
#mced-map .mm-dir-more:focus-visible { outline: 3px solid var(--mid); outline-offset: 2px; }
#mced-map.mm-unavailable .mm-dir-tools, #mced-map.mm-unavailable .mm-dir-list, #mced-map.mm-unavailable .mm-dir-more { display: none; }
#mced-map .mm-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 5. 0.17.143: hold our own metrics against the host site's stylesheet (Bricks / ACSS set a fixed 22px line height on text and
   Chrome keeps a closed <details>' content in layout under some author rules) */
section#mced-map { display: block; gap: 0; }   /* the host styles every <section> as a flex column with a 43px gap */
#mced-map .mm-numlabel, #mced-map .mm-pill, #mced-map .mm-group > h4, #mced-map .mm-group > summary { line-height: 1.35; }
#mced-map .mm-pill { align-items: flex-start; }
#mced-map .mm-pill i { margin-top: .2em; flex: none; }
#mced-map .mm-dir-item b, #mced-map .mm-dir-item em { line-height: 1.4; }
#mced-map .mm-cta p.mm-cta-h { font-size: 16px; font-weight: 800; line-height: 1.25; margin: 0 0 6px; }
#mced-map details.mm-group:not([open]) > :not(summary) { display: none !important; }
#mced-map details.mm-group > summary { margin: 0; padding: 0; }

/* 6. 0.17.146 directory: full width (the host's ACSS turns every "section > div" into a flex container, which shrank the search row
   and the list to their content width), two balanced columns from tablet width, one on phones, and 20-per-page pagination */
#mced-map .mm-dir { display: block; }
#mced-map .mm-dir-tools { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 320px); gap: 10px 16px; align-items: end; }
#mced-map .mm-dir-search, #mced-map .mm-dir-filter { flex: none; }
#mced-map .mm-dir-list { grid-template-columns: minmax(0, 1fr); gap: 2px 24px; margin-top: 4px; }
@media (min-width: 640px) { #mced-map .mm-dir-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 639.98px) { #mced-map .mm-dir-tools { grid-template-columns: minmax(0, 1fr); } }
#mced-map .mm-dir-item { padding: 5px 8px; }
#mced-map .mm-dir-empty { grid-column: 1 / -1; font-size: 13.5px; color: var(--ink-soft); padding: 10px 2px; line-height: 1.45; }
#mced-map .mm-dir-pages { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; }
#mced-map .mm-dir-pages[hidden] { display: none; }
#mced-map .mm-pg-list { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0; padding: 0; }
#mced-map .mm-pg-list li { margin: 0; padding: 0; }
#mced-map .mm-pg { font: 600 13.5px/1 var(--font); color: var(--deep-ink); background: #fff; border: 1.5px solid var(--rule); border-radius: 6px; min-width: 44px; min-height: 44px; padding: 0 12px; cursor: pointer; }
#mced-map .mm-pg:hover:not(:disabled) { border-color: var(--deep-ink); }
#mced-map .mm-pg:focus-visible { outline: 3px solid var(--mid); outline-offset: 2px; }
#mced-map .mm-pg.is-current { background: var(--deep-ink); border-color: var(--deep-ink); color: #fff; cursor: default; }
#mced-map .mm-pg:disabled { color: #7A817B; background: transparent; border-color: var(--rule); cursor: default; }
#mced-map .mm-pg-gap { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; min-height: 44px; color: var(--ink-soft); font-weight: 600; }

/* 7. 0.17.146 complete hover / selection outlines: overlays above every county (pointer-events none, so hover, tooltips, clicks and
   keyboard focus still reach the county underneath). The selection carries a restrained glow that follows the county outline. */
#mced-map .mm-hover-outline, #mced-map .mm-sel-outline { fill: none; pointer-events: none; stroke-linejoin: round; stroke-linecap: round; }
#mced-map .mm-hover-outline { stroke: var(--ink); stroke-width: 2; }
#mced-map .mm-sel-outline { stroke: var(--ink); stroke-width: 2.4; filter: drop-shadow(0 0 2px rgba(47, 51, 48, .55)) drop-shadow(0 0 5px rgba(47, 51, 48, .25)); animation: mm-sel-in .18s ease-out; }
@keyframes mm-sel-in { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { #mced-map .mm-sel-outline { animation: none; } }

/* 8. 0.17.147 legible outline at every map size: the overlays' stroke was in map units, so on a 320 px phone (map at ~26% scale)
   the selection line was ~0.6 px and faded to light grey on horizontal edges. A non-scaling stroke with an on-screen floor keeps
   it a clear ~1.75 px (hover 1.5 px) on phones and ~3.2 px (hover 2.6 px) on desktop, close to the 0.17.146 desktop look; the glow
   is tightened on narrow screens so a small county is not swamped. */
#mced-map .mm-hover-outline, #mced-map .mm-sel-outline { vector-effect: non-scaling-stroke; }
#mced-map .mm-hover-outline { stroke-width: clamp(1.5px, .12vw + 1px, 2.6px); }
#mced-map .mm-sel-outline { stroke-width: clamp(1.75px, .15vw + 1.2px, 3.2px); }
@media (max-width: 599px) { #mced-map .mm-sel-outline { filter: drop-shadow(0 0 1.5px rgba(47, 51, 48, .5)) drop-shadow(0 0 3px rgba(47, 51, 48, .2)); } }
