/* ================================================================
   service-area.css — page-specific styles for service-area.html
   Prefix: sa-
   Shared tokens/utilities (colors, .section-container, .eyebrow-*,
   .initiative-*, #cta-section, .breadcrumb, footer) live in main.css.

   The hero, breadcrumb, benefit cards, and CTA are plain Tailwind +
   inline var(--...) styles directly in the HTML (matching
   src/app/ServiceAreaPage.tsx) — no page-specific classes needed for
   those. What's left here is the search/map/panel/county explorer:
   its dropdown, state panel, city panel, county rows, and content
   modal are all rendered by service-area.js (ServiceAreaExplorer.tsx's
   vanilla-JS port) via innerHTML against these sa-* classes, so they
   stay as CSS rather than Tailwind utility classes in markup that
   doesn't exist until JS writes it.

   Light-surface explorer: mirrors src/app/theme.ts SURFACE/ON_LIGHT —
   base #fff, hairlines/text as rgba(10,11,20,X). Only the local-content
   modal stays on the dark surface.
   ================================================================ */

/* ── Search ─────────────────────────────────────────────────────────── */
.sa-search-clear {
  display: flex; align-items: center; padding: 0 var(--space-12);
  background: #fff; border: 1px solid var(--on-light-border); border-left: none;
  color: var(--on-light-50); cursor: pointer;
}
.sa-search-clear[hidden] { display: none; }
.sa-search-dropdown {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 500;
  background: #fff; border: 1px solid var(--on-light-border);
  box-shadow: 0 16px 48px rgba(0,0,0,.18);
  max-height: 360px; overflow-y: auto;
  display: none;
}
.sa-search-dropdown.open { display: block; }
.sa-search-result {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--space-12);
  padding: var(--space-12) var(--space-16); text-align: left; background: none; border: none; border-bottom: 1px solid var(--on-light-05);
  cursor: pointer; transition: background .15s;
}
.sa-search-result:hover { background: var(--on-light-wash); }
.sa-search-result-name { display: flex; align-items: center; gap: 10px; min-width: 0; font-family: var(--font-body); font-size: 14px; color: var(--CHAR); }
.sa-search-result-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sa-search-result-meta { flex-shrink: 0; font-family: var(--font-body); font-size: 12px; color: var(--on-light-35); }
.sa-search-empty { padding: 18px var(--space-16); }
.sa-search-empty p { font-family: var(--font-body); font-size: 14px; color: var(--on-light-60); margin: 0 0 10px; }
.sa-search-empty button {
  display: inline-flex; align-items: center; gap: var(--space-8);
  font-family: var(--font-body); font-weight: 600; font-size: 13px; color: var(--B);
  background: none; border: none; cursor: pointer; padding: 0;
}
.sa-search-hint { font-family: var(--font-body); font-size: 13px; color: var(--on-light-35); margin: 14px 0 0; }

