:root {
  --bg: #f6f4ef;
  --card: #ffffff;
  --ink: #1b2420;
  --muted: #66706b;
  --line: #e5e1d8;
  --brand: #173f32;
  --brand-2: #22604b;
  --accent: #c0612a;
  --wa: #168a48;
  --open: #17803f;
  --closed: #b13e2b;
  --shadow: 0 1px 2px rgba(20, 30, 25, .06), 0 4px 14px rgba(20, 30, 25, .06);
  --radius: 16px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111614;
    --card: #1a211e;
    --ink: #e9eeeb;
    --muted: #9aa5a0;
    --line: #2a3430;
    --brand: #133429;
    --brand-2: #4fae8a;
    --accent: #e08a52;
    --wa: #1f9d55;
    --open: #4cc27c;
    --closed: #ef7d68;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  overflow-x: hidden; margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}
a { color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
h2 { font-size: 1.15rem; display: flex; align-items: center; gap: 8px; }
.ic { width: 1.1em; height: 1.1em; flex: none; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
[hidden] { display: none !important; }
main { max-width: 1100px; margin: 0 auto; padding: 0 16px 32px; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; background: var(--brand); color: #fff;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 700; font-size: 1.1rem; }
.logo { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--accent); }
.logo .ic { width: 18px; height: 18px; }
.lang { font-size: .9rem; text-decoration: none; padding: 6px 12px; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; }

/* ---------- hero + search ---------- */
.hero {
  margin: 0 -16px; padding: 22px 16px 18px;
  background: linear-gradient(180deg, var(--brand) 0%, var(--brand) 55%, transparent 100%);
  color: #fff;
}
.hero h1 { font-size: clamp(1.6rem, 6vw, 2.4rem); letter-spacing: -.01em; }
.hero p { margin: 6px 0 16px; opacity: .85; }
.searchbox {
  display: flex; align-items: center; gap: 10px;
  background: var(--card); color: var(--ink); border-radius: 14px; padding: 0 14px;
  box-shadow: var(--shadow); border: 1px solid var(--line);
}
.searchbox .ic { color: var(--muted); }
.searchbox input {
  flex: 1; border: 0; outline: 0; background: transparent; color: inherit;
  font: inherit; font-size: 1.05rem; padding: 14px 0; min-width: 0;
}
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 12px 0 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  font: inherit; font-size: .9rem; padding: 7px 14px; border-radius: 999px; cursor: pointer;
  background: var(--card); color: var(--ink); border: 1px solid var(--line);
}
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ---------- sections ---------- */
section { margin-top: 22px; }
section > h2 { margin-bottom: 12px; }
.filtering .browse { display: none; }

.cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .cat-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.cat-tile {
  min-width: 0; display: flex; align-items: center; gap: 10px; padding: 10px 12px; text-decoration: none;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow);
}
.cat-tile .cat-name { flex: 1; min-width: 0; font-weight: 600; font-size: .9rem; line-height: 1.25; overflow-wrap: anywhere; hyphens: auto; }
.cat-tile small { color: var(--muted); }
.cat-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; flex: none; }
.cat-ic .ic { width: 20px; height: 20px; }

