/* איפה פנוי — לוח של סייר: ירוק אורן, חול, וכתום של חג */
:root {
  --bg: #f3f4ef; --surface: #ffffff; --fg: #1f2a24; --muted: #56625a; --line: #d6dbd0;
  --pine: #2f6b4f; --pine-soft: #dcebe2; --pine-ink: #1d4a35; --on-pine: #ffffff;
  --sand: #e7e6dd; --sand-ink: #6f6f62; --holiday: #a85a14; --hol-soft: #fbeedd;
  --warn: #b3261e; --warn-soft: #fbe3e0; --rain: #2f5f8f; --focus: #1a5fb4;
  --display: "Secular One", "IBM Plex Sans Hebrew", system-ui, sans-serif;
  --body: "IBM Plex Sans Hebrew", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --radius: 12px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131915; --surface: #1b231f; --fg: #e6ebe7; --muted: #a3aea7; --line: #2e3933;
    --pine: #74c39a; --pine-soft: #1f3a2d; --pine-ink: #c3ead4; --on-pine: #0d1f16;
    --sand: #222925; --sand-ink: #8c968f; --holiday: #e7a565; --hol-soft: #3a2c1c;
    --warn: #ff8a80; --warn-soft: #3d1f1c; --rain: #8bb8e6; --focus: #8ab4f8;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131915; --surface: #1b231f; --fg: #e6ebe7; --muted: #a3aea7; --line: #2e3933;
  --pine: #74c39a; --pine-soft: #1f3a2d; --pine-ink: #c3ead4; --on-pine: #0d1f16;
  --sand: #222925; --sand-ink: #8c968f; --holiday: #e7a565; --hol-soft: #3a2c1c;
  --warn: #ff8a80; --warn-soft: #3d1f1c; --rain: #8bb8e6; --focus: #8ab4f8;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font-family: var(--body); font-size: 16px; line-height: 1.55; }
a { color: var(--pine-ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.wrap { max-width: 1180px; margin: 0 auto; padding-inline: 16px; }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; background: var(--pine); color: var(--on-pine); padding: 8px 14px; border-radius: 8px; z-index: 2000; }
.skip:focus { top: 8px; }
[hidden] { display: none !important; }

/* כותרת */
.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 10px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); font-family: var(--display); font-size: 1.45rem; }
.top nav { display: flex; gap: 16px; font-size: .95rem; }

main.wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; padding-block: 22px 40px; }
.hero h1 { font-family: var(--display); font-weight: 400; font-size: clamp(1.6rem, 4.5vw, 2.4rem); line-height: 1.15; margin: 0 0 6px; text-wrap: balance; }
.sub { color: var(--muted); margin: 0; max-width: 60ch; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }

/* טופס */
.search { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px 14px; align-items: end; }
.field { display: grid; gap: 4px; }
.field label { font-size: .85rem; font-weight: 600; color: var(--muted); }
.field small { font-weight: 400; }
input[type=date], input[type=number], select {
  font: inherit; color: var(--fg); background: var(--bg); border: 1px solid var(--line); border-radius: 8px;
  padding: 8px 10px; min-height: 44px; width: 100%;
}
.filters { grid-column: 1 / -1; border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.filters legend { font-size: .85rem; font-weight: 600; color: var(--muted); margin-bottom: 6px; padding: 0; }
.filters label { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; min-height: 40px; border: 1px solid var(--line); border-radius: 999px; cursor: pointer; background: var(--bg); font-size: .92rem; user-select: none; }
.filters input { accent-color: var(--pine); width: 18px; height: 18px; margin: 0; }
.filters label:has(input:checked) { background: var(--pine-soft); border-color: var(--pine); color: var(--pine-ink); font-weight: 600; }

/* סרגל */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.seg button { font: inherit; border: 0; background: transparent; color: var(--fg); padding: 8px 14px; min-height: 42px; cursor: pointer; }
.seg button + button { border-inline-start: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--pine); color: var(--on-pine); font-weight: 600; }
.locbtn { font: inherit; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; min-height: 42px; padding: 8px 14px; border: 1px solid var(--pine); border-radius: 10px; background: var(--pine-soft); color: var(--pine-ink); cursor: pointer; }
.locbtn:hover { filter: brightness(1.05); }
.sortbox { display: flex; align-items: center; gap: 8px; }
.sortbox label { font-size: .9rem; color: var(--muted); }
.sortbox select { width: auto; }
.count { margin: 0; color: var(--muted); font-size: .92rem; margin-inline-start: auto; }
.hint { margin: 0; color: var(--muted); font-size: .92rem; }
.notice { margin: 0; padding: 10px 14px; border-radius: 10px; background: var(--hol-soft); color: var(--fg); border: 1px solid var(--line); }

