/* แผนที่พักใจ — calm map page
 *
 * Mobile-first: most visits to a "where can I go and sit" page happen on a
 * phone, often outdoors, so the air banner and the map have to work at
 * 360px before anything else matters.
 */

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
  z-index: 2000;
  background: #fff;
  padding: 10px 14px;
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .2);
}

.cm-header {
  background: linear-gradient(135deg, #0B1E47 0%, #13386e 100%);
  color: #fff;
  padding: 18px 16px;
}
.cm-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.cm-back {
  color: #bcd4ff;
  text-decoration: none;
  font-size: 14px;
  white-space: nowrap;
}
.cm-back:hover { color: #fff; }
.cm-title {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
}
.cm-sub {
  margin: 4px 0 0;
  font-size: 14px;
  opacity: .85;
}

/* The air banner is the first thing read, so it gets real contrast rather
   than being a subtle strip. On a 200+ AQI day this is the answer. */
.cm-air {
  background: #f4f7fb;
  border-bottom: 1px solid #dde5ef;
  padding: 14px 16px;
}
.cm-air-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
.cm-air-badge {
  flex: 0 0 auto;
  min-width: 58px;
  height: 58px;
  border-radius: 14px;
  background: #90a4ae;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 700;
  padding: 0 10px;
}
.cm-air-text { min-width: 0; }
.cm-air-head {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  color: #13223d;
  line-height: 1.35;
}
.cm-air-note {
  margin: 3px 0 0;
  font-size: 13px;
  color: #5a6b85;
  line-height: 1.4;
}

.cm-controls {
  max-width: 1100px;
  margin: 0 auto;
  padding: 14px 16px 8px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.cm-field {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: #33415c;
}
.cm-field select {
  padding: 8px 10px;
  border: 1px solid #c9d4e3;
  border-radius: 8px;
  font: inherit;
  background: #fff;
}
.cm-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.cm-tab {
  padding: 8px 14px;
  border: 1px solid #c9d4e3;
  border-radius: 999px;
  background: #fff;
  color: #33415c;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.cm-tab:hover { border-color: #00A8A8; }
.cm-tab.is-active {
  background: #00A8A8;
  border-color: #00A8A8;
  color: #fff;
  font-weight: 600;
}

.cm-map {
  max-width: 1100px;
  margin: 8px auto 0;
  height: 62vh;
  min-height: 340px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #dde5ef;
}

.cm-status {
  max-width: 1100px;
  margin: 10px auto 0;
  padding: 0 16px;
  font-size: 13px;
  color: #5a6b85;
}

.cm-disclosure {
  max-width: 1100px;
  margin: 22px auto 40px;
  padding: 18px 16px;
  background: #fbfcfe;
  border: 1px solid #e4ebf3;
  border-radius: 12px;
}
.cm-disclosure h2 {
  margin: 0 0 10px;
  font-size: 17px;
  color: #13223d;
}
.cm-disclosure ul {
  margin: 0;
  padding-left: 20px;
  color: #3d4b63;
  font-size: 14px;
  line-height: 1.7;
}
.cm-disclosure li { margin-bottom: 6px; }
.cm-attrib {
  margin: 12px 0 0;
  font-size: 12px;
  color: #6b7a93;
}
.cm-attrib a { color: #00807f; }

/* Popup pills: an unverified place must be visibly different from one a
   person has checked, not distinguished only by wording. */
.cm-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  margin-top: 4px;
}
.cm-pill-ok { background: #e3f5ec; color: #1b6b47; }
.cm-pill-mid { background: #e6eefb; color: #1d4e89; }
.cm-pill-raw { background: #fdf0dc; color: #8a5a12; }

@media (max-width: 640px) {
  .cm-title { font-size: 20px; }
  .cm-map { height: 56vh; }
  .cm-air-badge { min-width: 50px; height: 50px; font-size: 19px; }
  .cm-air-head { font-size: 15px; }
}

/* ──────────────────────────────────────────────────────────────────────────
   KAN-183 · 24 ต.ค. — ผิวแผนที่แบบพาสเทล
   Softening pass. The map had standard OpenStreetMap tiles, the stock blue
   teardrop pins and square popups, which reads as a navigation app. On a page
   someone opens when they feel bad, the surface itself should not feel sharp.
   ────────────────────────────────────────────────────────────────────────── */

/* Soft corners. The brief asked for ~20px; Leaflet's own wrapper and the tip
   both need setting or the radius clips at the top edge. */
.cm-map .leaflet-popup-content-wrapper {
  border-radius: 20px;
  box-shadow: 0 6px 24px rgba(31, 41, 55, 0.13);
  padding: 4px 6px;
}
.cm-map .leaflet-popup-content {
  margin: 12px 16px;
  font-size: 14px;
  line-height: 1.6;
}
.cm-map .leaflet-popup-tip {
  box-shadow: 0 4px 12px rgba(31, 41, 55, 0.08);
}
.cm-map .leaflet-popup-close-button {
  width: 28px;
  height: 28px;
  font-size: 18px;
  padding: 6px 0 0 0;
  color: #8c8178;
}

/* Rounded controls, to match */
.cm-map .leaflet-control-zoom a {
  border-radius: 12px;
  color: #5c6672;
}
.cm-map .leaflet-bar {
  border: 0;
  box-shadow: 0 2px 10px rgba(31, 41, 55, 0.12);
  border-radius: 12px;
}

/* Category pins.
   The effects sit on the inner .cm-pin-i, never on .cm-pin: Leaflet writes an
   inline transform onto .cm-pin to position it, which both defeats a scale()
   here and would make `transition: transform` animate the pin's position after
   every zoom. The drop shadow is what keeps a pale pin readable against a
   near-white basemap; without it the olive and mustard circles sink in. */
.cm-pin { background: none; border: 0; }
.cm-pin-i,
.cm-cluster-i {
  display: block;
  width: 100%;
  height: 100%;
}
.cm-pin-i {
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: drop-shadow(0 2px 4px rgba(31, 41, 55, 0.22));
  transition: transform 180ms ease-out;
}
.cm-pin:hover .cm-pin-i,
.cm-pin:focus .cm-pin-i {
  transform: scale(1.12);
}

/* Cluster bubbles: pastel fill, rounded numerals, no hard border. Three bands
   so a big cluster is visibly bigger without shouting. */
.cm-cluster { background: none; border: 0; }
.cm-cluster-i {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 600;
  line-height: 1;
  color: #4a4036;
  background: rgba(201, 129, 74, 0.22);
  box-shadow: 0 0 0 6px rgba(201, 129, 74, 0.12),
              0 2px 8px rgba(31, 41, 55, 0.12);
  transition: transform 180ms ease-out;
}
.cm-cluster:hover .cm-cluster-i { transform: scale(1.08); }
.cm-cluster-sm .cm-cluster-i { font-size: 13px; }
.cm-cluster-md .cm-cluster-i {
  font-size: 15px;
  background: rgba(194, 163, 63, 0.24);
  box-shadow: 0 0 0 7px rgba(194, 163, 63, 0.13), 0 2px 8px rgba(31, 41, 55, 0.12);
}
.cm-cluster-lg .cm-cluster-i {
  font-size: 17px;
  background: rgba(122, 139, 90, 0.26);
  box-shadow: 0 0 0 8px rgba(122, 139, 90, 0.14), 0 2px 8px rgba(31, 41, 55, 0.12);
}

@media (prefers-reduced-motion: reduce) {
  .cm-pin-i, .cm-cluster-i { transition: none; }
  .cm-pin:hover .cm-pin-i,
  .cm-pin:focus .cm-pin-i,
  .cm-cluster:hover .cm-cluster-i { transform: none; }
}
