@import "shared.css";

body {
  margin: 0;
  font-family: system-ui, sans-serif;
  background: #eff6ff;
  color: #1e293b;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  height: 100svh;          /* use small viewport height — accounts for mobile browser chrome */
}

/* ── Summary bar (below header) ────────────────────────────────── */
.index-summary {
  padding: .45rem 1.25rem;
  background: #eff6ff;
  border-bottom: 1px solid #bfdbfe;
  display: flex;
  align-items: center;
  flex-wrap: wrap;         /* prevent overflow on narrow screens */
  gap: .4rem .6rem;
  font-size: .78rem;
  color: #475569;
  flex-shrink: 0;
}

.index-summary .sep { color: #93c5fd; }

.legend {
  display: flex;
  gap: .75rem;
  margin-left: auto;
  font-size: .75rem;
  color: #475569;
  align-items: center;
}

.legend span { display: flex; align-items: center; gap: .35rem; }

.dot {
  width: 11px; height: 11px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

/* ── Map ─────────────────────────────────────────────────────── */
#map { flex: 1; width: 100%; min-height: 0; }

/* ── Leaflet popup ───────────────────────────────────────────── */
.leaflet-popup-content-wrapper {
  background: #f8fafc;
  color: #0f172a;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.4);
  border: 1px solid #e2e8f0;
}
.leaflet-popup-tip { background: #f8fafc; }
.leaflet-popup-content { margin: .75rem 1rem; font-size: .82rem; }

.popup-name  { font-weight: 700; font-size: .95rem; margin-bottom: .3rem; }
.popup-meta  { color: #475569; margin-bottom: .5rem; line-height: 1.5; }
.popup-dates { color: #64748b; font-size: .75rem; margin-bottom: .6rem; }

/* Button — high-specificity selectors override Leaflet's <a> colour reset */
.popup-link,
.leaflet-popup-content .popup-link,
.leaflet-popup-content a.popup-link {
  display: inline-block;
  padding: .4rem 1rem;
  background: #2563eb;
  color: #ffffff !important;
  border-radius: 6px;
  text-decoration: none !important;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .01em;
  border: none;
  cursor: pointer;
  transition: background .15s;
  min-height: 36px;        /* touch-friendly */
  line-height: 1.8;
}
.popup-link:hover,
.leaflet-popup-content a.popup-link:hover { background: #1d4ed8; }

.leaflet-container { background: #dbeafe; }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  .index-summary { padding: .4rem .9rem; font-size: .74rem; }

  /* On very small screens, push legend to its own row */
  .legend {
    margin-left: 0;
    width: 100%;
    border-top: 1px solid #bfdbfe;
    padding-top: .35rem;
  }

  /* Hide dot separators — the layout makes context clear */
  .index-summary .sep { display: none; }
}
