/* ============================================================
   Design tokens
   ============================================================ */
.crg-locations {
  /* Brand palette. Sand is the third colour and carries the accents. */
  --crg-navy:   #002E4D;
  --crg-blue:   #23447F;
  --crg-sand:   #D6C5A8;
  --crg-sand-d: #B8A27A;        /* darker sand, for text/accents on light */
  --crg-ink:    #1d2733;
  --crg-muted:  #5d6773;
  --crg-line:   #e3e8ee;

  /* Playfair Display for headings, Lato for everything else. Both fall back
     to stacks that keep the layout intact if the webfont never arrives. */
  --crg-font-head: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --crg-font-body: 'Lato', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;

  /* Tighter geometry throughout — the old 14–16px radii read as soft/bubbly. */
  --crg-radius:    6px;
  --crg-radius-sm: 4px;

  font-family: var(--crg-font-body);
  color: var(--crg-ink);

  /* The single side gutter for the whole block. Every section below is
     max-width:1100 + margin:auto with NO padding of its own, so the canvas,
     the search card and the directory share identical left/right edges at
     every viewport width. (Previously the gutter lived as padding on the map
     and directory but not the search card, so the search ran a few px wider on
     each side — visible once a theme wrapped the block on WordPress.) */
  padding-left: 1rem;
  padding-right: 1rem;
  box-sizing: border-box;
}
.crg-locations *, .crg-locations *::before, .crg-locations *::after { box-sizing: border-box; }
/* Headings use the display face. Everything else inherits Lato. */
.crg-locations .crg-search__title,
.crg-locations .crg-search__count-number,
.crg-locations .crg-dir__name,
.crg-locations .crg-pop__city {
  font-family: var(--crg-font-head);
}

/* The wrapper is the positioning context for the reset button floating over the map. */
.crg-locations .crg-map-wrap { position: relative; max-width: 1100px; margin: 2rem auto; }

/* Leaflet needs an explicit height, otherwise the map collapses to zero and nothing appears. */
/* The canvas sits on a pale sky gradient that drifts very slowly, so the
   empty space around the country reads as atmosphere rather than dead area.
   28s and a narrow colour range keep it ambient — it should never pull the
   eye away from the map itself. */
.crg-locations .crg-map {
  height: 560px;
  border-radius: var(--crg-radius);
  scroll-margin-top: 16px;
  background: #ffffff;
  /* Very slight elevation so the canvas reads as a surface, nothing more. */
  box-shadow:
    0 1px 2px rgba(0, 46, 77, .05),
    0 4px 16px -8px rgba(0, 46, 77, .12),
    inset 0 0 0 1px rgba(0, 46, 77, .04);
}
@media (max-width: 640px) { .crg-locations .crg-map { height: 380px; } }

