/* Ani Matziah – warm Judean-stone palette, mobile first, LTR + RTL via logical properties. */
:root {
  --bg: #f7f2e8; --paper: #fffdf8; --ink: #1f2a2e; --ink-2: #4a5559; --mut: #7b8386;
  --line: #e6dccb; --brand: #24343a; --gold: #c9a45c; --gold-2: #a8843f;
  --call: #24343a; --wa: #1f9d55; --radius: 16px;
  --shadow: 0 1px 2px rgba(40,30,10,.05), 0 8px 24px rgba(40,30,10,.07);
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans Hebrew', Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); overflow-x: clip; }
a { color: var(--brand); }
img, svg { max-width: 100%; }

/* header */
.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 10px 16px; background: rgba(247,242,232,.92); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand span { display: flex; flex-direction: column; line-height: 1.1; }
.brand b { font-size: 1.1rem; letter-spacing: .01em; }
.brand small { color: var(--mut); font-size: .78rem; }
.top nav { display: flex; align-items: center; gap: 8px; }
.lang { font-size: .9rem; text-decoration: none; padding: 8px 10px; border-radius: 10px; }
.lang:hover { background: var(--line); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px;
  padding: 0 14px; border-radius: 12px; font-weight: 600; font-size: .95rem; text-decoration: none;
  border: 0; cursor: pointer; white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn.join { background: var(--gold); color: #1f1a10; }
.btn.join:hover { background: var(--gold-2); color: #fff; }
.btn.big { min-height: 52px; padding: 0 26px; font-size: 1.05rem; }
.btn.call { background: var(--call); color: #fff; }
.btn.wa { background: var(--wa); color: #fff; }
.btn.ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--brand); }
.btn:focus-visible, .chip:focus-visible, input:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* hero: Gush Etzion photo (small WebP per screen size) under a dark gradient */
main { max-width: 1180px; margin: 0 auto; padding: 0 16px 48px; }
.hero {
  position: relative; color: #fff; text-align: center; padding: 56px 16px 64px;
  background: #3b3326 url(/assets/hero-800.webp) center 35% / cover no-repeat;
}
@media (min-width: 801px) { .hero { background-image: url(/assets/hero-1600.webp); padding: 92px 16px 104px; } }
.hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,24,26,.55) 0%, rgba(20,24,26,.35) 45%, rgba(20,24,26,.65) 100%); }
.hero-in { position: relative; max-width: 760px; margin: 0 auto; }
.eyebrow { margin: 0 0 8px; color: #f0d79d; font-weight: 700; letter-spacing: .08em; font-size: .85rem; text-transform: uppercase; }
.hero h1 { margin: 0; font-size: clamp(1.8rem, 5.5vw, 3rem); line-height: 1.12; letter-spacing: -.01em; text-shadow: 0 2px 18px rgba(0,0,0,.35); }
.sub { color: var(--ink-2); margin: 10px auto 0; max-width: 40em; }
.hero .sub { color: #f2ede4; font-size: 1.05rem; text-shadow: 0 1px 10px rgba(0,0,0,.4); }
.searchbar {
  display: flex; align-items: center; gap: 10px; max-width: 560px; margin: 26px auto 0; padding: 0 16px; color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 999px; box-shadow: var(--shadow);
}
.searchbar input { flex: 1; min-width: 0; height: 52px; border: 0; background: transparent; font: inherit; font-size: 1.05rem; color: var(--ink); }
.searchbar input:focus { outline: none; }
.searchbar:focus-within { border-color: var(--gold); }

/* trade chips: one swipeable row on phones, wrapping on desktop */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 16px 2px 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.chips::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .chips { flex-wrap: wrap; justify-content: center; overflow: visible; } }
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink);
  font: inherit; font-size: .92rem; cursor: pointer;
}
.chip i { font-style: normal; }
.chip span { color: var(--mut); font-size: .82rem; }
.chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.chip.on span { color: #cfd8da; }
.count { color: var(--mut); font-size: .88rem; margin: 6px 2px 12px; min-height: 1.3em; }

/* tiles */
.grid { display: grid; grid-template-columns: 1fr; gap: 14px; }
@media (min-width: 620px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 980px) { .grid { grid-template-columns: repeat(3, 1fr); } }
.tile {
  --h: 30; display: flex; flex-direction: column; gap: 10px; padding: 16px; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 0;
  border-top: 4px solid hsl(var(--h) 45% 55%);
}
.tile-top { display: flex; gap: 12px; align-items: center; }
.avatar {
  position: relative; flex: none; width: 56px; height: 56px; border-radius: 50%;
  display: grid; place-items: center; font-weight: 700; font-size: 1.15rem; letter-spacing: .02em;
  background: hsl(var(--h) 55% 90%); color: hsl(var(--h) 45% 28%);
}
.avatar i { position: absolute; inset-block-end: -4px; inset-inline-end: -6px; font-style: normal; font-size: .95rem;
  background: var(--paper); border-radius: 50%; width: 26px; height: 26px; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0,0,0,.15); }
