/* Orby Maps. Layout: full-screen map, brand bar + filter chips on top, bottom sheet (list/place) on phones,
   side panel on wide screens. Brand: black / white / Orby yellow. */
:root {
  --bg: #ffffff;
  --surface: #f3f3ef;
  --fg: #111111;
  --muted: #5d5d57;
  --line: #e1e1da;
  --yellow: #ffd60a;
  --on-yellow: #111111;
  --ink: #111111;          /* always-dark brand ink (marker body, top bar) */
  --on-ink: #ffffff;
  --open: #1b7a3d;
  --closed: #a33a1c;
  --scrim: rgba(0, 0, 0, .55);
  --display: "Noto Sans Hebrew", "Arial Hebrew", Arial, sans-serif;
  --body: "Noto Sans Hebrew", "Arial Hebrew", Arial, sans-serif;
  /* Place-type colors (same in both themes: they sit on the map, not on the page). Always paired with an icon. */
  --c-eat: #d4432a;   /* food & drink */
  --c-stay: #2459d9;  /* lodging */
  --c-see: #0f7d57;   /* sights, museums, parks, markets, activities */
  --c-shop: #7a3ae0;  /* shopping */
  --r: 14px;
  --shadow: 0 -6px 24px rgba(0, 0, 0, .12);
  --ease: cubic-bezier(.2, .8, .2, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121212; --surface: #1d1d1b; --fg: #f4f4f0; --muted: #a9a9a2; --line: #2f2f2c;
    --open: #6fd08c; --closed: #ff9a7a; --shadow: 0 -6px 24px rgba(0, 0, 0, .5); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #121212; --surface: #1d1d1b; --fg: #f4f4f0; --muted: #a9a9a2; --line: #2f2f2c;
  --open: #6fd08c; --closed: #ff9a7a; --shadow: 0 -6px 24px rgba(0, 0, 0, .5); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; overscroll-behavior: none; }
body { background: var(--bg); color: var(--fg); font: 16px/1.5 var(--body); overflow: hidden; -webkit-tap-highlight-color: transparent; }
button { font: inherit; color: inherit; cursor: pointer; touch-action: manipulation; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }
.skip { position: absolute; inset-inline-start: 8px; top: -60px; z-index: 100; background: var(--yellow); color: var(--on-yellow); padding: 8px 12px; border-radius: 8px; }
.skip:focus { top: 8px; }

/* Top bar */
.topbar { position: fixed; inset: 0 0 auto 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) 16px 10px; background: var(--ink); color: var(--on-ink); }
.brand { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font: 700 13px/1.2 var(--display); opacity: .85; }
.brand-name mark { background: var(--yellow); color: var(--on-yellow); padding: 0 .25em; }
.dest { margin: 0; font: 900 26px/1.1 var(--display); letter-spacing: -.01em; }
.top-actions { display: flex; gap: 8px; }
.icon-btn { min-width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .25);
  background: transparent; color: inherit; font: 800 14px var(--display); transition: background .15s var(--ease); }
.icon-btn:active { background: rgba(255, 255, 255, .15); }
.icon-btn[aria-pressed="true"] { background: var(--yellow); color: var(--on-yellow); border-color: var(--yellow); }

/* Filters */
.filters { position: fixed; z-index: 15; inset-inline: 0; top: calc(env(safe-area-inset-top, 0px) + 72px); display: grid; gap: 6px; padding: 8px 0; pointer-events: none; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-inline: 16px; scrollbar-width: none; overscroll-behavior-x: contain; pointer-events: auto; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 40px; display: inline-flex; align-items: center; gap: 6px; padding: 0 14px; border-radius: 99px;
  border: 1px solid var(--line); background: var(--bg); color: var(--fg); font: 700 14px var(--body); box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
  transition: background .15s var(--ease), transform .1s; }
