/* נוהל סופ״ש — trail-sign identity: sand page, pine ink, blaze orange, hand-painted trail markers. */
:root {
  --sand: #f4e8d0;
  --sand-2: #eadbbd;
  --card: #fbf4e6;
  --pine: #1d3b2a;
  --pine-2: #536656;
  --blaze: #d9581c;
  --on-blaze: #fffaf2;
  --paint: #fbf7ee;
  --rock: #cbbd9c;
  --line: rgb(29 59 42 / 0.14);
  --shadow: 0 1px 0 rgb(29 59 42 / 0.05), 0 10px 28px -16px rgb(29 59 42 / 0.35);
  --display: 'Rubik Dirt', 'IBM Plex Sans Hebrew', system-ui, sans-serif;
  --body: 'IBM Plex Sans Hebrew', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', monospace;
  --tabbar: 64px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --sand: #101912;
    --sand-2: #17231b;
    --card: #1b2a20;
    --pine: #efe3ca;
    --pine-2: #a7b5a4;
    --blaze: #e8692c;
    --on-blaze: #1a0d05;
    --paint: #f1e9da;
    --rock: #2f4135;
    --line: rgb(239 227 202 / 0.13);
    --shadow: 0 1px 0 rgb(0 0 0 / 0.3), 0 12px 30px -16px rgb(0 0 0 / 0.8);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--sand);
  color: var(--pine);
  font: 400 16px/1.55 var(--body);
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--blaze); outline-offset: 2px; border-radius: 6px; }
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.wrap {
  max-width: 560px;
  margin: 0 auto;
  padding: calc(env(safe-area-inset-top) + 20px) 16px calc(env(safe-area-inset-bottom) + 32px);
}
body.has-tabs .wrap { padding-bottom: calc(env(safe-area-inset-bottom) + var(--tabbar) + 32px); }

/* ---------- type ---------- */
.wordmark, .section-title, .page-title, .slide-title {
  font-family: var(--display);
  font-weight: 400;
  letter-spacing: 0;
  margin: 0;
  line-height: 1;
}
.wordmark { font-size: clamp(56px, 18vw, 84px); }
.section-title { font-size: 30px; margin: 40px 0 14px; }
.page-title { font-size: 34px; margin: 8px 0 18px; }
.lede { font-size: 18px; color: var(--pine-2); margin: 14px auto 0; max-width: 30ch; }
.muted { color: var(--pine-2); }
.num { font-family: var(--mono); font-weight: 500; direction: ltr; unicode-bidi: isolate; }

/* ---------- the blaze: a painted trail marker, white / colour / white ---------- */
.blaze { display: block; width: 22px; height: 28px; }
.blaze .p { fill: var(--paint); }
.chip {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: var(--rock);
  display: grid;
  place-items: center;
}
/* trail markers are painted on rocks: the blaze always sits on one */
.rock {
  display: grid;
  place-items: center;
  width: 168px;
  height: 156px;
  background: var(--rock);
  border-radius: 46% 54% 52% 48% / 56% 44% 56% 44%;
  box-shadow: inset 0 -12px 0 rgb(0 0 0 / 0.07);
}
.rock.sm { width: 58px; height: 52px; margin: 0 auto; box-shadow: inset 0 -6px 0 rgb(0 0 0 / 0.07); }
.divider { margin: 28px 0 0; }

/* ---------- hero ---------- */
.hero { text-align: center; padding-top: 8px; }
.badge { width: 132px; height: auto; aspect-ratio: 1; margin: 0 auto 18px; border-radius: 50%; box-shadow: var(--shadow); }
.badge.sm { width: 40px; height: 40px; margin: 0; box-shadow: none; }
.hero-actions { display: grid; gap: 10px; margin-top: 22px; }

