/* PYAP event map; the containing section is supplied by the main page. */
.pyap-map-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin: 0 0 8px;
}

.pyap-map-tools > span {
  color: #555a5a;
  font: 700 11px/1.2 Consolas, monospace;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.pyap-map-location-actions { display: flex; align-items: center; gap: 7px; min-width: 0; }

.pyap-map-tools .map-near-me-button {
  flex: 0 0 auto;
  width: auto;
  min-height: 44px;
  padding: 6px 11px;
  box-shadow: none;
  font-size: 11px;
}

.pyap-map-tools > span { margin-left: auto; }

.pyap-map-zoom { display: flex; gap: 4px; }
.pyap-map-zoom button {
  width: 44px;
  height: 44px;
  border: 1px solid #161b1d;
  border-radius: 0;
  background: #fffefa;
  color: #161b1d;
  font: 700 25px/1 Arial, sans-serif;
}
.pyap-map-zoom button:hover:not(:disabled) { background: #f1f278; color: #161b1d; }
.pyap-map-zoom button:disabled { opacity: 0.45; cursor: default; }

.pyap-map-shell {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  border: 2px solid #161b1d;
  border-radius: 0;
  background: #f0efe8;
}

.pyap-map-card {
  position: relative;
  border: 2px solid #161b1d;
  border-top: 0;
  padding: 16px;
  background: #fffefa;
  scroll-margin-top: 68px;
}
.pyap-map-card[hidden] { display: none; }
.pyap-map-card .pyap-map-popup { padding-right: 24px; }
.pyap-map-card-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: #555a5a;
  font: 26px/1 Arial, sans-serif;
}
.pyap-map-card-close:hover { color: #161b1d; }

#event-map {
  width: 100%;
  height: min(52vw, 500px);
  min-height: 340px;
  z-index: 0;
  background: #ecebe4;
}

.pyap-map-status,
.pyap-map-credits {
  margin: 8px 0 0;
  color: #555a5a;
  font-size: 0.85rem;
  line-height: 1.45;
}

.pyap-map-credits {
  margin-top: 3px;
  font-size: 0.7rem;
}

.pyap-map-credits a { color: #d94732; }

#event-map .leaflet-control-attribution {
  font-size: 11px;
  background: rgba(255, 255, 255, 0.92);
}

#event-map .leaflet-popup-content-wrapper {
  border-radius: 2px;
  box-shadow: 0 8px 24px rgba(12, 25, 25, 0.2);
}

#event-map .leaflet-popup-content { margin: 14px 16px; }

.pyap-map-pin {
  background: none;
  border: 0;
}

.pyap-map-pin span {
  display: block;
  box-sizing: border-box;
  width: 22px;
  height: 22px;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  background: #d94732;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.32);
  transform: rotate(-45deg);
}

.pyap-map-nearby-marker {
  background: none;
  border: 0;
}

.pyap-map-nearby-home span,
.pyap-map-nearby-current span {
  display: block;
  box-sizing: border-box;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  box-shadow: 0 0 0 3px #fffefa, 0 2px 8px rgba(0, 0, 0, 0.35);
}

.pyap-map-nearby-home span {
  border: 5px solid #2a40a5;
  background: #f1f278;
}

.pyap-map-nearby-current span {
  border: 5px solid #fffefa;
  background: #2a40a5;
  box-shadow: 0 0 0 2px #2a40a5, 0 2px 8px rgba(0, 0, 0, 0.35);
}

.pyap-map-cluster {
  box-sizing: border-box;
  border-radius: 50%;
  border: 3px solid #fff;
  background: #2a40a5;
  color: #fff;
  box-shadow: 0 2px 9px rgba(0, 0, 0, 0.3);
  text-align: center;
  font: 700 14px/32px Arial, sans-serif;
}

.pyap-map-cluster span { display: block; }

.pyap-map-popup {
  display: grid;
  gap: 6px;
  color: #162524;
  font-family: Arial, sans-serif;
  line-height: 1.35;
}

