:root {
  --bg: #f5efe6;
  --bg-card: #faf6ee;
  /* --ink: #2b2420; */
  /* --ink: #00473e; */
  --ink: #ee3540;
  --ink-muted: #6a5f57;
  --ink-faint: #a39a92;
  --accent: #c96a43;
  /* --accent-dark: #a95432; */
  --accent-dark: #7b0000;
  --olive: #6b7a3a;
  --line: #e2d8c8;
  --shadow: 0 1px 2px rgba(30, 20, 10, 0.04), 0 8px 24px rgba(30, 20, 10, 0.06);
  --radius: 14px;
  --serif: 'Noto Sans', system-ui, -apple-system, sans-serif;
  --display: 'Playfair Display', 'Noto Sans', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Header */
.site-header {
  padding: 88px 0 56px;
  border-bottom: 1px solid var(--line);
}
.header-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}
.site-header .eyebrow {
  margin: 0;
  color: var(--ink-muted);
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.38em;
  text-transform: uppercase;
}
.site-header .title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 1.05;
  margin: 28px 0 0;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.site-header .subtitle {
  font-weight: 700;
  color: inherit;
}

/* City belt */
.city-belt {
  width: 100%;
  margin: 40px auto 0;
}
.city-belt-viewport {
  width: 100%;
  overflow: hidden;
  position: relative;
}
.city-belt-track {
  display: flex;
  align-items: center;
  gap: 28px;
  white-space: nowrap;
  transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: transform;
}
.city-belt-track .city-item {
  flex-shrink: 0;
  background: transparent;
  border: 0;
  padding: 6px 4px;
  margin: 0;
  color: var(--ink-muted);
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  opacity: 0.35;
  transition: opacity 0.35s ease, color 0.35s ease, transform 0.35s ease;
}
.city-belt-track .city-item:hover { opacity: 0.65; }
.city-belt-track .city-item.active {
  opacity: 1;
  color: var(--ink);
  transform: scale(1.02);
  font-weight: 700;
}
.city-belt-track .city-sep {
  flex-shrink: 0;
  color: var(--ink-faint);
  font-size: 0.95rem;
  opacity: 0.5;
  user-select: none;
}
@media (prefers-reduced-motion: reduce) {
  .city-belt-track { transition: none; }
}

.site-header .est {
  margin: 32px 0 0;
  color: var(--ink-muted);
  font-family: var(--display);
  font-style: italic;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

@media (max-width: 560px) {
  .site-header { padding: 64px 0 40px; }
  .city-belt { margin-top: 28px; }
  .city-belt-track { gap: 20px; }
  .city-belt-track .city-item { font-size: 0.82rem; letter-spacing: 0.26em; }
}

/* Controls */
.controls {
  position: sticky;
  top: 0;
  z-index: 500;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
}
.controls .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.controls .row:first-child { margin-top: 0; }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s, color .15s;
  font-family: var(--sans);
}
.chip:hover { border-color: var(--ink-muted); }
.chip.active {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.chip .count { color: var(--ink-faint); font-size: 0.75rem; }
.chip.active .count { color: rgba(255,255,255,0.6); }

/* Tag-filter category groups (origin / vibe / specialty / refreshment / other) */
.tags { align-items: flex-start; }
.tag-group {
  display: inline-flex; flex-wrap: wrap; gap: 6px; align-items: center;
  padding-right: 10px;
  border-right: 1px solid var(--line);
}
.tag-group:last-child { border-right: 0; }
.tag-group-label {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--ink-faint); margin-right: 4px;
}
.chip[data-pill=red]    { background: #fde3df; border-color: #f3b8af; color: #7b2a23; }
.chip[data-pill=yellow] { background: #fbeec7; border-color: #e8d293; color: #6f5b1e; }
.chip[data-pill=blue]   { background: #d6e4ee; border-color: #aac4d6; color: #244a66; }
.chip[data-pill=brown]  { background: #ecdfd1; border-color: #cdb89c; color: #5d4530; }
.chip[data-pill=gray]   { background: var(--bg-card); border-color: var(--line); color: var(--ink-muted); }
.chip[data-pill]:hover  { border-color: var(--ink-muted); }
.chip[data-pill].active {
  background: var(--ink); color: var(--bg); border-color: var(--ink);
}
.controls.compact .tag-group { padding-right: 8px; }
.controls.compact .tag-group-label { font-size: 0.65rem; }

.cities .chip { font-family: var(--serif); font-size: 0.95rem; }

.locate { gap: 12px; }
.btn-ghost {
  padding: 8px 14px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.btn-ghost:hover { border-color: var(--ink-muted); }
.btn-ghost.small { padding: 7px 12px; font-size: 0.8rem; }
.address { display: flex; gap: 6px; flex: 1; min-width: 240px; max-width: 420px; }
.address input {
  flex: 1;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-card);
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink);
}
.address input:focus { outline: none; border-color: var(--ink-muted); }
.loc-status { color: var(--ink-muted); font-size: 0.8rem; }

/* Map + filters side-by-side */
.map-and-filters { padding: 24px 0; }
.map-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 1.1fr;
  gap: 24px;
  align-items: start;
}
.controls.compact {
  position: static;
  background: transparent;
  border: 0;
  padding: 0;
}
.controls.compact .row { margin-top: 10px; }
.controls.compact .row:first-child { margin-top: 0; }
.controls.compact .chip { padding: 4px 10px; font-size: 0.8rem; }
.controls.compact .row.search { margin-top: 0; margin-bottom: 4px; }
.controls.compact .row.search input {
  width: 100%;
  padding: 9px 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-card);
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--ink);
}
.controls.compact .row.search input:focus { outline: none; border-color: var(--ink-muted); }

