/* A shared place map (views/place_map.erb): the places listed on the left,
   the map on the right; stacked, map first, on phones. */

.shared-map {
  display: grid;
  grid-template-columns: minmax(300px, 380px) 1fr;
  height: 100vh;
  height: 100dvh;
  margin: 0;
  background: var(--parchment);
  color: var(--ink);
}

.shared-map__panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-right: 1px solid var(--border);
  background: var(--surface-warm);
}

.shared-map__head {
  display: flex;
  gap: var(--space-4);
  align-items: center;
  padding: 1rem 1rem 0.6rem;
}
.shared-map__head h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: var(--text-lg);
  line-height: 1.25;
}
.shared-map__logo img { display: block; }
.shared-map__meta {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: var(--text-sm);
}

.shared-map__cta {
  padding: 0 1rem 0.9rem;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
  color: var(--muted-strong);
}
.shared-map__btn {
  display: flex;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  padding: 0.65rem 1rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.shared-map__btn--gold {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--on-accent);
}
.shared-map__btn--gold:hover { background: var(--gold-dark); border-color: var(--gold-dark); }
.shared-map__btn:disabled { opacity: 0.7; cursor: default; }
.shared-map__cta p { margin: 0.5rem 0 0; }
.shared-map__cta a:not(.shared-map__btn) { color: var(--route); }

.shared-map__list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  margin: 0;
  padding: 0.4rem 0;
  list-style: none;
}
.shared-map__item {
  display: flex;
  gap: var(--space-4);
  padding: 0.6rem 1rem;
  cursor: pointer;
  border-left: 3px solid transparent;
}
.shared-map__item:hover,
.shared-map__item:focus-visible { background: var(--parchment-dark); outline: none; }
.shared-map__item.is-active {
  background: var(--parchment-dark);
  border-left-color: var(--gold);
}
.shared-map__item h2 {
  margin: 0;
  font-size: var(--text-md);
  line-height: 1.3;
}
.shared-map__num {
  flex: none;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--on-accent);
  font-size: var(--text-xs);
  font-weight: 700;
}
.shared-map__tags {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: var(--text-xs);
}
.shared-map__notes {
  margin: 0.3rem 0 0;
  font-size: var(--text-sm);
  color: var(--muted-strong);
}
.shared-map__link {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: var(--text-sm);
  color: var(--route);
}

.shared-map__map { min-height: 0; }

.shared-map__pin-anchor { background: none; border: none; }
.shared-map__pin {
  position: absolute;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gold);
  color: var(--on-accent);
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(27, 36, 48, 0.45);
  font: 700 11px/1 system-ui, sans-serif;
  transition: transform 0.15s ease;
}
.is-active > .shared-map__pin {
  transform: translate(-50%, -50%) scale(1.4);
  background: var(--route);
  color: #fff;
}
.shared-map__pin-anchor.is-active { z-index: 1000 !important; }

@media (max-width: 760px) {
  .shared-map {
    grid-template-columns: 1fr;
    grid-template-rows: 45vh 1fr;
    height: auto;
    min-height: 100dvh;
  }
  .shared-map__map { grid-row: 1; height: 45vh; position: sticky; top: 0; z-index: 1; }
  .shared-map__panel { grid-row: 2; border-right: none; }
  .shared-map__list { overflow: visible; }
}