.chip svg { width: 18px; height: 18px; }
.chip:active { transform: scale(.97); }
.chip[aria-pressed="true"] { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.toggles .chip[aria-pressed="true"] { background: var(--yellow); color: var(--on-yellow); border-color: var(--yellow); }
.chip .n { font-variant-numeric: tabular-nums; opacity: .65; font-weight: 600; }

#map { position: fixed; inset: 0; }
.pin[hidden] { display: none; }
.maplibregl-ctrl-attrib { font-size: 11px; }

/* Markers */
.pin { width: 44px; height: 44px; display: grid; place-items: center; background: none; border: 0; padding: 0; }
.pin span { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--g, var(--ink)); color: #fff;
  border: 2px solid #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .35); transition: transform .15s var(--ease); }
.pin span svg { width: 17px; height: 17px; }
/* Zoomed out: small dots so 60+ points stay readable; icons return from zoom 14 */
.z-low .pin span { width: 16px; height: 16px; border-width: 2px; }
.z-low .pin.must span { box-shadow: 0 0 0 3px var(--yellow); }
.z-low .pin span svg { display: none; }
.z-low .pin.active span { width: 32px; height: 32px; }
.z-low .pin.active span svg { display: block; }
.pin.must span { box-shadow: 0 0 0 3px var(--yellow), 0 2px 8px rgba(0, 0, 0, .45); }
.pin .star { position: absolute; top: 0; inset-inline-end: 0; width: 16px; height: 16px; border-radius: 50%; background: var(--yellow); color: var(--on-yellow);
  display: grid; place-items: center; border: 1.5px solid var(--ink); }
.pin .star svg { width: 9px; height: 9px; fill: currentColor; stroke: none; }
.z-low .pin .star { display: none; }
.pin.active span { transform: scale(1.3); box-shadow: 0 0 0 4px rgba(255, 214, 10, .6), 0 3px 10px rgba(0, 0, 0, .4); }
.me { width: 18px; height: 18px; border-radius: 50%; background: #1a73e8; border: 3px solid #fff; box-shadow: 0 0 0 6px rgba(26, 115, 232, .25); }

/* Sheet */
.sheet { position: fixed; z-index: 30; inset-inline: 0; bottom: 0; height: 88dvh; background: var(--bg); color: var(--fg);
  border-radius: 20px 20px 0 0; box-shadow: var(--shadow); display: flex; flex-direction: column;
  transform: translateY(calc(88dvh - 210px)); transition: transform .28s var(--ease); }
.sheet.dragging { transition: none; }
.grab, .list-head, .place-top { touch-action: none; }
.grab { flex: none; height: 28px; border: 0; background: none; display: grid; place-items: center; }
.grab span { width: 44px; height: 5px; border-radius: 3px; background: var(--line); }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 0 16px calc(env(safe-area-inset-bottom, 0px) + 24px); }

.list-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding-bottom: 8px; }
.list-head h2 { margin: 0; font: 800 20px var(--display); }
.list-head .sub { color: var(--muted); font-size: 14px; }
.list { list-style: none; margin: 0; padding: 0; display: grid; }
.row { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; width: 100%; text-align: start;
  padding: 12px 0; border: 0; border-bottom: 1px solid var(--line); background: none; }
