/* Canonical custom UI for every Weekend.London MapLibre surface. */
.map-section #tonight-shows-map,
.map-section #today-shows-map,
.map-section #tomorrow-shows-map,
.map-section #today-museums-map,
.map-section #tonight-museums-map,
.map-section #tomorrow-museums-map,
.map-section #today-free-map,
.map-section #tonight-free-map,
.map-section #tomorrow-free-map,
.map-section #free-events-map,
.map-section #weekend-map,
.map-section #theaters-map,
.map-section #museums-map,
.map-section #attractions-map,
.map-section #pubs-map {
  width: 100%;
  height: 500px;
  min-height: 400px;
  border-radius: 8px;
  overflow: hidden;
}

.map-section #today-free-map,
.map-section #tonight-free-map,
.map-section #tomorrow-free-map,
.map-section #free-events-map {
  background: #dbe4ec;
}

.map-section #tonight-shows-map,
.map-section #today-shows-map,
.map-section #tomorrow-shows-map,
.map-section #today-museums-map,
.map-section #tonight-museums-map,
.map-section #tomorrow-museums-map,
.map-section #today-free-map,
.map-section #tonight-free-map,
.map-section #tomorrow-free-map,
.map-section #free-events-map,
.map-section #museums-map,
.map-section #attractions-map,
.map-section #pubs-map {
  min-height: 300px;
}

.map-section {
  position: relative;
}

.map-container--places .map-section {
  flex: 1;
  min-height: 60vh;
}

.map-container--places .map-section #weekend-map {
  width: 100%;
  height: 66vh;
  min-height: 520px;
  border-radius: 0;
}

.map-tiles-loader {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 3;
}

.map-tiles-loader__card {
  min-width: 140px;
  text-align: center;
  border-radius: 12px;
  padding: 0.55rem 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(6, 20, 44, 0.7);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  color: #fff;
}

.map-tiles-loader__label {
  font-size: 0.73rem;
  opacity: 0.85;
}

.map-tiles-loader__percent {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
}

.map-tiles-loader.is-complete {
  opacity: 0;
  transition: opacity 0.2s ease;
}

.map-section .map-attribution {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.5rem 0 0;
  font-size: 0.75rem;
  color: var(--color-text-muted, #666);
}

.map-section .map-attribution a {
  color: inherit;
  text-decoration: none;
}

.map-section .map-attribution a:hover {
  text-decoration: underline;
}

/* Attribution toggle (CSS-only) */
.map-section .attribution-toggle {
  position: absolute;
  width: 0;
  height: 0;
  opacity: 0;
  pointer-events: none;
}

.map-section #icon.attribution-icon {
  display: inline-block;
  cursor: pointer;
  user-select: none;
}

.map-section #credential-source.attribution-credits {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

.map-section .attribution-toggle:checked ~ #credential-source.attribution-credits {
  display: flex;
}

.map-section .attribution-close {
  cursor: pointer;
  user-select: none;
  margin-left: 0.25rem;
  opacity: 0.7;
}

.map-section .attribution-close:hover {
  opacity: 1;
}

.map-section .attribution-toggle:checked ~ #icon.attribution-icon {
  display: none;
}

.maplibregl-popup.map-popup--event-card {
  z-index: 6;
}

.maplibregl-popup.map-popup--event-card .maplibregl-popup-content {
  position: relative;
  background: transparent;
  border-radius: 10px;
  box-shadow: none;
  padding: 0;
  overflow: visible;
}

.maplibregl-popup.map-popup--event-card .maplibregl-popup-tip {
  border-top-color: rgba(255, 255, 255, 0.95);
  border-bottom-color: rgba(255, 255, 255, 0.95);
}

