/* ============================================================
   ABI Guide — Interactive Maps (maps.html)
   Reuses global tokens from style.css
============================================================ */

[hidden] { display: none !important; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* --- App shell: sidebar + full map --------- */
.mapp {
  display: flex;
  height: calc(100vh - var(--nav-h));
}
.mapp__side {
  flex: 0 0 280px;
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  background: var(--surface-el);
  border-right: 1px solid var(--border);
  padding: var(--sp-4);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-bright) transparent;
}
.mapp__map-wrap { position: relative; flex: 1; min-width: 0; }
.mapp__map { position: absolute; inset: 0; background: #0a0d12; }

.mapp__loading {
  position: absolute;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.2em;
  color: var(--amber);
  background: oklch(0.07 0.005 252 / 0.72);
  pointer-events: none;
}

/* --- Sidebar groups ------------------------ */
.mapp__group { flex-shrink: 0; }
.mapp__label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: var(--sp-2);
}
.mapp__label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-2);
}
.mapp__label-row .mapp__label { margin-bottom: 0; }
.mapp__mini {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  color: var(--amber);
  padding: 2px 6px;
  border: 1px solid oklch(0.68 0.155 68 / 0.3);
  border-radius: var(--r);
  background: var(--amber-bg);
  transition: background 0.15s, color 0.15s;
}
.mapp__mini:hover { background: var(--amber); color: oklch(0.12 0.014 252); }

/* Search */
.mapp__search { position: relative; }
.mapp__search svg {
  position: absolute;
  left: 0.65rem; top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px;
  color: var(--ink-faint);
  pointer-events: none;
}
.mapp__search input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.88rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: var(--r);
  padding: 0.5rem 0.7rem 0.5rem 2.1rem;
  transition: border-color 0.15s;
}
.mapp__search input::placeholder { color: var(--ink-faint); }
.mapp__search input:focus { outline: none; border-color: var(--amber); }
.mapp__search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  z-index: 1100;
  background: var(--surface-raised);
  border: 1px solid var(--border-bright);
  border-radius: var(--r-md);
  max-height: 260px;
  overflow-y: auto;
  box-shadow: 0 10px 30px oklch(0 0 0 / 0.5);
}
.mapp__search-item {
  display: flex;
  flex-direction: column;
  gap: 1px;
  width: 100%;
  padding: 0.45rem 0.7rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  transition: background 0.12s;
}
.mapp__search-item:last-child { border-bottom: none; }
.mapp__search-item:hover { background: var(--amber-bg); }
.mapp__search-item span {
  font-family: var(--font-hd);
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--amber);
}
.mapp__search-item em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--ink-faint);
}
.mapp__search-empty { padding: 0.5rem 0.7rem; font-size: 0.8rem; color: var(--ink-faint); }

/* Floors */
.mapp__floors { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.mapp__floor {
  min-width: 42px;
  font-family: var(--font-hd);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-muted);
  background: var(--surface);
  border: 1px solid var(--border-bright);
  border-radius: var(--r);
  padding: 0.3rem 0.55rem;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.mapp__floor:hover { color: var(--ink); border-color: var(--amber-dim); }
.mapp__floor.is-active {
  color: oklch(0.12 0.014 252);
  background: var(--amber);
  border-color: var(--amber);
}

/* Category groups */
.mapp__group--cats { flex: 1; min-height: 0; }
.mapp__cats { display: flex; flex-direction: column; gap: var(--sp-2); }
.mapp__catgroup {
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  padding: 0 var(--sp-2) var(--sp-1);
}
.mapp__catgroup summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--font-hd);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--amber);
  padding: 0.45rem 0.2rem;
  user-select: none;
}
.mapp__catgroup summary::-webkit-details-marker { display: none; }
.mapp__catgroup summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 6px;
  font-size: 0.7rem;
  transition: transform 0.15s;
}
.mapp__catgroup[open] summary::before { transform: rotate(90deg); }
.mapp__cat { padding: 0.18rem 0; gap: var(--sp-2); }
.mapp__cat .checkrow__text { font-size: 0.8rem; flex: 1; }
.mapp__cat-ico { width: 16px; height: 16px; object-fit: contain; flex-shrink: 0; }
.mapp__cat-n {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--ink-faint);
}

/* Credit */
.mapp__credit {
  font-size: 0.68rem;
  color: var(--ink-faint);
  line-height: 1.5;
  border-top: 1px solid var(--border);
  padding-top: var(--sp-3);
}
.mapp__credit a { color: var(--amber-dim); }
.mapp__credit a:hover { color: var(--amber); }

/* --- Leaflet skin --------------------------- */
.leaflet-container { font-family: var(--font-body); }
.mapp-pin img {
  width: 28px; height: 28px;
  object-fit: contain;
  filter: drop-shadow(0 1px 2px oklch(0 0 0 / 0.7));
}
.mapp-label span {
  font-family: var(--font-hd);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: oklch(0.92 0.005 85 / 0.9);
  text-shadow: 0 1px 3px oklch(0 0 0 / 0.9), 0 0 8px oklch(0 0 0 / 0.7);
  white-space: nowrap;
  transform: translate(-50%, -50%);
  display: inline-block;
}
.leaflet-popup-content-wrapper {
  background: var(--surface-el);
  color: var(--ink);
  border: 1px solid var(--border-bright);
  border-radius: var(--r-md);
  box-shadow: 0 12px 34px oklch(0 0 0 / 0.55);
}
.leaflet-popup-tip { background: var(--surface-el); border: 1px solid var(--border-bright); }
.leaflet-popup-content { margin: 10px 14px; }
.mapp-pop__title {
  font-family: var(--font-hd);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 4px;
}
.mapp-pop__meta { display: flex; gap: 6px; align-items: center; margin-bottom: 4px; }
.mapp-pop__cat {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--amber);
  background: var(--amber-bg);
  border: 1px solid oklch(0.68 0.155 68 / 0.3);
  border-radius: var(--r);
  padding: 1px 6px;
}
.mapp-pop__lvl {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  color: var(--ink-faint);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 1px 6px;
}
.mapp-pop__info { font-size: 0.8rem; color: var(--ink-muted); line-height: 1.45; margin-top: 4px; }
.leaflet-container a.leaflet-popup-close-button { color: var(--ink-muted); }
.leaflet-bar a {
  background: var(--surface-el);
  color: var(--ink);
  border-bottom: 1px solid var(--border);
}
.leaflet-bar a:hover { background: var(--surface-raised); color: var(--amber); }

/* --- Responsive ----------------------------- */
@media (max-width: 860px) {
  .mapp { flex-direction: column; height: auto; }
  .mapp__side {
    flex: none;
    max-height: 45vh;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }
  .mapp__map-wrap { height: 62vh; }
}
