/* Sister Sister — Map discovery view (Launch A). Mobile-first.
 *
 * All selectors are prefixed (map-/ss-) so they never collide with the
 * sibling-owned discovery.css. Integrator: link this file in base.html.
 * (The _map.html partial also self-links it, so the view works standalone.)
 *
 * Mobile sheet sits above the bottom nav via --ss-bottomnav-h; the integrator
 * may override that custom property to match the real nav height.
 */

:root {
  --ss-bottomnav-h: 60px;
}

.mapwrap {
  display: flex;
  flex-direction: column;
}

.mapview {
  position: relative;
}

.ss-map {
  width: 100%;
  height: 52vh;
  min-height: 300px;
  background: #f2ede4; /* warm cream while tiles load */
  z-index: 0;
}

.ss-map.map-off {
  display: none;
}

.map-fallback-note {
  padding: 12px 16px;
  background: #fff6fc;
  border: 1px solid #f3c6e6;
  border-radius: 10px;
  margin: 12px 16px;
  font-size: 14px;
}

/* --- Restrained circle markers (DESIGN §9.3): pink / near-black, NOT pins --- */
.ss-marker {
  background: transparent;
  border: none;
}

.ss-marker .ss-dot {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: #ff87e2;
  border: 2px solid #1a1a1a;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
}

.ss-marker.is-selected .ss-dot {
  border-width: 3px;
  box-shadow:
    0 0 0 5px rgba(255, 135, 226, 0.35),
    0 1px 6px rgba(0, 0, 0, 0.3);
}

/* --- Marker popup --- */
.ss-popup {
  font-family: inherit;
  min-width: 140px;
}

.ss-popup-title {
  display: block;
  font-weight: 700;
  font-size: 15px;
  color: #111;
  text-decoration: none;
  margin-bottom: 2px;
}

.ss-popup-title:hover {
  text-decoration: underline;
}

.ss-popup-when,
.ss-popup-meta {
  font-size: 13px;
  color: #555;
  line-height: 1.35;
}

/* --- Results list / anchored sheet --- */
.maplist {
  background: #fffdf8;
}

.map-sheet-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 16px;
  background: #fffdf8;
  border: none;
  border-top: 1px solid #e6ded2;
  font-size: 15px;
  font-weight: 700;
  color: #111;
  cursor: pointer;
}

.map-sheet-toggle-label {
  font-size: 14px;
  font-weight: 600;
  color: #b04a9e;
}

.maplist-inner {
  overflow-y: auto;
}

.offmap-notice {
  margin: 12px 16px;
  padding: 10px 12px;
  background: #f7f2e9;
  border: 1px solid #e6ded2;
  border-radius: 10px;
  font-size: 14px;
  color: #444;
}

.offmap-notice a {
  color: #b04a9e;
  font-weight: 600;
}

.map-results {
  list-style: none;
  margin: 0;
  padding: 0 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.map-result {
  border: 1px solid #e9e2d4;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  transition: outline-color 0.15s ease, background 0.15s ease;
}

.map-result.is-selected {
  outline: 2px solid #ff87e2;
  background: #fff6fc;
}

.map-result-card {
  display: flex;
  gap: 12px;
  padding: 10px;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}

.map-result-img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 8px;
  flex-shrink: 0;
}

.map-result-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.map-result-when {
  font-size: 12px;
  font-weight: 600;
  color: #b04a9e;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.map-result-title {
  font-size: 16px;
  font-weight: 700;
  color: #111;
  line-height: 1.25;
}

.map-result-meta,
.map-result-hosts {
  font-size: 13px;
  color: #666;
  line-height: 1.35;
}

.map-empty {
  margin: 24px 16px;
  text-align: center;
  color: #777;
  font-size: 15px;
}

/* --- Mobile: map dominates, list becomes an anchored bottom sheet (DESIGN §9.5).
       Sheet clears the bottom nav + iOS safe area. --- */
@media (max-width: 767px) {
  .mapwrap {
    position: relative;
  }

  .ss-map {
    height: 62vh;
  }

  .maplist {
    position: fixed;
    left: 0;
    right: 0;
    z-index: 500;
    bottom: calc(var(--ss-bottomnav-h) + env(safe-area-inset-bottom, 0px));
    border-radius: 14px 14px 0 0;
    border-top: 1px solid #d9cfbd;
    box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    max-height: 55vh;
    /* Collapsed: only the toggle row (count) is visible. */
    transform: translateY(calc(100% - 47px));
    transition: transform 0.25s ease;
  }

  .mapwrap.sheet-open .maplist {
    transform: translateY(0);
  }

  .maplist-inner {
    max-height: calc(55vh - 47px);
  }
}

/* --- Desktop: ~62% map + ~38% results side by side (DESIGN §9.4) --- */
@media (min-width: 768px) {
  .mapwrap {
    flex-direction: row;
    align-items: stretch;
    min-height: 70vh;
  }

  .mapview {
    flex: 1 1 62%;
  }

  .ss-map {
    height: 70vh;
    min-height: 480px;
  }

  .maplist {
    flex: 0 0 38%;
    max-width: 440px;
    max-height: 70vh;
    overflow-y: auto;
    border-left: 1px solid #e9e2d4;
  }

  .map-sheet-toggle {
    display: none;
  }
}
