/* Scoped for WordPress shortcode embedding: the standalone app used to take over html/body and
   size #map to the viewport; inside a page we instead size everything off the shortcode wrapper. */
.calm-pedestrian-map-wrap {
  box-sizing: border-box;
  position: relative;
  width: 100%;
  height: var(--calm-map-height, 640px);
  margin: 0;
  padding: 0;
  overflow: hidden;
  background: #000000;
}

.calm-pedestrian-map-wrap * {
  box-sizing: border-box;
}

#map {
  width: 100%;
  height: 100%;
  background: #000000;
}

/* CSS-only "fullscreen" toggled by JS instead of the native Fullscreen API - the native API's
   position:fixed top-layer rendering can get clipped to a transformed WordPress theme ancestor
   (a well-known browser quirk), which was cutting off the right edge of the map. */
.calm-pedestrian-map-wrap.calm-pseudo-fullscreen {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 2147483647;
}

body.calm-pedestrian-map-lock-scroll {
  overflow: hidden;
}

.city-identity-panel {
  position: absolute;
  top: 24px;
  left: 24px;
  z-index: 760;
  min-width: 238px;
  padding: 14px 16px 13px;
  border-left: 3px solid #ffffff;
  background: rgba(12, 24, 35, 0.78);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
  color: #ffffff;
  backdrop-filter: blur(7px);
}

.city-identity-kicker {
  color: #b8d8e8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.city-identity-title {
  margin-top: 5px;
  font-family: "Noto Sans", "Helvetica Neue", sans-serif;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.city-identity-region,
.city-identity-status {
  color: rgba(231, 245, 252, 0.78);
  font-size: 10px;
  line-height: 1.4;
}

.city-identity-region {
  margin-top: 3px;
}

.city-identity-status {
  margin-top: 10px;
  color: #d7f4ff;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.north-boundary-datetime-title {
  position: absolute;
  z-index: 620;
  pointer-events: none;
  transform: translateX(-50%);
  white-space: nowrap;
  color: #f4fbff;
  background: rgba(12, 24, 35, 0.68);
  border: 1px solid rgba(209, 235, 255, 0.45);
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(5, 16, 26, 0.35);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1;
  padding: 7px 12px;
  backdrop-filter: blur(2px);
}

.leaflet-container {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.leaflet-tile {
  opacity: 0;
  filter: none;
}

.leaflet-tile-pane,
.municipality-name-label {
  display: none !important;
}

.highway-tile-layer {
  display: none;
}

.city-detail-tile-layer {
  filter: brightness(0.72) saturate(2.2) contrast(1.12);
  opacity: 0.52 !important;
}

.gta-tile-mask-canvas {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 390;
}

.gta-outer-outline-canvas {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 1;
}

.windjs-flow-canvas {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 409;
  display: none;
}

.wind-metaball-canvas {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 408;
  opacity: 0.55;
}

.temperature-overlay-canvas {
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 407;
  display: none;
}

#participant-p5-canvas {
  position: absolute;
  inset: 0;
  z-index: 430;
  pointer-events: none;
}

#participant-p5-canvas canvas {
  display: block;
}

