/* ── Kinfolk × Fooding Hybrid ── */
/* Original warm Kinfolk palette & serifs, with Fooding's bold structural elements */

:root {
  --font-display: 'Cormorant Garamond', 'Garamond', serif;
  --font-hero: 'Bodoni Moda', 'Didot', 'Bodoni MT', serif;
  --font-body: 'Cormorant Garamond', 'Garamond', serif;
  --font-sans: 'Outfit', sans-serif;

  --bg: #F8F6F1;
  --bg-card: #F8F6F1;
  --text: #2C2B28;
  --text-muted: #8A8680;
  --text-light: #B5B0A8;
  --accent: #2C2B28;
  --accent-text: #F8F6F1;
  --border: #2C2B28;
  --border-light: #DDD8CF;
  --bg-hover: #F2EFE9;
  --accent-warm: #8B7355;

  --radius: 0;
  --radius-pill: 0;
  --shadow-hover: none;
  --rule-weight: 2.5px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
  overflow-x: hidden;
  font-size: 16.5px;
}
a { text-decoration: none; color: inherit; }
input { font-family: var(--font-sans); }

/* ── Grain — very subtle ── */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* ── Hero ── */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6rem 2rem;
  overflow: hidden;
  border-bottom: var(--rule-weight) solid var(--text);
}

/* Soft, barely-there orbs */
.hero-orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}
.hero-orb--1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(200, 190, 172, 0.12) 0%, transparent 70%);
  top: -15%;
  right: -10%;
}
.hero-orb--2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(200, 190, 172, 0.08) 0%, transparent 70%);
  bottom: -10%;
  left: -5%;
}
.hero-orb--3 { display: none; }

.hero-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4rem;
  max-width: 960px;
  width: 100%;
  animation: fadeIn 1.5s ease-out;
}

.hero-content {
  flex: 1;
  text-align: center;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.hero-badge {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 3.5rem;
}

.hero-title {
  font-family: var(--font-hero);
  font-size: clamp(3.5rem, 9vw, 6rem);
  font-weight: 400;
  line-height: 1.25;
  color: var(--text);
  margin-bottom: 2rem;
  letter-spacing: -0.02em;
}
.hero-title em {
  font-style: italic;
  font-weight: 400;
}

.hero-desc {
  font-family: var(--font-body);
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 auto 4rem;
  line-height: 1.8;
  font-weight: 400;
  text-align: center;
}

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 4rem;
}

.stat {
  text-align: center;
}
.stat-number {
  font-family: var(--font-display);
  font-size: 2.8rem;
  font-weight: 400;
  color: var(--text);
  line-height: 1;
  display: block;
  letter-spacing: -0.02em;
}
.stat-label {
  font-family: var(--font-sans);
  font-size: 0.55rem;
  font-weight: 400;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-top: 0.6rem;
  display: block;
}

.hero-scroll-hint {
  position: absolute;
  bottom: -5rem;
  left: 0;
  right: 0;
  margin: 0 auto;
  width: fit-content;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: var(--text-light);
  animation: drift 3s ease-in-out infinite;
}
.hero-scroll-hint svg {
  opacity: 0.5;
}

@keyframes drift {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(6px); }
}

/* ── Filter Bar ── */
.filter-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(248, 246, 241, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 2px solid transparent;
  transition: border-color 0.3s ease;
  padding: 1rem 2rem;
}
.filter-bar.scrolled {
  border-bottom-color: var(--text);
}

.filter-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.filter-top-row {
  display: contents;
}

.search-wrap {
  position: relative;
  flex-shrink: 0;
  width: 240px;
}
.search-icon {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
#searchInput {
  width: 100%;
  padding: 0.5rem 0 0.5rem 2rem;
  border: none;
  border-bottom: 2px solid var(--border-light);
  background: transparent;
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--text);
  outline: none;
  transition: border-color 0.3s;
}
#searchInput::placeholder {
  color: var(--text-light);
  font-weight: 300;
}
#searchInput:focus {
  border-bottom-color: var(--text);
}

