/* ── meta-embed.css ──────────────────────────────────────────────────────────
   Scoped version of meta.css for use inside index.html.
   Class names that conflicted with style.css have been renamed:
     .county       → .meta-county
     .state-border → .meta-state-border
     .tooltip      → .meta-tooltip
     .controls     → .meta-controls
     #map-container → .meta-map-container
     #legend-container → #meta-legend-container
   Page-level rules (.site-header, .map-page) are omitted.
   Everything else is identical to meta.css.
───────────────────────────────────────────────────────────────────────────── */

/* ── Graph root wrapper ──────────────────────────────────────────── */
.meta-graph-root {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ── Controls row ────────────────────────────────────────────────── */
.meta-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.95rem;
}

.meta-controls label {
  font-weight: 600;
  color: #333;
}

#meta-metric-select {
  padding: 0.4rem 0.75rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 0.95rem;
  background: #fff;
  cursor: pointer;
}

#meta-metric-select:focus {
  outline: 2px solid #4a90d9;
}

/* ── Buttons ─────────────────────────────────────────────────────── */
.meta-btn {
  padding: 0.38rem 0.9rem;
  border: 1px solid #aaa;
  border-radius: 6px;
  font-size: 0.88rem;
  background: #fff;
  color: #444;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.meta-btn:hover:not(:disabled) {
  background: #1a1a2e;
  color: #fff;
  border-color: #1a1a2e;
}

.meta-btn:disabled {
  opacity: 0.38;
  cursor: default;
}

.meta-cycle-btn {
  background: #1a1a2e;
  color: #fff;
  border-color: #1a1a2e;
}

.meta-cycle-btn:hover {
  background: #333;
  border-color: #333;
}

.meta-cycle-btn.paused {
  background: #fff;
  color: #444;
  border-color: #aaa;
}

.meta-cycle-btn.paused:hover {
  background: #1a1a2e;
  color: #fff;
  border-color: #1a1a2e;
}

/* ── Map row (SVG + detail panel side by side) ───────────────────── */
.meta-map-row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  width: 100%;
}

.meta-map-container {
  flex: 1 1 auto;
  min-width: 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  padding: 1rem;
}

#meta-choropleth {
  width: 100%;
  height: auto;
  display: block;
}

/* ── County paths ────────────────────────────────────────────────── */
.meta-county {
  stroke: #fff;
  stroke-width: 0.25px;
  transition: opacity 0.3s ease, stroke 0.2s ease, stroke-width 0.2s ease;
  cursor: pointer;
}

.meta-county:hover {
  stroke: #222;
  stroke-width: 1.2px;
}

.meta-county.faded {
  opacity: 0.2;
}

.meta-county.selected {
  opacity: 1;
  stroke: #111;
  stroke-width: 2.5px;
  filter: brightness(1.15);
}

.meta-county.top {
  stroke: #ffd700;
  stroke-width: 2.5px;
  filter: drop-shadow(0 0 5px rgba(255, 215, 0, 0.9));
}

.meta-county.no-data {
  fill: #ddd;
}

/* ── Projected-county overlay ────────────────────────────────────── */
.projected-county {
  pointer-events: none;
  stroke: #111;
  stroke-width: 2.5px;
  animation: floatCounty 2s ease-in-out infinite alternate;
  transform-box: fill-box;
  transform-origin: center;
}

@keyframes floatCounty {
  from {
    filter: drop-shadow(0px 6px 10px rgba(0, 0, 0, 0.55));
    transform: translateY(0px);
  }
  to {
    filter: drop-shadow(0px 12px 14px rgba(0, 0, 0, 0.35));
    transform: translateY(-5px);
  }
}

.top-callout {
  stroke: #555;
  stroke-width: 1.2px;
  stroke-dasharray: 4 3;
  pointer-events: none;
}

.highest-label-bg {
  fill: rgba(255, 255, 255, 0.96);
  stroke: #bbb;
  stroke-width: 1px;
  filter: drop-shadow(0px 3px 7px rgba(0, 0, 0, 0.22));
}

.highest-label-title {
  font-size: 12.5px;
  font-weight: 700;
  fill: #111;
  pointer-events: none;
}

.highest-label-value {
  font-size: 10.5px;
  font-weight: 500;
  fill: #555;
  pointer-events: none;
}

/* ── State borders ───────────────────────────────────────────────── */
.meta-state-border {
  fill: none;
  stroke: #555;
  stroke-width: 0.8px;
  pointer-events: none;
}

/* ── Tooltip ─────────────────────────────────────────────────────── */
.meta-tooltip {
  position: fixed;
  background: rgba(20, 20, 40, 0.9);
  color: #fff;
  padding: 0.5rem 0.8rem;
  border-radius: 6px;
  font-size: 0.82rem;
  pointer-events: none;
  z-index: 1000;
  max-width: 220px;
  line-height: 1.5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.meta-tooltip.hidden {
  display: none;
}

.meta-tooltip strong {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 0.2rem;
}

/* ── Legend ──────────────────────────────────────────────────────── */
#meta-legend-container {
  margin-top: 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-left: 0.5rem;
}

#meta-legend-container svg {
  display: block;
}

/* ── Detail panel (right-side) ───────────────────────────────────── */
.detail-panel {
  flex: 0 0 220px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
  padding: 1rem 1.1rem;
  font-size: 0.85rem;
  color: #333;
  min-height: 160px;
}

.detail-hint {
  color: #999;
  font-style: italic;
  margin: 0;
  line-height: 1.5;
}

.detail-panel h3 {
  margin: 0 0 0.6rem;
  font-size: 0.95rem;
  color: #1a1a2e;
  line-height: 1.35;
}

.detail-panel .state-tag {
  display: inline-block;
  background: #e8ecf5;
  color: #444;
  border-radius: 4px;
  padding: 0.1rem 0.45rem;
  font-size: 0.78rem;
  margin-bottom: 0.6rem;
}

.top-badge {
  display: block;
  background: #fffbe6;
  border: 1px solid #ffd700;
  color: #7a5c00;
  border-radius: 5px;
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
}

.detail-metrics {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.detail-metrics li {
  display: flex;
  flex-direction: column;
}

.detail-metrics .metric-name {
  font-size: 0.73rem;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.detail-metrics .metric-value {
  font-size: 1rem;
  font-weight: 700;
  color: #1a1a2e;
}

.detail-metrics .metric-value.no-data {
  font-size: 0.82rem;
  font-weight: 400;
  color: #bbb;
}

/* ── Below-map county detail panel ──────────────────────────────── */
.county-detail-panel {
  width: 100%;
  margin-top: 18px;
  padding: 20px 24px 24px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.county-detail-panel.hidden {
  display: none;
}

.county-detail-panel h3 {
  margin: 0 0 16px;
  font-size: 1.25rem;
  font-weight: 800;
  color: #1a1a2e;
}

.detail-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 12px;
}

@media (max-width: 800px) {
  .detail-metrics-grid { grid-template-columns: repeat(2, 1fr); }
}

.detail-card {
  padding: 14px 16px;
  border-radius: 12px;
  background: #f7f7f7;
  border: 1px solid rgba(0, 0, 0, 0.08);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.detail-card .detail-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #666;
}

.detail-card strong {
  font-size: 1.2rem;
  font-weight: 700;
  color: #111;
}
