/* ===== Illustrated city maps (shared by /maps/*) ===== */
:root {
  --ink: #2b2522;
  --paper: #fffdf8;
  --font-round: 'Fredoka', 'Source Sans 3', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

.citymap-section { padding-top: 2.5rem; }

.map-crumbs {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
  font-size: 0.92rem;
  margin-bottom: 1.25rem;
}
.map-crumbs a { color: var(--color-text-mid); border-bottom: 1px solid transparent; transition: var(--transition); }
.map-crumbs a:hover { color: var(--color-accent); border-color: var(--color-accent); }

/* ---------- layout ---------- */
.citymap {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 1.5rem;
  align-items: start;
}

.citymap-stage {
  position: relative;
  height: min(78vh, 720px);
  min-height: 480px;
  border: 1px solid var(--color-border);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
  background: #e9eef0;
  scroll-margin-top: calc(var(--nav-height) + 12px);
}
.citymap-map { position: absolute; inset: 0; font-family: var(--font-body); background: #e9eef0; }

/* Subtle paper grain over everything (pointer-events off). */
.citymap-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 800;
  pointer-events: none;
  opacity: 0.22;
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .3 0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.citymap-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-height: min(78vh, 720px);
  overflow-y: auto;
  padding-right: 0.25rem;
}

.panel-block {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 14px;
  padding: 1rem 1rem 1.1rem;
}
.panel-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.panel-sub { font-size: 0.88rem; color: var(--color-text-mid); line-height: 1.5; margin-bottom: 0.8rem; }

/* ---------- filter chips (over the map) ---------- */
.map-filters {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 900;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  pointer-events: none;
}
.chip {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.65rem 0.3rem 0.3rem;
  font: 500 0.88rem/1 var(--font-round);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--color-border);
  border-radius: 100px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}
.chip:hover { transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); }
.chip:active { transform: translateY(1px); box-shadow: none; }
.chip:not(.on) { opacity: 0.6; background: #efebe4; box-shadow: none; }
.chip:not(.on) .chip-dot { background: #b9b2a8; }
.chip-n {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.12rem 0.38rem;
  border-radius: 100px;
  background: rgba(43, 37, 34, 0.08);
}
.chip-dot {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--c);
  flex: none;
}
.chip-dot svg, .pop-chip svg {
  width: 14px; height: 14px;
  fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round;
}

.map-reset {
  position: absolute;
  left: 12px;
  bottom: 22px;
  z-index: 900;
  font: 500 0.85rem/1 var(--font-round);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--color-border);
  border-radius: 100px;
  padding: 0.45rem 0.8rem;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
  cursor: pointer;
}
.map-reset:hover { background: #fff; }

/* Leaflet zoom control restyle */
.citymap .leaflet-bar { border: 1px solid var(--color-border); border-radius: 12px; overflow: hidden; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1); }
.citymap .leaflet-bar a { color: var(--ink); background: var(--paper); font-family: var(--font-round); width: 34px; height: 34px; line-height: 32px; }
.citymap .leaflet-bar a:first-child { border-bottom: 1px solid var(--color-border); }
.citymap .leaflet-control-attribution { font-size: 10px; background: rgba(255, 253, 248, 0.8); }

