/* ------------------------------------------------------------------
   Graphite levitation map.
   Every rule is scoped to .gmap-page / .gmap so nothing here can leak
   into the rest of the blog (and so the blog's own text-width clamps
   and link colours don't leak in here).
   ------------------------------------------------------------------ */

/* The page owns the viewport: navbar on top, app fills the rest. */
.gmap-page {
  height: 100vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.gmap-page .navbar { flex: 0 0 auto; }

.gmap {
  --bg:#f7f8fa; --panel:#fff; --ink:#1a1c1f; --muted:#6b7280;
  --line:#e4e7eb; --accent:#2563eb; --accent-soft:#eff4ff;

  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
}

/* Undo blog-wide constraints that would otherwise apply in here. */
.gmap p { max-width: none; margin: 0; }
.gmap img { max-width: none; }
.gmap h1, .gmap h2 { margin: 0; }

/* ---- app header (title + disclaimer) ---- */
.gmap-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 0 0 auto;
}
.gmap .header-top { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; }
.gmap-head h1 { font-size: 18px; font-weight: 650; }
.gmap .counts { font-size: 12px; color: var(--muted); margin-left: auto; }
.gmap .disclaimer { font-size: 12px; line-height: 1.45; color: var(--muted); }
.gmap .disclaimer a[href] { color: inherit; text-decoration: underline; }
.gmap .toggle {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font-size: 12px; color: var(--muted); margin-top: 8px;
}
.gmap.hide-desc .paper .desc { display: none; }

/* ---- map + sidebar ---- */
.gmap-main { flex: 1; display: flex; min-height: 0; }
.gmap .map-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.gmap #map { flex: 1; min-width: 0; }
.gmap #map .leaflet-container { background: #eef1f4; }

.gmap #tagbar {
  border-top: 1px solid var(--line); background: var(--panel);
  padding: 9px 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center;
  max-height: 34%; overflow-y: auto;
}
.gmap #tagbar .tb-label {
  font-size: 11px; color: var(--muted); font-weight: 700;
  text-transform: uppercase; letter-spacing: .04em; margin-right: 4px;
}
.gmap #tagbar .tag { font-size: 11.5px; padding: 3px 10px; }

.gmap-aside {
  width: 400px; max-width: 42vw; border-left: 1px solid var(--line);
  background: var(--panel); display: flex; flex-direction: column; min-height: 0;
}
.gmap .aside-head { padding: 14px 18px; border-bottom: 1px solid var(--line); }
.gmap .aside-head h2 { font-size: 16px; font-weight: 650; }
.gmap .aside-head h2 a[href] { color: var(--accent); text-decoration: none; }
.gmap .aside-head h2 a[href]:hover { text-decoration: underline; }
.gmap .aside-head p { margin: 5px 0 0; font-size: 12px; color: var(--muted); }
.gmap .aside-head a[href] { color: var(--accent); text-decoration: none; }
.gmap .aside-head a[href]:hover { text-decoration: underline; }
.gmap .list { overflow-y: auto; padding: 8px 10px; flex: 1; }

/* ---- institute rows ---- */
.gmap .loc-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: 10px; cursor: pointer;
}
.gmap .loc-row + .loc-row { border-top: 1px solid var(--line); }
.gmap .loc-row:hover { background: var(--accent-soft); }
.gmap .loc-row .loc-name { font-size: 14px; font-weight: 600; flex: 1; }
.gmap .loc-row .loc-meta { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* ---- paper cards ---- */
.gmap .paper { padding: 9px 12px; }
.gmap .paper + .paper { border-top: 1px solid var(--line); }
.gmap .paper .title { font-size: 13px; font-weight: 600; line-height: 1.35; }
.gmap .paper .title a[href] { color: var(--ink); text-decoration: none; }
.gmap .paper .title a[href]:hover { color: var(--accent); text-decoration: underline; }
.gmap .paper .meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; }
.gmap .paper .authors { font-size: 12px; color: #374151; margin-top: 4px; }
.gmap .paper .desc { font-size: 12.5px; color: #374151; margin-top: 6px; line-height: 1.45; }
.gmap .paper .tags { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 5px; }

.gmap .tag {
  font-size: 10.5px; padding: 2px 8px; border-radius: 20px;
  background: #f1f3f6; color: #4b5563; cursor: pointer;
}
.gmap .tag:hover { background: var(--accent); color: #fff; }
.gmap .tag.active { background: var(--accent); color: #fff; }

.gmap .empty { padding: 30px 18px; color: var(--muted); font-size: 13px; }

/* ---- leaflet tooltips ---- */
.leaflet-tooltip.loc-tip {
  font-size: 12px; line-height: 1.4; padding: 7px 10px; border-radius: 8px;
  border: 1px solid #e4e7eb; box-shadow: 0 4px 14px rgba(0,0,0,.12);
}
.loc-tip b { font-size: 12.5px; }
.loc-tip .t-sub { color: #6b7280; }

@media (max-width: 760px) {
  .gmap-main { flex-direction: column; }
  .gmap-aside {
    width: 100%; max-width: none; height: 48%;
    border-left: none; border-top: 1px solid var(--line);
  }
  .gmap #tagbar { max-height: 120px; }
}