.filter-rows {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
  overflow: hidden;
  max-width: 100%;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  overflow: hidden;
  min-width: 0;
}

.filter-label {
  font-family: var(--font-sans);
  font-size: 0.55rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-light);
  flex-shrink: 0;
  width: 52px;
}

.pills-scroll {
  overflow-x: auto;
  flex: 1;
  min-width: 0;
  -ms-overflow-style: none;
  scrollbar-width: none;
}
.pills-scroll::-webkit-scrollbar { display: none; }

.pills {
  display: flex;
  gap: 0.35rem;
  white-space: nowrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.8rem;
  border: 1.5px solid var(--border-light);
  background: transparent;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 400;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
}
.pill:hover {
  border-color: var(--text);
  color: var(--text);
}
.pill.active {
  color: var(--text);
  border-color: var(--text);
  background: transparent;
}
.pill-count {
  font-size: 0.6rem;
  font-weight: 400;
  opacity: 0.5;
}
.pill.disabled {
  color: var(--text-light);
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

/* ── Category Sections ── */
.category-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 4.5rem 2rem 2rem;
}

.category-header {
  display: flex;
  align-items: baseline;
  gap: 1.2rem;
  margin-bottom: 2.5rem;
  padding-bottom: 1.2rem;
  border-bottom: var(--rule-weight) solid var(--border);
}

.category-number {
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 300;
  color: var(--text-light);
}

.category-name {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.category-count {
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-light);
  margin-left: auto;
}

/* ── Card Grid ── */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 0;
  border-top: 1px solid var(--border-light);
}

/* ── Cards ── */
.place-card {
  display: block;
  background: var(--bg);
  border: none;
  border-bottom: 1px solid var(--border-light);
  border-right: 1px solid var(--border-light);
  padding: 1.3rem 1.4rem;
  transition: background 0.2s ease;
  position: relative;
  min-height: 0;
}
.place-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--rule-weight);
  background: var(--text);
  transform: scaleY(0);
  transform-origin: top;
  transition: transform 0.3s ease;
}
.place-card:hover {
  background: var(--bg-hover);
}
.place-card:hover::before {
  transform: scaleY(1);
}

/* ── Card top row ── */
.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--text);
  letter-spacing: -0.01em;
  flex: 1;
  min-width: 0;
}

/* ── Rating ── */
.card-rating {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
  white-space: nowrap;
  padding-top: 0.15rem;
}

.rating-num {
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 400;
  color: var(--accent-warm);
  letter-spacing: -0.01em;
}

.rating-dots {
  display: none;
}

.dot-filled {
  color: var(--accent-warm);
}

.dot-empty {
  color: var(--border-light);
}

.rating-count {
  font-family: var(--font-sans);
  font-size: 0.5rem;
  font-weight: 300;
  color: var(--text-light);
  letter-spacing: -0.01em;
}

/* ── Card meta ── */
.card-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 1.2em;
}

.card-category {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-style: italic;
  font-weight: 400;
  letter-spacing: 0.01em;
  color: var(--accent-warm);
}

.card-neighborhood {
  font-family: var(--font-sans);
  font-size: 0.5rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-light);
}
.card-neighborhood::before {
  content: '\2014';
  margin-right: 0.4rem;
  color: var(--border-light);
}

.card-price {
  font-family: var(--font-sans);
  font-size: 0.55rem;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  margin-left: auto;
}

/* ── Scroll Reveal ── */
.card-reveal {
  opacity: 1;
}

/* ── No Results ── */
.no-results {
  display: none;
  text-align: center;
  padding: 8rem 2rem;
}
.no-results.visible {
  display: block;
}
.no-results-inner {
  max-width: 300px;
  margin: 0 auto;
}
.no-results-icon {
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: 400;
  color: var(--text-light);
  display: block;
  margin-bottom: 1.5rem;
}
.no-results p {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 400;
}