.crg-locations .crg-map-reset {
  position: absolute; top: 14px; right: 58px;
  z-index: 1000; /* Above Leaflet's own layers, which use values up to about 700. */
  padding: 9px 16px; border: 0; border-radius: var(--crg-radius-sm);
  background: linear-gradient(135deg, #0a3a5c 0%, #002E4D 100%);
  color: #fff; font: 600 13px/1 var(--crg-font-body); letter-spacing: .02em; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 46, 77, .28), inset 0 1px 0 rgba(255, 255, 255, .12);
  transition: background .2s ease, box-shadow .2s ease, transform .12s ease;
}
.crg-locations .crg-map-reset:hover {
  background: linear-gradient(135deg, #23447F 0%, #0a3a5c 100%);
  box-shadow: 0 4px 14px rgba(0, 46, 77, .34), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.crg-locations .crg-map-reset:active { transform: translateY(1px); }
.crg-locations .crg-map-reset:focus-visible { outline: 3px solid #D6C5A8; outline-offset: 2px; }

/* Full screen (maximize) button, like the reference site's expand control. */
.crg-locations .crg-map-fullscreen {
  position: absolute; top: 14px; right: 12px;
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; padding: 0; border: 0; border-radius: var(--crg-radius-sm);
  background: linear-gradient(135deg, #0a3a5c 0%, #002E4D 100%);
  color: #fff; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 46, 77, .28), inset 0 1px 0 rgba(255, 255, 255, .12);
  transition: background .2s ease, box-shadow .2s ease, transform .12s ease;
}
.crg-locations .crg-map-fullscreen:hover {
  background: linear-gradient(135deg, #23447F 0%, #0a3a5c 100%);
  box-shadow: 0 4px 14px rgba(0, 46, 77, .34), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.crg-locations .crg-map-fullscreen:active { transform: translateY(1px); }
.crg-locations .crg-map-fullscreen:focus-visible { outline: 3px solid #D6C5A8; outline-offset: 2px; }
.crg-locations .crg-fs-icon { display: block; }
/* Icon depends on state: expand arrows by default, compress arrows while maximized. */
.crg-locations .crg-fs-shrink { display: none; }
.crg-locations .crg-map-fullscreen[aria-pressed="true"] .crg-fs-grow { display: none; }
.crg-locations .crg-map-fullscreen[aria-pressed="true"] .crg-fs-shrink { display: block; }

/* Native full screen: the wrapper becomes the whole viewport. */
.crg-locations .crg-map-wrap:fullscreen, .crg-locations .crg-map-wrap:-webkit-full-screen {
  max-width: none; margin: 0; padding: 0; width: 100%; height: 100%;
  background: #f4f5f7;
}
.crg-locations .crg-map-wrap:fullscreen .crg-map, .crg-locations .crg-map-wrap:-webkit-full-screen .crg-map { height: 100%; border-radius: 0; }

/* Fallback for browsers without the element Fullscreen API (iOS Safari). */
.crg-locations .crg-map-wrap.crg-fs-fallback {
  position: fixed; inset: 0; z-index: 99999;
  max-width: none; margin: 0; padding: 8px;
  background: #f4f5f7;
}
.crg-locations .crg-map-wrap.crg-fs-fallback .crg-map { height: 100%; }

/* Marker: the CRG logo in a circular badge, with the city label beside it.
   ONE hit target per marker: the .crg-pin box itself. Everything inside is
   pointer-events:none. Leaflet listens on mouseover/mouseout, which BUBBLE —
   so any hit-testable child makes the cursor crossing an internal boundary
   fire a spurious mouseout/mouseover pair. A single hit box removes that
   churn entirely. */
.crg-locations .crg-pin {
  background: transparent !important;
  border: 0 !important;
  overflow: visible !important;
}
.crg-locations .crg-pin > * { pointer-events: none; }
.crg-locations .crg-pin__dot {
  display: block;
  box-sizing: border-box;
  width: 26px; height: 26px; border-radius: 50%;
  background: #fff; border: 2px solid #002E4D;
  box-shadow: 0 0 0 3px rgba(0, 46, 77, .15), 0 2px 6px rgba(0, 0, 0, .45);
  overflow: hidden; /* trims the img corners */
}
.crg-locations .crg-pin__dot img {
  display: block; width: 100%; height: 100%; border-radius: 50%; object-fit: cover;
}
/* City label, drawn beside the badge. The whole pin carries zIndexOffset:1000
   in JS, so this always sits above cluster bubbles. */
.crg-locations .crg-pin__label {
  position: absolute;
  left: 32px; top: 50%;
  transform: translateY(-50%);
  padding: 3px 9px;
  background: rgba(255, 255, 255, .97);
  color: #002E4D;
  font: 700 11px/1.3 var(--crg-font-body);
  letter-spacing: .01em;
  white-space: nowrap;
  border: 1px solid rgba(0, 46, 77, .55);
  border-radius: 999px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
}
/* Calm pulse ring on hover: a slow, shallow breath just outside the badge.
   A white band with a soft navy halo so it reads on the light gray states and
   on the navy highlight alike. pointer-events:none is essential — the ring
   scales, and anything that scales must never take part in hit-testing, or it
   moves its own boundary under the cursor and oscillates. */
.crg-locations .crg-pin::after,
.crg-locations .crg-map .marker-cluster::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 30px; height: 30px;
  margin-left: -15px; margin-top: -15px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .85);
  box-shadow: 0 0 0 1.5px rgba(0, 46, 77, .32);
  opacity: 0;
  pointer-events: none;
  transform: scale(1);
}
.crg-locations .crg-map .marker-cluster::after { width: 40px; height: 40px; margin-left: -20px; margin-top: -20px; }
.crg-locations .crg-pin:hover::after,
.crg-locations .crg-map .marker-cluster:hover::after {
  animation: crg-pin-pulse 2.6s ease-in-out infinite;
}
@keyframes crg-pin-pulse {
  0%   { opacity: 0;   transform: scale(1); }
  35%  { opacity: .55; transform: scale(1.18); }
  100% { opacity: 0;   transform: scale(1.42); }
}
@media (prefers-reduced-motion: reduce) {
  .crg-locations .crg-pin:hover::after,
  .crg-locations .crg-map .marker-cluster:hover::after { animation: none; opacity: 0; }
}
.crg-locations .crg-pin:focus-visible { outline: 3px solid #D6C5A8; outline-offset: 2px; }


/* The dim effect: when a state is selected, non-selected states fade so the
   selected one carries all the visual weight. The JS drives fillOpacity on
   the SVG paths; this block only smooths the transition. */
.crg-locations .crg-map .leaflet-overlay-pane path { transition: fill 180ms ease, fill-opacity 240ms ease; }
@media (prefers-reduced-motion: reduce) {
  .crg-locations .crg-map .leaflet-overlay-pane path { transition: none; }
}

/* Hover chip: the hovered or selected state is named in a fixed pill at the
   bottom right of the canvas. State tooltips used to be pinned over the states,
   which hid the markers of small states; the chip replaces them and never
   covers or captures anything. */
.crg-locations .crg-map-chip {
  position: absolute; right: 10px; bottom: 10px;
  z-index: 800; /* Above Leaflet's map panes, below the buttons. */
  padding: 6px 12px; border-radius: var(--crg-radius-sm);
  background: rgba(255, 255, 255, .62);
  -webkit-backdrop-filter: blur(14px) saturate(150%);
  backdrop-filter: blur(14px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, .75);
  box-shadow: 0 2px 10px rgba(0, 46, 77, .12);
  color: var(--crg-navy); font: 700 12px/1.2 var(--crg-font-body);
  letter-spacing: .02em;
  pointer-events: none;
}
.crg-locations .crg-map-chip[hidden] { display: none; }

/* Cluster circles. The outer frame is the ~40x40 clickable box Leaflet.markercluster
   draws; we fill ALL of it as the click target (same cursor the inner circle has,
   same event surface). Previously the outer was transparent and only the inner
   26x26 caught events, which made the mouse flicker between "over cluster" and
   "over nothing" as it moved inside the frame — the state polygon underneath
   then blinked. The inner is the visible circle the user sees. */
.crg-locations .crg-map .marker-cluster-small,
.crg-locations .crg-map .marker-cluster-medium,
.crg-locations .crg-map .marker-cluster-large {
  background-color: transparent;
  border-radius: 50%;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
/* CRITICAL: every descendant of the cluster is pointer-events:none, so the
   ONLY hit-testable element is the outer .marker-cluster box, whose size never
   changes. Two bugs died here:
     1. The inner div used to hit-test AND scale up on hover. Scaling moved its
        own boundary past the cursor near the edges, firing mouseout → scale
        down → mouseover → scale up, forever. That was the blinking, and a
        mousedown/mouseup landing either side of that oscillation is why the
        click was swallowed and needed a second press.
     2. Leaflet listens on mouseover/mouseout, which BUBBLE. The cluster markup
        is div > div > span, so every crossing between those nested elements
        fired another spurious pair.
   No hover transform anywhere on the hit path — only colour, which cannot
   change geometry. */
.crg-locations .crg-map .marker-cluster > * { pointer-events: none; }
.crg-locations .crg-map .marker-cluster-small div,
.crg-locations .crg-map .marker-cluster-medium div,
.crg-locations .crg-map .marker-cluster-large div {
  background: radial-gradient(circle at 30% 30%, #4a7bc2 0%, #23447F 70%, #002E4D 100%);
  color: #fff;
  font: 700 13px/1 var(--crg-font-body);
  width: 34px; height: 34px; margin: 0; border-radius: 50%;
  border: 2px solid #fff;
  box-sizing: border-box;
  box-shadow: 0 0 0 3px rgba(35, 68, 127, .35), 0 2px 6px rgba(0, 0, 0, .35);
  display: flex; align-items: center; justify-content: center;
  transition: box-shadow .2s ease;
}
/* Hover feedback is box-shadow only. box-shadow never affects layout or
   hit-testing, so it cannot re-trigger its own hover. */
.crg-locations .crg-map .marker-cluster-small:hover div,
.crg-locations .crg-map .marker-cluster-medium:hover div,
.crg-locations .crg-map .marker-cluster-large:hover div {
  box-shadow: 0 0 0 5px rgba(35, 68, 127, .45), 0 3px 10px rgba(0, 0, 0, .4);
}
.crg-locations .crg-map .marker-cluster-small span,
.crg-locations .crg-map .marker-cluster-medium span,
.crg-locations .crg-map .marker-cluster-large span {
  color: #fff;
  font: 700 13px/1 var(--crg-font-body);
}
@media (prefers-reduced-motion: reduce) {
  .crg-locations .crg-map .marker-cluster-small div,
  .crg-locations .crg-map .marker-cluster-medium div,
  .crg-locations .crg-map .marker-cluster-large div { transition: none; }
}

/* ---- Location popup: frosted glass shell, navy header, stacked rows ---- */
.crg-locations .leaflet-popup-content-wrapper {
  padding: 0; overflow: hidden;
  border-radius: var(--crg-radius);
  /* .88 rather than a thinner glass: the popup frequently sits over a
     highlighted (navy) state, and body text needs to clear 4.5:1 regardless
     of what is behind it. Still reads as frosted, but never unreadable. */
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: blur(18px) saturate(165%);
  backdrop-filter: blur(18px) saturate(165%);
  border: 1px solid rgba(255, 255, 255, .72);
  box-shadow:
    0 1px 2px rgba(0, 46, 77, .10),
    0 20px 44px -14px rgba(0, 46, 77, .42);
}
.crg-locations .leaflet-popup-content { margin: 0; width: 268px !important; }
.crg-locations .leaflet-popup-tip {
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: blur(18px) saturate(165%);
  backdrop-filter: blur(18px) saturate(165%);
  box-shadow: none;
}

/* Shell arrives first; its contents follow in sequence (delays set in JS).
   The entrance is applied to the WRAPPER, never to .leaflet-popup itself:
   Leaflet positions the popup with an inline transform: translate3d(...), so
   animating transform on that element overrides its positioning and strands
   the popup at the container origin. The wrapper is free to transform. */
.crg-locations .leaflet-popup-content-wrapper,
.crg-locations .leaflet-popup-tip-container {
  animation: crg-pop-in .26s cubic-bezier(.22, .61, .36, 1) both;
  transform-origin: 50% 100%;
}
@keyframes crg-pop-in {
  from { opacity: 0; transform: translateY(8px) scale(.965); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.crg-locations .crg-pop__head { animation: crg-pop-item .3s cubic-bezier(.22,.61,.36,1) 60ms both; }
.crg-locations .crg-pop__row  { animation: crg-pop-item .3s cubic-bezier(.22,.61,.36,1) both; }
@keyframes crg-pop-item {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .crg-locations .leaflet-popup-content-wrapper,
  .crg-locations .leaflet-popup-tip-container,
  .crg-locations .crg-pop__head,
  .crg-locations .crg-pop__row { animation: none; }
}

.crg-locations .leaflet-popup-close-button {
  top: 10px !important; right: 10px !important;
  color: rgba(255, 255, 255, .85) !important; font: 400 15px/20px var(--crg-font-body);
  width: 20px; height: 20px; border-radius: var(--crg-radius-sm);
  background: rgba(255, 255, 255, .14); text-align: center;
  transition: background-color .15s ease, color .15s ease;
}
.crg-locations .leaflet-popup-close-button:hover {
  background: rgba(255, 255, 255, .3); color: #fff !important;
}

.crg-locations .crg-pop__head {
  display: flex; align-items: center; gap: 12px;
  padding: 15px 44px 15px 16px;
  background: linear-gradient(118deg, var(--crg-navy) 0%, #12405f 60%, #1b4a6d 100%);
  position: relative;
}
/* Thin sand rule under the header — the third colour as a quiet accent. */
.crg-locations .crg-pop__head::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: linear-gradient(90deg, var(--crg-sand) 0%, rgba(214, 197, 168, 0) 72%);
}
.crg-locations .crg-pop__logo {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 50%;
  background: #fff; border: 1px solid rgba(255, 255, 255, .55);
  box-shadow: 0 1px 5px rgba(0, 0, 0, .3);
  object-fit: cover;
}
.crg-locations .crg-pop__heading { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.crg-locations .crg-pop__city {
  color: #fff; font-size: 17px; font-weight: 600; line-height: 1.2; letter-spacing: .01em;
}
.crg-locations .crg-pop__region {
  color: var(--crg-sand);
  font: 400 10px/1.3 var(--crg-font-body);
  letter-spacing: .14em; text-transform: uppercase;
}

.crg-locations .crg-pop__rows { padding: 4px 0 6px; }
.crg-locations .crg-pop__row {
  display: flex; align-items: flex-start; gap: 11px;
  padding: 9px 16px;
  font: 400 13px/1.55 var(--crg-font-body);
  color: var(--crg-muted);
}
/* Hairline separators instead of margins: cleaner at this density. */
.crg-locations .crg-pop__row + .crg-pop__row {
  border-top: 1px solid rgba(0, 46, 77, .07);
}
.crg-locations .crg-pop__icon {
  flex: 0 0 auto; display: flex; margin-top: 2px;
  color: var(--crg-blue); opacity: .75;
}
.crg-locations .crg-pop__icon svg { display: block; }
.crg-locations .crg-pop__body { flex: 1 1 auto; min-width: 0; }
/* Beats Leaflet's own .leaflet-popup-content p margin (17px), which otherwise
   pushes paragraphs below and right of their row icon. */
.crg-locations .crg-map .crg-pop__row p { margin: 0; }
.crg-locations .crg-pop__line { display: block; color: #4b5663; }

/* Phone and website share one clean treatment: navy, medium weight, no
   decoration until hover. The old green phone / all-caps blue link clashed. */
.crg-locations .crg-pop__value {
  display: inline-block;
  color: var(--crg-navy);
  font-weight: 700;
  font-size: 13px;
  text-decoration: none;
  letter-spacing: .01em;
  transition: color .15s ease;
}
.crg-locations .crg-pop__value:hover { color: var(--crg-blue); text-decoration: underline; }
.crg-locations .crg-pop__value:focus-visible { outline: 2px solid var(--crg-sand); outline-offset: 2px; }

/* Right-aligned "leaves the page" glyph — a link in its own right. */
.crg-locations .crg-pop__trail {
  flex: 0 0 auto; display: flex; margin-top: 3px;
  color: var(--crg-blue); opacity: .5;
  cursor: pointer;
  transition: opacity .15s ease, transform .15s ease;
}
.crg-locations .crg-pop__trail svg { display: block; }
.crg-locations .crg-pop__row:hover .crg-pop__trail {
  opacity: .95; transform: translate(1px, -1px);
}
.crg-locations a.crg-pop__trail:hover { opacity: 1; }
.crg-locations a.crg-pop__trail:focus-visible { outline: 2px solid var(--crg-sand); outline-offset: 2px; border-radius: 2px; }
@media (prefers-reduced-motion: reduce) {
  .crg-locations .crg-pop__row:hover .crg-pop__trail { transform: none; }
}
/* Reduced-motion requirement from the brief. */
@media (prefers-reduced-motion: reduce) {
.crg-locations .crg-map-reset, .crg-locations .crg-map-fullscreen { transition: none; }
}

/* Keyboard access: every control shows a visible outline on focus.
   State shapes are intentionally NOT tab stops; keyboard users use the
   directory below the map (built in Stages 2 and 4), per the brief. */
.crg-locations .crg-map .leaflet-control-zoom a:focus-visible, .crg-locations .crg-map .leaflet-control-zoom button:focus-visible, .crg-locations .crg-map-reset:focus-visible, .crg-locations .crg-map-fullscreen:focus-visible { outline: 3px solid #D6C5A8; outline-offset: 2px; }

/* The zoom controls are now real button elements, styled to match the Reset
   and full-screen buttons instead of Leaflet's default grey bar. */
.crg-locations .crg-map .crg-hotspot { cursor: pointer; }
.crg-locations .crg-map .leaflet-control-zoom {
  border: 0 !important;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0, 46, 77, .22), inset 0 0 0 1px rgba(0, 46, 77, .08);
}
.crg-locations .crg-map .leaflet-control-zoom button {
  display: block; width: 32px; height: 32px; padding: 0;
  border: 0; background: rgba(255, 255, 255, .96); color: #002E4D;
  font: 500 18px/32px var(--crg-font-body); text-align: center; cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.crg-locations .crg-map .leaflet-control-zoom button:hover {
  background: #002E4D; color: #fff;
}
.crg-locations .crg-map .leaflet-control-zoom button + button {
  border-top: 1px solid rgba(0, 46, 77, .12);
}
.crg-locations .crg-map .leaflet-control-zoom button[disabled] {
  background: rgba(244, 246, 249, .9); color: #b4bcc6; cursor: default;
}

/* Attribution: present but quiet, so it stops reading as a stray white box. */
.crg-locations .crg-map .leaflet-control-attribution {
  background: rgba(255, 255, 255, .62);
  border-radius: 6px 0 0 0;
  padding: 2px 8px;
  color: #6b7480;
  font: 400 10px/1.5 var(--crg-font-body);
}
.crg-locations .crg-map .leaflet-control-attribution a { color: #4a5260; }
/* ============================================================
   Search panel (above the directory, below the map)
   ============================================================ */
.crg-locations .crg-search {
  position: relative;
  max-width: 1100px;
  margin: 1.5rem auto 1.25rem;
  padding: 1.4rem 1.6rem;
  background: rgba(255, 255, 255, .62);
  -webkit-backdrop-filter: blur(16px) saturate(155%);
  backdrop-filter: blur(16px) saturate(155%);
  border: 1px solid rgba(255, 255, 255, .8);
  border-radius: var(--crg-radius);
  box-shadow:
    0 1px 2px rgba(0, 46, 77, .05),
    0 10px 28px -14px rgba(0, 46, 77, .26),
    inset 0 1px 0 rgba(255, 255, 255, .9);
  box-sizing: border-box;
  font-family: var(--crg-font-body);
  overflow: hidden;
}
/* Brand accent rail across the top of the panel — navy into sand. */
.crg-locations .crg-search::before {
  content: "";
  position: absolute; left: 0; right: 0; top: 0; height: 2px;
  background: linear-gradient(90deg, var(--crg-navy) 0%, var(--crg-blue) 42%, var(--crg-sand) 100%);
}
.crg-locations .crg-search__title {
  margin: 0 0 .9rem;
  color: var(--crg-navy);
  font-size: 22px; font-weight: 600; line-height: 1.2;
  letter-spacing: .005em;
}
.crg-locations .crg-search__form {
  display: flex;
  gap: 10px;
  align-items: stretch;
}
.crg-locations .crg-search__input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 46px;
  padding: 10px 15px;
  border: 1px solid rgba(0, 46, 77, .16);
  border-radius: var(--crg-radius-sm);
  background: rgba(255, 255, 255, .82);
  color: var(--crg-navy);
  font: 400 14px/1.3 var(--crg-font-body);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.crg-locations .crg-search__input::placeholder { color: #94a0ad; }
.crg-locations .crg-search__input:focus {
  outline: none;
  background: #fff;
  border-color: var(--crg-blue);
  box-shadow: 0 0 0 3px rgba(35, 68, 127, .13);
}
.crg-locations .crg-search__button {
  flex: 0 0 auto;
  min-height: 46px;
  padding: 10px 26px;
  border: 0;
  border-radius: var(--crg-radius-sm);
  background: linear-gradient(135deg, var(--crg-navy) 0%, #0d3f63 100%);
  color: #fff;
  font: 700 12px/1 var(--crg-font-body);
  letter-spacing: .12em;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 46, 77, .22);
  transition: background .2s ease, box-shadow .15s ease;
}
.crg-locations .crg-search__button:hover {
  background: linear-gradient(135deg, var(--crg-blue) 0%, var(--crg-navy) 100%);
  box-shadow: 0 4px 14px rgba(0, 46, 77, .3);
}
.crg-locations .crg-search__button:active { box-shadow: 0 1px 4px rgba(0, 46, 77, .28); }
.crg-locations .crg-search__button:focus-visible { outline: 3px solid var(--crg-sand); outline-offset: 2px; }
.crg-locations .crg-search__count {
  margin: 1.1rem 0 0;
  color: var(--crg-muted);
  font: 400 13px/1.4 var(--crg-font-body);
  display: flex; align-items: baseline; gap: .5em;
}
.crg-locations .crg-search__count-number {
  color: var(--crg-navy);
  font-size: 26px; font-weight: 600; line-height: 1;
  margin-right: 0;
}
.crg-locations .crg-search__status {
  margin: .55rem 0 0;
  color: #9a6b2f;
  font: 400 12.5px/1.4 var(--crg-font-body);
  letter-spacing: .01em;
  min-height: 1.4em;
}
@media (max-width: 560px) {
  .crg-locations .crg-search { padding: 1rem; }
  .crg-locations .crg-search__form { flex-direction: column; }
  .crg-locations .crg-search__button { padding: 12px 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .crg-locations .crg-search__input, .crg-locations .crg-search__button { transition: none; }
}

/* ============================================================
   Location directory (below the map, same width as the map)
   ============================================================ */
.crg-locations .crg-dir {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 18px;
  align-content: start;
  align-items: start;              /* each card keeps its own height */
  max-width: 1100px;
  margin: 0 auto 3rem;
  font-family: var(--crg-font-body);
}

/* Cards are never collapsed: every card keeps a presence of its own. */
.crg-locations .crg-dir__state {
  display: flex;
  flex-direction: column;
  min-height: 190px;
  background: rgba(255, 255, 255, .78);
  -webkit-backdrop-filter: blur(12px) saturate(140%);
  backdrop-filter: blur(12px) saturate(140%);
  border: 1px solid var(--crg-line);
  border-radius: var(--crg-radius);
  box-shadow: 0 1px 2px rgba(0, 46, 77, .04), 0 4px 14px -8px rgba(0, 46, 77, .12);
  overflow: hidden;
  transition: border-color .2s ease, box-shadow .25s ease, transform .2s cubic-bezier(.22, .61, .36, 1);
}
.crg-locations .crg-dir__state:hover {
  border-color: #cdd8e5;
  box-shadow: 0 2px 4px rgba(0, 46, 77, .06), 0 12px 26px -12px rgba(0, 46, 77, .24);
  transform: translateY(-2px);
}
@media (prefers-reduced-motion: reduce) {
  .crg-locations .crg-dir__state:hover { transform: none; }
}

/* The state name is the control that selects the state on the map. */
.crg-locations .crg-dir__title { margin: 0; }
.crg-locations .crg-dir__head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 14px;
  box-sizing: border-box;
  border: 0;
  border-bottom: 1px solid #eef1f4;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background-color .2s ease;
}
.crg-locations .crg-dir__head:hover { background: #f2f5f9; }
.crg-locations .crg-dir__head:focus-visible { outline: 3px solid #D6C5A8; outline-offset: -3px; }

.crg-locations .crg-dir__icon {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #eef3fa 0%, #e2ebf6 100%);
  color: #23447F;
  box-shadow: inset 0 0 0 1px rgba(35, 68, 127, .08);
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.crg-locations .crg-dir__state:hover .crg-dir__icon {
  background: linear-gradient(135deg, #23447F 0%, #002E4D 100%);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 46, 77, .25);
}
.crg-locations .crg-dir__icon svg { display: block; }

.crg-locations .crg-dir__name {
  flex: 1 1 auto;
  min-width: 0;
  /* Playfair at 700 reads heavy at this size; 600 keeps it elegant. */
  font-size: 17px; font-weight: 600; line-height: 1.25;
  color: var(--crg-navy);
  letter-spacing: .005em;
  overflow-wrap: anywhere;
}

.crg-locations .crg-dir__count {
  flex: 0 0 auto;
  min-width: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #F1EFE8;
  color: #002E4D;
  font: 700 12px/1.2 var(--crg-font-body);
  text-align: center;
}

/* The [hidden] attribute must beat the card's own display:flex. A class
   selector outranks the browser's built-in [hidden]{display:none}, so without
   this rule hiding a non-matching card silently does nothing. */
.crg-locations .crg-dir__state[hidden],
.crg-locations .crg-dir__state li[hidden] { display: none !important; }

/* ---- Search-match treatment ----
   A matched card is lifted off the grid: white surface, a navy accent rail
   down its left edge, a deeper shadow, and a tinted header. Deliberately
   distinct from the "currently selected on the map" style, so the two states
   are never confused. Matched cards also float to the top via JS. */
.crg-locations .crg-dir__state.is-match {
  position: relative;
  border-color: #c3cfe0;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(35, 68, 127, .14), 0 14px 30px -8px rgba(0, 46, 77, .28);
  transform: translateZ(0);
  animation: crg-match-in .42s cubic-bezier(.22, .61, .36, 1) both;
}
/* Accent rail: a vertical navy→sand gradient marking the card as a hit. */
.crg-locations .crg-dir__state.is-match::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #23447F 0%, #002E4D 55%, #D6C5A8 100%);
  border-radius: var(--crg-radius) 0 0 var(--crg-radius);
}
.crg-locations .crg-dir__state.is-match .crg-dir__head {
  background: linear-gradient(180deg, #ffffff 0%, #f4f7fb 100%);
  border-bottom-color: #e3e9f1;
}
.crg-locations .crg-dir__state.is-match .crg-dir__icon {
  background: linear-gradient(135deg, #23447F 0%, #002E4D 100%);
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 46, 77, .3);
}
.crg-locations .crg-dir__state.is-match .crg-dir__count {
  background: #002E4D;
  color: #fff;
  box-shadow: none;
}
@keyframes crg-match-in {
  0%   { transform: translateY(14px) scale(.985); opacity: 0; }
  100% { transform: translateY(0) scale(1);       opacity: 1; }
}

/* Matched city row: a tinted capsule with a navy rail, a filled marker icon
   and a small "MATCH" tag, so the exact hit is unmistakable at a glance. */
.crg-locations .crg-dir__state.is-match li.is-match {
  position: relative;
  background: linear-gradient(90deg, #eef3fb 0%, #f8fafd 70%, #fff 100%);
  border-left-color: #23447F;
  box-shadow: inset 0 0 0 1px rgba(35, 68, 127, .12);
}
.crg-locations .crg-dir__state.is-match li.is-match .crg-dir__rowicon { color: #23447F; }
.crg-locations .crg-dir__state.is-match li.is-match .crg-dir__city {
  color: #002E4D;
  font-weight: 700;
}
.crg-locations .crg-dir__state.is-match li.is-match .crg-dir__city::after {
  content: "MATCH";
  display: inline-block;
  margin-left: 8px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #D6C5A8;
  color: #002E4D;
  font: 700 9px/1.2 var(--crg-font-body);
  letter-spacing: .08em;
  vertical-align: middle;
}
/* Non-matching rows inside a matched card recede so the hits carry the eye. */
.crg-locations .crg-dir__state.is-match li:not(.is-match) { opacity: .45; }
.crg-locations .crg-dir__state.is-match li:not(.is-match):hover { opacity: 1; }

/* A matched card drops the two-row height cap and shows every row. Otherwise
   the matched row can sit below its card's fold, and scrolling it into view
   leaves a half-cut row above it. Matched cards are few and float to the top,
   so letting them grow costs nothing. */
.crg-locations .crg-dir__state.is-match ul {
  max-height: none;
  overflow-y: visible;
}

/* While the debounce is pending, the panel reads as "working" without a spinner. */
.crg-locations .crg-search.is-pending .crg-search__count { opacity: .45; }
.crg-locations .crg-search__count { transition: opacity .2s ease; }

@media (prefers-reduced-motion: reduce) {
  .crg-locations .crg-dir__state.is-match { animation: none; }
  .crg-locations .crg-search__count { transition: none; }
}

/* Active card style: blue outline, sand header, navy icon and a lifted shadow.
   Deliberately different from the "selected on map" style below. */
.crg-locations .crg-dir__state.is-active {
  border-color: #23447F;
  box-shadow: 0 0 0 2px rgba(35, 68, 127, .22), 0 8px 20px rgba(0, 46, 77, .12);
  background: #fdfcf9;
}
.crg-locations .crg-dir__state.is-active .crg-dir__head {
  background: linear-gradient(180deg, #fbfaf5 0%, #F1EFE8 100%);
}
.crg-locations .crg-dir__state.is-active .crg-dir__icon {
  background: #23447F;
  color: #fff;
}
.crg-locations .crg-dir__state.is-active .crg-dir__count {
  background: #fff;
  box-shadow: inset 0 0 0 1px #d8d2c2;
}

.crg-locations .crg-dir__state ul {
  list-style: none;
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 4px;
  margin: 0;
  padding: 8px;
  /* Two city rows fully visible; taller states scroll inside their own card
     so a long list can no longer stretch the grid row it lives in. */
  max-height: 132px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
.crg-locations .crg-dir__state ul::-webkit-scrollbar { width: 8px; }
.crg-locations .crg-dir__state ul::-webkit-scrollbar-thumb { background: #d4dbe3; border-radius: 4px; }
.crg-locations .crg-dir__state ul::-webkit-scrollbar-track { background: transparent; }

.crg-locations .crg-dir__state li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-left: 4px solid transparent;
  border-radius: 8px;
  transition: background-color .15s ease, border-color .15s ease;
}
.crg-locations .crg-dir__state li:hover { background: #f7f9fb; }

.crg-locations .crg-dir__rowicon {
  flex: 0 0 auto;
  display: flex;
  color: #9aa3ad;
  transition: color .15s ease;
}
.crg-locations .crg-dir__rowicon svg { display: block; }

.crg-locations .crg-dir__city {
  flex: 1 1 auto;
  min-width: 0;
  font: 400 14px/1.4 var(--crg-font-body);
  color: #333;
  overflow-wrap: break-word;
}
.crg-locations a.crg-dir__city { color: #23447F; font-weight: 600; text-decoration: underline; }
.crg-locations a.crg-dir__city:hover { text-decoration-thickness: 2px; }
.crg-locations a.crg-dir__city:focus-visible {
  outline: 3px solid #D6C5A8;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Selected city row: sand background + 4 px blue left border + aria-current="true". */
.crg-locations .crg-dir__state li[aria-current="true"] {
  background: #F1EFE8;
  border-left-color: #23447F;
}
.crg-locations .crg-dir__state li[aria-current="true"] .crg-dir__rowicon { color: #23447F; }
.crg-locations .crg-dir__state li[aria-current="true"] .crg-dir__city { font-weight: 700; }

.crg-locations .crg-dir__action {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 12px;
  box-sizing: border-box;
  border: 1px solid #cfd8e3;
  border-radius: 8px;
  background: #fbfcfe;
  color: #23447F;
  font: 600 12px/1 var(--crg-font-body);
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.crg-locations .crg-dir__action:hover { background: #23447F; border-color: #23447F; color: #fff; }
.crg-locations .crg-dir__action:focus-visible { outline: 3px solid #D6C5A8; outline-offset: 2px; }
.crg-locations .crg-dir__action-icon { display: flex; }
.crg-locations .crg-dir__action-icon svg { display: block; }

/* One column on phones. */
@media (max-width: 560px) {
.crg-locations .crg-dir { grid-template-columns: 1fr; }
/* Cards grow to fit all their rows on phones, so the page itself scrolls
   naturally and no city list is trapped inside its own scroll area. */
.crg-locations .crg-dir__state ul { max-height: none; overflow-y: visible; }
}

/* Visually hidden, still announced by screen readers (live region). */
.crg-locations .crg-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
.crg-locations .crg-dir__state, .crg-locations .crg-dir__head, .crg-locations .crg-dir__icon, .crg-locations .crg-dir__state li, .crg-locations .crg-dir__action, .crg-locations .crg-dir__rowicon { transition: none; }
}
/* ============================================================
   WordPress plugin additions
   ============================================================ */
/* The interactive affordances stay hidden until the script has confirmed it runs. */
.crg-locations .crg-dir__plainname {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 14px;
  border-bottom: 1px solid #eef1f4;
  font: 700 15px/1.25 var(--crg-font-body);
  color: #002E4D;
}
.crg-locations:not(.crg-js) .crg-dir__head { display: none; }
.crg-locations:not(.crg-js) .crg-dir__action { display: none; }
.crg-locations:not(.crg-js) .crg-dir__plainname { display: flex; }
.crg-locations:not(.crg-js) .crg-map-reset,
.crg-locations:not(.crg-js) .crg-map-fullscreen { display: none; }
.crg-locations:not(.crg-js) .crg-map {
  display: flex;
  align-items: center;
  justify-content: center;
}
.crg-locations .crg-map__fallback { display: none; }
.crg-locations:not(.crg-js) .crg-map__fallback {
  display: block;
  padding: 1rem;
  color: #4a5260;
  font: 400 14px/1.5 var(--crg-font-body);
  text-align: center;
}
/* Placeholder shown while editing the page in Elementor. */
.crg-locations .crg-map--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}
.crg-locations .crg-map--placeholder p {
  padding: 1rem;
  color: #4a5260;
  font: 400 14px/1.5 var(--crg-font-body);
  text-align: center;
}
