/* Josh Map - world map of places Josh has lived, worked, and traveled */
.jw-map {
  font-family: "Rubik", "Helvetica Neue", sans-serif;
  color: #333;
  margin: 32px 0;
}

.jw-map__intro {
  font-size: 17px;
  line-height: 1.65;
  color: #1f2937;
  margin: 0 0 18px;
}

.jw-map__svgwrap {
  position: relative;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  padding: 14px;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.jw-map__svgwrap.is-zoomed { cursor: grab; }
.jw-map__svgwrap.is-dragging { cursor: grabbing; }

.jw-map__svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 620px;
}

.jw-map__svg path {
  fill: #E5E7EB;
  stroke: #ffffff;
  stroke-width: 0.5;
  transition: stroke 0.12s ease, stroke-width 0.12s ease;
  vector-effect: non-scaling-stroke;
}

.jw-map__svg path.jw-lived    { fill: #1C2A35; }
.jw-map__svg path.jw-worked   { fill: #2BAEE0; }
.jw-map__svg path.jw-traveled { fill: #A8DCEF; }

.jw-map__svg path.jw-lived:hover,
.jw-map__svg path.jw-worked:hover,
.jw-map__svg path.jw-traveled:hover,
.jw-map__svg path:hover {
  stroke: #1e40af;
  stroke-width: 2;
  cursor: default;
}

.jw-map__legend {
  display: flex;
  gap: 24px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 14px 0 4px;
  font-size: 14px;
  color: #334155;
}
.jw-map__legend .item { display: flex; align-items: center; gap: 8px; }
.jw-map__legend .sw {
  width: 16px; height: 16px; border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.12);
  display: inline-block;
}

.jw-map__counts {
  text-align: center;
  color: #64748b;
  font-size: 13px;
  margin: 6px 0 10px;
}
.jw-map__total {
  color: #1C2A35;
  font-size: 15px;
  font-weight: 700;
}

.jw-map__zoom {
  position: absolute;
  top: 22px;
  right: 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 4;
}
.jw-map__zoombtn {
  width: 32px;
  height: 32px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  color: #1C2A35;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: background 0.12s ease, border-color 0.12s ease;
}
.jw-map__zoombtn:hover {
  background: #f1f5f9;
  border-color: #2BAEE0;
  color: #2BAEE0;
}
.jw-map__zoombtn:active { background: #e2e8f0; }
.jw-map__zoombtn:focus-visible {
  outline: 2px solid #2BAEE0;
  outline-offset: 2px;
}

.jw-map__tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  font-size: 13px;
  padding: 6px 10px;
  border-radius: 4px;
  transform: translate(-50%, -100%);
  transition: opacity 0.1s ease;
  opacity: 0;
  white-space: nowrap;
  z-index: 5;
}
.jw-map__tooltip.is-visible { opacity: 1; }
.jw-map__tooltip .cat {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.jw-map__tooltip .cat.lived    { background: #1C2A35; }
.jw-map__tooltip .cat.worked   { background: #2BAEE0; color: #0f172a; }
.jw-map__tooltip .cat.traveled { background: #A8DCEF; color: #0f172a; }

.jw-map__caption {
  font-size: 13px;
  color: #64748b;
  font-style: italic;
  margin: 12px 0 0;
  text-align: center;
}

/* Accessible full list for screen readers + fallback if JS/map fails */
.jw-map__details {
  margin: 24px 0 0;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  padding: 14px 18px;
  font-size: 14px;
  line-height: 1.55;
}
.jw-map__details summary {
  cursor: pointer;
  font-weight: 700;
  color: #1C2A35;
  font-size: 15px;
  padding: 4px 0;
}
.jw-map__details summary:hover { color: #2BAEE0; }
.jw-map__details h4 {
  font-size: 14px;
  margin: 14px 0 4px;
  color: #1C2A35;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.jw-map__details ul {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  color: #334155;
}
.jw-map__details li {
  background: #f1f5f9;
  padding: 3px 10px;
  border-radius: 3px;
  font-size: 13px;
}

@media (max-width: 700px) {
  .jw-map__legend { gap: 14px; font-size: 13px; }
  .jw-map__svgwrap { padding: 8px; }
}