/* ---------- buttons, links, fields ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--pine);
  color: var(--sand);
  font: 700 17px/1 var(--body);
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.15s ease;
}
.btn:active { transform: scale(0.98); }
.btn[disabled] { opacity: 0.45; cursor: default; transform: none; }
.btn.accent { background: var(--blaze); color: var(--on-blaze); }
.btn.ghost { background: transparent; color: var(--pine); box-shadow: inset 0 0 0 1.5px var(--line); }
.btn.wide { width: 100%; }
.link {
  background: none;
  border: 0;
  padding: 6px 2px;
  color: var(--pine);
  font: 500 15px/1.4 var(--body);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.link[disabled] { color: var(--pine-2); text-decoration: none; cursor: default; }

label { display: grid; gap: 6px; font-weight: 500; }
label small { font-weight: 400; color: var(--pine-2); }
input, textarea, select {
  width: 100%;
  min-height: 52px;
  padding: 12px 16px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--pine);
  font: 400 17px/1.4 var(--body);
}
textarea { min-height: 120px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--blaze); box-shadow: 0 0 0 3px rgb(217 88 28 / 0.22); }
input[type='tel'], .code-input { direction: ltr; text-align: right; font-family: var(--mono); font-weight: 500; }
.code-input { text-align: center; font-size: 28px; letter-spacing: 0.35em; padding-inline-start: 0.35em; }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 400; }
.check input { width: 22px; min-height: 22px; height: 22px; margin-top: 2px; accent-color: var(--blaze); flex: none; }
.form { display: grid; gap: 16px; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; margin-bottom: 8px; font-weight: 500; }
legend small { font-weight: 400; color: var(--pine-2); }
.choices { display: grid; gap: 8px; }
.choices.two { grid-template-columns: 1fr 1fr; }
.choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 14px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  font-weight: 400;
  cursor: pointer;
}
.choice input[type='radio'], .choice input[type='checkbox'] {
  width: 20px; height: 20px; min-height: 0; padding: 0; margin: 0; flex: none; accent-color: var(--blaze);
}
.choice:has(input:checked) { border-color: var(--blaze); background: color-mix(in srgb, var(--blaze) 9%, var(--card)); }
.choice.other input[type='text'] { min-height: 38px; padding: 6px 10px; flex: 1; }
.consents { display: grid; gap: 12px; }
.consents .check span { font-size: 15px; }
.missing { outline: 2.5px solid var(--blaze); outline-offset: 6px; border-radius: 14px; }
.form-msg { margin: 0; min-height: 1.4em; color: var(--blaze); font-weight: 500; }
.form-msg.ok { color: var(--pine); }
.row { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.panel {
  background: var(--card);
  border-radius: 24px;
  padding: 22px 18px;
  box-shadow: var(--shadow);
  margin-top: 40px;
}
.panel .section-title { margin-top: 0; }
.timer { margin: -6px 0 0; color: var(--pine-2); font-size: 14px; text-align: center; }
.ts { min-height: 0; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 5px; border-radius: 16px; background: var(--sand-2); }
.segmented label { display: block; }
.segmented input { position: absolute; opacity: 0; width: 1px; min-height: 0; height: 1px; }
.segmented span { display: block; padding: 11px; border-radius: 12px; text-align: center; font-weight: 700; cursor: pointer; }
.segmented input:checked + span { background: var(--card); box-shadow: var(--shadow); }
.segmented input:focus-visible + span { outline: 3px solid var(--blaze); }

/* ---------- groups ---------- */
.groups { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.group {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: var(--card);
  border-radius: 18px;
}
.group .g-text { flex: 1; min-width: 0; }
.group b { display: block; font-size: 17px; }
.group small { display: block; color: var(--pine-2); font-size: 14px; line-height: 1.35; }
.g-act { flex: none; font-weight: 700; font-size: 15px; padding: 10px 14px; border-radius: 999px; background: var(--sand-2); text-decoration: none; }
.g-lock { flex: none; font-size: 13px; color: var(--pine-2); text-align: center; line-height: 1.2; }
.gated-cta { margin: 14px 0 0; text-align: center; color: var(--pine-2); }

/* ---------- member top bar and tabs ---------- */
.topbar { display: flex; align-items: center; gap: 12px; }
.topbar .hello { flex: 1; margin: 0; font-size: 17px; }
.icon-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  background: var(--card);
  color: var(--pine);
  cursor: pointer;
  box-shadow: var(--shadow);
}
.icon-btn svg { width: 22px; height: 22px; }
.icon-btn.on { background: var(--pine); color: var(--sand); }
.tabbar {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 6px 8px calc(env(safe-area-inset-bottom) + 6px);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.tabbar button {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 2px;
  min-height: 52px;
  padding: 8px 0 4px;
  border: 0;
  background: none;
  color: var(--pine-2);
  font: 500 13px/1 var(--body);
  cursor: pointer;
}
.tabbar svg { width: 24px; height: 24px; }
.tabbar button[aria-current='page'] { color: var(--pine); font-weight: 700; }
.tabbar button[aria-current='page']::before {
  content: '';
  position: absolute;
  top: 0;
  width: 28px;
  height: 4px;
  border-radius: 2px;
  background: var(--blaze);
}

/* ---------- events ---------- */
.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.event {
  background: var(--card);
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow);
  scroll-margin-top: 16px;
}
.event.flash { animation: flash 1.6s ease; }
@keyframes flash { 0%, 40% { box-shadow: 0 0 0 4px var(--blaze); } }
.ev-img { width: 100%; max-height: 420px; object-fit: cover; background: var(--sand-2); }
.ev-head { display: flex; gap: 14px; padding: 16px 16px 0; align-items: stretch; }
.ev-date {
  flex: none;
  width: 76px;
  border-radius: 14px;
  background: var(--pine);
  color: var(--sand);
  display: grid;
  place-content: center;
  text-align: center;
  padding: 8px 4px;
  line-height: 1.15;
}
.ev-dow { font-size: 13px; font-weight: 700; }
.ev-dm { font-size: 22px; }
.ev-time { font-size: 13px; opacity: 0.85; }
.ev-main { min-width: 0; align-self: center; }
.ev-title { margin: 0 0 4px; font-size: 21px; line-height: 1.25; font-weight: 700; }
.ev-loc { display: inline-flex; gap: 6px; align-items: center; color: var(--pine-2); text-decoration: none; font-weight: 500; }
.ev-loc span { text-decoration: underline; text-underline-offset: 3px; }
.ev-desc { margin: 14px 16px 0; white-space: pre-line; overflow-wrap: anywhere; }
.ev-desc.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ev-more { margin: 2px 16px 0; }
.ev-foot { padding: 14px 16px 16px; display: grid; gap: 12px; }
.meter { display: block; width: 100%; height: 14px; }
.meter .track { fill: var(--rock); }
.meter .fill { fill: var(--blaze); }
.ev-count { margin: 0; font-size: 15px; color: var(--pine-2); }
.ev-count b { color: var(--pine); }
.btn.going { background: transparent; color: var(--pine); box-shadow: inset 0 0 0 2px var(--pine); }
.empty { text-align: center; padding: 40px 20px; color: var(--pine-2); }
.empty .rock { margin-bottom: 14px; }