.map-pane { display: flex; flex-direction: column; gap: 10px; }
.map-locate {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.map-locate .address { flex: 1; min-width: 200px; max-width: none; }
.map-locate .loc-status { flex-basis: 100%; }

#map {
  height: clamp(420px, 60vh, 620px);
  min-height: 380px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  overflow: hidden;
}
@media (max-width: 760px) {
  .map-grid { grid-template-columns: 1fr; }
}
.leaflet-container { font-family: var(--sans); }
.marker-dot {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--bg);
  box-shadow: 0 1px 6px rgba(0,0,0,0.25);
}
.marker-dot.coffee { background: #7b5a3c; }
.marker-dot.dessert { background: #d87ea8; }
.marker-dot.japanese { background: #d44a4a; }
.marker-dot.korean { background: #cf7a2a; }
.marker-dot.chinese { background: #a03030; }
.marker-dot.italian { background: #5a7a35; }
.marker-dot.tea { background: #8a9a3a; }
.marker-dot.seafood { background: #3a7a9a; }
.marker-dot.bbq { background: #6a3a20; }
.marker-dot.street { background: #9a7a3a; }
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large {
  background-color: rgba(238, 53, 64, 0.25);
}
.marker-cluster-small div,
.marker-cluster-medium div,
.marker-cluster-large div {
  background-color: rgba(238, 53, 64, 0.65);
  width: 36px; height: 36px;
  margin-left: 2px; margin-top: 2px;
  color: #fff;
}
.marker-cluster {
  width: 40px !important; height: 40px !important;
}
.marker-cluster span {
  line-height: 36px;
  font-size: 15px;
  font-weight: 700;
}
.marker-emoji {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,0.35), 0 0 3px rgba(255,255,255,0.6);
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.3));
  cursor: pointer;
}

.popup-card { width: 200px; }
.popup-card img.pop-photo {
  display: block;
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  transition: opacity .2s ease;
}
.popup-card img.pop-photo:hover { opacity: 0.9; }
.popup-card .pop-title {
  font-family: var(--serif);
  margin: 8px 0 2px;
  font-size: 1rem;
  cursor: pointer;
  color: var(--ink);
}
.popup-card .pop-title:hover { color: var(--accent-dark); text-decoration: underline; }
.popup-card .pop-meta { color: var(--ink-muted); font-size: 0.78rem; }
.popup-card a.pop-link { display: inline-block; margin-top: 6px; color: var(--accent-dark); font-weight: 500; font-size: 0.82rem; text-decoration: none; }

/* Results */
.results { padding: 24px 0 64px; }
.results-bar {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.count { color: var(--ink-muted); font-size: 0.9rem; letter-spacing: 0.02em; }
.sort { color: var(--ink-muted); font-size: 0.85rem; display: inline-flex; align-items: center; gap: 8px; }
.sort select {
  font-family: var(--sans);
  font-size: 0.85rem;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--bg-card);
  color: var(--ink);
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px 24px;
}
@media (max-width: 960px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }

.card {
  display: flex; flex-direction: column;
  background: transparent;
  cursor: pointer;
  transition: transform .2s;
}
.card:hover { transform: translateY(-2px); }
.card .photo {
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #ddd3c3;
  position: relative;
}
.card .photo img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .4s ease;
}
.card:hover .photo > img { transform: scale(1.03); }

.card .photo .placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif); font-size: 2.2rem; color: var(--ink-faint);
  background: linear-gradient(135deg, #ede3d2, #d9cdbb);
}
.card .featured { display: none; }
.card .recommended {
  position: absolute; top: 12px; left: 12px;
  background: var(--ink);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 10px;
  border-radius: 999px;
}
.card .head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin: 16px 0 2px;
  gap: 12px;
}
.card h3 {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.35rem;
  margin: 0;
  letter-spacing: -0.005em;
  line-height: 1.2;
}
.card .rating { color: var(--ink-muted); font-size: 0.9rem; white-space: nowrap; flex-shrink: 0; }
.card .rating .star { color: var(--accent); }
.card .genre {
  color: var(--olive);
  font-size: 0.92rem;
  margin: 0;
}
.card .meta {
  color: var(--ink-faint);
  font-size: 0.82rem;
  margin: 8px 0 0;
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
}
.card .meta .dot { color: var(--ink-faint); }
.card .note {
  color: var(--ink-muted);
  font-style: italic;
  font-size: 0.86rem;
  margin: 8px 0 0;
  line-height: 1.4;
}

.empty { text-align: center; color: var(--ink-muted); padding: 48px 0; font-style: italic; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0;
  color: var(--ink-muted);
  font-size: 0.85rem;
}
.site-footer a { color: var(--accent-dark); text-decoration: none; }

/* Modal */
.modal[hidden] { display: none; }
.modal {
  position: fixed; inset: 0;
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-backdrop {
  position: absolute; inset: 0;
  background: rgba(20, 14, 8, 0.55);
  backdrop-filter: blur(2px);
}
.modal-dialog {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  width: min(1040px, 100%);
  max-height: 90vh;
  overflow: hidden;
  display: flex; flex-direction: column;
}
.modal-close {
  position: absolute; top: 10px; right: 14px;
  z-index: 2;
  background: rgba(255,255,255,0.85);
  border: 1px solid var(--line);
  border-radius: 999px;
  width: 34px; height: 34px;
  font-size: 1.4rem; line-height: 1;
  color: var(--ink);
  cursor: pointer;
}
.modal-close:hover { background: #fff; }
.modal-body {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  min-height: 0;
}
@media (max-width: 760px) {
  .modal-body { grid-template-columns: 1fr; }
  .modal-dialog { max-height: 94vh; }
}
.modal-media {
  position: relative;
  background: #1a1410;
  min-height: 320px;
  display: flex; align-items: stretch; justify-content: center;
}
.modal-photo-placeholder {
  display: flex; align-items: center; justify-content: center;
  width: 100%; color: var(--ink-faint);
  font-family: var(--display); font-size: 4rem;
  background: linear-gradient(135deg, #ede3d2, #d9cdbb);
}
.modal-photo.single, .modal-photo.single img {
  width: 100%; height: 100%;
}
.modal-photo.single img { object-fit: cover; display: block; }

.modal-carousel { position: relative; width: 100%; }
.modal-carousel-track {
  position: relative;
  width: 100%; height: 100%;
  min-height: 360px;
}
.modal-carousel-track img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity .25s ease;
}
.modal-carousel-track img.active { opacity: 1; }
.carousel-btn {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 38px; height: 38px;
  border-radius: 999px;
  border: none;
  background: rgba(255,255,255,0.85);
  color: var(--ink);
  font-size: 1.5rem; line-height: 1;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.carousel-btn:hover { background: #fff; }
.carousel-btn.prev { left: 12px; }
.carousel-btn.next { right: 12px; }
.carousel-dots {
  position: absolute; bottom: 12px; left: 0; right: 0;
  display: flex; gap: 6px; justify-content: center;
}
.carousel-dots .dot {
  width: 7px; height: 7px; border-radius: 999px;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: background .2s, transform .2s;
}
.carousel-dots .dot.active { background: #fff; transform: scale(1.2); }

.modal-info {
  padding: 28px 28px 24px;
  overflow-y: auto;
}
.m-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.7rem;
  letter-spacing: -0.005em;
  margin: 0 36px 4px 0;
  color: var(--ink);
}
.m-genre { color: var(--olive); font-size: 0.95rem; margin: 0 0 10px; }
.m-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
  color: var(--ink-muted); font-size: 0.9rem;
  margin-bottom: 14px;
}
.m-meta .star { color: var(--accent); }
.m-meta .m-dot { color: var(--ink-faint); }
.m-addr { color: var(--ink-muted); font-size: 0.9rem; margin: 0 0 14px; }
.m-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 14px; }
.m-tag {
  font-size: 0.78rem;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--ink-muted);
}
.m-summary {
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0 0 14px;
}
.m-comment {
  margin: 0 0 16px;
  padding: 10px 14px;
  border-left: 3px solid var(--accent);
  background: rgba(201, 106, 67, 0.08);
  font-style: italic;
  color: var(--ink);
  font-size: 0.92rem;
  border-radius: 0 8px 8px 0;
}
.m-link {
  display: inline-block;
  color: var(--accent-dark);
  font-weight: 500;
  text-decoration: none;
  font-size: 0.9rem;
}
.m-link:hover { text-decoration: underline; }

.card { outline: none; }
.card:focus-visible { box-shadow: 0 0 0 3px rgba(201, 106, 67, 0.4); border-radius: 12px; }
.site-footer a:hover { text-decoration: underline; }