.row:active { background: var(--surface); }
.row .ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--g); color: #fff; }
.row.must .ic { box-shadow: 0 0 0 3px var(--yellow); }
.row .mustTag { display: inline-block; margin-inline-start: 6px; padding: 0 8px; border-radius: 99px; background: var(--yellow); color: var(--on-yellow); font: 700 12px/1.6 var(--body); vertical-align: middle; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; padding: 0 0 10px; font-size: 13px; color: var(--muted); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 50%; background: var(--g); display: inline-block; }
.legend i.mustDot { background: var(--bg); box-shadow: 0 0 0 3px var(--yellow); width: 10px; height: 10px; }
.row .t { min-width: 0; }
.row .nm { display: block; font: 700 17px/1.3 var(--display); }
.row .meta { display: block; color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .end { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; text-align: end; }
.empty { padding: 32px 8px; text-align: center; color: var(--muted); }
.empty button { margin-top: 12px; }

/* Place detail */
.place { display: grid; gap: 16px; padding-top: 4px; }
.place-top { display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: start; }
.place-top > div { min-width: 0; }
.back { display: inline-flex; align-items: center; gap: 4px; border: 0; background: none; color: var(--muted); font-weight: 700; font-size: 14px; padding: 0; min-height: 32px; }
.back svg { width: 18px; height: 18px; }
.place h2 { margin: 2px 0 0; font: 900 28px/1.15 var(--display); letter-spacing: -.01em; text-wrap: balance; }
.place .en { color: var(--muted); font-size: 14px; unicode-bidi: plaintext; }
.close { border: 1px solid var(--line); color: var(--fg); }
.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 12px; border-radius: 99px; background: var(--surface); font: 700 14px var(--body); }
.badge svg { width: 16px; height: 16px; }
.badge.must { background: var(--yellow); color: var(--on-yellow); }
.badge.kosher { background: var(--ink); color: var(--on-ink); }
.tip { margin: 0; padding: 14px 16px; border-radius: var(--r); background: var(--surface); border-inline-start: 5px solid var(--yellow); }
.tip-label { display: block; font: 800 13px var(--display); color: var(--muted); margin-bottom: 4px; }
.tip p { margin: 0; font: 600 18px/1.45 var(--body); }
.section-title { margin: 0 0 8px; font: 800 16px var(--display); }
.hours { display: grid; gap: 6px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.status.open { color: var(--open); }
.status.closed { color: var(--closed); }
.status svg { width: 18px; height: 18px; }
details.week summary { cursor: pointer; color: var(--muted); font-size: 14px; min-height: 32px; display: flex; align-items: center; }
details.week table { width: 100%; border-collapse: collapse; font-size: 14px; font-variant-numeric: tabular-nums; }
details.week td { padding: 4px 0; border-bottom: 1px solid var(--line); }
details.week td:last-child { text-align: end; direction: ltr; }
details.week tr.today td { font-weight: 700; }
.stories { display: grid; grid-auto-flow: column; grid-auto-columns: 96px; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.story { aspect-ratio: 9 / 16; max-width: 100%; border-radius: 12px; border: 2px solid var(--yellow); background: var(--ink); color: var(--on-ink);
  display: grid; place-items: center; position: relative; }
.story svg { width: 28px; height: 28px; fill: currentColor; stroke: none; }
.story small { position: absolute; bottom: 6px; inset-inline: 6px; font: 700 11px var(--body); text-align: center; }
.reels { display: flex; flex-wrap: wrap; gap: 8px; }
.reel { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line); color: var(--fg); text-decoration: none; font-weight: 700; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; position: sticky; bottom: 0; padding-block: 12px; background: var(--bg); }
.btn { min-height: 50px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; border-radius: 14px; font: 800 16px var(--display); text-decoration: none; }
.btn.primary { background: var(--yellow); color: var(--on-yellow); }
.btn.secondary { border: 1.5px solid var(--fg); color: var(--fg); }
.addr { color: var(--muted); font-size: 14px; }

/* Story viewer (tap to play only, never autoplay) */
.viewer { position: fixed; inset: 0; z-index: 60; background: var(--scrim); display: grid; place-items: center; padding: 16px; }
.viewer-stage { width: min(360px, 100%); aspect-ratio: 9 / 16; max-height: 86dvh; border-radius: 18px; background: var(--ink); color: var(--on-ink);
  display: grid; place-items: center; text-align: center; padding: 24px; font: 700 16px/1.5 var(--body); }
.viewer-close { position: absolute; top: calc(env(safe-area-inset-top, 0px) + 12px); inset-inline-end: 12px; background: var(--ink); color: var(--on-ink); }

/* Wide screens: the sheet becomes a side panel */
@media (min-width: 900px) {
  .sheet { transform: none !important; inset-inline-start: 0; inset-inline-end: auto; top: calc(env(safe-area-inset-top, 0px) + 72px); width: 420px; height: auto; border-radius: 0; transform: none; box-shadow: 4px 0 24px rgba(0, 0, 0, .12); }
  .grab { display: none; }
  .filters { inset-inline-start: 420px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* Keep every sheet child inside the phone width (the story strip scrolls inside itself) */
.sheet-body { overflow-x: hidden; }
.place > *, .hours > * { min-width: 0; }
.stories { max-width: 100%; }
.ltr { direction: ltr; unicode-bidi: isolate; }

[dir="ltr"] .back svg { transform: scaleX(-1); }

/* Login (email -> one-time code) */
.login { position: fixed; inset: 0; z-index: 80; background: var(--ink); color: var(--on-ink); display: grid; place-items: center;
  padding: calc(env(safe-area-inset-top, 0px) + 16px) 16px calc(env(safe-area-inset-bottom, 0px) + 16px); overflow-y: auto; }
.login-card { width: min(420px, 100%); display: grid; gap: 14px; }
.login-top { display: flex; justify-content: space-between; align-items: center; }
.login-brand { font-size: 15px; }
.login-dest { margin: 8px 0 0; font: 900 44px/1.05 var(--display); letter-spacing: -.02em; }
.login-lead { margin: 0; font-size: 17px; opacity: .85; }
.login form { display: grid; gap: 10px; }
.field-label { font: 700 14px var(--body); opacity: .8; }
.field { width: 100%; min-height: 52px; padding: 0 14px; border-radius: 12px; border: 1.5px solid rgba(255, 255, 255, .3); background: #1c1c1c; color: #fff; font: 600 18px var(--body); }
.field:focus { border-color: var(--yellow); outline: none; }
.field.code { font-size: 28px; letter-spacing: 10px; text-align: center; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; opacity: .85; cursor: pointer; }
.consent input { width: 20px; height: 20px; margin-top: 2px; accent-color: var(--yellow); flex: none; }
.btn.wide { width: 100%; border: 0; cursor: pointer; }
.btn[disabled] { opacity: .5; cursor: progress; }
.login-sent { margin: 0; font-size: 16px; }
.login-sent b { direction: ltr; unicode-bidi: isolate; }
.login-links { display: flex; justify-content: space-between; gap: 12px; }
.linkish { border: 0; background: none; color: var(--yellow); font: 700 14px var(--body); min-height: 44px; padding: 0; text-decoration: underline; }
.login-error { margin: 0; min-height: 1.5em; color: #ff9a7a; font-weight: 700; }
.login-fine { margin: 0; font-size: 12px; opacity: .6; }
.login-sent .hint { display: block; margin-top: 8px; font-size: 14px; opacity: .8; }