/* ---------- footer, toast ---------- */
.foot { margin-top: 36px; display: flex; justify-content: center; gap: 6px; align-items: center; color: var(--pine-2); }
.toast {
  position: fixed;
  inset-inline: 16px;
  bottom: calc(env(safe-area-inset-bottom) + 84px);
  z-index: 40;
  max-width: 520px;
  margin: 0 auto;
  padding: 14px 18px;
  border-radius: 16px;
  background: var(--pine);
  color: var(--sand);
  font-weight: 500;
  text-align: center;
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.toast.show { opacity: 1; transform: none; }

/* ---------- onboarding: full screen, one idea per slide ---------- */
.onb {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--sand);
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: calc(env(safe-area-inset-top) + 12px) 20px calc(env(safe-area-inset-bottom) + 20px);
}
.onb-top { display: flex; justify-content: flex-end; min-height: 44px; }
.onb-stage { position: relative; overflow: hidden; display: grid; }
.slide {
  grid-area: 1 / 1;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  gap: 18px;
  padding: 8px 4px;
  transition: transform 0.45s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.35s ease;
}
/* RTL: the next slide waits on the left, finished ones leave to the right */
.slide.before { transform: translateX(-40%); opacity: 0; pointer-events: none; }
.slide.after { transform: translateX(40%); opacity: 0; pointer-events: none; }
.hero-blaze { width: 70px; height: 90px; }
.slide-art { width: min(58vw, 260px); height: auto; aspect-ratio: 1; border-radius: 50%; box-shadow: var(--shadow); }
.slide-title { font-size: clamp(34px, 10vw, 46px); max-width: 12ch; }
.slide-text { margin: 0; font-size: 18px; color: var(--pine-2); max-width: 30ch; }
.art-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; width: min(76vw, 300px); }
.art-grid img { width: 100%; height: auto; aspect-ratio: 1; border-radius: 50%; box-shadow: var(--shadow); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; width: min(100%, 360px); text-align: start; }
.steps li { display: flex; gap: 14px; align-items: center; background: var(--card); border-radius: 16px; padding: 12px 14px; }
.steps .chip { width: 42px; height: 42px; border-radius: 12px; background: var(--sand-2); color: var(--pine); }
.steps svg { width: 24px; height: 24px; }
.steps b { display: block; }
.steps small { color: var(--pine-2); }
.onb-bottom { display: grid; gap: 14px; justify-items: center; }
.onb-bottom .btn { width: min(100%, 420px); }
.progress { display: flex; gap: 10px; direction: rtl; }
.progress .blaze { width: 14px; height: 18px; opacity: 0.35; transition: opacity 0.2s ease; }
.progress .blaze .m { fill: var(--rock); }
.progress .blaze.done { opacity: 1; }
.progress .blaze.done .m { fill: var(--pine); }
.progress .blaze.now { opacity: 1; }
.progress .blaze.now .m { fill: var(--blaze); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
@media (min-width: 720px) {
  .hero-actions { grid-template-columns: 1fr 1fr; }
}

/* ---------- about page ---------- */
.about section > p { font-size: 17px; margin: 0 0 12px; }
.steps.how { width: 100%; counter-reset: step; }
.steps.how li { display: block; position: relative; padding-inline-start: 56px; }
.steps.how li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  inset-inline-start: 14px;
  top: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--pine);
  color: var(--sand);
  font: 500 15px/1 var(--mono);
}
.steps.how small { display: block; margin-top: 2px; }
.plain { margin: 0; padding-inline-start: 0; list-style: none; display: grid; gap: 10px; }
.about .hero-actions { margin-top: 32px; }

