:root {
  --bg: #faf7f1;
  --card: #ffffff;
  --ink: #23211d;
  --muted: #6f6a60;
  --accent: #b3541e;
  --accent-dark: #8f4217;
  --try-bg: #e8f3e4;
  --try-ink: #2e6b34;
  --return-bg: #e9e4f6;
  --return-ink: #4b3a86;
  --line: #e7e0d3;
  --radius: 14px;
  --shadow: 0 2px 10px rgba(35, 33, 29, 0.07);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ---------- header ---------- */

.site-header {
  background: #23211d;
  color: #f5f1e8;
  padding: 28px 20px 18px;
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

.site-header h1 {
  margin: 0 0 4px;
  font-size: 1.9rem;
  letter-spacing: -0.01em;
}

.subtitle {
  margin: 0;
  color: #b9b2a3;
  font-size: 0.95rem;
}

.view-toggle {
  display: flex;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 4px;
  gap: 4px;
}

.toggle-btn {
  border: 0;
  background: transparent;
  color: #d9d3c4;
  font-size: 0.95rem;
  font-weight: 600;
  padding: 8px 22px;
  border-radius: 999px;
  cursor: pointer;
}

.toggle-btn.active {
  background: var(--accent);
  color: #fff;
}

.filters {
  max-width: 1080px;
  margin: 16px auto 0;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-chip {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: transparent;
  color: #d9d3c4;
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 0.9rem;
  cursor: pointer;
}

.filter-chip .count {
  opacity: 0.7;
  font-size: 0.82rem;
  margin-left: 2px;
}

.filter-chip.active {
  background: #f5f1e8;
  color: #23211d;
  border-color: #f5f1e8;
  font-weight: 600;
}

/* ---------- layout ---------- */

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 20px 40px;
}

.hidden { display: none !important; }

/* ---------- cards ---------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* hero image: 16/9 with gradient fallback if the photo is missing */
.hero {
  position: relative;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #3a2c20 0%, #8f4217 55%, #b3541e 100%);
  overflow: hidden;
}

.hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero .badge {
  position: absolute;
  top: 12px;
  right: 12px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.3);
}

.card-body {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.kicker {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-dark);
}

.card h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.65rem;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

.badge {
  flex-shrink: 0;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}

.badge.try { background: var(--try-bg); color: var(--try-ink); }
.badge.return { background: var(--return-bg); color: var(--return-ink); }

.desc {
  margin: 0;
  font-size: 0.95rem;
}

.dontmiss {
  margin: 6px 0 0;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.highlights {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.highlights li {
  font-size: 0.9rem;
  padding-left: 18px;
  position: relative;
}

.highlights li::before {
  content: "•";
  color: var(--accent);
  font-weight: 700;
  position: absolute;
  left: 4px;
}

.details {
  margin: 4px 0 0;
  padding: 12px 0 0;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 0.85rem;
}

.detail-row { display: flex; gap: 10px; }

.details dt {
  font-weight: 700;
  color: var(--muted);
  min-width: 96px;
  flex-shrink: 0;
}

.details dd { margin: 0; }

.card-foot {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.address {
  color: var(--muted);
  font-size: 0.82rem;
}

.directions {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent-dark);
  text-decoration: none;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 1px;
}

.directions:hover { color: var(--accent); }

/* ---------- map view ---------- */

.map-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 18px;
  align-items: start;
}

#map {
  height: 560px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  z-index: 0;
}

.map-side-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 560px;
  overflow-y: auto;
  padding-right: 2px;
}

.map-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 14px;
  cursor: pointer;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  width: 100%;
  font: inherit;
  color: inherit;
}

.map-item:hover { border-color: var(--accent); }

.map-item.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(179, 84, 30, 0.25);
}

.pin-num {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-item .mi-name { font-weight: 700; font-size: 0.95rem; }
.map-item .mi-addr { font-size: 0.82rem; color: var(--muted); }

.number-pin {
  background: var(--accent);
  color: #fff;
  border: 2px solid #fff;
  border-radius: 50%;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 13px;
}

.leaflet-popup-content { font-family: inherit; max-width: 220px; }
.leaflet-popup-content strong { font-size: 0.95rem; }
.leaflet-popup-content .pop-addr { font-size: 0.82rem; color: #555; }
.pop-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 6px;
  display: block;
}

.map-fallback {
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

/* ---------- mobile ---------- */

@media (max-width: 860px) {
  .map-layout { grid-template-columns: 1fr; }
  #map { height: 380px; }
  .map-side-list { max-height: 320px; }
}

@media (max-width: 560px) {
  .site-header h1 { font-size: 1.55rem; }
  .cards { grid-template-columns: 1fr; }
  main { padding: 18px 14px 32px; }
}
