/* MEHKO Finder — styles.css
   Food-friendly, clean, mobile-first. Vanilla CSS, no frameworks. */

:root {
  --green: #14453d;
  --green-dark: #0d332c;
  --terracotta: #e2603b;
  --terracotta-dark: #c94e2c;
  --cream: #fff9f2;
  --sand: #f5e9da;
  --ink: #2b2622;
  --ink-soft: #5d554e;
  --card: #ffffff;
  --border: #e8d9c4;
  --radius: 14px;
  --shadow: 0 4px 18px rgba(20, 69, 61, 0.10);
  --maxw: 1180px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.55;
}

a { color: #b8441f; }
a:hover { color: var(--terracotta-dark); }

/* ---------- Header ---------- */
.site-header {
  background: var(--green);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0,0,0,.18);
}
.header-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0.7rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.brand { display: flex; align-items: center; gap: 0.65rem; text-decoration: none; color: #fff; }
.brand img { width: 42px; height: 42px; display: block; }
.brand-text { line-height: 1.15; }
.brand-text strong { font-size: 1.25rem; letter-spacing: .2px; display: block; }
.brand-text span { font-size: 0.78rem; opacity: .85; }
.main-nav { margin-left: auto; display: flex; gap: 0.25rem; flex-wrap: wrap; }
.main-nav a {
  color: #fff; text-decoration: none; font-size: 0.92rem; font-weight: 600;
  padding: 0.45rem 0.75rem; border-radius: 8px;
}
.main-nav a:hover { background: rgba(255,255,255,.14); color: #fff; }
.main-nav a.nav-cta {
  background: var(--terracotta); color: #fff; font-weight: 700;
  border-radius: 9px; margin-left: 0.3rem;
}
.main-nav a.nav-cta:hover { background: var(--terracotta-dark); color: #fff; }

/* ---------- Hero ---------- */
.hero {
  background: linear-gradient(135deg, var(--green) 0%, var(--green-dark) 60%, #1a5c4e 100%);
  color: #fff;
  padding: 2.2rem 1rem 2rem;
}
.hero-inner { max-width: var(--maxw); margin: 0 auto; }
.hero h1 { margin: 0 0 0.4rem; font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.2; }
.hero p { margin: 0; font-size: 1.05rem; opacity: .92; max-width: 44rem; }
.hero-tag { margin-bottom: 1.2rem; }
.hero-actions { display: flex; gap: 0.7rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.hero-actions .btn { text-decoration: none; display: inline-block; }
.btn.light {
  background: transparent; color: #fff; border: 2px solid #fff;
}
.btn.light:hover { background: rgba(255,255,255,.16); }
.discovery-note {
  margin-top: 0.8rem; font-size: 0.88rem; opacity: .85; max-width: 44rem;
}
.privacy-note {
  margin-top: 1.1rem;
  display: inline-block;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.3);
  padding: 0.55rem 0.9rem;
  border-radius: 10px;
  font-size: 0.9rem;
}

/* ---------- Layout ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 2rem 1rem; }
section.block { margin-bottom: 3rem; }
.section-title { font-size: 1.6rem; margin: 0 0 0.4rem; color: var(--green); }
.section-sub { margin: 0 0 1.4rem; color: var(--ink-soft); }

/* ---------- Finder ---------- */
.finder-toolbar {
  display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center;
  background: var(--card); border: 1px solid var(--border);
  padding: 0.8rem; border-radius: var(--radius); box-shadow: var(--shadow);
  margin-bottom: 0.9rem;
}
.finder-toolbar input[type="search"],
.finder-toolbar select {
  font: inherit; padding: 0.6rem 0.75rem; border: 1px solid var(--border);
  border-radius: 9px; background: #fff; color: var(--ink);
}
.finder-toolbar input[type="search"] { flex: 1 1 220px; min-width: 180px; }
.finder-toolbar select { flex: 0 1 auto; }
.btn {
  font: inherit; font-weight: 700; cursor: pointer;
  border: none; border-radius: 9px; padding: 0.6rem 1.1rem;
  background: #c94e2c; color: #fff;
  transition: background .15s;
}
.btn:hover { background: #b8441f; }
.btn.ghost { background: #fff; color: var(--green); border: 1.5px solid var(--green); }
.btn.ghost:hover { background: var(--sand); }
.btn:disabled { opacity: .55; cursor: wait; }

.finder-grid { display: grid; grid-template-columns: 1.9fr 1fr; gap: 1rem; align-items: start; }

/* Mobile List/Map segmented toggle — hidden on desktop (both shown). */
.view-toggle { display: none; gap: 0; margin-bottom: 0.8rem; background: var(--sand);
  border: 1px solid var(--border); border-radius: 999px; padding: 4px; width: max-content; }
.view-toggle button {
  font: inherit; font-weight: 700; font-size: 0.92rem; cursor: pointer;
  border: none; background: transparent; color: var(--green);
  padding: 0.5rem 1.3rem; border-radius: 999px;
}
.view-toggle button.active { background: var(--green); color: #fff; }
.map-shell {
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  border: 1px solid var(--border); position: relative; background: var(--sand);
}
#map { height: 62vh; min-height: 420px; width: 100%; z-index: 1; }
.map-status {
  position: absolute; left: 10px; bottom: 10px; z-index: 500;
  background: rgba(20,69,61,.92); color: #fff; font-size: 0.8rem;
  padding: 0.35rem 0.7rem; border-radius: 8px; pointer-events: none;
  max-width: calc(100% - 20px);
}
.results-panel {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  display: flex; flex-direction: column; max-height: 62vh; min-height: 420px;
}
.results-head {
  padding: 0.8rem 1rem; border-bottom: 1px solid var(--border);
  font-weight: 700; color: var(--green); display: flex; justify-content: space-between; align-items: center; gap: .5rem;
}
.results-head .count { font-size: 0.85rem; color: var(--ink-soft); font-weight: 600; }
.results-list { overflow-y: auto; padding: 0.7rem; display: flex; flex-direction: column; gap: 0.7rem; }
.sort-note { margin: 0; padding: 0.45rem 1rem 0; font-size: 0.8rem; color: var(--ink-soft); font-style: italic; }

.listing-card {
  border: 1px solid var(--border); border-radius: 11px; padding: 0.8rem 0.9rem;
  background: #fffdf9; cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.listing-card:hover, .listing-card.active { border-color: var(--terracotta); box-shadow: var(--shadow); }
.listing-card h3 { margin: 0 0 0.25rem; font-size: 1.02rem; color: var(--green); }
.card-top { display: flex; gap: 0.7rem; align-items: flex-start; }
.card-avatar {
  flex: 0 0 44px; width: 44px; height: 44px; border-radius: 12px;
  background: var(--green); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem; font-weight: 800;
}
.card-head { min-width: 0; }
.card-head h3 { margin-top: 2px; }
.trust { margin-top: 0.45rem; font-size: 0.85rem; }
.trust a { font-weight: 600; }
.listing-meta { font-size: 0.88rem; color: var(--ink-soft); margin: 0.1rem 0; }
.badge {
  display: inline-block; font-size: 0.75rem; font-weight: 700;
  background: var(--sand); color: var(--green);
  padding: 0.15rem 0.55rem; border-radius: 999px; margin-right: 0.3rem; margin-top: 0.25rem;
}
.badge.permit { background: #e2efe4; color: #1d5c2e; }
.badge.pending { background: #fdf0dc; color: #8a5a12; }
.listing-card .src { font-size: 0.82rem; margin-top: 0.35rem; }
.distance { font-size: 0.8rem; color: #b8441f; font-weight: 700; }
.dev-banner {
  background: #8a5a12; color: #fff; text-align: center; font-weight: 700;
  padding: 0.6rem 1rem; font-size: 0.9rem;
}

.empty-state, .error-state {
  padding: 1.4rem 1rem; text-align: center; color: var(--ink-soft); font-size: 0.95rem;
}
.error-state { color: #8a2b1d; background: #fdf0ec; border: 1px solid #f0c9bd; border-radius: 10px; }

/* Leaflet pin styling */
.mehko-pin {
  width: 34px; height: 34px; border-radius: 50% 50% 50% 0;
  background: var(--terracotta); border: 3px solid #fff;
  transform: rotate(-45deg); box-shadow: 0 3px 9px rgba(0,0,0,.45);
}
.mehko-pin .dot {
  width: 12px; height: 12px; background: #fff; border-radius: 50%;
  position: absolute; top: 8px; left: 8px;
}
.mehko-pin.active-pin { background: var(--green); transform: rotate(-45deg) scale(1.15); }

/* ---------- Contact rows (popups + cards) ---------- */
.contact-block { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--border); }
.contact-row { font-size: .86rem; margin: 3px 0; line-height: 1.35; }
.contact-row a { color: var(--green); font-weight: 600; }
.contact-row.note { font-style: italic; color: var(--ink-soft); }
.claim-link, .card-claim { margin-top: 7px; font-size: .85rem; font-weight: 600; }
.claim-link a, .card-claim a { color: var(--terracotta-dark); }

/* ---------- Map popups ---------- */
.popup-card { min-width: 200px; max-width: 250px; }
.popup-name { font-size: 1.02rem; line-height: 1.3; }
.popup-loc { color: var(--ink-soft); font-size: .86rem; margin: 2px 0 6px; }
.popup-row { font-size: .86rem; margin: 3px 0; line-height: 1.35; }
.popup-label { font-weight: 700; color: var(--terracotta-dark); margin-right: 5px; }
.popup-row a { color: var(--green); }
.popup-note { font-size: .76rem; color: var(--ink-soft); font-style: italic; margin-top: 7px; }
.popup-link { margin-top: 7px; font-weight: 600; }
.popup-link a { color: var(--green); }

/* ---------- News ---------- */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 1rem; }
.news-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.1rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 0.45rem;
}
.news-card .outlet { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--terracotta-dark); }
.news-card h3 { margin: 0; font-size: 1.08rem; line-height: 1.35; }
.news-card h3 a { color: var(--green); text-decoration: none; }
.news-card h3 a:hover { text-decoration: underline; }
.news-card time { font-size: 0.85rem; color: var(--ink-soft); }
.news-card p { margin: 0; font-size: 0.93rem; color: var(--ink-soft); flex: 1; }
.news-card .read { font-size: 0.9rem; font-weight: 700; }

/* ---------- About ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
.about-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.4rem; box-shadow: var(--shadow);
}
.about-card h3 { margin-top: 0; color: var(--green); }
.about-card ul { padding-left: 1.2rem; margin: 0.5rem 0; }
.about-card li { margin-bottom: 0.35rem; }
.county-chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.6rem; }
.county-chips span {
  background: var(--sand); border: 1px solid var(--border); color: var(--green);
  font-size: 0.82rem; font-weight: 600; padding: 0.2rem 0.6rem; border-radius: 999px;
}
.county-chips.notoptin span { background: #f3e3da; border-color: #e0bfae; color: #7a3a1d; }

/* ---------- Form ---------- */
.form-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.6rem; box-shadow: var(--shadow); max-width: 640px;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.9rem; }
.field { margin-bottom: 1rem; display: flex; flex-direction: column; gap: 0.3rem; }
.field.full { grid-column: 1 / -1; }
.field label { font-weight: 700; font-size: 0.92rem; color: var(--green); }
.field input, .field select, .field textarea {
  font: inherit; padding: 0.6rem 0.75rem; border: 1px solid var(--border); border-radius: 9px; background: #fffdf9;
}
.field textarea { min-height: 96px; resize: vertical; }
.field .hint { font-size: 0.82rem; color: var(--ink-soft); }
.form-ok {
  background: #e9f4ea; border: 1px solid #bcdcc0; color: #1d5c2e;
  padding: 1rem 1.2rem; border-radius: 10px; margin-top: 1rem;
}
.mailto-fallback { margin-top: 1rem; font-size: 0.92rem; color: var(--ink-soft); }

/* ---------- Footer ---------- */
.site-footer { background: var(--green-dark); color: #e9e2d6; margin-top: 1rem; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 2rem 1rem 1.4rem; font-size: 0.9rem; }
.footer-inner a { color: #ffd9c4; }
.footer-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1.4rem; margin-bottom: 1.4rem; }
.footer-cols h4 { margin: 0 0 0.5rem; color: #fff; font-size: 1rem; }
.footer-cols p, .footer-cols ul { margin: 0; padding: 0; list-style: none; }
.footer-cols li { margin-bottom: 0.3rem; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.18); padding-top: 1rem; font-size: 0.82rem; opacity: .9; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .finder-grid { grid-template-columns: 1fr; }
  .view-toggle { display: inline-flex; }
  .finder-grid.view-list .map-shell { display: none; }
  .finder-grid.view-map .results-panel { display: none; }
  .results-panel { max-height: 480px; }
  #map { height: 55vh; min-height: 340px; }
  .about-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
  .header-inner { flex-wrap: wrap; }
  .main-nav { margin-left: 0; }
  .wrap { padding: 1.4rem 0.8rem; }
}
