﻿.weather-map-page {
  --wm-bg: #f3f0ea;
  --wm-card: rgba(255, 255, 255, 0.82);
  --wm-card-strong: rgba(250, 247, 241, 0.96);
  --wm-stroke: rgba(31, 42, 48, 0.12);
  --wm-stroke-strong: rgba(31, 86, 114, 0.18);
  --wm-text: #1f2a30;
  --wm-muted: #5f6e77;
  --wm-shadow: 0 24px 58px rgba(31, 42, 48, 0.12);
  --wm-blue: #1f69ff;
  --wm-pink: #ec5e9e;
  --wm-gold: #d89a1b;
  --wm-coral: #d86445;
  --wm-red: #b84235;
  --wm-alert: #b43b66;
  --wm-alert-strong: #81284a;
}

.weather-map-page .site-header {
  background: rgba(247, 242, 234, 0.88);
  backdrop-filter: saturate(140%) blur(16px);
}

.weather-map-page .header-row {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(31, 42, 48, 0.08);
}

.weather-map-shell {
  display: grid;
  gap: 18px;
  padding-bottom: 28px;
}

.weather-map-hero,
.weather-map-board {
  border: 1px solid var(--wm-stroke);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.84), rgba(248, 243, 235, 0.88));
  box-shadow: var(--wm-shadow);
}

.weather-map-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 20px;
  padding: 22px;
}

.weather-map-hero__copy h1 {
  margin: 0;
  max-width: 18ch;
  font-family: "Newsreader", serif;
  font-size: clamp(34px, 4.4vw, 54px);
  line-height: 0.95;
  color: var(--wm-text);
}

.weather-map-hero__lead {
  max-width: 70ch;
  margin: 14px 0 0 0;
  color: var(--wm-muted);
  font-size: 15px;
  line-height: 1.62;
}

.weather-map-hero__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.weather-map-hero__badges span,
.map-card__tag {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(31, 86, 114, 0.12);
  background: rgba(31, 86, 114, 0.06);
  color: var(--wm-text);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.weather-map-hero__status {
  display: grid;
  gap: 14px;
  align-content: start;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(18, 39, 56, 0.96), rgba(24, 57, 77, 0.92));
  color: #f7fbff;
}

.hero-status__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.hero-status__label {
  color: rgba(232, 242, 248, 0.78);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

#wmStatusLabel {
  font-size: 18px;
}

#wmStatusMessage {
  margin: 0;
  color: rgba(232, 242, 248, 0.82);
  font-size: 13px;
  line-height: 1.5;
}