/* ── Footer ── */
.footer {
  text-align: center;
  padding: 5rem 2rem;
  border-top: var(--rule-weight) solid var(--border);
  color: var(--text-light);
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* ── Hero Illustration ── */
.hero-illustration {
  flex-shrink: 0;
  opacity: 0.85;
}
.hero-illustration img {
  display: block;
  mix-blend-mode: multiply;
  -webkit-mask-image: radial-gradient(ellipse 90% 85% at 50% 50%, rgba(0,0,0,1) 60%, rgba(0,0,0,0) 100%);
  mask-image: radial-gradient(ellipse 90% 85% at 50% 50%, rgba(0,0,0,1) 60%, rgba(0,0,0,0) 100%);
}

/* ── Map Toggle ── */
.map-toggle {
  margin-left: auto;
  cursor: pointer;
  width: 38px;
  height: 38px;
  border: 1.5px solid var(--border-light);
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
  color: var(--text-muted);
}
.map-toggle:hover {
  border-color: var(--text);
  color: var(--text);
}
.map-toggle.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* ── Map Layout ── */
.page-wrap {
  display: flex;
  transition: all 0.4s ease;
}

.card-area {
  width: 100%;
  transition: width 0.4s ease;
}

.map-panel {
  width: 0;
  opacity: 0;
  overflow: hidden;
  position: sticky;
  top: 56px;
  height: calc(100vh - 56px);
  transition: width 0.4s ease, opacity 0.3s ease;
  border-left: 1.5px solid var(--border-light);
}

.page-wrap.map-open .card-area {
  width: 55%;
}
.page-wrap.map-open .map-panel {
  width: 45%;
  opacity: 1;
}

#map {
  width: 100%;
  height: 100%;
}

/* ── Map Tile Styling — desaturated for Kinfolk aesthetic ── */
.leaflet-tile-pane {
  filter: saturate(0.3) brightness(1.05) contrast(0.95);
}

.leaflet-control-zoom a {
  font-family: var(--font-sans) !important;
  color: var(--text) !important;
  border-color: var(--border-light) !important;
  background: var(--bg) !important;
}

.leaflet-control-attribution {
  font-family: var(--font-sans) !important;
  font-size: 0.55rem !important;
  color: var(--text-light) !important;
  background: rgba(248, 246, 241, 0.85) !important;
}

/* ── Map Markers ── */
.kinfolk-marker {
  background: var(--text);
  border: 2px solid var(--bg);
  border-radius: 50%;
  width: 10px;
  height: 10px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: transform 0.2s ease, background 0.2s ease;
}

.kinfolk-marker.highlighted {
  background: var(--accent-warm);
  transform: scale(1.8);
  z-index: 1000 !important;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-warm) 25%, transparent);
}

/* ── Map Clusters ── */
.marker-cluster {
  background: rgba(44, 43, 40, 0.1) !important;
}
.marker-cluster div {
  background: var(--text) !important;
  color: var(--bg) !important;
  font-family: var(--font-sans) !important;
  font-size: 0.7rem !important;
  font-weight: 500 !important;
  width: 28px !important;
  height: 28px !important;
  line-height: 28px !important;
  border-radius: 50% !important;
  text-align: center !important;
  margin-left: 4px !important;
  margin-top: 4px !important;
}

/* ── Map Popups ── */
.leaflet-popup-content-wrapper {
  border-radius: 0 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
  font-family: var(--font-body) !important;
  padding: 0 !important;
}
.leaflet-popup-content {
  margin: 0.8rem 1rem !important;
  font-size: 0.85rem !important;
  line-height: 1.5 !important;
}
.leaflet-popup-content .popup-title {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.1rem;
}
.leaflet-popup-content .popup-category {
  font-family: var(--font-sans);
  font-size: 0.55rem;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.leaflet-popup-tip {
  box-shadow: none !important;
}

/* ── Map Counter ── */
.map-counter {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: var(--bg);
  border: 1.5px solid var(--border-light);
  padding: 0.4rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  pointer-events: none;
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 2px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}

/* ── Pill scroll fades ── */
.pills-scroll {
  position: relative;
}
.pills-scroll::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 40px;
  background: linear-gradient(to right, transparent, var(--bg));
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s;
}
.pills-scroll.can-scroll-right::after {
  opacity: 1;
}
.filter-bar .pills-scroll::after {
  background: linear-gradient(to right, transparent, rgba(248, 246, 241, 0.95));
}

