/* Caregiver search. Colours, fonts and base classes come from /site.css. */
.search-page { padding-block: 36px 96px; }
.search-h1 { font: 400 46px/1.1 var(--font-display); }

/* ---- the search bar: the place + one segment per filter, in one pill ---- */
.filters { margin-top: 22px; }
.sbox { position: relative; display: flex; align-items: center; width: fit-content; max-width: 100%; background: var(--white); border: 1px solid var(--control-line); border-radius: var(--radius); padding: 7px; padding-inline-end: 64px; box-shadow: 0 12px 30px -18px rgba(27, 36, 32, .3); }
.sbar { display: flex; align-items: center; min-width: 0; }
.seg { display: flex; flex-direction: column; padding: 4px 18px; line-height: 1.3; border-radius: var(--r); cursor: text; }
.seg:focus-within { outline: 2px solid var(--green); outline-offset: -2px; }
.seg-label, .fseg-label { font-size: 14px; font-weight: 700; color: var(--ink); }
.seg input { width: 130px; border: 0; padding: 0; font: inherit; font-size: 16px; color: var(--ink); background: transparent; outline: none; }
.seg input::placeholder { color: #6A736D; }
.go { position: absolute; inset-inline-end: 7px; top: 50%; translate: 0 -50%; width: 50px; height: 50px; border: 0; border-radius: var(--r); background: var(--family); color: var(--ink); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: background .2s; }
.go:hover { background: var(--family-dark); }
.go svg { width: 20px; height: 20px; }

/* The "did you mean" / "place not found" hint sits under the pill, not inside it. */
.sbox .city-hint { position: absolute; inset-inline-start: 24px; top: calc(100% + 6px); max-width: calc(100% - 24px); }
.fbar { display: flex; align-items: center; min-width: 0; }
.fseg { position: relative; display: flex; align-items: center; gap: 8px; padding: 4px 18px; border: 0; border-radius: var(--r); background: transparent; color: var(--ink); font: inherit; line-height: 1.3; text-align: start; cursor: pointer; }
.fseg::before { content: ''; position: absolute; inset-inline-start: 0; top: 50%; translate: 0 -50%; width: 1px; height: 32px; background: var(--line); }
.fseg:hover { background: var(--sand); }
.fseg:hover::before, .fseg:hover + .fseg::before { opacity: 0; }
.fseg-text { display: flex; flex-direction: column; min-width: 0; }
.fseg-value { font-size: 16px; min-width: 96px; max-width: 170px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.fseg-n { display: none; }
.fseg[data-active='true'] .fseg-value { color: var(--green); font-weight: 700; }
.fseg svg { display: none; flex: none; transition: transform .2s; }  /* the chevron shows on a phone only */
.fseg[aria-expanded='true'] { background: var(--mint); }
.fseg[aria-expanded='true'] svg { transform: rotate(180deg); }
.fclear { height: 40px; padding: 0 12px; font-size: 14px; white-space: nowrap; text-decoration: underline; text-underline-offset: 4px; }

.fpanel { margin-top: 12px; max-width: 760px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; display: flex; flex-direction: column; gap: 14px; }
.fpanel-title { font-weight: 700; font-size: 17px; }
.fpanel .field { max-width: 320px; font-size: 16px; }
.fpanel .field select { height: 48px; }
/* Hourly rate: the amount big above a full-width slider, the two ends under it. 44px tall for a thumb on a phone. */
.rate-field { max-width: 420px; gap: 4px; }
.rate-out { font-size: 22px; font-weight: 700; color: var(--green); }
.rate-range { width: 100%; height: 44px; margin: 0; accent-color: var(--green); cursor: pointer; }
.rate-range:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
.rate-ends { display: flex; justify-content: space-between; font-size: 14px; font-weight: 400; color: var(--muted); }
.fshow { align-self: flex-start; height: 44px; font-size: 16px; }
/* Room for the segments (built by JS) and the first cards, so nothing below jumps while they load. */
.fbar:empty { min-height: 50px; }
#count { min-height: 1.6em; }
.list:empty:not([aria-busy='true']) { display: none; }   /* no empty box, so its gap does not push the empty card down */
.list[aria-busy='true']:empty { min-height: 60vh; }
/* While the first results load: two static card outlines instead of a blank screen (no shimmer, so no motion to switch off). */
#list[aria-busy='true']:empty::before, #list[aria-busy='true']:empty::after { content: ''; display: block; height: 150px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(var(--sand), var(--sand)) right 14px top 14px / 92px 116px no-repeat, linear-gradient(var(--sage), var(--sage)) right 120px top 22px / 45% 18px no-repeat, linear-gradient(var(--sage), var(--sage)) right 120px top 54px / 30% 12px no-repeat; }

/* ---- count + sort, and how to reach someone ---- */
/* RTL: the count, then the sort right under it on the same (right) side, not pushed to the far left */
.results-head { display: flex; flex-direction: column; align-items: flex-start; gap: 8px 16px; margin-top: 30px; }
.results-title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 12px; }
.title { font-size: 17px; font-weight: 700; line-height: 1.4; }
/* No place chosen: the heading is for screen readers only, and the count is the visible line. */
.title.sr-only + #count { font-size: 17px; font-weight: 700; color: var(--ink); }
.title:focus { outline: none; }  /* focused by script only (tabindex -1), to land after "הצגת התוצאות" or a clear */
#count { font-size: 15px; }
.sortbox { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.sort { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--muted); }
.sort select { height: 40px; border: 1px solid var(--control-line); border-radius: var(--r); padding: 0 14px; font: 600 14px/1 var(--font); background: var(--white); color: var(--ink); }
#orderNote { font-size: 14px; }
.how-wrap { margin-top: 16px; }
.how { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; line-height: 1.5; background: var(--mint); border-radius: var(--r); padding: 14px 18px; }
.how svg { flex: none; margin-top: 1px; color: var(--green); }

/* ---- results + the side panel ---- */
.results-layout { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; margin-top: 24px; }
.results { flex: 999 1 640px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.side { flex: 1 1 300px; max-width: 360px; position: sticky; top: 24px; display: flex; flex-direction: column; gap: 14px; }
.prompt { background: var(--sage); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; font-size: 16px; }
.prompt-title { font: 400 28px/1.15 var(--font-display); }
.prompt .btn { margin-top: 4px; }
.free { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.free svg { flex: none; margin-top: 2px; color: var(--green); }
.list { display: flex; flex-direction: column; gap: 16px; }
.group { font: 400 22px/1.2 var(--font-display); color: var(--green); margin-top: 8px; }
.group:first-child { margin-top: 0; }
.more { text-align: center; }
.empty-card { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; padding: 40px 24px; }
.empty-actions { justify-content: center; margin-top: 8px; }

/* ---- one caregiver: photo | details | price and the button ---- */
.carer { position: relative; display: flex; gap: 22px; border-radius: var(--radius); }
/* The whole card opens the profile: the name link stretches over it, and the other controls sit above. */
.carer-name a::after { content: ''; position: absolute; inset: 0; border-radius: var(--radius); }
.badge-why, .carer-cta { position: relative; z-index: 1; }
.carer-name a:focus-visible { outline: none; }
.carer-name a:focus-visible::after { outline: 3px solid var(--green); outline-offset: 2px; }
.carer:hover { border-color: var(--leaf); box-shadow: 0 18px 40px -24px rgba(27, 36, 32, .35); }
.carer-photo { flex: none; }
.carer-photo img { display: block; width: 150px; height: 184px; object-fit: cover; object-position: 50% 30%; border-radius: var(--r); background: var(--sand); }
.carer-main { flex: 1 1 320px; min-width: 0; display: flex; flex-direction: column; gap: 10px; padding-block: 4px; }
.carer-top { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; }
.carer-name { font: 400 27px/1.2 var(--font-display); overflow-wrap: anywhere; }
.carer-name a { color: var(--ink); text-decoration: none; }
.carer-name a:hover { text-decoration: underline; text-underline-offset: 5px; }
.carer-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.carer-badges .badge { font-size: 13px; font-weight: 700; padding: 4px 11px 4px 12px; }
.badge-why { min-height: 44px; margin-block: -9px; padding: 0 4px; border: 0; background: none; font: inherit; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.carer-rating { display: flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 700; }
.carer-meta, .carer-areas { font-size: 15px; color: var(--muted); line-height: 1.5; overflow-wrap: anywhere; }
.carer-areas { margin-top: -8px; }
.carer-dist { display: flex; align-items: center; gap: 4px; font-size: 14px; color: var(--green); font-weight: 600; margin-top: -6px; }
.carer-dist svg { flex: none; }
.carer-bio { font-size: 17px; text-wrap: pretty; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.carer-tags, .carer-when { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.skill { font-size: 14px; font-weight: 600; border: 1px solid var(--line); padding: 3px 11px; border-radius: 999px; }
.skill-more { font-size: 14px; font-weight: 700; color: var(--muted); padding: 3px 6px; }
.when-chip { height: 30px; padding: 0 11px; gap: 4px; border-radius: 999px; background: var(--mint); color: var(--green); box-shadow: inset 0 0 0 1px var(--leaf); font-size: 13px; font-weight: 700; display: inline-flex; align-items: center; }
.when-chip svg { flex: none; }
.when-chip.is-off { background: var(--sand); color: #5F6A63; box-shadow: none; font-weight: 600; }
.carer-side { flex: 0 0 190px; display: flex; flex-direction: column; justify-content: space-between; gap: 14px; padding-block: 4px; padding-inline-start: 22px; border-inline-start: 1px solid #EFEADF; }
.carer-price { display: flex; align-items: baseline; gap: 6px; line-height: 1; font-size: 14px; color: var(--muted); }
.carer-price strong { font: 400 32px/1 var(--font-display); color: var(--ink); }
.carer-invites { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; color: var(--muted); }
.carer-invites::before { content: ''; flex: none; width: 9px; height: 9px; border-radius: 50%; background: var(--live); }
.carer-note { font-size: 14px; line-height: 1.4; color: var(--muted); }
.carer-cta { height: 48px; font-size: 16px; }

/* ---- after the results: the accordions (the last one is the numbered safety list) ---- */
.explain { margin-top: 56px; }
.accordions { max-width: 880px; display: flex; flex-direction: column; gap: 12px; }
.facts { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); scroll-margin-top: 24px; }
.facts summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 24px; cursor: pointer; font: 400 20px/1.3 var(--font-display); border-radius: var(--radius); }
.facts summary::-webkit-details-marker { display: none; }
.facts summary::after { content: ''; flex: none; width: 9px; height: 9px; margin-inline-end: 6px; border: solid var(--green); border-width: 0 2px 2px 0; rotate: 45deg; translate: 0 -2px; transition: rotate .2s, translate .2s; }
.facts[open] summary::after { rotate: -135deg; translate: 0 2px; }
.facts-body { padding: 0 24px 22px; display: flex; flex-direction: column; gap: 10px; font-size: 16px; color: var(--muted); }
.facts strong { color: var(--ink); }
.facts-h { font: 400 20px/1.3 var(--font-display); padding: 20px 24px 14px; }

/* "מה זה אומר?": what the verified badge means, in a dialog */
.why-dialog { width: min(92vw, 520px); border: 0; border-radius: var(--radius); padding: 24px; background: var(--white); color: var(--ink); box-shadow: var(--shadow); }
.why-dialog::backdrop { background: rgba(27, 36, 32, .6); }
.why-dialog p { margin-top: 10px; font-size: 16px; line-height: 1.5; color: var(--muted); }
.why-dialog strong { color: var(--ink); }
.why-h { font: 400 22px/1.3 var(--font-display); }
.why-dialog form { margin-top: 18px; }
.why-dialog .btn { width: 100%; }
.tips { margin: 0; list-style: none; counter-reset: tip; }
.tips li { counter-increment: tip; display: flex; align-items: flex-start; gap: 12px; line-height: 1.5; }
.tips li::before { content: counter(tip); flex: none; width: 26px; height: 26px; margin-top: 1px; border-radius: 50%; background: var(--mint); color: var(--green); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; }

@media (max-width: 720px) {
  .search-page { padding-block: 16px 32px; }
  .search-h1 { font-size: 30px; }
  /* On a phone the pill holds only the place; the filters become a row of chips that stays in reach while
     scrolling (the wrappers dissolve so the row and its panels can stick to the whole page). */
  .filters, .sbox { display: contents; }
  .sbar { position: relative; margin: 12px var(--gutter) 0; height: 56px; padding: 0 8px; padding-inline-end: 64px; background: var(--white); border: 1px solid var(--control-line); border-radius: var(--radius); box-shadow: 0 8px 22px -14px rgba(27, 36, 32, .3); }
  .seg { flex: 1; min-width: 0; padding: 2px 12px; }
  .sbox .city-hint { position: static; max-width: none; margin: 8px var(--gutter) 0; }
  .seg input { width: 100%; }
  .go { inset-inline-end: 6px; width: 44px; height: 44px; }
  .fbar { position: sticky; top: 0; z-index: 6; gap: 8px; padding: 10px var(--gutter); background: var(--cream); overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
  .fbar::-webkit-scrollbar { display: none; }
  .fseg { flex: none; height: 44px; padding: 0 14px; gap: 6px; border: 1px solid var(--control-line); background: var(--white); font-size: 14px; font-weight: 600; }
  .fseg::before, .fseg-value { display: none; }
  .fseg-n { display: inline; }
  .fseg-label { font-size: 14px; font-weight: 600; white-space: nowrap; }
  .fseg svg { display: block; }
  .fseg:hover { background: var(--white); }
  .fseg[aria-expanded='true'] { background: var(--mint); border-color: var(--green); }
  .fseg[data-active='true'] { background: var(--green); border-color: var(--green); color: var(--cream); }
  .fseg[data-active='true'] .fseg-label { color: var(--cream); font-weight: 700; }
  .fclear { flex: none; height: 44px; }
  /* An open panel sticks under the chips and scrolls inside itself, so it never outgrows the screen. */
  #fpanels { position: sticky; top: 64px; z-index: 5; margin-inline: var(--gutter); }
  .fpanel { margin-top: 0; padding: 16px; max-height: 65vh; max-height: 65svh; overflow-y: auto; overscroll-behavior: contain; box-shadow: var(--shadow); }
  /* Children keep their height (the closing button was squeezed to 18px); the button stays at the bottom while the chips scroll. */
  .fpanel { scroll-padding-bottom: 64px; }
  .fpanel > * { flex-shrink: 0; }
  .fpanel .chips { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .fpanel .chip { height: auto; min-height: 44px; justify-content: center; text-align: center; padding: 6px 10px; line-height: 1.25; }
  .fshow { align-self: stretch; position: sticky; bottom: -16px; box-shadow: 0 -12px 12px -4px var(--white), 0 16px 0 0 var(--white); }
  .title { scroll-margin-top: 72px; }
  .results-head { margin-top: 4px; }
  .title { font-size: 16px; }
  #count { font-size: 14px; }
  .sortbox { display: contents; }
  #orderNote { flex-basis: 100%; margin-top: -2px; }
  .sort { font-size: 14px; }
  .sort select { height: 44px; font-size: 16px; padding: 0 14px; max-width: 220px; }
  .how-wrap { margin-top: 12px; }
  .how { font-size: 14px; gap: 8px; padding: 10px 12px; border-radius: var(--r); }
  .how svg { width: 18px; height: 18px; }
  .results-layout { margin-top: 16px; gap: 12px; }
  .results, .list { gap: 12px; }
  .side { position: static; max-width: none; flex-basis: 100%; margin-top: 6px; }
  .prompt { padding: 22px; border-radius: var(--radius); gap: 10px; font-size: 15px; }
  .prompt-title { font-size: 24px; }
  .prompt .btn { align-self: stretch; height: 50px; font-size: 16px; }
  .free { font-size: 13px; }
  .group { font-size: 20px; }

  /* A phone card: photo beside name / rating / city / price, everything else full width below.
     The wrappers dissolve into one grid; gaps are margins so a missing line leaves no hole. */
  .carer { display: grid; grid-template-columns: 92px minmax(0, 1fr); grid-template-rows: auto auto auto auto 1fr; grid-template-areas: 'photo name' 'photo rating' 'photo meta' 'photo price' 'photo .' 'areas areas' 'dist dist' 'badges badges' 'bio bio' 'tags tags' 'when when' 'note note' 'cta cta'; gap: 0 14px; padding: 14px; border-radius: var(--radius); }
  .carer-main, .carer-top, .carer-side { display: contents; }
  .carer-photo { grid-area: photo; align-self: start; }
  .carer-photo img { width: 92px; height: 116px; border-radius: var(--r); }
  .carer-name { grid-area: name; font-size: 22px; }
  .carer-rating { grid-area: rating; margin-top: 6px; font-size: 14px; }
  .carer-meta { grid-area: meta; margin-top: 6px; font-size: 14px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .carer-price { grid-area: price; margin-top: 6px; gap: 5px; font-size: 14px; }
  .carer-price strong { font-size: 24px; }
  .carer-areas { grid-area: areas; margin-top: 10px; font-size: 14px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
  .carer-dist { grid-area: dist; margin-top: 6px; font-size: 14px; }
  .carer-badges { grid-area: badges; margin-top: 10px; }
  .carer-badges .badge { font-size: 13px; }
  .badge-why { font-size: 13px; }
  .carer-bio { grid-area: bio; margin-top: 10px; font-size: 15px; line-height: 1.45; -webkit-line-clamp: 2; }
  .carer-tags { grid-area: tags; margin-top: 10px; gap: 6px 4px; }
  .skill, .skill-more { font-size: 14px; }
  .skill { padding: 3px 8px; }
  .skill-more { padding: 3px 2px; }
  .carer-when { grid-area: when; margin-top: 10px; }
  .when-chip { height: 30px; padding: 0 7px; gap: 3px; font-size: 13px; }
  .carer-when { gap: 4px; }
  .carer-invites, .carer-note { grid-area: note; margin-top: 10px; font-size: 14px; }
  .carer-cta { grid-area: cta; margin-top: 10px; }

  .explain { margin-top: 12px; }
  .facts summary { padding: 16px 18px; font-size: 18px; }
  .facts-h { font-size: 18px; padding: 16px 18px 12px; }
  .facts-body { padding: 0 18px 22px; font-size: 15px; }
  .tips li { gap: 10px; line-height: 1.45; }
}

@media (max-width: 340px) {
  .carer-areas { -webkit-line-clamp: 2; }
}

/* the nursing-care switch (search.js careBtn): a toggle, so no chevron; on = filled like an active filter */
.fseg--care[aria-pressed='true'] .fseg-value { color: var(--green); font-weight: 700; }
