/* =============================================================
   NC County Map — Frontend Styles
   All rules scoped to .nc-county-map-wrap to avoid Divi conflicts
============================================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Playfair+Display:wght@600&display=swap');

/* ── Wrapper ─────────────────────────────────────────────── */
.nc-county-map-wrap {
  position: relative;
  width: 100%;
  font-family: 'Inter', system-ui, sans-serif;
  background: #f4f1ec;
  border-radius: 10px;
  overflow: hidden;
}

.nc-county-map-wrap svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* ── County paths ────────────────────────────────────────── */
.nc-county-map-wrap .ncmap-county {
  fill: #d6cfc3;
  stroke: #b8b0a3;
  stroke-width: 0.5px;
  cursor: default;
  transition: fill .18s ease;
}

.nc-county-map-wrap .ncmap-partner {
  fill: #4a7c59;
  stroke: #2e5c3a;
  stroke-width: 0.8px;
  cursor: pointer;
  filter: drop-shadow(0 1px 3px rgba(74,124,89,.25));
  transition: fill .18s ease, filter .18s ease;
}

.nc-county-map-wrap .ncmap-partner:hover {
  fill: #3a6147;
  filter: drop-shadow(0 2px 8px rgba(74,124,89,.45));
}

/* ── Loading spinner ─────────────────────────────────────── */
.nc-county-map-wrap .ncmap-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  pointer-events: none;
  z-index: 5;
}

.nc-county-map-wrap .ncmap-loader p {
  font-size: .78rem;
  color: #6b7280;
  margin: 0;
}

.ncmap-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #d6cfc3;
  border-top-color: #4a7c59;
  border-radius: 50%;
  animation: ncmap-spin .7s linear infinite;
}

@keyframes ncmap-spin { to { transform: rotate(360deg); } }

/* ── Tooltip ─────────────────────────────────────────────── */
.ncmap-tooltip {
  position: fixed;
  z-index: 9990;
  background: rgba(20,20,20,.82);
  backdrop-filter: blur(4px);
  color: #fff;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: .72rem;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 6px;
  pointer-events: none;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .14s ease;
}

.ncmap-tooltip--visible { opacity: 1; }

/* ── Popup card ──────────────────────────────────────────── */
.ncmap-popup {
  position: fixed;
  z-index: 9999;
  width: min(340px, calc(100vw - 28px));
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0,0,0,.17), 0 4px 16px rgba(0,0,0,.09);
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  transform: scale(.94) translateY(6px);
  transition: opacity .2s ease, transform .2s ease;
  font-family: 'Inter', system-ui, sans-serif;
}

.ncmap-popup--visible {
  opacity: 1;
  transform: scale(1) translateY(0);
  pointer-events: auto;
}

/* Image area */
.ncmap-popup-img-wrap {
  position: relative;
  width: 100%;
  height: 140px;
  overflow: hidden;
  background: #c8dece;
}

.ncmap-popup-img-area { width: 100%; height: 100%; }

.ncmap-popup-img-area img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.ncmap-popup-img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: linear-gradient(135deg, #4a7c59, #2e5c3a);
}

.ncmap-popup-img-placeholder span { font-size: 28px; }
.ncmap-popup-img-placeholder small { color: rgba(255,255,255,.7); font-size: .7rem; }


.ncmap-popup-close {
  position: absolute;
  top: 8px; right: 8px;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: rgba(0,0,0,.32);
  border: none;
  cursor: pointer;
  color: #fff;
  font-size: 15px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s;
}
.ncmap-popup-close:hover { background: rgba(0,0,0,.55); }

/* Body */
.ncmap-popup-body { padding: 14px 16px 16px; }

.ncmap-popup-county {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.1rem;
  color: #1a1a1a;
  line-height: 1.2;
  margin-bottom: 1px;
}

.ncmap-popup-farm {
  font-size: .78rem;
  color: #4a7c59;
  font-weight: 600;
  margin-bottom: 8px;
}

.ncmap-popup-divider { border: none; border-top: 1px solid #e8e4df; margin: 8px 0; }

.ncmap-popup-lbl {
  font-size: .62rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #6b7280;
  margin-bottom: 3px;
}

.ncmap-popup-val {
  font-size: .8rem;
  color: #1a1a1a;
  line-height: 1.4;
  margin-bottom: 8px;
}

.ncmap-popup-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 8px;
}

.ncmap-popup-tag {
  background: #e8f0eb;
  color: #4a7c59;
  font-size: .68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid #c5dbc9;
}

.ncmap-popup-fieldday {
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fdf8f0;
  border: 1px solid #e8dcc8;
  border-radius: 8px;
  padding: 7px 10px;
  margin-top: 6px;
}

.ncmap-popup-fd-icon {
  font-size: 16px;
  flex-shrink: 0;
}

.ncmap-popup-fieldday strong {
  display: block;
  font-size: .76rem;
  color: #1a1a1a;
}

.ncmap-popup-fieldday span {
  font-size: .72rem;
  color: #6b7280;
}

/* ==========================================================
   v1.2.0 — Farm navigation bar in popup
========================================================== */
.ncmap-popup-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f4f7f5;
  border: 1px solid #d1e4d8;
  border-radius: 8px;
  padding: 4px 6px;
  margin: 6px 0 8px;
  gap: 6px;
}

.ncmap-popup-nav-label {
  font-size: .72rem;
  font-weight: 600;
  color: #4a7c59;
  white-space: nowrap;
  flex: 1;
  text-align: center;
}

.ncmap-popup-nav-btn {
  width: 26px; height: 26px;
  border-radius: 6px;
  border: 1.5px solid #c5dbc9;
  background: #fff;
  color: #4a7c59;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .12s, border-color .12s;
  flex-shrink: 0;
}
.ncmap-popup-nav-btn:hover:not(:disabled) { background: #e8f0eb; border-color: #4a7c59; }
.ncmap-popup-nav-btn:disabled { opacity: .3; cursor: default; }
