/* AdventureRooms wayfinding — components. Warm Wayfinder, clean. Tokens in tokens.css. */
*, *::before, *::after { box-sizing: border-box; }
html { font-family: var(--font-ui); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* Lock the page; only the sheet scrolls -> kills iOS rubber-band + pull-to-refresh */
html, body { height: 100%; margin: 0; overflow: hidden; overscroll-behavior: none; background: var(--bg); color: var(--ink); }

/* Full-screen map: vh fallback first, then dvh (tracks the URL bar) */
#map { position: fixed; inset: 0; height: 100vh; height: 100dvh; background: #eee7db; }
.maplibregl-ctrl-attrib { font-size: 10px; }
.maplibregl-ctrl-bottom-right { margin-bottom: env(safe-area-inset-bottom); }
/* Keep zoom controls clear of the fixed top bar + notch */
.maplibregl-ctrl-top-right { margin-top: calc(env(safe-area-inset-top) + 92px); }
/* Native geolocate button hidden — we drive it from the primed "Show my location" button */
.maplibregl-ctrl-geolocate { display: none; }
/* Tint the live location dot to our blue */
.maplibregl-user-location-dot, .maplibregl-user-location-dot::before { background-color: var(--gps); }

button { font: inherit; color: inherit; -webkit-appearance: none; appearance: none; }
a { color: inherit; }

/* >=44px tap targets; keyboard focus ring */
button, a.btn, [role="button"], .tap { min-height: var(--tap); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
:focus:not(:focus-visible) { outline: none; }
/* consistent press behaviour; kill the iOS grey tap-flash + 300ms delay (.sheet__grip keeps touch-action:none by specificity) */
button, a.btn, .channels a, .li, .link, .lang, .share, .ob__skip, .modal__link {
  -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; touch-action: manipulation;
}

/* ---------- top bar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5; pointer-events: none;
  display: flex; align-items: flex-start; gap: 10px;
  padding: max(12px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) 26px max(14px, env(safe-area-inset-left));
  background: linear-gradient(180deg, rgba(244,236,224,.96), rgba(244,236,224,.72) 60%, rgba(244,236,224,0));
}
.brand { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.brand__logo { height: 23px; width: auto; display: block; filter: drop-shadow(0 1px 1.5px rgba(28,27,25,.22)); }
.brand__sub { font: 500 11px/1 var(--font-ui); color: var(--muted); }
.topbar__right { margin-left: auto; display: flex; align-items: center; gap: 8px; pointer-events: auto; }
.status { display: inline-flex; align-items: center; gap: 5px; font: 500 11.5px/1.2 var(--font-ui); color: var(--ink);
  background: rgba(255,255,255,.72); border: 1px solid var(--hairline-2); border-radius: var(--r-pill); padding: 6px 10px; backdrop-filter: blur(6px);
  max-width: 46vw; }
.status #statusText { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status__dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: 0 0 auto; }
.lang {
  flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
  font: 600 12px/1 var(--font-ui); letter-spacing: .2px; color: var(--ink);
  background: rgba(255,255,255,.72); border: 1px solid var(--hairline-2);
  border-radius: var(--r-pill); padding: 0 13px; min-height: var(--tap); min-width: var(--tap);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); cursor: pointer; transition: background-color .15s ease;
}
.lang:active { background: rgba(255,255,255,.95); }

/* ---------- bottom sheet (draggable: peek <-> full) ---------- */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; margin: 0 auto; max-width: 540px;
  --sheet-peek: 40px;                 /* visible height when collapsed (the grabber bar) */
  display: flex; flex-direction: column;
  max-height: 88vh; max-height: 88dvh; /* dvh wins where supported, tracks the URL bar */
  background: var(--surface); border-radius: var(--r-sheet) var(--r-sheet) 0 0; box-shadow: var(--shadow-sheet);
  transform: translateY(0); will-change: transform;     /* CSS default = fully expanded + usable (no-JS safe) */
  transition: transform .34s cubic-bezier(.32,.72,0,1);
  touch-action: none;                 /* the shell never pans the map; the scroller re-enables pan-y */
}
.sheet.is-dragging { transition: none; }                /* 1:1 finger tracking during a drag */
/* pinned grabber header — the primary drag/toggle zone */
.sheet__header { flex: 0 0 auto; touch-action: none; }
.sheet__grip {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  width: 100%; height: var(--sheet-peek); padding: 0; margin: 0;
  background: none; border: none; cursor: grab; touch-action: none; -webkit-tap-highlight-color: transparent;
}
.sheet__grip:active { cursor: grabbing; }
.sheet__grabber { width: 38px; height: 5px; border-radius: 3px; background: var(--hairline-2); }
.sheet__hint { display: flex; height: 14px; color: var(--faint); opacity: 0; transition: opacity .2s ease; }
.sheet__hint svg { width: 15px; height: 15px; }
.sheet__grip[aria-expanded="false"] .sheet__hint { opacity: 1; }  /* "pull up" cue only when collapsed */
/* inner scroller holds all the content */
.sheet__scroll {
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 2px max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.view__head { display: flex; align-items: center; gap: 10px; }
.view__head .eyebrow { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eyebrow { font: var(--t-eyebrow); letter-spacing: .6px; text-transform: uppercase; color: var(--label); }
.title { font: var(--t-title); letter-spacing: -.4px; color: var(--ink); margin: 5px 0 3px; }
.body { font: var(--t-body); color: var(--muted); margin: 0; }

.share {
  margin-left: auto; flex: 0 0 auto;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: var(--tap); padding: 0 14px; white-space: nowrap;
  font: 600 12.5px/1 var(--font-ui); letter-spacing: -.1px;
  color: var(--accent-text); background: var(--accent-tint);
  border: none; border-radius: var(--r-pill); cursor: pointer; transition: background-color .15s ease;
}
.share:active { background: #ffe7d4; }
.share svg { width: 16px; height: 16px; flex: 0 0 auto; }

/* recommended hero — subtle tint + hairline (clean, not a heavy box) */
/* Recommended hero — subtle tint only (no heavy box) */
.rec { margin-top: 14px; background: var(--accent-tint); border: none; border-radius: var(--r-card); padding: 13px 14px; }
.rec__tag { font: 700 10px/1 var(--font-ui); letter-spacing: .5px; text-transform: uppercase; color: var(--accent-text); margin-bottom: 8px; }
.rec__row { display: flex; align-items: center; gap: 11px; }
.rec__pin { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  color: #fff; font: 800 12px/1 var(--font-ui); flex: 0 0 auto; }
.rec__pin.is-ok { background: var(--ok); } .rec__pin.is-warn { background: var(--warn); color: var(--ink); }
.rec__txt { flex: 1; min-width: 0; }
.rec__name { font: var(--t-item); color: var(--ink); }
.rec__meta { font: 400 12px/1.3 var(--font-ui); color: var(--muted); margin-top: 1px; }
/* Caution = hairline-separated line, not a nested box */
.rec__note { font: 400 12.5px/1.45 var(--font-ui); color: var(--warn-ink); background: none; border: none;
  border-top: 1px solid var(--hairline-2); border-radius: 0; padding: 10px 0 0; margin: 11px 0 0; }

.pill { font: 700 10.5px/1 var(--font-ui); padding: 4px 8px; border-radius: var(--r-pill); flex: 0 0 auto; white-space: nowrap; }
.pill--ok { background: var(--ok-bg); color: var(--ok-ink); }
.pill--warn { background: var(--warn-bg); color: var(--warn-ink); }

/* buttons (one primary per view) */
.btnrow { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 52px; padding: 0 18px;
  border: none; border-radius: var(--r-btn);
  font: var(--t-btn); letter-spacing: -.2px; white-space: nowrap;
  text-decoration: none; cursor: pointer; transition: background-color .15s ease, box-shadow .15s ease;
}
.btn svg { flex: 0 0 auto; }
.btn--primary { background: var(--cta); color: #fff; box-shadow: 0 1px 2px rgba(28,27,25,.18); }
.btn--primary:active { background: var(--cta-press); box-shadow: none; }
.btn--secondary { background: var(--surface-2); color: var(--ink); border: 1px solid var(--hairline-2); }
.btn--secondary:active { background: var(--hairline-2); }
.locate svg { width: 18px; height: 18px; }

/* always-visible forward channels (WhatsApp dominates in Cyprus; works without Web Share) */
.channels { display: flex; gap: 8px; margin-top: 12px; }
.channels a {
  flex: 1 1 0; min-width: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 46px; padding: 0 8px;
  text-decoration: none; white-space: nowrap; overflow: hidden;
  font: 600 12.5px/1 var(--font-ui); letter-spacing: -.1px; color: var(--ink);
  background: var(--surface-2); border: 1px solid var(--hairline-2); border-radius: var(--r-btn); transition: background-color .15s ease;
}
.channels a:active { background: var(--hairline-2); }
.channels a span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.channels svg { width: 16px; height: 16px; flex: 0 0 auto; }

/* mandatory ODbL map credit — always visible above the sheet fold */
.credit { margin: 14px 0 0; text-align: center; font: 400 10px/1.3 var(--font-ui); color: var(--label); }

/* "closer" list — settings-style */
.more { margin-top: 16px; }
.more__label { font: 600 11px/1 var(--font-ui); letter-spacing: .5px; text-transform: uppercase; color: var(--label); margin-bottom: 4px; }
.list { display: flex; flex-direction: column; }
.li { display: flex; align-items: center; gap: 11px; width: 100%; text-align: left; background: none; border: none;
  border-bottom: 1px solid var(--hairline); padding: 12px 2px; font: 400 14px/1.2 var(--font-ui); color: var(--ink); cursor: pointer; }
.li:last-child { border-bottom: none; }
.li__dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.li__dot.is-ok { background: var(--ok); } .li__dot.is-warn { background: var(--warn); }
.li__name { flex: 1; min-width: 0; }
.li__min { font: 600 12px/1 var(--font-ui); color: var(--muted); }
.li__chev { color: var(--faint); font-size: 18px; line-height: 1; }

.link { display: block; width: 100%; text-align: center; margin-top: 13px; padding: 8px; background: none; border: none;
  font: 600 13px/1.2 var(--font-ui); color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.link--accent { color: var(--accent-text); }
.locate { margin-top: 14px; }
/* status pill row (Reliable / Check first) used in the closer list */
.pill--sm { font: 700 9.5px/1 var(--font-ui); padding: 3px 7px; }
.li .pill { flex: 0 0 auto; }

/* ---------- toast ---------- */
.toast { position: fixed; left: 50%; top: calc(env(safe-area-inset-top) + 64px); transform: translateX(-50%) translateY(-10px);
  z-index: 9; background: var(--ink); color: #fff; font: 500 13px/1.35 var(--font-ui); padding: 11px 15px; border-radius: 12px;
  max-width: 86vw; text-align: center; box-shadow: var(--shadow-pop); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- modal (primer / denied help) ---------- */
.modal { position: fixed; inset: 0; z-index: 20; background: rgba(28,27,25,.45);
  display: flex; align-items: center; justify-content: center; padding: 22px; }
.modal__card { background: var(--surface); border-radius: 18px; box-shadow: var(--shadow-pop); max-width: 360px; width: 100%;
  padding: 22px 20px; text-align: center; }
.modal__ico { font-size: 30px; margin-bottom: 6px; }
.modal__card h3 { margin: 0 0 6px; font: 600 17px/1.25 var(--font-ui); color: var(--ink); }
.modal__card p { margin: 6px 0 0; font: 400 13px/1.5 var(--font-ui); color: var(--muted); }
.modal__card .btn { margin-top: 16px; }
.modal__link { display: inline-block; margin-top: 11px; background: none; border: none; color: var(--muted);
  font: 500 12.5px/1 var(--font-ui); text-decoration: underline; cursor: pointer; min-height: 32px; }

/* ---------- onboarding ---------- */
.ob { position: fixed; inset: 0; z-index: 30; background: rgba(28,27,25,.5); display: flex; align-items: flex-end; }
.ob__card { background: var(--surface); margin: 12px; margin-bottom: max(12px, env(safe-area-inset-bottom)); width: 100%;
  max-width: 520px; margin-left: auto; margin-right: auto; border-radius: 22px; padding: 22px 20px 16px; text-align: center; box-shadow: var(--shadow-pop); }
.ob__ill { width: 96px; height: 96px; border-radius: 50%; background: #fdf1e6; margin: 2px auto 12px; display: flex; align-items: center; justify-content: center; }
.ob__ill svg { width: 50px; height: 50px; }
.ob__dots { display: flex; gap: 6px; justify-content: center; margin-bottom: 12px; }
.ob__dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--hairline-2); transition: width .2s; }
.ob__dots i.on { background: var(--accent); width: 18px; border-radius: var(--r-pill); }
.ob__title { margin: 0 0 6px; font: 700 18px/1.25 var(--font-ui); letter-spacing: -.3px; color: var(--ink); }
.ob__body { margin: 0 0 14px; font: 400 13px/1.5 var(--font-ui); color: var(--muted); }
.ob__skip { display: block; margin: 8px auto 0; background: none; border: none; color: var(--muted); font: 600 12px/1 var(--font-ui); cursor: pointer; min-height: var(--tap); padding: 0 16px; }

/* ---------- welcome announcement ---------- */
.welcome { position: fixed; inset: 0; z-index: 30; background: rgba(28,27,25,.5);
  display: flex; align-items: center; justify-content: center; padding: 20px; }
.welcome__card { position: relative; background: var(--surface); border-radius: 22px; box-shadow: var(--shadow-pop);
  max-width: 400px; width: 100%; padding: 16px 18px 18px; text-align: center;
  animation: welcomeIn .28s cubic-bezier(.32,.72,0,1); }
@keyframes welcomeIn { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.welcome__x { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; min-height: 32px;
  display: flex; align-items: center; justify-content: center; border: none; border-radius: 50%;
  background: rgba(255,255,255,.65); color: var(--muted); font: 400 22px/1 var(--font-ui); cursor: pointer; z-index: 2; }
.welcome__art-wrap { margin: 2px 0 14px; }
.welcome__art { display: block; width: 100%; height: auto; border-radius: 16px; }
.welcome__title { margin: 0 0 9px; font: 700 19px/1.25 var(--font-ui); letter-spacing: -.3px; color: var(--ink); }
.welcome__body { margin: 0 0 8px; font: 400 13.5px/1.5 var(--font-ui); color: var(--muted); }
.welcome__cta { margin-top: 12px; }
.welcome__once { margin: 10px 0 0; font: 500 11px/1.3 var(--font-ui); color: var(--faint); }

/* ---------- map markers ---------- */
.pin { background: none; border: none; padding: 0; cursor: pointer; line-height: 0; min-height: 0; }
.pin__badge { display: flex; align-items: center; justify-content: center; border-radius: 50%; color: #fff;
  border: 2.5px solid #fff; box-shadow: var(--shadow-pin); font-weight: 800; }
.pin--parking .pin__badge { width: 26px; height: 26px; font-size: 12px; }
.pin--parking.is-ok .pin__badge { background: var(--ok); }
.pin--parking.is-warn .pin__badge { background: var(--warn); color: var(--ink); }
.pin--parking.is-rec .pin__badge { width: 30px; height: 30px; font-size: 14px; }
.pin--venue .pin__badge { width: 38px; height: 38px; font-size: 19px; background: var(--accent); }
.pin--church .pin__badge { width: 15px; height: 15px; border-width: 2px; background: #b59b78; }
.pin--sel .pin__badge { outline: 3px solid var(--accent); outline-offset: 2px; }

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important;
    transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