/* ---------- pins ---------- */
.pin-wrap { background: none; border: none; }
.pin {
  width: 32px;
  height: 32px;
  border-radius: 50% 50% 50% 5px;
  transform: rotate(-45deg);
  background: var(--c);
  border: 2px solid var(--ink);
  box-shadow: -1px 3px 0 rgba(43, 37, 34, 0.28);
  display: grid;
  place-items: center;
  transition: transform 0.15s ease, opacity 0.2s ease, filter 0.2s ease;
}
.pin-glyph { transform: rotate(45deg); display: grid; place-items: center; }
.pin svg { width: 17px; height: 17px; fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.pin-wrap:hover .pin { transform: rotate(-45deg) scale(1.15); }
.citymap.route-active .pin { opacity: 0.4; filter: grayscale(0.5); }

/* ---------- illustrated landmark icons ---------- */
.art-wrap { background: none; border: none; }
.art {
  position: relative;
  width: 100%;
  height: 100%;
  transform-origin: 50% 94%;
  transition: transform 0.18s ease, opacity 0.2s ease, filter 0.2s ease;
  /* white "sticker" edge so drawings pop off the basemap */
  filter: drop-shadow(0 0 1px #fffdf8) drop-shadow(0 0 1.5px #fffdf8);
}
.art svg { display: block; width: 100%; height: 100%; overflow: visible; }
.art-wrap:hover .art { transform: translateY(-3px) scale(1.08); }
.art-badge {
  position: absolute;
  right: 4%;
  bottom: 2%;
  width: 24%;
  aspect-ratio: 1;
  min-width: 13px;
  border-radius: 50%;
  background: var(--c);
  border: 1.5px solid var(--ink);
  display: grid;
  place-items: center;
}
.art-badge svg { width: 62%; height: 62%; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.citymap.route-active .art { opacity: 0.35; filter: grayscale(0.6); }
.citymap.route-active .on-route .art,
.citymap.route-active .on-route .pin {
  opacity: 1;
  filter: drop-shadow(0 0 1px #fffdf8) drop-shadow(0 0 1.5px #fffdf8);
}

.pin-tip.leaflet-tooltip {
  font: 500 0.85rem/1.2 var(--font-round);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--color-border);
  border-radius: 10px;
  padding: 0.3rem 0.55rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.pin-tip.leaflet-tooltip-top::before { border-top-color: var(--color-border); }

/* ---------- area labels ---------- */
.area-label-wrap { background: none; border: none; }
.area-label {
  position: absolute;
  left: 0; top: 0;
  white-space: nowrap;
  font-family: var(--font-round);
  color: #4a413b;
  text-shadow: 0 0 3px var(--paper), 0 0 3px var(--paper), 0 0 6px var(--paper);
  pointer-events: none;
  user-select: none;
}
.area-label.kind-borough { font-size: 1.05rem; font-weight: 600; letter-spacing: 0.3em; color: #5b4e44; opacity: 0.8; }
.area-label.kind-hood { font-size: 0.82rem; font-weight: 500; letter-spacing: 0.04em; opacity: 0.85; }
.area-label.kind-park { font-size: 0.85rem; font-weight: 600; color: #3f7a43; text-shadow: 0 0 3px #e8f3df, 0 0 6px #e8f3df; }
.area-label.kind-water { font-size: 0.85rem; font-style: italic; font-weight: 400; color: #4f86a6; letter-spacing: 0.12em; text-shadow: 0 0 4px #d6e8f2; }

/* ---------- routes ---------- */
.route-dots { animation: march 1.4s linear infinite; }
.route-boat { animation: march 2.4s linear infinite; }
@keyframes march { to { stroke-dashoffset: -24; } }
@media (prefers-reduced-motion: reduce) { .route-dots, .route-boat { animation: none; } }

.stop-wrap { background: none; border: none; }
.stop {
  display: grid;
  place-items: center;
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--rc);
  color: #fff;
  font: 600 0.92rem/1 var(--font-round);
  border: 2.5px solid var(--paper);
  box-shadow: 0 0 0 2px var(--ink), 2px 3px 0 2px rgba(43, 37, 34, 0.25);
  cursor: pointer;
  transition: transform 0.15s ease;
}
.stop:hover { transform: scale(1.12); }

.route-list { display: flex; flex-direction: column; gap: 0.5rem; }
.route-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  width: 100%;
  text-align: left;
  padding: 0.6rem 0.7rem;
  background: var(--color-bg);
  border: 1.5px solid var(--color-border);
  border-radius: 12px;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}
.route-card:hover { border-color: var(--rc); transform: translateX(2px); }
.route-card.on { border-color: var(--rc); background: #fff; box-shadow: inset 4px 0 0 var(--rc); }
.route-swatch {
  flex: none;
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--rc);
  box-shadow: 1.5px 1.5px 0 rgba(43, 37, 34, 0.25);
}
.route-swatch svg {
  width: 20px; height: 20px;
  fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.route-text { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.route-name { font-family: var(--font-round); font-weight: 500; font-size: 0.98rem; line-height: 1.25; }
.route-meta { font-size: 0.8rem; color: var(--color-text-mid); line-height: 1.3; }

/* itinerary */
.itinerary { box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06); }
.itin-head { display: flex; gap: 0.65rem; align-items: flex-start; }
.itin-title { flex: 1; min-width: 0; }
.itin-head h3 { font-family: var(--font-display); font-size: 1.2rem; line-height: 1.25; }
.itin-meta { font-size: 0.82rem; color: var(--color-text-mid); margin-top: 0.15rem; }
.itin-close {
  flex: none;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: 1.5px solid var(--color-border);
  background: var(--color-bg);
  font-size: 1.2rem; line-height: 1;
  cursor: pointer;
  color: var(--color-text-mid);
}
.itin-close:hover { color: var(--ink); border-color: var(--ink); }
.itin-blurb { font-size: 0.9rem; line-height: 1.55; color: #444; margin: 0.6rem 0 0.8rem; }
.itin-stops { list-style: none; position: relative; }
.itin-stops::before {
  content: '';
  position: absolute;
  left: 13px; top: 14px; bottom: 14px;
  border-left: 3px dotted var(--rc);
}
.itin-stop {
  position: relative;
  display: flex;
  gap: 0.65rem;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 0.35rem 0.25rem 0.35rem 0;
  border-radius: 8px;
  cursor: pointer;
  font-family: inherit;
  color: inherit;
}
.itin-stop:hover .itin-name { color: var(--rc); }
.itin-num {
  flex: none;
  display: grid; place-items: center;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--rc);
  color: #fff;
  font: 600 0.85rem/1 var(--font-round);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1.5px var(--ink);
}
.itin-body { display: flex; flex-direction: column; padding-top: 0.15rem; }
.itin-name { font-weight: 600; font-size: 0.95rem; line-height: 1.3; transition: color 0.15s; }
.itin-tip { font-size: 0.82rem; color: var(--color-text-mid); line-height: 1.4; margin-top: 0.1rem; }

/* place index */
.place-index summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.place-index summary::-webkit-details-marker { display: none; }
.place-index summary::after { content: '+'; font-family: var(--font-round); font-size: 1.3rem; color: var(--color-text-mid); }
.place-index[open] summary::after { content: '–'; }
.pl-group { margin-top: 0.9rem; }
.pl-group h4 { display: flex; align-items: center; gap: 0.45rem; font: 500 0.9rem/1 var(--font-round); margin-bottom: 0.35rem; }
.pl-group ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.pl-group button {
  font: inherit;
  font-size: 0.84rem;
  padding: 0.2rem 0.55rem;
  border-radius: 100px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  cursor: pointer;
  color: inherit;
  transition: border-color 0.15s, color 0.15s;
}
.pl-group button:hover { border-color: var(--c); color: var(--c); }

/* ---------- popups ---------- */
.pop-wrap .leaflet-popup-content-wrapper {
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
  overflow: hidden;
}
.pop-wrap .leaflet-popup-content { margin: 0; font-family: var(--font-body); line-height: 1.5; }
.pop-wrap .leaflet-popup-tip { background: var(--paper); border: 1px solid var(--color-border); box-shadow: none; }
.pop-wrap .leaflet-popup-tip-container { margin-top: -2px; }
.pop-wrap a.leaflet-popup-close-button { top: 8px; right: 8px; color: #fff; font-size: 20px; }
.pop { padding-bottom: 0.9rem; }
.pop-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
  padding: 0.6rem 2.2rem 0.6rem 0.85rem;
  background: var(--c);
  color: #fff;

}
.pop-chip { display: inline-flex; align-items: center; gap: 0.3rem; font: 500 0.8rem/1 var(--font-round); letter-spacing: 0.03em; }
.pop-hood { font-size: 0.78rem; opacity: 0.9; }
.pop-hood::before { content: '· '; }
.pop-photo { width: 100%; height: 150px; object-fit: cover; border-bottom: none; }
.pop-title { font-family: var(--font-display); font-size: 1.15rem; line-height: 1.25; padding: 0.7rem 0.9rem 0; color: var(--ink); }
.pop-note { font-size: 0.9rem; line-height: 1.5; color: #4a4440; padding: 0.35rem 0.9rem 0; margin: 0 !important; }
.pop-links { display: flex; flex-wrap: wrap; gap: 0.4rem; padding: 0.7rem 0.9rem 0; }
.pop-links a {
  font: 500 0.82rem/1 var(--font-round);
  color: var(--ink) !important;
  padding: 0.4rem 0.65rem;
  border: 1px solid var(--color-border);
  border-radius: 100px;
  background: #fff;
  transition: background 0.15s;
}
.pop-links a:hover { background: var(--c); color: #fff !important; }

/* ---------- maps collection page ---------- */
.maps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.75rem;
}
.map-card {
  position: relative;
  display: block;
  border: 1px solid var(--color-border);
  border-radius: 18px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
a.map-card:hover { transform: translateY(-4px); box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1); }
.map-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-bottom: 1px solid var(--color-border); }
.map-card.soon img { filter: grayscale(0.6); opacity: 0.7; }
.map-card-body { padding: 1rem 1.15rem 1.2rem; }
.map-card-body h3 { font-family: var(--font-display); font-size: 1.35rem; margin-bottom: 0.2rem; }
.map-card-body p { font-size: 0.92rem; color: var(--color-text-mid); line-height: 1.5; }
.map-badge {
  position: absolute;
  top: 12px; left: 12px;
  font: 500 0.78rem/1 var(--font-round);
  padding: 0.35rem 0.65rem;
  border-radius: 100px;
  border: 1px solid var(--color-border);
  background: var(--paper);
  color: var(--ink);
}
.map-badge.live { background: #3c8d5a; color: #fff; }

/* ---------- responsive ---------- */
@media (max-width: 899px) {
  .citymap { grid-template-columns: 1fr; }
  .citymap-stage { order: -1; height: 72vh; min-height: 440px; border-radius: 14px; box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06); }
  .citymap-panel { max-height: none; overflow: visible; padding-right: 0; }
  .map-filters { flex-wrap: nowrap; overflow-x: auto; right: 0; padding-right: 12px; pointer-events: auto; scrollbar-width: none; }
  .map-filters::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
}

/* area jump buttons */
.area-list { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.area-btn {
  font: 500 0.88rem/1 var(--font-round);
  padding: 0.5rem 0.85rem;
  border-radius: 100px;
  border: 1px solid var(--color-border);
  background: var(--color-bg);
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.area-btn:hover { border-color: var(--color-accent); background: #fff; }

/* illustrated postcard on the maps collection cards */
.map-card-art {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
  aspect-ratio: 16 / 9;
  padding: 0.8rem 0.8rem 0.5rem;
  background: linear-gradient(#e6f1f4 0 70%, #f6efe0 70%);
  border-bottom: 1px solid var(--color-border);
}
.map-card-art svg { width: 33%; height: auto; max-height: 100%; filter: drop-shadow(0 0 1px #fffdf8); }
.map-card-art svg:nth-child(2) { width: 40%; }
