/* =========================================================================
   RE/MAX כחול לבן נתניה — theme.css
   Design system + base. Direction 02 · קו החוף.
   Tokens mirror theme.json one-for-one so the editor and the front end can
   never drift apart.
   ========================================================================= */

/* @font-face lives in theme.json — single source of truth, and it feeds the
   block editor as well as the front end. Do not re-declare it here. */

:root {
  /* ── ink / neutrals ─────────────────────────────────────────────── */
  --ink:        #0B0F14;
  --ink-2:      #131A22;
  --ink-3:      #1D2732;
  --navy:       #001122;
  --navy-2:     #002B5C;

  /* ── brand (RE/MAX) ────────────────────────────────────────────── */
  --blue:       #0053A1;
  --blue-lit:   #0A6FD8;
  --red:        #E01C2F;
  --red-deep:   #B4121F;

  /* ── paper ─────────────────────────────────────────────────────── */
  --paper:      #FFFFFF;
  --paper-2:    #F6F7F9;
  --paper-3:    #EBEEF2;
  --muted:      #5A6572;
  /* was #8A96A3 — 3.1:1 on white, under the 4.5:1 the labels must meet.
     This lands at ~4.6:1 and the eyebrows stay quiet. */
  --muted-2:    #5F6A77;   /* 15.11.2026: 5.1:1 on paper (was 4.3, under AA) */

  /* ── hairlines ─────────────────────────────────────────────────── */
  --line:       rgba(11,15,20,.13);
  --line-soft:  rgba(11,15,20,.07);
  --line-dark:  rgba(255,255,255,.15);
  --line-dark-soft: rgba(255,255,255,.07);

  /* ── type scale · Google Sans runs large, so every step sits one
        notch below where the same scale would normally land ────────── */
  --t-mega:   clamp(3rem, 8vw, 7.5rem);
  --t-xl:     clamp(2.75rem, 7vw, 6.5rem);
  --t-lg:     clamp(2.125rem, 4.4vw, 3.75rem);
  --t-md:     clamp(1.625rem, 2.8vw, 2.375rem);
  --t-sm:     clamp(1.125rem, 1.6vw, 1.375rem);
  --t-lead:   clamp(1rem, 1.2vw, 1.125rem);
  --t-body:   1rem;
  --t-meta:   .8125rem;
  --t-label:  .6875rem;

  /* ── rhythm ────────────────────────────────────────────────────── */
  --gut:      clamp(1.25rem, 4vw, 3.5rem);
  --max:      1560px;
  --sec:      clamp(4.5rem, 9vw, 8.5rem);
  /* 88 since the 2026 rebrand: the squarer lockup lifted the resting bar to
     ~102px on desktop (56px padding + 46px logo) and ~76px on a phone. One
     knob — every clearance on the site (hero, menu, sticky, anchors) reads it. */
  --hdr-h:    88px;

  /* ── motion ────────────────────────────────────────────────────── */
  --e-out:    cubic-bezier(.16,1,.3,1);
  --e-inout:  cubic-bezier(.65,0,.35,1);
}

/* ---------------------------------------------------------------- RESET */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-block-start: var(--hdr-h); }
body {
  margin: 0;
  font-family: 'Google Sans', system-ui, 'Segoe UI', sans-serif;
  font-size: var(--t-body);
  font-variation-settings: 'wght' 400;
  line-height: 1.7;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* clip, not hidden. `overflow-x: hidden` on the body makes it a scroll
     container, which silently kills `position: sticky` for everything inside —
     the catalog filter bar scrolled away instead of following. `clip` stops the
     full-bleed marquees causing a horizontal scrollbar without creating that
     container. */
  overflow-x: clip;
}
img, video, svg { display: block; max-width: 100%; height: auto; }
/* <picture> is a wrapper for art direction only — it must not become a box in
   the layout, or every flex and aspect-ratio parent would need rewriting */