.maplibregl-popup.map-popup--event-card .map-popup-event-card {
  display: flex;
  flex-direction: column;
  width: min(340px, calc(100vw - 34px));
  min-width: 280px;
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  background: var(--color-light-grey, #f3f4f6);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.3);
}

.maplibregl-popup.map-popup--event-card .map-popup-event-card .event-image-container {
  min-height: 180px;
}

.maplibregl-popup.map-popup--event-card .maplibregl-popup-close-button {
  z-index: 30;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  line-height: 36px;
  border-radius: 999px;
  background: black;
  color: #fff;
  font-size: 20px;
}

.maplibregl-popup.map-popup--event-card .badge-category,
.map-mobile-popup-shell .map-popup-event-card .badge-category {
  top: 10px;
  right: auto;
  left: 10px;
}

.maplibregl-popup.map-popup--event-card .maplibregl-popup-close-button:hover {
  background: rgba(0, 0, 0, 0.76);
}

.map-popup-fallback-image {
  width: 100%;
  height: 100%;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 52px;
  background: linear-gradient(165deg, #1f74c2 0%, #0f2f4b 100%);
}

.map-popup-event-card .video-card {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #0b1b2e;
}

.map-popup-event-card .video-card__poster,
.map-popup-event-card .video-card__video {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.25s ease;
}

.map-popup-event-card .video-card__poster {
  z-index: 1;
  opacity: 1;
}

.map-popup-event-card .video-card__video {
  opacity: 0;
}

.map-popup-event-card .video-card.is-playing .video-card__poster {
  opacity: 0;
}

.map-popup-event-card .video-card.is-playing .video-card__video {
  opacity: 1;
}

.map-popup-event-card .video-card__playhint {
  position: absolute;
  inset: 0;
  display: none;
  width: 58px;
  height: 44px;
  margin: auto;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  z-index: 3;
}

.map-popup-event-card .video-card__playhint::before {
  position: absolute;
  inset: 0;
  width: 0;
  height: 0;
  margin: auto;
  content: "";
  border-top: 9px solid transparent;
  border-bottom: 9px solid transparent;
  border-left: 14px solid #0b1b2e;
}

.map-popup-event-card .badge-category[data-category="musical"],
.map-popup-event-card .badge-category[data-category="musicals"] {
  background: #b91c1c;
}

.map-popup-event-card .badge-category[data-category="play"],
.map-popup-event-card .badge-category[data-category="plays"] {
  background: #2563eb;
}

.map-popup-link {
  color: #0b5cad;
  font-weight: 700;
  text-decoration: none;
}

.map-popup-link:hover {
  text-decoration: underline;
}

.venue-map-container {
  width: 100%;
  min-width: 0;
  margin-top: 24px;
}

.event-venue-grid--map-only .venue-map-container {
  margin-top: 0;
}

.venue-map {
  position: relative;
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 400px;
  min-height: 300px;
  overflow: hidden;
  border: 1px solid var(--border-color, #e0e0e0);
  border-radius: 8px;
  background-color: #e7edf3;
}

.venue-map .maplibregl-canvas-container,
.venue-map .maplibregl-control-container {
  opacity: 1;
  transition: opacity 180ms ease;
}

.venue-map.is-loading .maplibregl-canvas-container,
.venue-map.is-loading .maplibregl-control-container {
  opacity: 0;
}

.venue-map.is-loading::before {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  pointer-events: none;
  opacity: 0.5;
  background:
    linear-gradient(90deg, rgba(67, 88, 106, 0.045) 1px, transparent 1px),
    linear-gradient(0deg, rgba(67, 88, 106, 0.045) 1px, transparent 1px);
  background-size: 64px 64px;
}

.venue-marker,
.station-marker,
.nearby-place-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.venue-marker img {
  display: block;
  width: 25px;
  height: 41px;
}

.station-marker-inner {
  width: 20px;
  height: 20px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #1a5490;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.nearby-place-marker-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  font-size: 18px;
  line-height: 1;
}

.map-mobile-popup-overlay {
  position: absolute;
  inset: 0;
  z-index: 8;
  pointer-events: auto;
}

.map-mobile-popup-shell {
  position: relative;
  width: 100%;
  height: 100%;
}

.map-mobile-popup-shell .map-popup-event-card {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
}

.map-visit-hint {
  position: absolute;
  left: 10px;
  bottom: 10px;
  border: none;
}

@media (max-width: 768px) {
  body.map-view-open {
    overflow: hidden;
  }

  .map-section.is-map-active {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100svh;
    z-index: 1000;
    background: #0b1b2e;
  }

  .map-section.is-map-active #tonight-shows-map,
  .map-section.is-map-active #today-shows-map,
  .map-section.is-map-active #tomorrow-shows-map,
  .map-section.is-map-active #today-museums-map,
  .map-section.is-map-active #tonight-museums-map,
  .map-section.is-map-active #tomorrow-museums-map,
  .map-section.is-map-active #today-free-map,
  .map-section.is-map-active #tonight-free-map,
  .map-section.is-map-active #tomorrow-free-map,
  .map-section.is-map-active #free-events-map,
  .map-section.is-map-active #weekend-map,
  .map-section.is-map-active #theaters-map,
  .map-section.is-map-active #museums-map,
  .map-section.is-map-active #attractions-map,
  .map-section.is-map-active #pubs-map {
    width: 100vw;
    height: 100svh;
    min-height: 100svh;
    border-radius: 0;
  }

  .map-mobile-close-map {
    position: fixed;
    top: 12px;
    left: 12px;
    z-index: 1100;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.95);
    color: #111;
    font-size: 24px;
    line-height: 40px;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    cursor: pointer;
  }

  .map-mobile-popup-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0 12px 12px;
    pointer-events: none;
  }

  .map-mobile-popup-shell {
    width: 100%;
    max-width: 640px;
    height: auto;
    max-height: 400px;
    pointer-events: auto;
  }

  .map-mobile-popup-shell .map-popup-event-card {
    width: 100%;
    height: auto;
    max-height: 400px;
    border-radius: 16px;
    overflow: hidden;
  }

  .map-mobile-popup-shell .map-popup-event-card .event-image-container {
    height: clamp(160px, 38vw, 220px);
  }

  .map-mobile-popup-shell .map-popup-event-card .event-body {
    padding: 12px 12px 14px;
  }

  .maplibregl-popup.map-popup--event-card .map-popup-event-card {
    width: min(340px, calc(100vw - 42px));
    min-width: 0;
  }

  .maplibregl-popup.map-popup--event-card .maplibregl-popup-close-button {
    top: 8px;
    right: 8px;
    width: 44px;
    height: 44px;
    line-height: 42px;
  }

  .map-container--places .map-section #weekend-map {
    width: 100%;
    height: 62vh;
    min-height: 420px;
  }
}