.participant-panel {
  position: absolute;
  top: 26px;
  left: 26px;
  z-index: 800;
  width: min(328px, calc(100% - 36px));
  max-height: calc(100% - 52px);
  overflow-y: auto;
  padding: 16px;
  color: #f7f6f0;
  background: rgba(10, 13, 16, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-left: 3px solid #ffffff;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  font-family: "Helvetica Neue", Helvetica, sans-serif;
}

.panel-kicker,
.participant-panel label,
.telemetry-grid span,
.scope-heading {
  color: rgba(247, 246, 240, 0.56);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.panel-kicker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
}

.panel-kicker-row .panel-kicker {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scope-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-collapse-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 26px;
  height: 26px;
  padding: 0;
  color: #ffffff;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.panel-collapse-toggle:hover {
  border-color: #ffffff;
}

.participant-panel.panel-collapsed {
  width: auto;
  max-width: calc(100% - 36px);
  padding-bottom: 16px;
}

.participant-panel .panel-body {
  margin-top: 15px;
}

.participant-panel.panel-collapsed .panel-body {
  display: none;
}

.env-measurement {
  margin: 2px 0 9px;
  color: #e8e7df;
  font-size: 11px;
  font-weight: 500;
}

.fullscreen-toggle-btn {
  padding: 9px 14px;
  color: #f7f6f0;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  font: inherit;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}

.fullscreen-toggle-btn.standalone {
  position: absolute;
  top: 26px;
  right: 26px;
  z-index: 800;
  background: rgba(10, 13, 16, 0.9);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
}

.fullscreen-toggle-btn:hover {
  border-color: #ffffff;
  color: #ffffff;
}

.env-legend {
  margin-top: 10px;
}

.env-legend-title {
  margin-bottom: 6px;
  color: rgba(247, 246, 240, 0.56);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.env-legend-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  color: #e8e7df;
  font-size: 11px;
}

.env-legend-swatch {
  width: 11px;
  height: 11px;
  flex: none;
  border-radius: 2px;
}

.env-legend-gradient {
  height: 10px;
  border-radius: 2px;
  background: linear-gradient(to right, rgb(64, 120, 220), rgb(80, 190, 210), rgb(240, 210, 90), rgb(230, 90, 60));
}

.env-legend-scale-labels {
  display: flex;
  justify-content: space-between;
  margin-top: 3px;
  color: rgba(247, 246, 240, 0.56);
  font-size: 9px;
}

.env-credit {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  color: rgba(247, 246, 240, 0.56);
  font-size: 9px;
  letter-spacing: 0.04em;
}

.env-credit a {
  color: #ffffff;
}

.participant-panel select {
  width: 100%;
  margin: 7px 0 17px;
  padding: 9px 10px;
  color: #ffffff;
  background: #181d20;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 2px;
  font: inherit;
  font-size: 12px;
}

.telemetry-grid {
  display: grid;
  grid-template-columns: 1fr 1.55fr;
  gap: 8px 12px;
  padding-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
}

.telemetry-grid strong {
  overflow: hidden;
  color: #e8e7df;
  font-size: 11px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.telemetry-grid .accent,
.scope-heading strong {
  color: #ffffff;
}

.scope-heading {
  margin: 13px 0 7px;
}

.scope-heading strong {
  font-size: 11px;
}

.carbon-scope {
  display: block;
  width: 100%;
  height: 38px;
  background: rgba(255, 255, 255, 0.025);
}

.panel-section {
  margin-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
}

.panel-section:first-of-type {
  margin-top: 0;
  border-top: 0;
}

.panel-section > summary {
  cursor: pointer;
  list-style: none;
  padding: 11px 0;
  color: rgba(247, 246, 240, 0.75);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.panel-section > summary::-webkit-details-marker {
  display: none;
}

.panel-section > summary::after {
  content: "+";
  color: #ffffff;
  font-size: 13px;
}

.panel-section[open] > summary::after {
  content: "\2212";
}

.panel-section-body {
  padding-bottom: 12px;
}

.panel-toggle-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 500;
  color: #e8e7df;
  text-transform: none;
  letter-spacing: 0;
  cursor: pointer;
}

.panel-toggle-row input[type="checkbox"] {
  accent-color: #ffffff;
  width: 14px;
  height: 14px;
}

/* The participant view owns the visual hierarchy; legacy floating weather widgets stay dormant in favor of the unified panel. */
.city-identity-panel,
.north-boundary-datetime-title,
.wind-heatmap-control,
.grey-area-control,
.wind-metaball-canvas,
.parks-pane {
  display: none !important;
}

@media (max-width: 560px) {
  .participant-panel {
    top: 12px;
    left: 12px;
    padding: 12px;
  }

  .fullscreen-toggle-btn.standalone {
    top: 12px;
    right: 12px;
    padding: 7px 11px;
    font-size: 10px;
  }
}

.municipality-name-label {
  background: transparent;
  border: 0;
  color: #ffffff !important;
  font-family: "Noto Sans", "Helvetica Neue", sans-serif;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9), 0 0 5px rgba(0, 0, 0, 0.75);
  text-transform: uppercase;
  white-space: nowrap;
}

.municipality-name-label span {
  color: #ffffff !important;
  font-family: "Noto Sans", "Helvetica Neue", sans-serif;
  display: inline-block;
  transform: rotate(calc(-1 * var(--map-rotation-deg, 0deg)));
  transform-origin: center;
}

.wind-heatmap-control {
  position: absolute;
  left: 14px;
  bottom: 42px;
  z-index: 760;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(197, 232, 255, 0.42);
  background: rgba(12, 24, 35, 0.88);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
}

.wind-heatmap-control-title {
  color: #e8f8ff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-right: 2px;
}

.pm25-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  color: rgba(235, 247, 255, 0.84);
  font-size: 10px;
  white-space: nowrap;
}

.pm25-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.pm25-legend-item i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.wind-heatmap-control-btn {
  appearance: none;
  border: 1px solid rgba(169, 226, 255, 0.62);
  background: rgba(13, 120, 185, 0.3);
  color: #f3fbff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 7px;
  padding: 5px 9px;
  cursor: pointer;
}

.wind-heatmap-control-btn:hover {
  background: rgba(24, 152, 226, 0.43);
}

.wind-heatmap-control-btn:disabled {
  cursor: default;
  opacity: 0.45;
}

.grey-area-control {
  position: absolute;
  left: 14px;
  bottom: 88px;
  z-index: 760;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(197, 232, 255, 0.42);
  background: rgba(8, 18, 30, 0.82);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(2px);
}

.grey-area-control-btn {
  appearance: none;
  border: 1px solid rgba(169, 226, 255, 0.62);
  background: rgba(13, 120, 185, 0.3);
  color: #f3fbff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 7px;
  padding: 5px 9px;
  cursor: pointer;
}

.grey-area-control-btn:hover {
  background: rgba(24, 152, 226, 0.43);
}

.wind-station-tooltip {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.wind-station-tooltip .station-tooltip-card {
  background: rgba(12, 68, 55, 0.92);
  border-radius: 6px;
  color: #ffffff;
  display: inline-block;
  font-size: 11px;
  line-height: 1.3;
  padding: 4px 6px;
  transform: rotate(calc(0deg - var(--map-rotation-deg, 0deg)));
  transform-origin: center center;
}

.municipality-wind-tooltip {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

.municipality-wind-tooltip .municipality-tooltip-card {
  background: rgba(20, 95, 143, 0.9);
  border-radius: 6px;
  color: #ffffff;
  display: inline-block;
  font-size: 11px;
  line-height: 1.3;
  padding: 4px 6px;
  transform: rotate(calc(0deg - var(--map-rotation-deg, 0deg)));
  transform-origin: center center;
}

@media (min-width: 769px) {
  .city-identity-panel {
    top: 30px;
    left: 30px;
    min-width: 290px;
    padding: 17px 20px 16px;
    border-left-width: 4px;
    background: rgba(8, 20, 31, 0.84);
  }

  .city-identity-kicker {
    font-size: 11px;
  }

  .city-identity-title {
    font-size: 21px;
  }

  .city-identity-region,
  .city-identity-status {
    font-size: 11px;
  }

  .wind-heatmap-control {
    left: 30px;
    bottom: 28px;
    gap: 10px;
    padding: 10px 13px;
    border-radius: 8px;
  }

  .wind-heatmap-control-title {
    font-size: 12px;
  }

  .pm25-legend {
    gap: 8px;
    font-size: 11px;
  }

  .wind-heatmap-control-btn {
    font-size: 12px;
    padding: 6px 11px;
  }

  .municipality-name-label {
    font-size: 12px;
  }
}

