.metro-hero .hero-copy {
  max-width: 760px;
}

.metro-hero {
  background:
    radial-gradient(circle at 86% 10%, rgb(243 236 251 / 90%), transparent 42%),
    linear-gradient(180deg, #ffffff 0%, #f7f3fb 100%);
}

.metro-hero .hero-content {
  padding: 56px 0 44px;
}

.metro-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.metro-kpi {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 90%);
}

.metro-kpi strong {
  display: block;
  color: var(--navy-950);
  font-size: 1rem;
}

.metro-kpi span {
  color: var(--muted);
  font-size: .86rem;
}

.metro-province-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.metro-province-card {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 12px;
  align-items: center;
  color: inherit;
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.metro-province-card:hover,
.metro-province-card:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}

.metro-province-card .meta {
  grid-column: 2;
}

.map-dot {
  width: 18px;
  height: 18px;
  grid-row: 1 / 3;
  border: 5px solid var(--teal-700);
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}

.search-topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-top: 20px;
}

.search-keyword {
  width: min(100%, 720px);
}

.view-switch {
  display: inline-flex;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
}

.view-switch button {
  min-height: 42px;
  padding: 8px 16px;
  border: 0;
  border-radius: 6px;
  color: var(--navy-950);
  background: transparent;
  font-weight: 700;
}

.view-switch button[aria-pressed="true"] {
  color: white;
  background: var(--navy-950);
}

.filter-title {
  justify-content: space-between;
}

.filter-sidebar .field + .field {
  margin-top: 12px;
}

.filter-actions {
  margin-top: 18px;
}

.map-search-layout {
  grid-template-columns: 270px minmax(0, 1fr);
  width: min(calc(100% - 24px), 1540px);
  max-width: none;
}

.map-search-layout .filter-sidebar {
  top: calc(var(--header-height) + 12px);
}

.result-content {
  min-width: 0;
}

.map-results-layout {
  height: 60vh;
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: var(--radius-lg);
  background: white;
  box-shadow: var(--shadow-1);
}

.map-list-rail {
  height: 100%;
  max-height: 60vh;
  overflow: auto;
  border-right: 1px solid var(--line);
  background: white;
}

.map-list-card {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background 150ms ease, box-shadow 150ms ease;
}

.map-list-card:hover,
.map-list-card:focus,
.map-list-card.active {
  position: relative;
  z-index: 2;
  background: var(--teal-100);
  box-shadow: inset 5px 0 0 var(--teal-700);
}

.map-list-card img {
  width: 92px;
  height: 92px;
  object-fit: cover;
  border-radius: var(--radius-sm);
}

.map-list-card h3 {
  margin: 8px 0 4px;
  font-size: 1rem;
}

.map-list-card p {
  margin-bottom: 5px;
}

.interactive-map {
  position: relative;
  min-width: 0;
  height: 100%;
  min-height: 520px;
  overflow: hidden;
  isolation: isolate;
  background-color: #e7eee6;
  background-image:
    linear-gradient(25deg, transparent 46%, rgb(255 255 255 / 75%) 47%, rgb(255 255 255 / 75%) 49%, transparent 50%),
    linear-gradient(115deg, transparent 46%, rgb(255 255 255 / 60%) 47%, rgb(255 255 255 / 60%) 49%, transparent 50%),
    repeating-linear-gradient(0deg, rgb(158 181 164 / 16%) 0 1px, transparent 1px 36px),
    repeating-linear-gradient(90deg, rgb(158 181 164 / 16%) 0 1px, transparent 1px 40px);
  background-size: 170px 170px, 220px 220px, 100% 100%, 100% 100%;
}

.map-river {
  position: absolute;
  z-index: -1;
  top: -10%;
  left: 52%;
  width: 55px;
  height: 125%;
  border: 8px solid rgb(255 255 255 / 70%);
  border-top: 0;
  border-bottom: 0;
  border-radius: 50%;
  background: #a9d5e3;
  transform: rotate(8deg);
}

.map-road {
  position: absolute;
  z-index: -1;
  height: 9px;
  border: 2px solid white;
  background: #d4b976;
  box-shadow: 0 0 0 1px #baa365;
  transform-origin: left center;
}

