/* Visite 360 — styles partagés (visite + admin) */

@font-face {
  font-family: 'Jost';
  src: url('fonts/jost-latin.woff2') format('woff2');
  font-weight: 300 600;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Jost';
  src: url('fonts/jost-latin-ext.woff2') format('woff2');
  font-weight: 300 600;
  font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  /* tirés des rendus : noyer des portes, pierre du sol, laiton des suspensions, velours des chaises */
  --walnut: #2a211b;
  --walnut-2: #3a2e25;
  --glass: rgba(38, 30, 24, 0.66);
  --glass-strong: rgba(34, 27, 22, 0.88);
  --stone: #ece5d8;
  --stone-2: #bdb2a1;
  --stone-3: #8f8576;
  --brass: #c8a15e;
  --brass-hi: #e3c489;
  --velvet: #7fa59c;
  --alert: #e09a86;
  --line: rgba(236, 229, 216, 0.14);
  --line-strong: rgba(236, 229, 216, 0.26);
  --font: 'Jost', 'Avenir Next', 'Futura', system-ui, sans-serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  background: var(--walnut);
  color: var(--stone);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}

button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brass-hi); outline-offset: 2px; }

/* ---------- moteur ---------- */
.pano {
  overflow: hidden;
  touch-action: none;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
}
.pano.is-dragging { cursor: grabbing; }
.pano-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pano-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  transition: opacity 0.4s ease 0.05s;
}
.pano.is-moving .pano-layer { opacity: 0; transition-duration: 0.15s; transition-delay: 0s; }

/* ---------- points de passage ---------- */
.hs {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  padding: 0;
  border: 0;
  background: none;
  pointer-events: auto;
  cursor: pointer;
}
.hs:focus-visible { outline: none; }

.hs-ring {
  position: absolute;
  left: 0;
  top: 0;
  width: var(--d, 48px);
  height: calc(var(--d, 48px) * var(--sq, 1));
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 2px solid rgba(236, 229, 216, 0.95);
  background: rgba(42, 33, 27, 0.22);
  box-shadow: 0 0 0 1px rgba(42, 33, 27, 0.35), 0 6px 22px rgba(30, 22, 16, 0.35), inset 0 0 0 1px rgba(42, 33, 27, 0.25);
  transition: border-color 0.2s, background-color 0.2s, box-shadow 0.2s;
}
.hs--wall .hs-ring { background: rgba(42, 33, 27, 0.45); backdrop-filter: blur(4px); }

.hs-dot {
  width: calc(var(--d, 48px) * 0.22);
  height: calc(var(--d, 48px) * 0.22);
  max-width: 14px;
  max-height: 14px;
  border-radius: 50%;
  background: var(--brass);
  transform: scaleY(var(--sq, 1));
  transition: transform 0.2s, background-color 0.2s;
}
.hs-ring svg {
  width: calc(var(--d, 48px) * 0.46);
  max-width: 26px;
  aspect-ratio: 1;
  transform: scaleY(var(--sq, 1));
  fill: none;
  stroke: var(--stone);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.hs:hover .hs-ring,
.hs:focus-visible .hs-ring {
  border-color: var(--brass-hi);
  background-color: rgba(200, 161, 94, 0.32);
  box-shadow: 0 0 0 1px rgba(42, 33, 27, 0.35), 0 0 0 6px rgba(227, 196, 137, 0.18), 0 6px 22px rgba(30, 22, 16, 0.35);
}
.hs:hover .hs-dot { background: var(--brass-hi); transform: scaleY(var(--sq, 1)) scale(1.25); }

.hs-tag {
  position: absolute;
  left: 0;
  bottom: calc(var(--d, 48px) * var(--sq, 1) / 2 + 10px);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 6px 6px;
  border-radius: 8px;
  background: var(--glass-strong);
  backdrop-filter: blur(10px);
  box-shadow: 0 10px 30px rgba(20, 15, 11, 0.35);
  white-space: nowrap;
  text-align: left;
  color: var(--stone);
  opacity: 0;
  transform: translate(-50%, 4px);
  pointer-events: none;
  transition: opacity 0.18s, transform 0.18s;
}
.hs-tag:not(:has(.thumb)) { padding-left: 14px; }
.hs:hover .hs-tag,
.hs:focus-visible .hs-tag { opacity: 1; transform: translate(-50%, 0); }
.hs-tag .thumb { width: 96px; border-radius: 4px; }
.hs-text { display: flex; flex-direction: column; gap: 1px; }
.hs-name { font-size: 15px; font-weight: 450; }
.hs-floor { font-size: 12.5px; color: var(--brass-hi); }

@media (hover: none) {
  .hs-tag { opacity: 1; transform: translate(-50%, 0); padding: 4px 10px; }
  .hs-tag .thumb { display: none; }
  .hs-name { font-size: 13px; }
}

/* ---------- vignettes ---------- */
/* l'image fait 2× la vignette : on voit ±90° autour de --u et ±45° autour de l'horizon */
.thumb {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 1;
  border-radius: 6px;
  background-color: var(--walnut-2);
  background-repeat: repeat-x;
  background-size: 200% 200%;
  background-position: calc((var(--u, 0.5) * 2 - 0.5) * 100%) 50%;
}

/* ---------- boutons ---------- */
.icon-btn {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--glass);
  backdrop-filter: blur(12px);
  color: var(--stone);
  cursor: pointer;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.icon-btn:hover { border-color: var(--line-strong); background-color: rgba(58, 46, 37, 0.8); }
.icon-btn[aria-pressed='true'] { background: var(--stone); color: var(--walnut); border-color: transparent; }
.icon-btn svg, .btn svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
