/* ==========================================================================
   Daftar — India map (MapLibre + list + weather + place filters)
   ========================================================================== */

.mapwrap {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: clamp(var(--space-4), 2.5vw, var(--space-6));
  box-shadow: var(--shadow-page);
  overflow: hidden;
}

.mapwrap::before {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: 3px;
  background: linear-gradient(
    to bottom,
    var(--highlight) 0 33%,
    oklch(100% 0 0) 33% 66%,
    oklch(42% 0.1 150) 66% 100%
  );
  opacity: 0.85;
}

.mapwrap__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  padding-inline-start: var(--space-3);
}

.mapwrap__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.btn--find {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.7rem 1.15rem;
  border-radius: var(--radius-pill);
  border: 1.5px solid var(--ink);
  background: var(--ink);
  color: var(--accent-on);
  font-weight: 700;
  font-size: var(--text-sm);
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}

.btn--find:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  background: color-mix(in oklab, var(--ink) 88%, var(--highlight));
}

.btn--find:disabled {
  opacity: 0.6;
  cursor: wait;
  transform: none;
}

.btn--find[aria-busy="true"] .find__spin {
  animation: find-spin 0.8s linear infinite;
}

@keyframes find-spin { to { transform: rotate(360deg); } }

.find-status {
  font-size: var(--text-xs);
  color: var(--text-muted);
  min-height: 1.2em;
}

.place-filters-wrap {
  padding-inline-start: var(--space-3);
  margin-bottom: var(--space-3);
}

.place-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.55rem;
}

.place-filter {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 650;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  cursor: pointer;
}

.place-filter.is-on,
.place-filter:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--accent-on);
}

.place-filter__body {
  max-height: 9.5rem;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 0.65rem;
  background: var(--bg-sunk);
  padding: 0.5rem 0.65rem;
}

.place-filter__note {
  font-size: var(--text-xs);
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.place-filter__search input {
  width: 100%;
  font: inherit;
  padding: 0.45rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 0.45rem;
  background: var(--bg);
  margin-bottom: 0.4rem;
}

.place-filter__list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.25rem;
}

.place-filter__item {
  width: 100%;
  text-align: start;
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 0.35rem 0.25rem;
  cursor: pointer;
  color: var(--text);
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.place-filter__item span {
  color: var(--text-faint);
  font-weight: 500;
  font-size: var(--text-xs);
}

.place-filter__item:hover {
  color: var(--ink);
}

.place-filter__doors {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.place-filter__door {
  font-size: var(--text-sm);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.map-stage {
  display: grid;
  gap: var(--space-4);
  padding-inline-start: var(--space-3);
}

@media (min-width: 48rem) {
  .map-stage {
    grid-template-columns: minmax(0, 1.45fr) minmax(0, 0.7fr);
    align-items: stretch;
  }
}

.map-gl-wrap {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}

.map-gl {
  width: 100%;
  height: min(72vh, 640px);
  min-height: 22rem;
  border-radius: 0.85rem;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-sunk);
}

.map-fallback {
  padding: 1.5rem;
  color: var(--text-muted);
  font-size: var(--text-sm);
}

.maplist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
  gap: var(--space-2);
  max-height: min(72vh, 640px);
  overflow-y: auto;
  padding-inline-end: 2px;
}

.tile {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-tile);
  background: var(--bg);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  text-align: start;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}

.tile:hover {
  border-color: var(--ink);
  transform: translateY(-1px);
}

.tile--ut {
  border-style: dashed;
  color: var(--text-muted);
}

.tile[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--accent-on);
}

.tile[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  inset-inline: 18%;
  bottom: 0;
  height: 2px;
  background: var(--highlight);
}

.tile.is-dim { opacity: 0.28; pointer-events: none; }

.map__legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-4);
  padding-inline-start: var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-faint);
}

.map__legend span { display: inline-flex; align-items: center; gap: var(--space-2); }

.swatch {
  width: 12px; height: 12px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--bg-sunk);
  flex: none;
}
.swatch--ut { background: transparent; border-style: dashed; }
.swatch--on { background: var(--ink); border-color: var(--ink); }
.swatch--pin {
  background: var(--ink);
  border-color: var(--highlight);
  border-radius: 50%;
}

/* Weather strip */
.wx {
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--bg);
  padding: 0.75rem 0.85rem;
  font-size: var(--text-sm);
}

.wx__hint,
.wx__loading,
.wx__err {
  color: var(--text-muted);
  margin: 0;
}

.wx__head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
  margin-bottom: 0.55rem;
}

.wx__title { font-size: 1rem; }
.wx__sub { font-size: var(--text-xs); color: var(--text-muted); }

.wx__bars {
  list-style: none;
  margin: 0 0 0.55rem;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.wx__bars li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.5rem;
  align-items: center;
}

.wx__bars em {
  font-style: normal;
  font-size: var(--text-xs);
  font-weight: 650;
  color: var(--text-muted);
}

.wx__bar {
  height: 0.45rem;
  border-radius: 999px;
  background: var(--bg-sunk);
  position: relative;
  overflow: hidden;
}

.wx__bar::after {
  content: "";
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: var(--p, 0%);
  border-radius: inherit;
  background: var(--ink);
}

.wx__bar--rain::after { background: color-mix(in oklab, #3b6ea5 80%, var(--ink)); }
.wx__bar--clear::after { background: var(--highlight); }
.wx__bar--cloud::after { background: #8a8a8a; }

.wx__advice {
  margin: 0 0 0.35rem;
  font-weight: 650;
  line-height: 1.4;
}

.wx__attr {
  margin: 0;
  font-size: 0.68rem;
  color: var(--text-faint);
}

.map-pop {
  font: inherit;
  font-size: 0.85rem;
  line-height: 1.35;
  color: #111;
}

.map-pop strong { display: block; margin-bottom: 0.25rem; }
.map-pop p { margin: 0 0 0.45rem; color: #444; }
.map-pop__link {
  font-weight: 700;
  color: #1a1a1a;
  text-decoration: underline;
}

/* Hero: give the map more room */
@media (min-width: 64rem) {
  .hero {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr);
  }
}

.map-grid-legacy { display: none; }
