.map-page { background: var(--paper); }

.map-main { padding-top: 104px; }

.map-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 2rem;
  padding-block: clamp(2rem, 4vw, 3.25rem);
}

.map-heading .section-index { color: var(--red); }

.map-heading h1 {
  margin: 0.55rem 0 0;
  font-family: var(--serif);
  font-size: clamp(3.25rem, 6.5vw, 6.25rem);
  font-weight: 400;
  letter-spacing: -0.055em;
  line-height: 0.95;
}

.map-heading h1 span { color: var(--red); }

.map-heading > p {
  max-width: 19rem;
  margin: 0 0 0.15rem;
  color: rgba(37, 43, 61, 0.7);
  font-size: 1rem;
}

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 29%);
  min-height: 610px;
  border-block: 1px solid var(--ink);
}

.map-stage {
  position: relative;
  min-height: max(610px, 66vh);
  overflow: hidden;
  isolation: isolate;
  background: #475c68;
  cursor: grab;
  touch-action: none;
}

.map-stage.is-dragging { cursor: grabbing; }

.map-stage:focus-visible { outline-offset: -5px; }

.map-world {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100%, calc(66vh * 2.089));
  aspect-ratio: 1813 / 868;
  transform: translate(-50%, -50%) scale(1);
  transform-origin: center;
  transition: transform 450ms cubic-bezier(.22, 1, .36, 1);
  user-select: none;
}

.map-stage.is-dragging .map-world { transition: none; }

.map-world > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
  user-select: none;
}

.map-pin {
  position: absolute;
  z-index: 2;
  top: var(--pin-y);
  left: var(--pin-x);
  display: flex;
  width: 2.75rem;
  height: 2.75rem;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  transform: translate(-50%, -100%) scale(var(--pin-scale, 1));
  transform-origin: center bottom;
  border: 0;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}

.map-pin__icon {
  display: grid;
  width: 2rem;
  height: 2rem;
  flex: none;
  place-items: center;
  border: 2px solid var(--white);
  border-radius: 50% 50% 50% 10%;
  box-shadow: 0 4px 18px rgba(12, 25, 39, 0.35), 0 0 0 3px rgba(37, 43, 61, 0.35);
  background: var(--navy);
  transform: rotate(-45deg);
}

.map-pin__icon::after {
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--white);
  content: '';
}

.map-pin:hover .map-pin__icon,
.map-pin.is-active .map-pin__icon { background: var(--red); }

.map-pin.is-live .map-pin__icon {
  background: #ca232b;
  box-shadow: 0 4px 18px rgba(12, 25, 39, 0.35), 0 0 0 7px rgba(202, 35, 43, 0.3);
  animation: map-pin-bounce 1.2s ease-in-out infinite;
}

.map-zoom-controls { display: none; }

@keyframes map-pin-bounce {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -13px; }
}

.map-sidebar {
  display: flex;
  flex-direction: column;
  padding: 1.7rem clamp(1.2rem, 2.5vw, 2rem);
  border-left: 1px solid var(--ink);
  background: var(--periwinkle-soft);
}

.map-sidebar__heading { padding-bottom: 1rem; }

.map-sidebar__heading .section-index { color: var(--red); }

.map-sidebar h2 {
  margin: 0.65rem 0 0;
  font-family: var(--serif);
  font-size: clamp(2.1rem, 2.75vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.04em;
  line-height: 0.96;
}

.map-event-list { display: grid; gap: 0.75rem; }

.map-event {
  padding: 1rem;
  border: 1px solid rgba(37, 43, 61, 0.24);
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.55);
  transition: background 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.map-event.is-selected {
  border-color: var(--red);
  box-shadow: inset 4px 0 var(--red);
  background: var(--white);
}

.map-event.is-live { border-color: #ca232b; }

.map-event__select {
  display: grid;
  width: 100%;
  gap: 0.18rem;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.map-event__date {
  color: var(--red);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.map-event__select strong {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 2.2vw, 2.25rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

.map-event__select > span:last-child { font-size: 0.87rem; }

.map-event__live {
  width: fit-content;
  margin: 0.25rem 0;
  padding: 0.12rem 0.5rem;
  border-radius: 999px;
  background: #ca232b;
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.map-event__live[hidden] { display: none; }

.map-event__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem 0.65rem;
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--line);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.map-event__bottom a { text-decoration-thickness: 1px; text-underline-offset: 0.2rem; }

.map-live-key {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin: auto 0 0;
  padding-top: 1rem;
  color: rgba(37, 43, 61, 0.7);
  font-size: 0.8rem;
}

.map-live-key__dot {
  width: 0.7rem;
  height: 0.7rem;
  flex: none;
  border-radius: 50%;
  background: #ca232b;
}

@media (max-width: 1000px) {
  .map-layout { grid-template-columns: minmax(0, 1fr) 320px; }
  .map-world { width: max(100%, calc(66vh * 2.089)); }
}

@media (max-width: 720px) {
  .map-main { padding-top: 84px; }
  .map-heading { align-items: start; flex-direction: column; gap: 0.6rem; padding-block: 1.5rem; }
  .map-heading h1 { font-size: clamp(3.1rem, 13vw, 5rem); }
  .map-heading > p { max-width: 30rem; }
  .map-layout { display: block; }
  .map-stage { height: auto; min-height: 0; aspect-ratio: 1813 / 868; cursor: default; touch-action: pan-y; }
  .map-stage.is-zoomed { cursor: grab; touch-action: none; }
  .map-world { width: 100%; }
  .map-pin__icon { width: 1.8rem; height: 1.8rem; }
  .map-zoom-controls { position: absolute; z-index: 5; top: 0.5rem; right: 0.5rem; display: grid; gap: 0.25rem; }
  .map-zoom-controls button { width: 2.5rem; height: 2.5rem; padding: 0; border: 1px solid rgba(37, 43, 61, 0.35); border-radius: 0.4rem; background: rgba(248, 246, 241, 0.94); color: var(--ink); font: 1.5rem/1 var(--sans); cursor: pointer; }
  .map-zoom-controls button:disabled { opacity: 0.45; cursor: default; }
  .map-sidebar { border-top: 1px solid var(--ink); border-left: 0; }
  .map-event-list { grid-template-columns: 1fr; }
  .map-live-key { margin-top: 1rem; }
}

@media (prefers-reduced-motion: reduce) {
  .map-world { transition: none; }
  .map-pin.is-live .map-pin__icon { animation: none; }
}
