@font-face {
  font-family: "El Messiri";
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url("fonts/el-messiri-arabic.woff2") format("woff2");
}
@font-face {
  font-family: "Readex Pro";
  font-style: normal;
  font-weight: 300 600;
  font-display: swap;
  src: url("fonts/readex-pro-arabic.woff2") format("woff2");
}

:root {
  --ivory: #fbf7ef;
  --card: #fffdf9;
  --line: #dfd0b4;
  --edge: #9c8560;
  --walnut: #3a291d;
  --walnut-soft: #6a5545;
  --amber: #c48f37;
  --amber-deep: #8d5d16;
  --amber-wash: #f7ead0;
  --green: #2f4a36;
  --green-deep: #24392a;
  --shadow: 0 1px 2px rgba(58, 41, 29, 0.08), 0 10px 28px rgba(58, 41, 29, 0.16);
  --display: "El Messiri", "Readex Pro", "Geeza Pro", Tahoma, sans-serif;
  --text: "Readex Pro", "Geeza Pro", "Segoe UI", Tahoma, sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px);
  --safe-r: env(safe-area-inset-right, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ivory); color: var(--walnut); }
body { font-family: var(--text); overflow: hidden; -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }

.tour { position: fixed; inset: 0; height: 100dvh; background: var(--ivory); }
/* Pannellum positions hotspots from the left edge; keep the viewer LTR, labels stay RTL */
.pano { position: absolute; inset: 0; direction: ltr; }
.pnlm-container { background: var(--ivory) !important; font-family: var(--text) !important; }
.pnlm-load-box, .pnlm-panorama-info, .pnlm-about-msg, .pnlm-orientation-button, .pnlm-compass { display: none !important; }

/* scene change veil: ivory flash that fades out once the new place has loaded */
.veil { position: absolute; inset: 0; z-index: 3; background: var(--ivory); opacity: 0; pointer-events: none; }
.veil.is-in { opacity: 1; }
.veil.is-out { animation: veil-out .5s ease-out forwards; }
@keyframes veil-out { from { opacity: 1; } to { opacity: 0; } }

/* top bar */
.bar {
  position: absolute; z-index: 5;
  top: calc(12px + var(--safe-t)); inset-inline: calc(12px + var(--safe-r)) calc(12px + var(--safe-l));
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  pointer-events: none;
}
.bar > * { pointer-events: auto; }
.here {
  display: flex; align-items: center; gap: 12px; min-width: 0;
  background: color-mix(in srgb, var(--card) 92%, transparent);
  border: 1px solid var(--line); border-radius: 14px; padding: 8px 14px 8px 12px;
  box-shadow: var(--shadow); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.logo { width: 96px; height: auto; display: block; flex: none; }
.here-text { display: flex; flex-direction: column; min-width: 0; border-inline-start: 1px solid var(--line); padding-inline-start: 12px; }
.here-label { font-size: 12px; color: var(--walnut-soft); line-height: 1.3; }
.here-name { margin: 0; font-family: var(--display); font-weight: 700; font-size: 19px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.tools { display: flex; gap: 8px; flex: none; }
.tool {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; min-width: 48px; padding: 0 16px;
  background: color-mix(in srgb, var(--card) 92%, transparent); color: var(--walnut);
  border: 1px solid var(--line); border-radius: 999px; box-shadow: var(--shadow);
  font-size: 15px; font-weight: 500; cursor: pointer;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: background-color .15s ease, border-color .15s ease;
}
.tool-icon { padding: 0; width: 48px; }
a.tool { text-decoration: none; }
.tool-wa { background: var(--green); color: var(--card); border-color: var(--green); }
.tool-wa:hover { background: var(--green-deep); border-color: var(--green-deep); color: var(--card); }
.tool svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tool:hover { background: var(--amber-wash); border-color: var(--edge); }
.tool[aria-pressed="true"], .tool[aria-expanded="true"] { background: var(--walnut); color: var(--card); border-color: var(--walnut); }
.tool:focus-visible, .place:focus-visible, .hs:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
.tool .i-close { display: none; }
.tool[aria-pressed="true"] .i-open { display: none; }
.tool[aria-pressed="true"] .i-close { display: block; }

/* places panel */
.places {
  position: absolute; z-index: 6;
  top: calc(12px + var(--safe-t)); bottom: calc(12px + var(--safe-b)); inset-inline-start: calc(12px + var(--safe-r));
  width: min(340px, calc(100vw - 24px));
  display: flex; flex-direction: column;
  background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow);
  overflow: hidden;
}
.places-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 10px; border-bottom: 1px solid var(--line); }
.places-head h2 { margin: 0; font-family: var(--display); font-size: 20px; font-weight: 700; }
.places-head .tool { box-shadow: none; }
.places-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; overscroll-behavior: contain; display: grid; gap: 6px; counter-reset: p; }
.place {
  width: 100%; display: grid; grid-template-columns: 88px 1fr; align-items: center; gap: 12px;
  padding: 6px; border: 1px solid transparent; border-radius: 12px; background: none;
  text-align: start; cursor: pointer; min-height: 60px;
}
.place img { width: 88px; height: 55px; object-fit: cover; border-radius: 8px; display: block; background: var(--amber-wash); }
.place span { font-size: 15px; line-height: 1.35; }
.place:hover { background: var(--amber-wash); }
.place[aria-current="true"] { background: var(--amber-wash); border-color: var(--edge); font-weight: 600; }