.road-one {
  top: 43%;
  left: -5%;
  width: 115%;
  transform: rotate(-10deg);
}

.road-two {
  top: 15%;
  left: 34%;
  width: 100%;
  transform: rotate(73deg);
}

.road-three {
  top: 75%;
  left: -6%;
  width: 85%;
  transform: rotate(18deg);
}

.map-region-label {
  position: absolute;
  z-index: 0;
  color: rgb(3 22 54 / 52%);
  font-size: clamp(.72rem, 1.2vw, 1rem);
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  pointer-events: none;
}

.map-hint {
  position: absolute;
  z-index: 7;
  top: 14px;
  left: 14px;
  display: grid;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgb(255 255 255 / 94%);
  box-shadow: var(--shadow-1);
}

.map-hint span {
  color: var(--muted);
  font-size: .78rem;
}

/* Color-coded Pins & Minimum 56x56px Touch Target */
.map-pin {
  position: absolute;
  z-index: 5;
  min-height: 56px;
  min-width: 56px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 3px solid white;
  border-radius: 999px 999px 999px 4px;
  color: white;
  background: var(--navy-900);
  box-shadow: 0 4px 14px rgb(0 0 0 / 30%);
  font-size: 0.95rem;
  font-weight: 700;
  transform: translate(-50%, -100%);
  transition: transform 140ms ease, background 140ms ease, z-index 0s;
}

/* Red Pin: ตลาดนัด (Flea / Night Market) */
.map-pin[data-category="ตลาดนัด"],
.map-pin.pin-market {
  background: #dc2626;
}

/* Warm Amber Pin: งานอีเวนต์ (Event / Pop-up) */
.map-pin[data-category="งานอีเวนต์"],
.map-pin.pin-event {
  background: #d97706;
}

/* Dark Blue Pin: ตึกแถว (Shophouse / Commercial Building) */
.map-pin[data-category="ตึกแถว"],
.map-pin.pin-shophouse {
  background: #1e3a8a;
}

/* Green Pin: พื้นที่เกษตร / พื้นที่ว่าง (Agricultural / Empty Land) */
.map-pin[data-category="พื้นที่เกษตร"],
.map-pin.pin-land {
  background: #16a34a;
}

.map-pin:hover,
.map-pin:focus,
.map-pin.active {
  z-index: 12;
  box-shadow: 0 0 0 4px rgb(217 119 6 / 40%), 0 6px 20px rgb(0 0 0 / 40%);
  transform: translate(-50%, -100%) scale(1.16);
}

.map-halo {
  position: absolute;
  z-index: 2;
  width: 170px;
  height: 170px;
  border: 3px solid rgb(34 104 108 / 62%);
  border-radius: 50%;
  background: rgb(34 104 108 / 12%);
  pointer-events: none;
  transform: translate(-50%, -50%) scale(var(--radius-scale, 1));
  box-shadow: 0 0 0 14px rgb(34 104 108 / 7%);
}

.poi-marker {
  position: absolute;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 6px;
  pointer-events: none;
  transform: translate(-50%, -50%);
  animation: poi-enter 160ms ease-out both;
}

.poi-marker b,
.poi-icon {
  display: inline-grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  border: 2px solid white;
  border-radius: 50%;
  color: white;
  font-size: .72rem;
  box-shadow: 0 2px 7px rgb(3 22 54 / 25%);
}

.poi-marker > span {
  max-width: 170px;
  padding: 4px 7px;
  border-radius: 5px;
  color: var(--navy-950);
  background: rgb(255 255 255 / 94%);
  box-shadow: 0 2px 7px rgb(3 22 54 / 20%);
  font-size: .72rem;
  font-weight: 700;
}

.poi-transit,
.poi-transit b {
  background: #3264b8;
}

.poi-university,
.poi-university b {
  background: #6b3aa8;
}

.poi-mall,
.poi-mall b {
  background: #ad4d00;
}

.poi-hospital,
.poi-hospital b {
  background: #b41f35;
}

@keyframes poi-enter {
  from { opacity: 0; transform: translate(-50%, -50%) scale(.7); }
}

.map-popover {
  position: absolute;
  z-index: 20;
  right: 16px;
  bottom: 74px;
  width: min(320px, calc(100% - 32px));
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgb(255 255 255 / 97%);
  box-shadow: var(--shadow-2);
}