.hero-status__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.hero-status__chip {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.hero-status__chip span {
  color: rgba(232, 242, 248, 0.72);
  font-size: 11px;
}

.hero-status__chip strong {
  font-size: 13px;
  line-height: 1.4;
}

.weather-map-board {
  display: grid;
  grid-template-columns: minmax(0, 1.28fr) minmax(320px, 0.72fr);
  gap: 18px;
  padding: 18px;
}

.weather-map-main,
.weather-map-side {
  min-width: 0;
}

.weather-map-main {
  display: grid;
  gap: 12px;
}

.weather-map-toolbar {
  display: grid;
  gap: 12px;
}

.weather-map-toolbar__row {
  display: grid;
  gap: 12px;
}

.weather-map-toolbar__row--top {
  grid-template-columns: minmax(220px, 0.34fr) minmax(0, 1fr);
  align-items: start;
}

.weather-map-stage {
  position: relative;
  min-width: 0;
}

.weather-map-canvas {
  height: clamp(500px, 70vh, 860px);
  min-height: 500px;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--wm-stroke);
  background: linear-gradient(180deg, #d9e8ef, #bed6e0 42%, #8eb0b3 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.weather-map-canvas .leaflet-top,
.weather-map-canvas .leaflet-bottom {
  z-index: 30;
}

.weather-map-canvas .leaflet-control-zoom {
  margin-top: 14px;
  margin-left: 14px;
}

.weather-map-canvas .leaflet-popup-pane {
  z-index: 820;
}

.map-status-card,
.timeline-card,
.layer-dock {
  border: 1px solid rgba(15, 36, 49, 0.12);
  background: rgba(250, 247, 241, 0.92);
  box-shadow: 0 18px 42px rgba(19, 32, 39, 0.14);
  backdrop-filter: blur(12px);
}

.map-status-card {
  display: grid;
  gap: 4px;
  min-width: 170px;
  padding: 12px 14px;
  border-radius: 18px;
  color: var(--wm-text);
}

.map-status-card span {
  color: var(--wm-muted);
  font-size: 12px;
}

.layer-dock {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 8px;
  padding: 10px;
  border-radius: 18px;
}

.layer-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(31, 42, 48, 0.12);
  background: rgba(255, 255, 255, 0.76);
  color: var(--wm-text);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.layer-pill input {
  accent-color: var(--wm-blue);
}

.timeline-card {
  display: grid;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 18px;
}

.timeline-card__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.timeline-card__range {
  display: grid;
  gap: 6px;
  color: var(--wm-text);
  font-size: 12px;
  font-weight: 700;
}

.timeline-card__range input {
  width: 100%;
}

.weather-map-footnote {
  padding: 12px 14px;
  border-radius: 18px;
  border: 1px solid var(--wm-stroke);
  background: rgba(255, 255, 255, 0.72);
  color: var(--wm-muted);
  font-size: 12px;
  line-height: 1.55;
}

.weather-map-side {
  display: grid;
  gap: 12px;
  align-content: start;
}

.map-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 24px;
  border: 1px solid var(--wm-stroke);
  background: var(--wm-card);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.map-card__head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.map-card__head h2 {
  margin: 0;
  font-size: 18px;
  color: var(--wm-text);
}

.legend-list,
.source-list,
.limitations-list {
  display: grid;
  gap: 10px;
}

.legend-item,
.source-item,
.limitations-item {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-radius: 18px;
  border: 1px solid rgba(31, 42, 48, 0.1);
  background: rgba(255, 255, 255, 0.7);
}

.legend-item strong,
.source-item strong {
  font-size: 13px;
  color: var(--wm-text);
}

.legend-item span,
.source-item span,
.limitations-item {
  color: var(--wm-muted);
  font-size: 12px;
  line-height: 1.5;
}

.temperature-scale {
  display: grid;
  gap: 8px;
}

.temperature-scale__row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.temperature-scale__swatch {
  width: 112px;
  height: 14px;
  border-radius: 999px;
  border: 1px solid rgba(31, 42, 48, 0.1);
}

.temperature-scale__label {
  color: var(--wm-muted);
  font-size: 12px;
}

.view-metrics {
  display: grid;
  gap: 12px;
  margin: 0;
}

.view-metrics div {
  display: grid;
  gap: 5px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(31, 42, 48, 0.08);
}

.view-metrics div:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.view-metrics dt {
  color: var(--wm-muted);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.view-metrics dd {
  margin: 0;
  color: var(--wm-text);
  font-size: 13px;
  line-height: 1.45;
}

.weather-map-popup .leaflet-popup-content-wrapper {
  border-radius: 20px;
  box-shadow: 0 22px 52px rgba(19, 32, 39, 0.18);
}

.weather-map-popup .leaflet-popup-tip {
  box-shadow: 0 10px 20px rgba(19, 32, 39, 0.12);
}

.weather-map-popup .leaflet-popup-content {
  margin: 12px 14px;
}

.wm-popup {
  width: min(86vw, 420px);
  max-width: 420px;
  color: var(--wm-text);
}

.wm-popup h3 {
  margin: 0;
  font-size: 18px;
}

.wm-popup__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.wm-popup__badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  background: rgba(31, 42, 48, 0.06);
}

.wm-popup__badge.level-1 {
  background: rgba(216, 154, 27, 0.14);
}

.wm-popup__badge.level-2 {
  background: rgba(216, 100, 69, 0.14);
}

.wm-popup__badge.level-3 {
  background: rgba(184, 66, 53, 0.14);
}

.wm-popup__lead,
.wm-popup__note {
  color: var(--wm-muted);
  font-size: 13px;
  line-height: 1.55;
}

.wm-popup__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.wm-popup__cell {
  padding: 10px;
  border-radius: 14px;
  background: rgba(31, 42, 48, 0.05);
  border: 1px solid rgba(31, 42, 48, 0.08);
}

.wm-popup__cell strong {
  display: block;
  margin-bottom: 4px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--wm-muted);
}

.wm-popup__instructions {
  margin: 10px 0 0 16px;
  padding: 0;
  color: var(--wm-muted);
  font-size: 13px;
  line-height: 1.5;
}

.wm-lightning-marker {
  background: transparent;
  border: 0;
}

.wm-bolt {
  width: 18px;
  height: 18px;
  display: block;
  color: #ffd555;
  filter: drop-shadow(0 0 8px rgba(255, 213, 85, 0.88));
  animation: wmBoltPulse 1.65s infinite ease-in-out;
}

.wm-bolt svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.wm-bolt.level-2 {
  color: #ffb347;
}

.wm-bolt.level-3 {
  color: #ff8257;
}

.wm-lightning-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #fff9b5 0%, #ffd555 52%, #ff9d3b 100%);
  box-shadow: 0 0 0 4px rgba(255, 213, 85, 0.16);
}

@keyframes wmBoltPulse {
  0%, 52%, 100% {
    opacity: 0.16;
    transform: scale(0.88);
  }
  10% {
    opacity: 1;
    transform: scale(1.04);
  }
  20% {
    opacity: 0.28;
    transform: scale(0.92);
  }
  34% {
    opacity: 0.84;
    transform: scale(1.02);
  }
}

@media (prefers-reduced-motion: reduce) {
  .wm-bolt {
    animation: none;
    opacity: 0.82;
  }
}

@media (max-width: 1180px) {
  .weather-map-hero,
  .weather-map-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 920px) {
  .weather-map-toolbar__row--top {
    grid-template-columns: 1fr;
  }

  .layer-dock {
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
  }

  .layer-dock::-webkit-scrollbar {
    display: none;
  }
}

@media (max-width: 860px) {
  .weather-map-canvas {
    height: 62vh;
    min-height: 420px;
  }
}

@media (max-width: 640px) {
  .weather-map-hero,
  .weather-map-board {
    padding: 14px;
    border-radius: 22px;
  }

  .weather-map-hero__copy h1 {
    max-width: none;
    font-size: 34px;
  }

  .hero-status__grid {
    grid-template-columns: 1fr;
  }

  .weather-map-canvas {
    height: min(56dvh, 520px);
    min-height: 360px;
    border-radius: 20px;
  }

  .timeline-card__buttons {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .map-status-card,
  .layer-dock,
  .timeline-card,
  .weather-map-footnote,
  .map-card {
    border-radius: 18px;
  }

  .layer-pill {
    min-height: 42px;
  }

  .wm-popup {
    width: min(84vw, 360px);
  }

  .wm-popup__grid {
    grid-template-columns: 1fr;
  }
}