/* category colours (placeholders + tiles) */
.ph-eat { background: #fbe7da; color: #a8481a; }
.ph-stay { background: #e2ecf8; color: #2c5c95; }
.ph-beauty { background: #f8e3ec; color: #a23a68; }
.ph-health { background: #dff3ec; color: #18795a; }
.ph-shops { background: #fdf0d2; color: #94650c; }
.ph-services { background: #e7e9ee; color: #44506a; }
.ph-home { background: #efe6da; color: #7a5530; }
.ph-motor { background: #e3e6f3; color: #3c4890; }
.ph-wine { background: #f3e0e3; color: #8a2539; }
.ph-farm { background: #e7f0d9; color: #4c7320; }
.ph-kids { background: #fff1c7; color: #8a6a00; }
.ph-pets { background: #f3e9dd; color: #8b5a2b; }
.ph-events { background: #ece2f5; color: #5d3a8c; }
.ph-other { background: #e9ebe9; color: #4d5a54; }
@media (prefers-color-scheme: dark) {
  [class*="ph-"] { filter: saturate(.9) brightness(.82); }
}

/* ---------- cards ---------- */
.list-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.grid { display: grid; gap: 12px; }
@media (min-width: 640px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 980px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.card {
  position: relative; display: flex; text-decoration: none; overflow: hidden;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-img { position: relative; flex: none; width: 108px; background: var(--line); }
.card-img img, .card-img .ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.ph { display: grid; place-items: center; }
.ph .ic { width: 34px; height: 34px; opacity: .85; }
.card-body { padding: 10px 12px; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.card h3 { font-size: 1.02rem; }
.card .tag { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cat { display: inline-flex; align-items: center; gap: 5px; font-size: .78rem; font-weight: 600; color: var(--brand-2); text-decoration: none; text-transform: uppercase; letter-spacing: .03em; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .84rem; color: var(--muted); margin-top: 2px; }
.meta > span { display: inline-flex; align-items: center; gap: 4px; }
.open:empty { display: none; }
.open::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.open.is-open { color: var(--open); font-weight: 600; }
.open.is-closed { color: var(--closed); }

/* vertical cards in the featured rail */
.rail { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 2px 16px 8px; scrollbar-width: thin; }
.rail .card { flex: 0 0 260px; flex-direction: column; scroll-snap-align: start; }
.rail .card-img { width: 100%; aspect-ratio: 16 / 10; }
@media (min-width: 640px) {
  .grid .card { flex-direction: column; }
  .grid .card-img { width: 100%; aspect-ratio: 16 / 10; }
}

.badge-feat, .badge-ex {
  position: absolute; top: 8px; left: 8px; display: inline-flex; align-items: center; gap: 4px;
  font-size: .72rem; font-weight: 700; padding: 3px 8px; border-radius: 999px;
}
.badge-feat { background: var(--accent); color: #fff; }
.badge-feat .ic { width: 12px; height: 12px; }
.badge-ex { top: auto; bottom: 8px; background: rgba(0,0,0,.6); color: #fff; }
.badge-feat.inline, .badge-ex.inline { position: static; }
.badge-ex.inline { background: var(--line); color: var(--muted); }

.empty { text-align: center; color: var(--muted); padding: 30px 10px; }

/* ---------- category page ---------- */
.page-head { margin-top: 12px; }
.page-title { display: flex; align-items: center; gap: 12px; margin: 8px 0 14px; }
.page-title .cat-ic { width: 52px; height: 52px; border-radius: 14px; }
.page-title .cat-ic .ic { width: 26px; height: 26px; }
.page-title h1 { font-size: 1.5rem; }
.page-title p { margin: 2px 0 0; }
.backlink { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: .95rem; padding: 6px 0; }

/* ---------- business page ---------- */
.biz { max-width: 760px; margin: 0 auto; padding-top: 6px; }
.gal-wrap { position: relative; margin: 6px -16px 0; }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: #000; }
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: 0 0 100%; width: 100%; aspect-ratio: 4 / 3; height: auto; object-fit: cover; scroll-snap-align: center; }
.gal-count { position: absolute; right: 12px; bottom: 12px; background: rgba(0,0,0,.6); color: #fff; font-size: .8rem; padding: 3px 10px; border-radius: 999px; }
.gallery-ph { display: grid; place-items: center; aspect-ratio: 16 / 7; }
.gallery-ph .ic { width: 56px; height: 56px; opacity: .8; }
@media (min-width: 640px) {
  .gal-wrap { margin: 6px 0 0; }
  .gallery, .gallery-ph { border-radius: var(--radius); }
}
.biz-head { margin-top: 16px; }
.biz-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.biz-head h1 { font-size: clamp(1.6rem, 6vw, 2.2rem); margin-top: 6px; letter-spacing: -.01em; }
.biz-head .tag { margin: 6px 0 0; color: var(--muted); font-size: 1.05rem; }
.biz-head .meta { font-size: .95rem; margin-top: 8px; }

.actions { display: grid; gap: 8px; margin-top: 16px; grid-template-columns: repeat(4, 1fr); }
.actions.n1 { grid-template-columns: 1fr; }
.actions.n2 { grid-template-columns: repeat(2, 1fr); }
.actions.n3 { grid-template-columns: repeat(3, 1fr); }
.act {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 4px;
  text-decoration: none; font-size: .85rem; font-weight: 600;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; color: var(--brand-2);
}
.act .ic { width: 22px; height: 22px; }
.act-wa { background: var(--wa); border-color: var(--wa); color: #fff; }

.box { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; box-shadow: var(--shadow); }
.box p { margin: 10px 0 0; }
.hours { width: 100%; border-collapse: collapse; margin-top: 8px; }
.hours th, .hours td { text-align: left; padding: 7px 0; border-bottom: 1px solid var(--line); font-weight: 400; }
.hours tr:last-child th, .hours tr:last-child td { border-bottom: 0; }
.hours td { text-align: right; }
.hours tr.today { font-weight: 700; color: var(--brand-2); }
.hours tr.today th { font-weight: 700; }
.contact { list-style: none; margin: 8px 0 0; padding: 0; }
.contact li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.contact li:last-child { border-bottom: 0; }
.contact .ic { color: var(--brand-2); }
.contact a { text-decoration: none; word-break: break-word; }

.owner { text-align: center; color: var(--muted); padding: 8px 0; }
.owner p { margin: 0 0 10px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 18px; border-radius: 12px; font-weight: 600; text-decoration: none;
  background: var(--brand-2); color: #fff; border: 1px solid transparent;
}
.btn-wa { background: var(--wa); }
.btn-ghost { background: transparent; color: var(--brand-2); border-color: var(--line); }

/* ---------- footer ---------- */
.foot { max-width: 1100px; margin: 20px auto 0; padding: 0 16px 28px; }
.list-cta {
  background: var(--brand); color: #fff; border-radius: var(--radius); padding: 22px 18px; text-align: center;
}
.list-cta h2 { justify-content: center; font-size: 1.25rem; }
.list-cta p { margin: 8px 0 16px; opacity: .85; }
.foot > .small { text-align: center; color: var(--muted); margin-top: 18px; }

.notfound { text-align: center; padding: 60px 0; }
.notfound h1 { font-size: 3rem; color: var(--accent); }
.notfound p { margin: 8px 0 20px; color: var(--muted); }

/* phones: icon above the name so long names never break mid-word */
@media (max-width: 639px) {
  .cat-tile { position: relative; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px; }
  .cat-tile .cat-name { overflow-wrap: normal; hyphens: manual; }
  .cat-tile small { position: absolute; top: 10px; right: 12px; }
}

/* private preview of a page that is not public yet */
.preview-banner { background: #fff1c7; color: #5c4300; text-align: center; font-weight: 600; font-size: .92rem; padding: 10px 16px; }