/* hotspots: a round floor marker with a forward chevron and the destination name */
.hs {
  width: 52px; height: 52px; border-radius: 50%;
  background: color-mix(in srgb, var(--card) 90%, transparent);
  border: 2px solid var(--card); box-shadow: 0 0 0 1px var(--edge), var(--shadow);
  display: grid; place-items: center; cursor: pointer; padding: 0;
}
.hs svg { width: 26px; height: 26px; fill: none; stroke: var(--walnut); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.hs:hover { background: var(--amber-wash); }
.hs .hs-label {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  direction: rtl; white-space: nowrap; font-size: 14px; font-weight: 500; line-height: 1.3;
  background: var(--walnut); color: var(--card); padding: 5px 11px; border-radius: 999px;
  pointer-events: none;
}

.hint {
  position: absolute; z-index: 4; margin: 0; left: 50%; transform: translateX(-50%);
  bottom: calc(16px + var(--safe-b)); max-width: calc(100vw - 32px);
  font-size: 13px; text-align: center; color: var(--walnut);
  background: color-mix(in srgb, var(--card) 90%, transparent); border: 1px solid var(--line);
  border-radius: 999px; padding: 8px 16px; box-shadow: var(--shadow);
  transition: opacity .4s ease;
}
.hint.is-off { opacity: 0; pointer-events: none; }
.msg { position: absolute; z-index: 7; inset: auto 16px calc(16px + var(--safe-b)); margin: 0; padding: 12px 16px; background: var(--card); border: 1px solid var(--edge); border-radius: 12px; font-size: 15px; text-align: center; }

/* fallback fullscreen (iPhone Safari has no element fullscreen) */
.tour.is-pseudo-full .bar .here { display: none; }

/* mid widths: keep the top bar on one line */
@media (min-width: 641px) and (max-width: 1000px) {
  .tool-home span { display: none; }
  .tool-home { width: 48px; padding: 0; }
}

@media (max-width: 640px) {
  .logo { display: none; }
  .here { padding: 8px 12px; }
  .here-text { border: 0; padding: 0; }
  .here-name { font-size: 17px; }
  .tool:not(.tool-icon):not(.tool-wa) span { display: none; }
  .tool:not(.tool-icon):not(.tool-wa) { width: 48px; padding: 0; }
  /* booking button becomes a full-width bar at the bottom, like the site's WhatsApp bar */
  .tool-wa {
    position: fixed; z-index: 5; inset-inline: calc(12px + var(--safe-r)) calc(12px + var(--safe-l));
    bottom: calc(12px + var(--safe-b)); min-height: 50px; font-size: 16px;
  }
  .hint { bottom: calc(74px + var(--safe-b)); }
  .places { bottom: calc(74px + var(--safe-b)); max-height: calc(100dvh - 150px); }
  .places { inset-inline: calc(10px + var(--safe-r)) calc(10px + var(--safe-l)); width: auto; top: auto; max-height: 72dvh; }
}

@media (prefers-reduced-motion: reduce) {
  .tool, .hint { transition: none; }
  .veil.is-out { animation: none; opacity: 0; }
}