.map-popover h2 {
  margin: 9px 0;
  font-size: 1.15rem;
}

.map-popover-close {
  position: absolute;
  top: 8px;
  right: 8px;
  min-width: 36px;
  min-height: 36px;
  border: 0;
  border-radius: 50%;
  background: var(--soft);
}

.nearby-summary {
  margin: 10px 0;
  color: var(--teal-700);
  font-weight: 700;
}

.map-legend {
  position: absolute;
  z-index: 8;
  right: 12px;
  bottom: 12px;
  left: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgb(255 255 255 / 92%);
  box-shadow: var(--shadow-1);
  font-size: .72rem;
}

.map-legend > span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.map-legend .poi-icon {
  width: 22px;
  height: 22px;
  flex-basis: 22px;
  border-width: 1px;
  font-size: .65rem;
}

.nearby-panel {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--canvas);
}

.nearby-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.nearby-list > span {
  display: flex;
  align-items: center;
  gap: 9px;
}

.nearby-list small {
  display: block;
  color: var(--muted);
}

.blog-hero {
  padding: 76px 0;
  color: white;
  background: linear-gradient(135deg, var(--navy-950), var(--teal-700));
}

.blog-hero h1 {
  color: white;
}

.blog-hero p {
  max-width: 700px;
}

.blog-search {
  max-width: 700px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 24px;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.blog-card {
  overflow: hidden;
}

.blog-card a {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.blog-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.blog-card-body {
  display: grid;
  gap: 11px;
  padding: 18px;
}

.blog-card h3,
.blog-card p {
  margin: 0;
}

.article-header {
  padding: 64px 0 34px;
  background: white;
}

.article-narrow {
  max-width: 840px;
}

.article-header .chip {
  margin-top: 26px;
}

.article-header h1 {
  margin: 14px 0;
  font-size: clamp(2rem, 5vw, 3.4rem);
}

.article-lead {
  color: #3f4753;
  font-size: 1.2rem;
}

.article-hero-image {
  width: 100%;
  max-height: 480px;
  margin: 30px 0;
  border-radius: var(--radius-lg);
  object-fit: cover;
  box-shadow: var(--shadow-1);
}

.article-body {
  padding-bottom: 56px;
  font-size: 1.08rem;
}

.article-body > p:first-child {
  font-size: 1.18rem;
}

.article-body section {
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.related-posts {
  background: white;
}

@media (max-width: 1180px) {
  .map-results-layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .map-list-card {
    grid-template-columns: 1fr;
  }

  .map-list-card img {
    width: 100%;
    height: 120px;
  }
}

@media (max-width: 920px) {
  .metro-kpis {
    grid-template-columns: 1fr;
  }

  .metro-province-grid,
  .blog-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-search-layout {
    grid-template-columns: 1fr;
  }

  .map-results-layout {
    display: block;
  }

  .map-list-rail {
    display: flex;
    max-height: none;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    scroll-snap-type: x mandatory;
  }

  .map-list-card {
    min-width: 260px;
    max-width: 260px;
    scroll-snap-align: start;
  }

  .interactive-map {
    min-height: 600px;
  }
}

@media (max-width: 760px) {
  .search-topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .view-switch {
    align-self: stretch;
  }

  .view-switch button {
    flex: 1;
  }

  .metro-province-grid,
  .blog-grid,
  .nearby-list {
    grid-template-columns: 1fr;
  }

  .map-results-layout {
    min-height: auto;
  }

  .interactive-map {
    min-height: 560px;
  }

  .map-list-card {
    grid-template-columns: 90px 1fr;
  }

  .map-list-card img {
    width: 90px;
    height: 90px;
  }

  .map-popover {
    right: 10px;
    bottom: 76px;
    left: 10px;
    width: auto;
  }

  .map-legend {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  .map-legend > span {
    flex: 0 0 auto;
  }

  .poi-marker > span {
    display: none;
  }

  .blog-search {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 430px) {
  .map-list-card {
    min-width: 86vw;
    max-width: 86vw;
  }

  .interactive-map {
    min-height: 510px;
  }
}

.article-page {
  max-width: 840px;
  margin-inline: auto;
  padding-block: 32px;
}