/* ── Responsive — Tablet ── */
@media (max-width: 768px) {
  .hero { min-height: 85vh; padding: 4rem 1.5rem; }
  .hero-inner { flex-direction: column; gap: 2rem; }
  .hero-illustration img { width: 160px; height: auto; margin: 0 auto; }
  .hero-content { text-align: center; }
  .hero-title { font-size: clamp(3.5rem, 14vw, 5.5rem); }
  .hero-stats { justify-content: center; gap: 2.5rem; }
  .stat { text-align: center; padding-left: 0; }
  .stat::before { display: none; }
  .stat-number { font-size: 2.4rem; }
  .hero-desc { font-size: 1rem; margin: 0 auto 3rem; }

  .filter-bar { padding: 0.8rem 1rem; }
  .filter-inner {
    flex-direction: column;
    gap: 0.6rem;
    align-items: stretch;
  }

  .filter-top-row {
    display: flex;
    align-items: center;
    gap: 0.8rem;
  }
  .filter-top-row .search-wrap { flex: 1; width: auto; }
  .filter-top-row .map-toggle { margin-left: 0; }

  .filter-rows { gap: 0.25rem; }
  .filter-label { width: 52px; font-size: 0.55rem; }

  .page-wrap { flex-direction: column; }
  .page-wrap.map-open .card-area { width: 100%; }
  .page-wrap.map-open .map-panel {
    width: 100%;
    height: 40vh;
    position: relative;
    top: auto;
    border-left: none;
    border-bottom: 1.5px solid var(--border-light);
    order: -1;
  }

  .category-section { padding: 3rem 1rem 1.5rem; }
  .category-name { font-size: 2rem; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
}

/* ── Responsive — Mobile ── */
@media (max-width: 480px) {
  .hero { min-height: 80vh; min-height: 80dvh; padding: 3rem 1.2rem; }
  .hero-badge { font-size: 0.55rem; margin-bottom: 1.5rem; }
  .hero-title { font-size: clamp(3rem, 13vw, 4rem); }
  .hero-desc { font-size: 0.9rem; margin-bottom: 2.5rem; }
  .hero-desc br { display: none; }
  .hero-stats { gap: 1.8rem; }
  .stat-number { font-size: 2rem; }
  .stat-label { font-size: 0.5rem; }
  .hero-illustration img { width: 120px; }
  .hero-scroll-hint { bottom: -3.5rem; }

  .filter-bar { padding: 0.6rem 0; }
  .filter-inner { gap: 0.4rem; }
  .filter-top-row { padding: 0 1rem; }
  .filter-rows { gap: 0.15rem; }
  .filter-row { gap: 0.4rem; }

  .filter-label {
    width: 48px;
    font-size: 0.5rem;
    padding-left: 0.8rem;
  }

  .pills-scroll {
    -webkit-overflow-scrolling: touch;
    scroll-padding-left: 0.5rem;
  }
  .pill {
    padding: 0.25rem 0.5rem;
    font-size: 0.62rem;
  }
  .pill-count { font-size: 0.55rem; }

  .category-section { padding: 2.5rem 1rem 1rem; }
  .category-header { flex-wrap: wrap; gap: 0.6rem; }
  .category-name { font-size: 1.6rem; }
  .category-count { font-size: 0.55rem; }
  .card-grid { grid-template-columns: 1fr; }
  .place-card { padding: 0.9rem 1rem; }
  .card-title { font-size: 1rem; }
  .card-rating { gap: 0.2rem; }
  .rating-num { font-size: 0.65rem; }
  .rating-dots { font-size: 0.45rem; }
  .rating-count { font-size: 0.5rem; }

  .map-toggle { width: 34px; height: 34px; }
  .footer { padding: 3rem 1.5rem; }
  .page-wrap.map-open .map-panel { height: 35vh; }
}
