.map-page {
  background:
    radial-gradient(circle at 12% 4%, rgba(176, 131, 46, 0.16), transparent 25rem),
    radial-gradient(circle at 88% 18%, rgba(13, 27, 42, 0.08), transparent 28rem),
    linear-gradient(180deg, #fbf8f0 0%, #fffdfa 42%, #f1ede4 100%);
  color: var(--navy);
}

.map-page .site-header {
  background: rgba(249, 247, 241, 0.92);
}

.map-page .main-nav a[aria-current="page"] {
  color: var(--gold);
}

.map-page .main-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.map-hero {
  position: relative;
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 0;
  padding: 104px 0 28px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 42px;
  align-items: center;
}

.map-hero h1 {
  max-width: 880px;
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2.8rem, 4.9vw, 5.1rem);
  line-height: 0.95;
  letter-spacing: 0;
  color: #0d1321;
}

.map-hero p {
  max-width: 680px;
  margin: 20px 0 0;
  color: #505d67;
  font-size: 1.08rem;
  line-height: 1.72;
}

.map-hero-panel {
  border: 1px solid rgba(214, 177, 95, 0.3);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.08), transparent 38%),
    #0d1321;
  box-shadow: 0 24px 70px rgba(13, 27, 42, 0.15);
  padding: 24px;
  display: grid;
  gap: 13px;
  color: #dbe2e8;
}

.map-hero-panel strong {
  color: #e2bd6c;
  font-size: 0.82rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.map-hero-panel span {
  position: relative;
  padding-left: 24px;
  font-size: 0.98rem;
}

.map-hero-panel span::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.66em;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 0 0 5px rgba(224, 187, 104, 0.13);
}

.map-shell {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto 76px;
  min-height: 700px;
  display: grid;
  grid-template-columns: minmax(340px, 382px) minmax(0, 1fr);
  gap: 12px;
  border: 1px solid rgba(214, 177, 95, 0.26);
  border-radius: 32px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.06), transparent 32%),
    #0d1321;
  box-shadow: 0 34px 90px rgba(13, 27, 42, 0.2);
  padding: 12px;
}

.map-sidebar,
.map-canvas-wrap,
.map-advisory {
  border: 1px solid rgba(13, 27, 42, 0.1);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 28px 80px rgba(13, 27, 42, 0.08);
}

.map-sidebar {
  border: 0;
  border-radius: 24px;
  padding: 18px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 16px;
  max-height: 700px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(250, 248, 243, 0.96)),
    #fff;
  box-shadow: none;
}

.map-toolbar {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.map-toolbar label:first-child,
.map-reset {
  grid-column: 1 / -1;
}

.map-toolbar label {
  display: grid;
  gap: 7px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #836225;
}

.map-toolbar input,
.map-toolbar select {
  min-width: 0;
  border: 1px solid rgba(13, 27, 42, 0.12);
  border-radius: 12px;
  background: #fff;
  color: #182433;
  padding: 12px 13px;
  font: 600 0.95rem/1.2 "DM Sans", Arial, sans-serif;
  outline: none;
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.map-toolbar input:focus,
.map-toolbar select:focus {
  border-color: rgba(176, 131, 46, 0.65);
  box-shadow: 0 0 0 4px rgba(176, 131, 46, 0.12);
}

.map-reset {
  justify-content: center;
  min-height: 44px;
  border-color: rgba(13, 27, 42, 0.16);
  background: #101827;
  color: #fff;
}

.map-summary {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(176, 131, 46, 0.18);
  border-radius: 16px;
  background: rgba(176, 131, 46, 0.08);
  padding: 14px;
}

.map-summary strong {
  font-size: 1.12rem;
  color: #101827;
}

.map-summary span {
  color: #65717d;
  font-size: 0.88rem;
  line-height: 1.55;
}

.map-project-list {
  display: grid;
  gap: 10px;
  overflow: auto;
  padding: 2px 4px 2px 0;
  scrollbar-color: rgba(176, 131, 46, 0.6) rgba(13, 27, 42, 0.08);
}

.map-project-card {
  width: 100%;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 13px;
  text-align: left;
  border: 1px solid rgba(13, 27, 42, 0.08);
  border-left: 3px solid transparent;
  border-radius: 16px;
  background: #fff;
  padding: 9px;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.map-project-card:hover,
.map-project-card.is-active {
  transform: translateY(-2px);
  border-color: rgba(176, 131, 46, 0.55);
  border-left-color: #b0832e;
  box-shadow: 0 18px 32px rgba(13, 27, 42, 0.1);
  background: linear-gradient(180deg, #fff, #fffaf1);
}

.map-project-card img {
  width: 84px;
  height: 88px;
  border-radius: 11px;
  object-fit: cover;
}

.map-project-card h3 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.04rem;
  line-height: 1.12;
  color: #0e1724;
}

.map-project-card p {
  margin: 7px 0 0;
  color: #65717d;
  font-size: 0.82rem;
  line-height: 1.42;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.map-card-meta,
.map-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}

.map-card-meta span,
.map-card-tags span {
  border-radius: 999px;
  background: rgba(176, 131, 46, 0.1);
  color: #7a5a1d;
  padding: 4px 7px;
  font-size: 0.68rem;
  font-weight: 800;
}

.map-card-tags span {
  background: rgba(13, 27, 42, 0.06);
  color: #43505d;
}

.map-canvas-wrap {
  position: relative;
  min-height: 700px;
  border: 0;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: none;
}

.project-map {
  min-height: 700px;
  width: 100%;
  background: #e7e3d9;
}

.leaflet-container {
  font-family: "DM Sans", Arial, sans-serif;
}

.leaflet-tile-pane {
  filter: saturate(0.86) contrast(0.98);
}

.leaflet-control-zoom {
  border: 0 !important;
  box-shadow: 0 14px 36px rgba(13, 27, 42, 0.22);
}

.leaflet-control-zoom a {
  border: 0 !important;
  color: #0d1321 !important;
  font: 900 1.2rem/1 "DM Sans", Arial, sans-serif !important;
}

.map-empty {
  position: absolute;
  inset: auto 24px 24px;
  border-radius: 16px;
  background: rgba(13, 27, 42, 0.88);
  color: #fff;
  padding: 16px 18px;
  font-weight: 700;
  box-shadow: 0 16px 44px rgba(13, 27, 42, 0.22);
}

.project-marker {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50% 50% 50% 10px;
  background: linear-gradient(135deg, #d9b15f, #9d6e1d);
  border: 3px solid #fff;
  transform: rotate(-45deg);
  box-shadow: 0 15px 30px rgba(13, 27, 42, 0.32);
}

.project-marker span {
  transform: rotate(45deg);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 900;
}

.project-marker.is-premium {
  background: linear-gradient(135deg, #f2d486, #b47d23);
}

.project-marker.is-township {
  background: linear-gradient(135deg, #1c3348, #09121e);
}

.leaflet-popup-content-wrapper {
  border-radius: 18px;
  box-shadow: 0 18px 50px rgba(13, 27, 42, 0.2);
}

.leaflet-popup-content {
  width: 280px !important;
  margin: 12px;
  font-family: "DM Sans", Arial, sans-serif;
}

.map-popup img {
  width: 100%;
  height: 132px;
  object-fit: cover;
  border-radius: 14px;
  display: block;
  margin-bottom: 12px;
}

.map-popup h3 {
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  color: #0d1321;
  font-size: 1.25rem;
}

.map-popup p {
  margin: 7px 0;
  color: #53606d;
  line-height: 1.45;
}

.map-popup a {
  display: inline-flex;
  margin-top: 8px;
  color: #8a641e;
  font-weight: 900;
  text-decoration: none;
}

.map-advisory {
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto 86px;
  border-radius: 28px;
  padding: clamp(26px, 5vw, 48px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.map-advisory h2 {
  max-width: 720px;
  margin: 0;
  font-family: "Playfair Display", Georgia, serif;
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 0.98;
  color: #0d1321;
}

.map-advisory p {
  max-width: 720px;
  margin: 18px 0 0;
  color: #5e6a75;
  line-height: 1.75;
}

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

  .map-hero {
    min-height: auto;
    padding-top: 96px;
    gap: 28px;
  }

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

  .map-hero-panel strong {
    grid-column: 1 / -1;
  }

  .map-shell {
    min-height: auto;
    padding: 10px;
  }

  .map-canvas-wrap {
    order: -1;
  }

  .map-sidebar {
    max-height: none;
  }

  .map-project-list {
    max-height: 420px;
  }

  .map-canvas-wrap,
  .project-map {
    min-height: 540px;
  }

  .map-advisory {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 640px) {
  .map-hero,
  .map-shell,
  .map-advisory {
    width: min(100% - 24px, 1180px);
  }

  .map-hero {
    padding-top: 88px;
    padding-bottom: 20px;
    gap: 16px;
  }

  .map-hero h1 {
    font-size: clamp(2.2rem, 11.5vw, 3.15rem);
    line-height: 1;
  }

  .map-hero p {
    margin-top: 14px;
    font-size: 0.96rem;
    line-height: 1.55;
  }

  .map-hero-panel {
    display: none;
  }

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

  .map-sidebar {
    padding: 14px;
    border-radius: 20px;
  }

  .map-canvas-wrap,
  .project-map {
    min-height: 430px;
    border-radius: 20px;
  }

  .project-marker {
    width: 32px;
    height: 32px;
    border-width: 2px;
  }

  .project-marker span {
    font-size: 0.66rem;
  }

  .map-project-card {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .map-project-card img {
    width: 76px;
    height: 84px;
  }

  .leaflet-popup-content {
    width: 236px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .map-project-card,
  .project-marker {
    transition: none;
  }
}