/* רשימה + מפה */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: 16px; align-items: start; }
.mapbox { position: sticky; top: 12px; }
#map { height: calc(100vh - 40px); max-height: 720px; min-height: 360px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--sand); }
.cards { display: grid; gap: 12px; }
.empty { padding: 24px; text-align: center; color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: grid; gap: 10px; scroll-margin-top: 12px; }
.card.hl { border-color: var(--pine); box-shadow: 0 0 0 2px var(--pine-soft); }
.card-head { display: flex; justify-content: space-between; align-items: start; gap: 10px; }
.card h3 { font-family: var(--display); font-weight: 400; font-size: 1.35rem; margin: 0; line-height: 1.2; }
.card .area { color: var(--muted); font-size: .88rem; }
.dist { font-size: .85rem; color: var(--pine-ink); background: var(--pine-soft); border-radius: 999px; padding: 2px 10px; white-space: nowrap; }
.facs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.facs li { font-size: .82rem; padding: 3px 9px; border-radius: 999px; background: var(--bg); border: 1px solid var(--line); }
.facs li.no { color: var(--sand-ink); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--sand-ink) 60%, transparent); }
.price { font-size: .92rem; }
.price b { font-variant-numeric: tabular-nums; }
.price .why { display: block; color: var(--muted); font-size: .8rem; }
.wx { display: grid; gap: 6px; }
.wx-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; font-size: .9rem; padding: 6px 10px; border-radius: 8px; background: var(--bg); }
.wx-row .d { font-weight: 600; min-width: 5.5em; }
.wx-row .t { font-variant-numeric: tabular-nums; }
.wx-row.warn { background: var(--warn-soft); }
.wx-row .w { color: var(--warn); font-weight: 600; }
.wx-none { font-size: .88rem; color: var(--muted); }
.card-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; font: inherit; font-weight: 600; text-decoration: none; background: var(--pine); color: var(--on-pine); border: 0; border-radius: 10px; padding: 10px 16px; min-height: 44px; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.link-sm { font-size: .88rem; }
.closed-note { font-size: .85rem; color: var(--holiday); font-weight: 600; }

/* מפה — חלון קופץ */
.leaflet-popup-content { font-family: var(--body); direction: rtl; text-align: right; margin: 10px 12px; }
.pop b { display: block; font-size: 1rem; }
.pop button { font: inherit; margin-top: 6px; background: var(--pine); color: #fff; border: 0; border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.pin { width: 22px; height: 22px; margin: 6px; border-radius: 50%; background: #2f6b4f; border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.4); }
.pin.dim { background: #9aa39d; }
.pin.hl { background: #a85a14; transform: scale(1.3); }

/* לוח שנה */
.calbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 10px; }
.customrange { display: flex; gap: 10px; flex-wrap: wrap; }
.customrange label { display: flex; align-items: center; gap: 6px; font-size: .9rem; }
.customrange input { width: auto; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .82rem; color: var(--muted); margin-bottom: 10px; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -1px; border: 1px solid var(--line); }
.sw-closed { background: repeating-linear-gradient(45deg, var(--sand), var(--sand) 3px, var(--surface) 3px, var(--surface) 6px); }
.sw-warn { background: var(--warn-soft); }
.sw-hol { background: var(--hol-soft); }
.calbox { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.cal { border-collapse: separate; border-spacing: 0; font-size: .85rem; min-width: 100%; }
.cal th, .cal td { border-bottom: 1px solid var(--line); border-inline-start: 1px solid var(--line); padding: 0; text-align: center; }
.cal thead th { position: sticky; top: 0; background: var(--surface); padding: 6px 4px; font-weight: 500; white-space: nowrap; z-index: 1; }
.cal thead th .dow { display: block; color: var(--muted); font-size: .75rem; }
.cal thead th .hn { display: block; color: var(--holiday); font-size: .7rem; font-weight: 600; max-width: 5.5em; white-space: normal; line-height: 1.15; margin: 0 auto; }
.cal th.we, .cal td.we { background: var(--hol-soft); }
.cal th.site { position: sticky; inset-inline-start: 0; background: var(--surface); text-align: right; padding: 6px 10px; font-weight: 600; white-space: nowrap; z-index: 2; border-inline-start: 0; }
.cal thead th.site { z-index: 3; }
.cal th.site small { display: block; font-weight: 400; color: var(--muted); font-size: .72rem; }
.cal td a { display: grid; place-items: center; gap: 0; min-width: 58px; min-height: 52px; padding: 4px 2px; text-decoration: none; color: var(--fg); line-height: 1.15; }
.cal td a:hover { background: var(--pine-soft); }
.cal td .ic { font-size: 1.05rem; }
.cal td .tt { font-variant-numeric: tabular-nums; font-size: .75rem; color: var(--muted); }
.cal td.warn { background: var(--warn-soft); }
.cal td.closed { background: repeating-linear-gradient(45deg, var(--sand), var(--sand) 4px, var(--surface) 4px, var(--surface) 8px); }
.cal td.closed .tt { color: var(--sand-ink); }

/* טוב לדעת + תחתית */
.tips h2 { font-family: var(--display); font-weight: 400; font-size: 1.3rem; margin: 0 0 8px; }
.tips ul { margin: 0; padding-inline-start: 1.2em; display: grid; gap: 6px; }
.foot { border-top: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: .88rem; }
.foot .wrap { padding-block: 18px 28px; }
.foot p { margin: 4px 0; }

/* עמודי טקסט */
.doc { max-width: 760px; }
.doc h1 { font-family: var(--display); font-weight: 400; font-size: clamp(1.6rem, 4vw, 2.1rem); margin: 0 0 12px; }
.doc h2 { font-family: var(--display); font-weight: 400; font-size: 1.25rem; margin: 22px 0 6px; }

@media (max-width: 960px) {
  .search { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .split { grid-template-columns: 1fr; }
  .mapbox { position: static; order: -1; }
  #map { height: min(62vh, 520px); min-height: 0; }
}
@media (max-width: 520px) {
  .search { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .field:first-child { grid-column: 1 / -1; }
  .count { margin-inline-start: 0; width: 100%; }
  .top nav { gap: 12px; font-size: .88rem; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }
