/* TTT map containers (shows, museums, free) + weekend events map */
.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 #weekend-map,
.map-section #theaters-map,
.map-section #museums-map {
  width: 100%;
  height: 500px;
  min-height: 400px;
  border-radius: 8px;
  overflow: hidden;
}

.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 #museums-map {
  min-height: 300px;
}

.map-section {
  position: relative;
}

.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 {
  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);
  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: 12;
  top: -15px;
  right: -15px;
  width: 30px;
  height: 30px;
  line-height: 28px;
  border-radius: 999px;
  background: black;
  color: #fff;
  font-size: 20px;
}

.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-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 #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 #weekend-map,
  .map-section #theaters-map,
  .map-section #museums-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 {
    display: none;
  }
}
