/*
 * Visit map widget (Leaflet).
 * Pair with public/js/visit-map.js
 */

.visit-map {
  --vm-line: #e5e5e5;
  --vm-ink: #515151;
  --vm-muted: #777;
  --vm-accent: #268bd2;
  --vm-accent-ink: #fff;
  --vm-height: 340px;
  margin: 1.25rem 0 1.75rem;
  border: 1px solid var(--vm-line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.visit-map__layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(11rem, 15rem);
  min-height: var(--vm-height);
}

.visit-map__canvas {
  min-height: var(--vm-height);
  background: #e8eef2;
}

.visit-map__list {
  margin: 0;
  padding: 0.55rem 0;
  list-style: none;
  overflow-y: auto;
  max-height: var(--vm-height);
  border-left: 1px solid var(--vm-line);
  font-family: "PT Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.8rem;
  background: #fafafa;
}

.visit-map__item {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  width: 100%;
  padding: 0.4rem 0.7rem;
  border: 0;
  background: transparent;
  text-align: left;
  color: var(--vm-ink);
  cursor: pointer;
  font: inherit;
  line-height: 1.3;
}

.visit-map__item:hover,
.visit-map__item:focus-visible {
  background: #eef5fb;
  outline: none;
}

.visit-map__item.is-active {
  background: #e3f0fa;
}

.visit-map__num {
  flex: 0 0 auto;
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 999px;
  background: var(--vm-accent);
  color: var(--vm-accent-ink);
  font-size: 0.7rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.05rem;
}

.visit-map__meta {
  min-width: 0;
}

.visit-map__date {
  display: block;
  color: var(--vm-muted);
  font-size: 0.72rem;
}

.visit-map__title {
  display: block;
}

.visit-map__marker {
  width: 1.55rem;
  height: 1.55rem;
  border-radius: 999px;
  background: var(--vm-accent);
  color: var(--vm-accent-ink);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  font: 700 0.72rem/1.55rem "PT Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  text-align: center;
}

.visit-map__marker.is-active {
  background: #0b5f99;
  transform: scale(1.12);
}

.visit-map__marker--stay {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #5a6570;
  border-radius: 6px;
  color: #fff;
  line-height: 0;
}

.visit-map__marker--stay.is-active {
  background: #2f3840;
  transform: scale(1.12);
}

.visit-map__leaflet-popup .leaflet-popup-content-wrapper {
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.visit-map__leaflet-popup .leaflet-popup-content {
  margin: 0.65rem 0.8rem;
  font-family: "PT Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.82rem;
  line-height: 1.35;
  color: var(--vm-ink);
}

.visit-map__popup-title {
  font-weight: 700;
}

.visit-map__popup-date {
  color: var(--vm-muted);
  font-size: 0.72rem;
  margin-top: 0.15rem;
}

.visit-map__read {
  display: inline-block;
  margin-top: 0.45rem;
  color: var(--vm-accent);
  font-weight: 700;
  text-decoration: none;
}

.visit-map__read:hover,
.visit-map__read:focus-visible {
  text-decoration: underline;
  outline: none;
}

.leaflet-container a {
  color: var(--vm-accent);
}

@media (max-width: 640px) {
  .visit-map {
    --vm-height: 260px;
  }

  .visit-map__layout {
    grid-template-columns: 1fr;
  }

  .visit-map__list {
    max-height: 11rem;
    border-left: 0;
    border-top: 1px solid var(--vm-line);
  }
}