/* ---------- gallery: accordion, one panel open in colour, the rest narrow and grey ---------- */
.gallery { display: flex; gap: 8px; height: 380px; }
.gallery figure {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  margin: 0;
  border-radius: 18px;
  overflow: hidden;
  cursor: pointer;
  transition: flex-grow 0.7s cubic-bezier(0.2, 0.75, 0.2, 1);
}
.gallery figure.on { flex-grow: 6; }
.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) brightness(0.85);
  transform: scale(1.06);
  transition: filter 0.7s ease, transform 0.7s ease;
}
.gallery figure.on img { filter: none; transform: none; }
@media (min-width: 640px) { .gallery { height: 460px; gap: 10px; } }

/* ---------- event extras, back link, logout dialog ---------- */
.badges { display: flex; gap: 6px; flex-wrap: wrap; }
.tag { padding: 4px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; }
.tag.soon { background: var(--pine); color: var(--sand); }
.tag.few { background: color-mix(in srgb, var(--blaze) 18%, var(--card)); color: var(--blaze); }
.tag.full { background: var(--sand-2); color: var(--pine-2); }
.ev-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.btn.small { min-height: 42px; padding: 0 16px; font-size: 15px; flex: 1; }
.admin-act { justify-self: start; font-size: 14px; }
.back { display: inline-block; margin-bottom: 4px; text-decoration: none; font-weight: 700; }
.dialog {
  max-width: min(92vw, 400px);
  border: 0;
  border-radius: 24px;
  padding: 24px 20px;
  background: var(--card);
  color: var(--pine);
  box-shadow: var(--shadow);
}
.dialog::backdrop { background: rgb(0 0 0 / 0.45); }
.dialog .section-title { margin-top: 0; }
.dialog .row { justify-content: stretch; }
.dialog .row .btn { flex: 1; }
/* the "טיול / בילוי" switch: the chosen side is clearly filled */
.segmented input:checked + span { background: var(--blaze); color: var(--on-blaze); box-shadow: none; }

/* ---------- event heading line, admin panel ---------- */
.ev-head { display: grid; gap: 4px; }
.ev-when { margin: 0; font-weight: 700; color: var(--blaze); font-size: 16px; }
.topbar .badge.sm { flex: none; width: 40px; height: 40px; }
.admin { border-top: 1px dashed var(--line); padding-top: 10px; }
.admin summary { cursor: pointer; font-weight: 700; color: var(--pine-2); }
.admin-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.btn.danger { color: var(--blaze); box-shadow: inset 0 0 0 1.5px var(--blaze); }
.attendees { display: grid; gap: 8px; margin-top: 10px; }
.attendee-list { font-size: 15px; gap: 4px; }
.attendee-list a { font-family: var(--mono); direction: ltr; unicode-bidi: isolate; }
.small-note { font-size: 13px; margin: 8px 0 0; }

/* ---------- admin members tab ---------- */
.tabbar.four { grid-template-columns: repeat(4, 1fr); }
.search { margin: 28px 0 8px; }
.member.removed { opacity: 0.55; }
.member small.num { direction: ltr; text-align: end; }
.danger-text { color: var(--blaze); }

/* ---------- follow us: quiet but visible ---------- */
.social { display: flex; justify-content: center; gap: 14px; margin-top: 32px; }
.social a {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--pine-2);
  box-shadow: inset 0 0 0 1.5px var(--line);
  transition: color 0.15s ease, box-shadow 0.15s ease;
}
.social a:hover, .social a:focus-visible { color: var(--blaze); box-shadow: inset 0 0 0 1.5px var(--blaze); }
.social svg { width: 20px; height: 20px; }
.social + .foot { margin-top: 14px; }
