/* Map page extras */

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(14rem, 18rem);
  gap: 1rem;
  padding: 1rem 1rem 2rem;
  max-width: 90rem;
  margin: 0 auto;
}

.map-stage {
  position: relative;
  background: #d6d0c6;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 12rem;
}

.map-inner {
  position: relative;
  width: 100%;
}

.map-stage img.base {
  width: 100%;
  height: auto;
  display: block;
}

.map-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  z-index: 2;
}

.map-overlay[hidden] {
  display: none !important;
}

.map-hotspot {
  position: absolute;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  cursor: pointer;
  z-index: 5;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.map-hotspot:hover,
.map-hotspot:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
  transform: scale(1.35);
  z-index: 6;
}

.map-hotspot--site { background: #c0392b; }
.map-hotspot--church { background: #8e44ad; }
.map-hotspot--hotel { background: #d4a017; }
.map-hotspot--river { background: #2980b9; }
.map-hotspot--vista {
  background: #3498db;
  border-radius: 2px;
  width: 10px;
  height: 10px;
}
.map-hotspot--gone {
  opacity: 0.55;
  background-image: linear-gradient(
    135deg,
    transparent 40%,
    #111 40%,
    #111 60%,
    transparent 60%
  );
}

.map-stage .placeholder {
  padding: 3rem 1.5rem;
  text-align: center;
  font-family: var(--font-ui);
  color: var(--color-muted);
}

.map-side {
  font-family: var(--font-ui);
  font-size: 0.9rem;
}

.map-side h2 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--color-accent);
  margin: 0 0 0.75rem;
}

.map-legend {
  list-style: none;
  margin: 0 0 1.25rem;
  padding: 0;
}

.map-legend li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.35rem 0;
}

.dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot--site { background: #c0392b; }
.dot--church { background: #8e44ad; }
.dot--hotel { background: #d4a017; }
.dot--river { background: #2980b9; }
.dot--vista { background: #3498db; }

.map-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 28rem;
  overflow: auto;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
}

.map-list button {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
  text-align: left;
  font: inherit;
  padding: 0.45rem 0.65rem;
  border: none;
  border-bottom: 1px solid var(--color-border);
  background: transparent;
  cursor: pointer;
  color: var(--color-text);
}

.map-list button:hover {
  background: var(--color-bg);
}

.map-list .grid-ref {
  color: var(--color-muted);
  font-size: 0.8rem;
}

.map-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.map-toolbar button {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  cursor: pointer;
}

.map-toolbar button[aria-pressed="true"] {
  background: var(--color-bg);
  border-color: #c4b5a0;
}

@media (max-width: 900px) {
  .map-layout {
    grid-template-columns: 1fr;
  }

  .map-list {
    max-height: 16rem;
  }
}
