/* map module styles — cluster legend + Leaflet popups. */

/* ============================ cluster legend ============================== */
.kh-legend {
  background: rgba(252, 250, 244, .94);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 11px 13px;
  font-size: 12px;
  line-height: 1.4;
}
.kh-legend-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: .01em;
  margin-bottom: 7px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--accent-strong);
}
.kh-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  color: var(--ink-2);
}
.kh-legend-row + .kh-legend-row { margin-top: 4px; }

/* color swatch used in the legend and popup */
.kh-swatch {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(35, 32, 27, .12);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .55);
  flex: 0 0 auto;
}

/* ============================ Leaflet chrome ============================== */
/* zoom control restyled as paper buttons */
.leaflet-control-zoom a {
  background: rgba(252, 250, 244, .94) !important;
  color: var(--accent-strong) !important;
  border-color: var(--line) !important;
  font-weight: 600;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.leaflet-control-zoom a:hover {
  background: var(--accent-wash) !important;
  color: var(--accent) !important;
}
.leaflet-bar {
  border-radius: var(--radius-sm) !important;
  box-shadow: var(--shadow) !important;
  overflow: hidden;
}
.leaflet-container { font-family: var(--font-body); }
.leaflet-container a { color: var(--accent); }
/* keep the legend + attribution off the very edges */
.leaflet-bottom.leaflet-right { margin-bottom: 6px; margin-right: 6px; }
.leaflet-control-attribution {
  background: rgba(252, 250, 244, .82) !important;
  color: var(--muted) !important;
  border-radius: 6px 0 0 0;
  font-size: 10.5px;
}

/* ============================ popups ====================================== */
.kh-popup-wrap .leaflet-popup-content-wrapper {
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  overflow: hidden;            /* clip the full-bleed photo to the rounded corners */
}
/* photo banner at the top of the popup */
.kh-popup-photo {
  margin: -12px -14px 10px;    /* break out to the wrapper edges */
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--bg-2);
}
.kh-popup-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kh-popup-wrap .leaflet-popup-tip {
  background: var(--surface);
  border: 1px solid var(--line);
}
.kh-popup-wrap .leaflet-popup-content {
  margin: 12px 14px;
  color: var(--ink);
  line-height: 1.45;
}
.kh-popup-wrap a.leaflet-popup-close-button {
  color: var(--muted);
  padding: 6px 7px 0 0;
}
.kh-popup-wrap a.leaflet-popup-close-button:hover { color: var(--warm); }
.kh-popup { width: 232px; }
.kh-popup-title { overflow-wrap: anywhere; }
.kh-popup-title {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
}
.kh-popup-kr {
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}
.kh-popup-meta { margin-top: 8px; }
.kh-popup-cluster {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--ink-2);
}
.kh-popup-group {
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
}
.kh-popup-year { color: var(--muted); }
.kh-popup-tally {
  margin-top: 9px;
  padding-top: 7px;
  border-top: 1px solid var(--line-soft);
  font-size: 12px;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}