.who { min-width: 0; }
.who h3 { margin: 0; font-size: 1.08rem; line-height: 1.25; overflow-wrap: anywhere; }
.who .alt { margin: 1px 0 0; color: var(--mut); font-size: .85rem; }
.who .trades { margin: 3px 0 0; color: hsl(var(--h) 40% 32%); font-size: .9rem; font-weight: 600; }
.desc { margin: 0; color: var(--ink-2); font-size: .93rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta { margin: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; color: var(--mut); font-size: .86rem; }
.meta a { color: var(--ink-2); text-decoration: none; }
.site { font-size: .86rem; overflow-wrap: anywhere; }
.actions { display: flex; gap: 8px; margin-top: auto; padding-top: 4px; }
.actions .btn { flex: 1; }

/* premium listings + demo, sponsor slot */
.tile { position: relative; }
.tile.premium { border: 2px solid var(--gold); border-top-width: 4px; background: linear-gradient(180deg, #fff8e8, var(--paper) 60%); }
.badge { position: absolute; inset-block-start: -12px; inset-inline-end: 14px; background: var(--gold); color: #1f1a10; font-weight: 700; font-size: .78rem; padding: 3px 10px; border-radius: 999px; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.avatar.gold { background: #f3e2b8; color: var(--gold-2); font-size: 1.5rem; }
.sponsor {
  grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px;
  padding: 20px; border-radius: var(--radius); background: repeating-linear-gradient(135deg, #efe6d3 0 14px, #f5eedf 14px 28px);
  border: 1.5px dashed var(--gold-2);
}
.sponsor .tag { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--gold-2); width: 100%; }
.sponsor p { margin: 0; font-size: 1.05rem; font-weight: 600; flex: 1 1 260px; }

.empty { text-align: center; color: var(--mut); padding: 30px 0; }
.cta { text-align: center; margin-top: 40px; padding: 28px 16px; background: var(--brand); color: #fff; border-radius: var(--radius); }
.cta h2 { margin: 0 0 14px; font-size: 1.3rem; }
.foot { text-align: center; color: var(--mut); font-size: .88rem; padding: 24px 16px 40px; border-top: 1px solid var(--line); }
.foot a { color: var(--ink-2); }

/* join form */
.narrow { max-width: 620px; }
.narrow h1 { margin: 8px 0 0; }
.join-form { display: grid; gap: 14px; margin-top: 20px; }
.join-form label { display: grid; gap: 6px; font-weight: 600; font-size: .95rem; }
.join-form input, .join-form select, .join-form textarea {
  font: inherit; font-weight: 400; padding: 12px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); width: 100%;
}
.join-form fieldset { border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 14px; display: flex; flex-wrap: wrap; gap: 6px 18px; }
.join-form legend { font-weight: 600; padding: 0 6px; }
.join-form .check { display: inline-flex; align-items: center; gap: 6px; font-weight: 400; }
.join-form .check input { width: auto; }
.note { color: var(--gold-2); font-weight: 600; margin: 0; }

[hidden] { display: none !important; }

/* join form extras */
.hp { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.err { background: #fde8e6; color: #8a1f12; padding: 10px 14px; border-radius: 12px; font-weight: 600; }
.cf-turnstile { min-height: 65px; }

/* admin */
.admin main { max-width: 1100px; padding-top: 18px; }
.admin .who { color: var(--mut); font-size: .85rem; }
.adm-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.adm-bar input { flex: 1 1 220px; min-height: 44px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: 12px; font: inherit; background: var(--paper); }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; }
.tabs button { min-height: 40px; padding: 0 12px; border: 1.5px solid var(--line); border-radius: 999px; background: var(--paper); font: inherit; cursor: pointer; }
.tabs button.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.tabs span { opacity: .7; font-size: .85em; }
.adm-list { display: grid; gap: 8px; }
.adm-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.adm-row.prem { border-color: var(--gold); }
.adm-main { min-width: 0; flex: 1 1 320px; }
.adm-main .he { color: var(--mut); }
.sub2 { color: var(--mut); font-size: .86rem; overflow-wrap: anywhere; }
.sub2.d { color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.adm-btns { display: flex; gap: 6px; }
dialog { width: min(760px, calc(100vw - 24px)); max-height: calc(100vh - 24px); border: 0; border-radius: 16px; padding: 20px; background: var(--bg); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
dialog::backdrop { background: rgba(20,24,26,.5); }
dialog h2 { margin: 0; }
.two { display: grid; gap: 12px; }
@media (min-width: 640px) { .two { grid-template-columns: 1fr 1fr; } }
.checks { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.dlg-actions { display: flex; gap: 8px; align-items: center; position: sticky; bottom: -20px; background: var(--bg); padding: 10px 0; }
.dlg-actions .spacer { flex: 1; }
.btn.danger { color: #a3261a; border-color: #a3261a; }

/* trade colours (generated from TRADES in functions/_lib/site.js; inline styles are blocked by the CSP) */
.t-handyman { --h: 28; }
.t-electrician { --h: 45; }
.t-painter { --h: 330; }
.t-gardener { --h: 110; }
.t-carpenter { --h: 20; }
.t-plumber { --h: 205; }
.t-contractor { --h: 0; }
.t-stonework { --h: 35; }
.t-locksmith { --h: 260; }
.t-computers { --h: 220; }
.t-appliances { --h: 190; }
.t-architect { --h: 240; }
.t-aluminium { --h: 200; }
.t-interior { --h: 300; }
.t-mechanic { --h: 355; }
.t-aircon { --h: 195; }
.t-cleaning { --h: 170; }
.t-sealing { --h: 210; }
.t-transport { --h: 15; }
.t-gas { --h: 10; }
.t-pest { --h: 80; }
.t-other { --h: 50; }
/* end trade colours */