picture { display: contents; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3, h4, h5, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
input, select, textarea { font: inherit; color: inherit; }

/* ---------------------------------------------------------------- SELECT
   The native control is a different shape, weight and arrow on every platform,
   and on Windows it is a grey system widget that undoes the typography around
   it. This is the one place worth overriding a native control: the three
   questions in the hero and the catalog filter bar are the most-used surfaces
   on the site, and they were reading as a form from 2009.

   The arrow is drawn rather than an icon font or an image: one data URI, no
   request, and it inherits nothing that can go missing. */
select {
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%235A6572' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  /* RTL: the far edge of the line is the left */
  background-position: left .9rem center;
  background-size: 11px 8px;
  padding-inline-end: 2.1rem;
  cursor: pointer;
  transition: background-color .3s var(--e-out), box-shadow .3s var(--e-out), color .3s;
}
select::-ms-expand { display: none; }
.on-dark select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%23ffffff' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}
/* the open state gets the arrow flipped — a small thing, but it is the only
   feedback a native select gives that it is listening */
select:focus { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 6.5 6 1.5l5 5' fill='none' stroke='%230053A1' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
.on-dark select:focus { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 6.5 6 1.5l5 5' fill='none' stroke='%23ffffff' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E"); }
/* the dropdown itself is the OS's, but at least the list is not white-on-white */
select option { background: var(--paper); color: var(--ink); }
::selection { background: var(--red); color: #fff; }
/* <i> is used for decorative bars and rules here. Left italic it would pull
   the italic font file down for elements that render no text at all. */
i:empty { font-style: normal; }

/* ---------------------------------------------------------------- DROPDOWN
   Everything above styles the closed control. The list it opens is drawn by the
   operating system and no stylesheet can reach it — grey system rows on Windows,
   a wheel on iOS — so the most-used sentence on the site ended in someone else's
   typeface. That is the whole reason this component exists.

   app.js builds a listbox next to each <select> in the two bars and hides the
   native control WITHOUT removing it: the <select> still holds the value, still
   submits with the GET form, and still fires `change` for the .is-set underline.
   With JS off none of this is generated and the native control is simply left
   alone — the filter bar has always had to work before any script loads.

   The panel is not a generic popup. The three bands sit on the edge nearest the
   trigger, the row you are on takes a blue mark on the reading edge, and the row
   you chose takes the full mark — the same object as the .is-set underline in
   the cell above it, at a smaller scale.

   Do NOT give .sel-menu a `display`: an author display beats the UA's [hidden]
   rule and the menu would render permanently. Same trap as .lnk[hidden] above. */
.sel { position: relative; }
/* present, submittable, unreachable — not `display: none`, so a required field
   can still be validated and reported by the browser */
.sel-native {
  position: absolute; width: 1px; height: 1px;
  opacity: 0; pointer-events: none;
}

.sel-btn {
  display: flex; align-items: center; gap: .6rem;
  width: 100%; padding: 0; text-align: start; cursor: pointer;
}
.sel-val { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-arrow {
  flex: 0 0 auto; width: 12px; height: 8px; color: var(--muted);
  transition: transform .34s var(--e-out), color .3s;
}
.sel.open .sel-arrow { transform: rotate(180deg); color: var(--blue); }

.sel-menu {
  position: absolute; z-index: 70;
  inset-block-start: calc(100% + .6rem); inset-inline-start: 0;
  min-width: 100%; width: max-content; max-width: min(22rem, 76vw);
  padding-block-start: 3px;
  background: var(--paper);
  border: 1px solid var(--line); border-radius: 4px;
  box-shadow: 0 28px 56px -28px rgba(0,17,34,.5), 0 6px 18px -14px rgba(0,17,34,.45);
  opacity: 0; transform: translateY(-6px);
  transition: opacity .2s var(--e-out), transform .26s var(--e-out);
}
.sel-menu::before {
  content: ''; position: absolute; inset-block-start: 0; inset-inline: 0;
  height: 3px; background: var(--band); border-radius: 3px 3px 0 0;
}
.sel-menu.open { opacity: 1; transform: none; }
/* opening upward: the band follows the trigger, so it is always the edge the
   list grew out of */
.sel-menu.up {
  inset-block-start: auto; inset-block-end: calc(100% + .6rem);
  padding-block: 0 3px; transform: translateY(6px);
}
.sel-menu.up::before { inset-block-start: auto; inset-block-end: 0; border-radius: 0 0 3px 3px; }
.sel-menu.up.open { transform: none; }
/* the hero card's lists float on <body>, fixed to their trigger (app.js) —
   inside the hero they were clipped away (12.11.2026) */
.sel-menu.float { position: fixed; inset: auto; z-index: 700; }
/* the last cell in the row: a menu wider than its cell would grow off-screen */
.sel-menu.flip { inset-inline-start: auto; inset-inline-end: 0; }

.sel-list {
  max-height: var(--sel-max, 20rem);
  overflow-y: auto; overscroll-behavior: contain;
  padding-block: .3rem;
  scrollbar-width: thin; scrollbar-color: rgba(0,83,161,.3) transparent;
}
.sel-list::-webkit-scrollbar { width: 6px; }
.sel-list::-webkit-scrollbar-thumb { background: rgba(0,83,161,.28); border-radius: 99px; }
.sel-list li {
  position: relative; display: flex; align-items: center; gap: .6rem;
  padding-block: .5rem; padding-inline: 1rem .8rem;
  font-size: .9375rem; line-height: 1.4; letter-spacing: -.012em;
  cursor: pointer;
  opacity: 0; transform: translateY(-5px);
  transition: background .22s var(--e-out), color .22s,
              opacity .3s var(--e-out) var(--dly, 0ms),
              transform .3s var(--e-out) var(--dly, 0ms);
}
.sel-menu.open .sel-list li { opacity: 1; transform: none; }
.sel-list li::before {
  content: ''; position: absolute; inset-block: 0; inset-inline-start: 0; width: 3px;
  background: var(--blue);
  transform: scaleY(0); transition: transform .26s var(--e-out);
}
.sel-list li.on { background: var(--paper-2); }
.sel-list li.on::before { transform: scaleY(1); }
/* the row already chosen carries the whole mark, not just the blue */
.sel-list li[aria-selected="true"] { color: var(--blue); font-variation-settings: 'wght' 500; }
.sel-list li[aria-selected="true"]::before { background: var(--band-v); transform: scaleY(1); }
.sel-txt { flex: 1 1 auto; }
.sel-tick {
  flex: 0 0 auto; width: 14px; height: 11px;
  opacity: 0; transform: scale(.6);
  transition: opacity .24s var(--e-out), transform .3s var(--e-out);
}
.sel-list li[aria-selected="true"] .sel-tick { opacity: 1; transform: none; }

/* ── phones: a sheet, not a popup ────────────────────────────────────────
   A 30-item panel hanging off a 12px chevron is a desktop object. On a phone
   the list comes up from the bottom edge, where the thumb already is, and the
   question is repeated at the top of it because the label behind is covered.

   It is moved to <body> to be shown: the hero clips itself on the slash and the
   search card sits inside a backdrop-filter, and both of those trap a fixed
   child. See app.js. */
.sel-scrim {
  position: fixed; inset: 0; z-index: 900;
  background: rgba(11,15,20,.55);
  backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .3s var(--e-out);
}
.sel-scrim.on { opacity: 1; }
.sel-menu.sheet {
  position: fixed; z-index: 901;
  inset: auto 0 0 0;
  min-width: 0; width: auto; max-width: none;
  padding-block-start: 3px;
  border: 0; border-radius: 14px 14px 0 0;
  box-shadow: 0 -22px 60px -22px rgba(0,17,34,.6);
  transform: translateY(100%);
  transition: transform .4s var(--e-out);
}
.sel-menu.sheet::before { border-radius: 14px 14px 0 0; }
.sel-menu.sheet.open { transform: none; }
.sel-head { display: none; }
.sel-menu.sheet .sel-head {
  display: flex; flex-direction: column; align-items: center; gap: .55rem;
  padding: .7rem 1rem .8rem;
  border-block-end: 1px solid var(--line-soft);
}
.sel-menu.sheet .sel-head span {
  font-size: var(--t-label); font-variation-settings: 'wght' 500;
  letter-spacing: .2em; text-transform: uppercase; color: var(--muted-2);
}
.sel-grab { width: 40px; height: 4px; border-radius: 99px; background: var(--paper-3); }
.sel-menu.sheet .sel-list {
  max-height: min(56vh, 26rem);
  padding-block: .35rem calc(.35rem + env(safe-area-inset-bottom, 0px));
}
/* a real tap target, per 5568 */
.sel-menu.sheet .sel-list li { padding-block: .8rem; padding-inline: 1.15rem .9rem; font-size: 1rem; }

/* visible focus everywhere — Israeli Standard 5568 */
:focus-visible {
  outline: 3px solid var(--blue-lit);
  outline-offset: 3px;
  border-radius: 2px;
}
.on-dark :focus-visible { outline-color: #fff; }

/* ---------------------------------------------------------------- A11Y */
.rmx-sr, .rmx-skip {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.rmx-skip:focus {
  position: fixed; inset-block-start: .75rem; inset-inline-start: .75rem;
  z-index: 9999; width: auto; height: auto; margin: 0; clip-path: none;
  padding: .75rem 1.25rem; background: var(--ink); color: #fff; border-radius: 2px;
}
/* the second skip control stacks under the first when focused */
button.rmx-skip:focus { inset-block-start: 4rem; }

/* the on-page stillness switch — WCAG 2.2.2. Everything that moves by itself
   (films, rails, sparks, the fan, the glows) must be stoppable on the page,
   not only through the OS setting. app.js pauses the videos and the rails
   and persists the choice; this line freezes every keyframe. */
html.rmx-still *,
html.rmx-still *::before,
html.rmx-still *::after { animation-play-state: paused !important; }

/* ---------------------------------------------------------------- LAYOUT */
.wrap { width: 100%; max-width: var(--max); margin-inline: auto; padding-inline: var(--gut); }
.sec { padding-block: var(--sec); }

/* ---------------------------------------------------------------- TYPE */
/* tiny wide-tracked label — the load-bearing detail of the whole system */
.label {
  display: inline-block;
  font-size: var(--t-label);
  font-variation-settings: 'wght' 500;
  letter-spacing: .2em;
  line-height: 1;
  text-transform: uppercase;
}
.dh {
  font-variation-settings: 'wght' 700, 'GRAD' 0;
  letter-spacing: -.038em;
  line-height: .96;
  text-wrap: balance;
}
/* on dark fields push GRAD, not wght — the mark keeps its metrics */
.on-dark .dh { font-variation-settings: 'wght' 700, 'GRAD' 90; }
.tnum { font-variant-numeric: tabular-nums; font-feature-settings: 'tnum' 1; }

.sec-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1.5rem; flex-wrap: wrap; margin-block-end: clamp(1.75rem, 3.5vw, 3rem);
}
.sec-head h2 { font-size: var(--t-lg); font-variation-settings: 'wght' 700; letter-spacing: -.032em; line-height: 1; }
.sec-head .label { color: var(--muted-2); }
.on-dark .sec-head .label { color: rgba(255,255,255,.58); } /* .45 read at ~4.4:1 on ink — under AA */

/* ---------------------------------------------------------------- BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  font-size: .9375rem; font-variation-settings: 'wght' 500; letter-spacing: -.012em;
  padding: .8rem 1.4rem; border-radius: 100px; white-space: nowrap;
  transition: background .28s var(--e-out), color .28s, transform .28s var(--e-out), box-shadow .28s;
}
.btn-red { background: var(--red); color: #fff; }
.btn-red:hover { background: var(--red-deep); transform: translateY(-2px); box-shadow: 0 14px 30px -14px rgba(224,28,47,.5); }
.btn-ghost { border: 1px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--ink); }
.on-dark .btn-ghost { border-color: var(--line-dark); color: #fff; }
.on-dark .btn-ghost:hover { background: #fff; color: var(--ink); border-color: #fff; }

/* text link that grows its gap on hover */
.lnk {
  display: inline-flex; align-items: center; gap: .5rem;
  font-size: .9375rem; font-variation-settings: 'wght' 500;
  padding-block-end: .3rem; border-block-end: 1px solid currentColor;
  transition: gap .34s var(--e-out), border-color .3s, color .3s;
}
.lnk:hover { gap: .95rem; border-color: var(--red); color: var(--red); }
/* An author `display` beats the UA's [hidden] rule, so any .lnk a script hides
   would carry on rendering. Cost one visible read-more button on a description
   that was never clipped; worth stating once, here, rather than per component. */
.lnk[hidden] { display: none; }

/* ---------------------------------------------------------------- REVEAL */
[data-rv] {
  opacity: 0; transform: translateY(22px);
  transition: opacity .85s var(--e-out), transform .85s var(--e-out);
  transition-delay: var(--d, 0ms);
}
[data-rv].in { opacity: 1; transform: none; }

.lines { display: block; }
.lines .ln { display: block; overflow: hidden; }
.lines .ln > span {
  display: block; transform: translateY(105%);
  transition: transform 1.05s var(--e-out); transition-delay: var(--d, 0ms);
}
.lines.in .ln > span { transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-rv], [data-rv].in { opacity: 1; transform: none; transition: none; }
  .lines .ln > span { transform: none !important; transition: none; }
  /* the rule below flattens durations, not delays — a staggered list of instant
     transitions is still a list that arrives one row at a time */
  .sel-list li,
  .menu.open .menu-nav a { transition-delay: 0ms !important; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