/* ── State chips ────────────────────────────────────────────────────── */
.sa-state-chip {
  font-family: var(--font-body); font-size: 13px; color: var(--on-light-70);
  background: transparent; border: 1px solid var(--on-light-border);
  padding: var(--space-8) var(--space-16); cursor: pointer; transition: all .15s;
}
.sa-state-chip:hover { border-color: var(--on-light-30); }
.sa-state-chip.active { font-weight: 600; color: #fff; background: var(--B); border-color: var(--B); }

/* ── Map + state/city panel ───────────────────────────────────────────
   .sa-map-grid/.sa-map-wrap are now plain Tailwind + inline style on the
   grid container in the HTML (matching ServiceAreaExplorer.tsx) — the
   grid-template-columns responsive override below moved to
   `lg:grid-cols-[1fr_380px]` in markup. */
.sa-leaflet-map { height: 420px; width: 100%; background: var(--CREAM); isolation: isolate; }
.sa-leaflet-map .leaflet-tooltip { font-family: var(--font-body); font-size: 12px; }
.sa-leaflet-map .leaflet-pane { z-index: 200; }
.sa-leaflet-map .leaflet-top, .sa-leaflet-map .leaflet-bottom { z-index: 300; }

.sa-panel { background: #fff; max-height: 560px; overflow-y: auto; }
.sa-panel-inner { padding: 28px; }

.sa-panel-back {
  display: inline-flex; align-items: center; gap: var(--space-8); margin-bottom: var(--space-20);
  font-family: var(--font-body); font-size: 12.5px; color: var(--on-light-45);
  background: none; border: none; cursor: pointer; padding: 0;
}
.sa-panel-title-row { display: flex; align-items: baseline; gap: var(--space-12); margin-bottom: var(--space-8); }
.sa-panel-name { font-family: var(--font-heading); font-weight: 800; font-size: 30px; color: var(--CHAR); line-height: 1; letter-spacing: -.5px; margin: 0; }
.sa-panel-abbr { font-family: var(--font-heading); font-weight: 700; font-size: 15px; color: var(--B); }
.sa-panel-tagline { font-family: var(--font-body); font-size: 13.5px; color: var(--on-light-45); line-height: 1.65; margin: 0 0 18px; }
.sa-panel-meta-row { display: flex; align-items: center; gap: var(--space-8); margin: 0 0 28px; }
.sa-panel-meta-row p { font-family: var(--font-body); font-size: 13.5px; color: var(--on-light-50); margin: 0; }

.sa-panel-stats { display: flex; gap: var(--space-24); padding-bottom: var(--space-20); margin-bottom: var(--space-20); border-bottom: 1px solid var(--on-light-hairline); }
.sa-panel-stat-num { font-family: var(--font-heading); font-weight: 800; font-size: 22px; color: var(--B); line-height: 1; margin: 0; }
.sa-panel-stat-label { font-family: var(--font-body); font-size: 11px; color: var(--on-light-35); margin: 3px 0 0; }

.sa-panel-label { font-family: var(--font-heading); font-weight: 600; font-size: 10px; color: var(--B); letter-spacing: 3px; text-transform: uppercase; margin: 0 0 10px; }
.sa-panel-label-row { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: var(--space-12); }
.sa-panel-label-row button {
  font-family: var(--font-body); font-size: 11.5px; color: var(--on-light-40);
  background: none; border: none; cursor: pointer; padding: 0;
}
.sa-panel-label-row button:hover { color: var(--CHAR); }

.sa-panel-metros { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--space-24); }
.sa-panel-metro-item { background: var(--on-light-03); border: 1px solid var(--on-light-hairline); }
.sa-panel-metro-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: var(--space-8);
  text-align: left; padding: 10px 14px;
  font-family: var(--font-body); font-size: 14px; color: rgba(10,11,20,.72);
  background: none; border: none;
  cursor: pointer; transition: background .15s;
}
.sa-panel-metro-btn:hover { background: var(--on-light-wash); }
.sa-panel-metro-item.open .sa-panel-metro-btn { color: var(--CHAR); font-weight: 600; }
.sa-panel-metro-chevron { flex-shrink: 0; color: #C4AB6C; transition: transform .2s; }
.sa-panel-metro-item.open .sa-panel-metro-chevron { transform: rotate(90deg); }

.sa-panel-metro-cities { display: none; flex-wrap: wrap; gap: 6px; padding: 0 14px var(--space-12); }
.sa-panel-metro-item.open .sa-panel-metro-cities { display: flex; }

.sa-panel-services { display: flex; flex-wrap: wrap; gap: var(--space-8); margin-bottom: var(--space-24); }
.sa-panel-chip { font-family: var(--font-body); font-size: 12.5px; color: var(--on-light-70); background: var(--on-light-05); border: 1px solid var(--on-light-hairline); padding: 5px 11px; }

.sa-panel-cta {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: var(--space-8);
  padding: 14px 0; margin-bottom: 28px;
  background: var(--B); font-family: var(--font-body); font-weight: 700; font-size: 14px; color: #fff;
  border: none; cursor: pointer; transition: opacity .2s;
}
.sa-panel-cta:hover { opacity: .9; }

.sa-panel-proof { padding-top: var(--space-24); border-top: 1px solid var(--on-light-hairline); }
.sa-panel-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: var(--space-16); }
.sa-panel-tab {
  font-family: var(--font-body); font-size: 12.5px; color: var(--on-light-45);
  background: var(--on-light-03); border: 1px solid rgba(10,11,20,.06);
  padding: var(--space-8) var(--space-8); cursor: pointer; line-height: 1.25;
}
.sa-panel-tab .count { display: block; font-size: 10px; color: var(--on-light-30); font-weight: 400; }
.sa-panel-tab.active { font-weight: 600; color: #1A52A8; background: rgba(26,82,168,.14); border-color: rgba(26,82,168,.5); }

.sa-proof-list { display: flex; flex-direction: column; gap: var(--space-8); }
.sa-proof-item { text-align: left; padding: var(--space-12) var(--space-16); background: var(--on-light-03); border: 1px solid var(--on-light-hairline); cursor: default; }
.sa-proof-title { font-family: var(--font-heading); font-weight: 700; font-size: 14px; color: var(--CHAR); line-height: 1.3; margin: 0 0 var(--space-4); }
.sa-proof-meta { font-family: var(--font-body); font-size: 12px; color: var(--on-light-40); margin: 0; }
.sa-proof-empty { font-family: var(--font-body); font-size: 13px; color: var(--on-light-30); padding: 10px 0; margin: 0; }

/* City panel */
.sa-city-meta-row { display: flex; align-items: center; gap: var(--space-8); margin-bottom: 28px; }
.sa-city-meta-row p { font-family: var(--font-body); font-size: 13.5px; color: var(--on-light-50); margin: 0; }
.sa-content-hint { font-family: var(--font-body); font-size: 12px; color: rgba(10,11,20,.32); line-height: 1.5; margin: 0 0 var(--space-12); }
.sa-content-rows { display: flex; flex-direction: column; gap: var(--space-8); margin-bottom: var(--space-24); }
.sa-content-row {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-12);
  padding: var(--space-12) var(--space-16); text-align: left;
  background: rgba(10,11,20,.035); border: 1px solid transparent; border-left-width: 3px; border-left-style: solid;
  cursor: pointer; transition: all .15s;
}
.sa-content-row.empty { opacity: .45; cursor: default; }
.sa-content-row.active { background: rgba(10,11,20,.09); border-color: currentColor; }
.sa-content-row-name { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sa-content-row-name span { font-family: var(--font-heading); font-weight: 700; font-size: 15px; color: var(--CHAR); white-space: nowrap; }
.sa-content-row-hint { font-family: var(--font-body); font-size: 12px; color: var(--on-light-35); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.sa-content-count { font-family: var(--font-body); font-size: 12px; color: var(--on-light-30); margin: 0 0 18px; }
.sa-content-empty { padding: 18px var(--space-16); margin-bottom: 28px; background: rgba(10,11,20,.035); border: 1px dashed rgba(10,11,20,.15); }
.sa-content-empty p { font-family: var(--font-body); font-size: 13.5px; color: var(--on-light-45); line-height: 1.6; margin: 0; }

/* ── County / city browser ─────────────────────────────────────────────
   Wrapper spacing (.sa-counties-wrap/-label/-rule) and the footer row
   are now Tailwind + inline style directly in the HTML — the county
   list itself is still JS-rendered against the classes below. */
.sa-county-list { max-height: 420px; overflow-y: auto; border: 1px solid var(--on-light-border); background: #fff; }
.sa-county-item { border-bottom: 1px solid var(--on-light-05); }
.sa-county-item:last-child { border-bottom: none; }
.sa-county-header {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; text-align: left; background: none; border: none; cursor: pointer;
  transition: background .15s;
}
.sa-county-header:hover { background: var(--on-light-03); }
.sa-county-item.open .sa-county-header { background: var(--on-light-03); }
.sa-county-name-row { display: flex; align-items: center; gap: var(--space-12); }
.sa-county-chevron { color: var(--on-light-30); transition: transform .2s; transform: rotate(-90deg); }
.sa-county-item.open .sa-county-chevron { color: var(--B); transform: rotate(0deg); }
.sa-county-name { font-family: var(--font-body); font-weight: 500; font-size: 14px; color: var(--on-light-70); }
.sa-county-item.open .sa-county-name { font-weight: 600; color: var(--CHAR); }
.sa-county-count { font-family: var(--font-body); font-size: 12px; color: rgba(10,11,20,.28); }

.sa-county-cities { display: none; flex-wrap: wrap; gap: 6px; padding: var(--space-4) 28px var(--space-16); }
.sa-county-item.open .sa-county-cities { display: flex; }
.sa-city-chip {
  display: inline-flex; align-items: center; padding: var(--space-4) 10px;
  font-family: var(--font-body); font-size: 12.5px; color: var(--on-light-60);
  background: var(--on-light-05); border: 1px solid rgba(10,11,20,.07);
  cursor: pointer; transition: all .15s;
}
.sa-city-chip:hover { border-color: var(--on-light-30); }
.sa-city-chip.hit { font-weight: 700; color: #fff; background: var(--B); border-color: var(--B); }

.sa-check-address-btn {
  display: inline-flex; align-items: center; gap: var(--space-8); align-self: flex-start;
  padding: var(--space-12) var(--space-24); background: none; border: 1.5px solid var(--SAND);
  font-family: var(--font-body); font-weight: 600; font-size: 13.5px; color: var(--B);
  cursor: pointer; transition: background .15s;
}
.sa-check-address-btn:hover { background: rgba(196,171,108,.08); }

/* ── Local content modal (kept dark — overlay) ───────────────────────── */
.sa-content-modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  display: none; align-items: center; justify-content: center; padding: var(--space-16);
  background: rgba(0,0,0,.9); backdrop-filter: blur(10px);
}
.sa-content-modal-overlay.open { display: flex; }
.sa-content-modal {
  position: relative; width: 100%; max-width: 940px; max-height: 88vh;
  background: var(--CHAR); overflow: hidden; overflow-y: auto;
  display: flex; flex-direction: column;
}
.sa-content-modal.stacked { max-width: 880px; }
.sa-content-modal-close {
  position: absolute; top: 16px; right: 16px; z-index: 10;
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(10,11,20,.65); border: none; cursor: pointer;
}
.sa-content-modal-gallery { position: relative; overflow: hidden; background: var(--DARK); min-height: 220px; }
.sa-content-modal.stacked .sa-content-modal-gallery { aspect-ratio: 21/9; min-height: 0; }
.sa-content-modal-gallery-track { display: flex; height: 100%; transition: transform .3s cubic-bezier(.22,1,.36,1); }
.sa-content-modal-gallery-slide { position: relative; flex: 0 0 100%; height: 100%; }
.sa-content-modal-gallery-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sa-content-modal-gallery-caption {
  position: absolute; bottom: 0; left: 0; right: 0; padding: var(--space-16) var(--space-24);
  background: linear-gradient(0deg, var(--on-light-90) 0%, rgba(10,11,20,0) 100%);
  font-family: var(--font-body); font-size: 12.5px; color: var(--on-dark-85);
}
.sa-content-modal-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--on-light-60); border: none; cursor: pointer;
}
.sa-content-modal-nav.prev { left: 12px; }
.sa-content-modal-nav.next { right: 12px; }
.sa-content-modal-dots { position: absolute; bottom: 12px; right: 16px; display: flex; gap: 6px; }
.sa-content-modal-dots button { width: 6px; height: 6px; border-radius: 50%; background: var(--on-dark-40); border: none; cursor: pointer; padding: 0; transition: all .3s; }
.sa-content-modal-dots button.active { width: 16px; background: var(--SAND); }
.sa-content-modal-badge { position: absolute; top: 16px; left: 16px; padding: 5px 10px; }
.sa-content-modal-badge span { font-family: var(--font-heading); font-weight: 700; font-size: 9px; color: var(--DARK); letter-spacing: 2px; text-transform: uppercase; }

.sa-content-modal-body { flex: 1; padding: var(--space-24) 28px 28px; overflow-y: auto; }
.sa-content-modal-loc { display: flex; align-items: center; gap: var(--space-8); margin-bottom: var(--space-16); font-family: var(--font-body); font-size: 12px; color: var(--on-dark-40); }
.sa-content-modal-stars { display: flex; gap: var(--space-4); margin-bottom: var(--space-16); }
.sa-content-modal-title { font-family: var(--font-heading); font-weight: 800; font-size: clamp(20px,2.2vw,27px); color: #fff; line-height: 1.15; letter-spacing: -.5px; margin: 0 0 6px; }
.sa-content-modal-service { font-family: var(--font-body); font-size: 13px; color: var(--SAND); margin: 0 0 var(--space-20); }
.sa-content-modal-what { margin-bottom: var(--space-20); padding: var(--space-16); background: rgba(26,82,168,.12); border: 1px solid rgba(26,82,168,.25); }
.sa-content-modal-what-label { font-family: var(--font-heading); font-weight: 700; font-size: 10px; color: var(--B); letter-spacing: 2px; text-transform: uppercase; margin: 0 0 6px; }
.sa-content-modal-what p { font-family: var(--font-body); font-size: 14px; color: var(--on-dark-body); line-height: 1.65; margin: 0; }
.sa-content-modal-story p { font-family: var(--font-body); font-size: 14.5px; color: var(--on-dark-65); line-height: 1.8; margin: 0 0 var(--space-16); }
.sa-content-modal-quote-wrap { margin-bottom: var(--space-16); }
.sa-content-modal-quote { font-family: var(--font-body); font-size: 15px; color: var(--on-dark-75); line-height: 1.8; margin: var(--space-8) 0 0; }
.sa-content-modal-author { display: flex; align-items: center; gap: var(--space-12); margin-top: var(--space-16); }
.sa-content-modal-avatar { width: 32px; height: 32px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: #333; }
.sa-content-modal-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sa-content-modal-author-name { font-family: var(--font-body); font-weight: 600; font-size: 13px; color: #fff; margin: 0; }
.sa-content-modal-author-meta { font-family: var(--font-body); font-size: 11.5px; color: var(--on-dark-35); margin: 0; }
.sa-content-modal-divider { height: 1px; background: var(--on-dark-hairline); margin: var(--space-8) 0 18px; }
.sa-content-modal-cta {
  display: flex; align-items: center; justify-content: center; gap: var(--space-8); width: 100%;
  padding: 13px var(--space-24); background: var(--B); font-family: var(--font-heading); font-weight: 700; font-size: 13px;
  color: #fff; border: none; cursor: pointer; letter-spacing: .3px; transition: opacity .2s;
}
.sa-content-modal-cta:hover { opacity: .9; }

/* ── Responsive ──────────────────────────────────────────────────────── */
@media (min-width: 1024px) {
  .sa-leaflet-map { height: 520px; }
  .sa-panel { max-height: 520px; }
  .sa-content-modal:not(.stacked) { flex-direction: row; max-height: min(85vh, 560px); }
  .sa-content-modal:not(.stacked) .sa-content-modal-gallery { width: 48%; flex-shrink: 0; min-height: 0; }
  .sa-content-modal:not(.stacked) .sa-content-modal-body { border-left: 1px solid var(--on-dark-hairline); }
}