.pyap-map-popup-meta {
  color: #2a40a5;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.pyap-map-popup-title { font-size: 15px; }
.pyap-map-popup-venue { font-size: 12px; }
.pyap-map-popup-note { color: #596563; font-size: 12px; }
.pyap-map-popup-stats { border-top: 1px solid #d8d7cf; padding-top: 8px; margin-top: 3px; }
.pyap-map-popup-stats[hidden] { display: none; }
.pyap-map-popup-attendance { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.pyap-map-popup-gender-ring { position: relative; display: inline-block; width: 22px; height: 22px; flex: none; border-radius: 50%; }
.pyap-map-popup-gender-ring::after { content: ''; position: absolute; inset: 6px; border-radius: 50%; background: #fff; }
.pyap-map-popup-age { display: block; color: #596563; font-size: 11px; margin-top: 3px; }
.pyap-map-popup-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 4px; }
.pyap-map-popup-actions a { color: #d94732; font-size: 13px; font-weight: 700; }
.pyap-map-popup-pick {
  flex: 0 0 100%;
  min-height: 44px;
  padding: 9px 12px;
  border: 1px solid #161b1d;
  border-radius: 0;
  background: #fffefa;
  color: #161b1d;
  font: 700 13px/1.3 Arial, sans-serif;
  text-align: center;
  cursor: pointer;
}
.pyap-map-popup-pick:hover { border-color: #2a40a5; color: #2a40a5; }
.pyap-map-popup-pick.selected,
.pyap-map-popup-pick.selected:hover { border-color: #2a40a5; background: #2a40a5; color: #fff; }
.pyap-map-popup-pick:focus-visible { outline: 3px solid #59afc2; outline-offset: 2px; }

#event-map.pyap-map-fallback {
  box-sizing: border-box;
  overflow-y: auto;
  padding: 28px;
  background: #f0efe8;
  color: #243331;
  font-family: Arial, sans-serif;
}

.pyap-map-fallback > strong { font-size: 1.1rem; }
.pyap-map-fallback > p { margin: 8px 0 14px; }
.pyap-map-fallback-list { display: grid; gap: 9px; padding: 0; margin: 0; list-style: none; }
.pyap-map-fallback-list li { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid #d7d9d2; padding-bottom: 8px; font-size: 0.85rem; }
.pyap-map-fallback-list a { flex: none; color: #005d6d; font-weight: 700; }
.pyap-map-fallback-extra { color: #596563; font-size: 0.8rem; }

@media (max-width: 680px) {
  .pyap-map-tools { gap: 7px; }
  .pyap-map-tools > span { font-size: 10px; }
  .pyap-map-tools .map-near-me-button { width: auto; min-height: 44px; padding: 6px 9px; }
  #event-map { height: 350px; min-height: 320px; }
  #event-map.pyap-map-fallback { padding: 20px; }
  #event-map .leaflet-bar a { width: 44px; height: 44px; line-height: 44px; font-size: 24px; }
  #event-map .leaflet-popup-content { margin: 13px 14px; }
  .pyap-map-popup-title { font-size: 17px; }
  .pyap-map-popup-venue, .pyap-map-popup-note { font-size: 13px; }
  .pyap-map-popup-actions { gap: 7px; }
  .pyap-map-popup-actions a { display: inline-flex; align-items: center; min-height: 44px; padding: 7px 9px; border: 1px solid currentColor; text-decoration: none; }
  .pyap-map-popup-pick { font-size: 14px; }
  .pyap-map-card { scroll-margin-top: 60px; }
}

@media (max-width: 460px) {
  .pyap-map-tools > span { display: none; }
  .pyap-map-tools .map-near-me-button { padding: 6px 7px; font-size: 10px; }
  .pyap-map-zoom { margin-left: auto; }
}
@media (max-width: 360px) {
  .pyap-map-tools { flex-wrap: wrap; }
  .pyap-map-location-actions { width: 100%; }
  .pyap-map-tools .map-near-me-button { flex: 1 1 0; }
}
