/* ===========================================================
   Argilea Villa - 360 tour
   Loaded on the tour page on top of app.css, and on its own
   inside wp-admin for the hotspot mapper. Every token carries a
   fallback so it survives without app.css.
   =========================================================== */

.tour-stage{
  position:relative;
  width:100%;
  height:clamp(460px,72vh,820px);
  background:var(--sand,#d4c8b3);
  overflow:hidden;
  border-radius:2px;
  box-shadow:0 24px 60px -30px rgba(49,36,25,.45);
}
.tour-stage:focus{outline:none}
.tour-stage:focus-visible{outline:2px solid var(--clay,#a8967e);outline-offset:4px}
/* Full screen, by either route. dvh matters on phones: 100vh there is the tall
   viewport behind the browser chrome, which crops the bottom of the tour. */
.tour-stage.is-fs{
  position:fixed;inset:0;z-index:9999;
  width:100%;height:100vh;height:100dvh;
  max-height:none;border-radius:0;box-shadow:none;
}
/* only the CSS fallback needs the page held still underneath it */
html.tour-fs-lock,html.tour-fs-lock body{overflow:hidden}

.tour-canvas{display:block;width:100%;height:100%;cursor:grab;touch-action:none}
.tour-stage.grabbing .tour-canvas{cursor:grabbing}

/* soft vignette so the chrome always has something to sit on */
.tour-stage::after{
  content:"";position:absolute;inset:0;pointer-events:none;
  background:
    linear-gradient(180deg,rgba(31,31,31,.34) 0%,rgba(31,31,31,0) 22%),
    linear-gradient(0deg,rgba(31,31,31,.42) 0%,rgba(31,31,31,0) 30%);
}

/* Stacking: photo, then the hotspots over it, then the chrome on top so the
   room name and the rail stay readable through a transition. */
.tour-title,.tour-tools,.tour-rail,.tour-hint,.tour-loading,.tour-readout{z-index:3}

/* ---------- hotspots ---------- */
.tour-hotspots{position:absolute;inset:0;z-index:1;pointer-events:none;transition:opacity .3s ease}
.tour-hotspots.out{opacity:0}

.hs{
  position:absolute;top:0;left:0;
  pointer-events:auto;
  display:flex;flex-direction:column;align-items:center;gap:.5rem;
  background:none;border:0;padding:0;cursor:pointer;
  font-family:var(--sans,'Jost',-apple-system,Segoe UI,sans-serif);color:#fff;
  --near:1;
  /* the viewer shows and hides these with display, so they never stretch the stage's
     scroll box. they start hidden inline, set when the hotspot is built */
}
.hs-nav,.hs-link{width:max-content}

/* ---------- walk-to point: a disc lying on the floor ----------
   Not a button pasted onto the photograph. The disc is squashed by its own
   pitch (--squash, set by the viewer from the angle below the horizon), so a
   point further down the floor reads flatter and the marker sits in the room.
   ------------------------------------------------------------------------- */
.hs-nav{gap:.34rem}

.hs-step{
  display:grid;place-items:center;
  width:calc(22px * var(--near));height:calc(22px * var(--near));
  animation:hsStep 3.2s ease-in-out infinite;
}
.hs-step svg{
  width:100%;height:100%;fill:none;stroke:#fff;stroke-width:2.2;
  stroke-linecap:round;stroke-linejoin:round;
  filter:drop-shadow(0 2px 7px rgba(31,31,31,.75));
}
@keyframes hsStep{
  0%,68%,100%{transform:translateY(0);opacity:.82}
  84%{transform:translateY(5px);opacity:1}
}

.hs-pad{
  position:relative;display:block;
  width:calc(74px * var(--near));height:calc(74px * var(--near));
  transform:scaleY(var(--squash,.45));
  transition:transform .3s ease;
}
.hs-pad-face{
  position:absolute;inset:0;border-radius:50%;
  border:2px solid rgba(255,255,255,.9);
  background:radial-gradient(closest-side,
    rgba(255,255,255,.28), rgba(255,255,255,.05) 68%, transparent);
  box-shadow:0 0 20px rgba(31,31,31,.4), inset 0 0 14px rgba(255,255,255,.22);
  transition:border-color .28s ease,background .28s ease,box-shadow .28s ease;
}
/* a ring travelling outward across the floor, so the point reads as live */
.hs-pad::after{
  content:"";position:absolute;inset:0;border-radius:50%;
  border:1.5px solid rgba(255,255,255,.5);
  animation:hsBeacon 3s ease-out infinite;
  pointer-events:none;
}
@keyframes hsBeacon{
  0%{transform:scale(.72);opacity:.75}
  70%,100%{transform:scale(1.55);opacity:0}
}

.hs-nav:hover .hs-pad,.hs-nav:focus-visible .hs-pad{
  transform:scaleY(var(--squash,.45)) scale(1.07);
}
.hs-nav:hover .hs-pad-face,.hs-nav:focus-visible .hs-pad-face{
  border-color:#fff;
  background:radial-gradient(closest-side,
    rgba(168,150,126,.6), rgba(168,150,126,.2) 68%, transparent);
  box-shadow:0 0 30px rgba(168,150,126,.55), inset 0 0 18px rgba(255,255,255,.3);
}

/* the room name, set in the display face and kept quiet until wanted */
.hs-nav .hs-label{
  font-family:var(--serif,'Marcellus',Georgia,serif);
  font-size:calc(.92rem * max(var(--near),.72));
  letter-spacing:.015em;text-transform:none;
  opacity:.72;transition:opacity .28s ease;
}
.hs-nav:hover .hs-label,.hs-nav:focus-visible .hs-label{opacity:1}

/* ---------- link point: still a button, because it leaves the tour ---------- */
.hs-ring{
  display:grid;place-items:center;
  width:calc(54px * var(--near));height:calc(54px * var(--near));
  border-radius:50%;
  background:rgba(168,150,126,.55);
  border:1px solid #fff;
  backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px);
  transition:background .28s ease,border-color .28s ease,transform .28s ease;
}
.hs-ring svg{
  width:52%;height:52%;fill:none;stroke:#fff;stroke-width:2;
  stroke-linecap:round;stroke-linejoin:round;
  animation:hsNudgeX 2.6s ease-in-out infinite;
}
@keyframes hsNudgeX{0%,72%,100%{transform:translateX(0)}84%{transform:translateX(3px)}}
.hs-link:hover .hs-ring,.hs-link:focus-visible .hs-ring{
  background:var(--clay,#a8967e);border-color:var(--clay,#a8967e);transform:scale(1.08);
}
.hs-label{
  font-size:calc(.72rem * max(var(--near),.72));
  letter-spacing:.16em;text-transform:uppercase;font-weight:400;
  text-shadow:0 1px 10px rgba(31,31,31,.9);
  white-space:nowrap;opacity:.92;
}

/* info point */
.hs-info{width:max-content}
.hs-dot{
  display:grid;place-items:center;
  width:calc(30px * var(--near));height:calc(30px * var(--near));
  border-radius:50%;
  background:rgba(255,255,255,.9);
  box-shadow:0 0 0 0 rgba(255,255,255,.5);
  animation:hsPulse 2.8s ease-out infinite;
  transition:background .28s ease;
}
.hs-plus{position:relative;width:44%;height:44%}
.hs-plus::before,.hs-plus::after{
  content:"";position:absolute;background:var(--brown,#312419);
  left:50%;top:50%;transform:translate(-50%,-50%);
}
.hs-plus::before{width:100%;height:1.5px}
.hs-plus::after{width:1.5px;height:100%}
@keyframes hsPulse{
  0%{box-shadow:0 0 0 0 rgba(255,255,255,.45)}
  70%{box-shadow:0 0 0 16px rgba(255,255,255,0)}
  100%{box-shadow:0 0 0 0 rgba(255,255,255,0)}
}
.hs-info:hover .hs-dot,.hs-info.open .hs-dot{background:var(--clay,#a8967e);animation:none}
.hs-info:hover .hs-plus::before,.hs-info:hover .hs-plus::after,
.hs-info.open .hs-plus::before,.hs-info.open .hs-plus::after{background:#fff}

.hs-tip{
  width:min(260px,58vw);
  background:rgba(251,250,248,.96);
  color:var(--ink,#1f1f1f);
  padding:.85rem 1rem .95rem;
  text-align:left;
  box-shadow:0 18px 40px -18px rgba(31,36,25,.6);
  opacity:0;transform:translate(var(--tip-shift,0px),6px);pointer-events:none;
  transition:opacity .26s ease,transform .26s ease;
}
.hs-tip b{
  display:block;font-family:var(--serif,'Marcellus',Georgia,serif);font-weight:400;
  font-size:1.02rem;color:var(--clay-dark,#8a7860);margin-bottom:.15rem;
}
.hs-tip i{display:block;font-style:normal;font-size:.83rem;line-height:1.6;color:var(--grey,#606060)}
.hs-info:hover .hs-tip,.hs-info:focus-visible .hs-tip,.hs-info.open .hs-tip{
  opacity:1;transform:translate(var(--tip-shift,0px),0);
}

/* ---------- chrome ---------- */
.tour-title{
  position:absolute;right:clamp(16px,3vw,32px);top:clamp(14px,2.6vw,26px);
  max-width:min(58%,420px);text-align:right;
  font-family:var(--serif,'Marcellus',Georgia,serif);font-size:clamp(1.05rem,2.4vw,1.7rem);
  color:#fff;text-shadow:0 2px 16px rgba(31,31,31,.7);
  pointer-events:none;letter-spacing:.01em;line-height:1.2;
}

.tour-tools{
  position:absolute;right:clamp(14px,2.6vw,26px);bottom:clamp(14px,2.6vw,26px);
  display:flex;gap:.5rem;
}
.tour-tools button{
  width:40px;height:40px;display:grid;place-items:center;
  border:1px solid rgba(255,255,255,.5);border-radius:50%;
  background:rgba(31,31,31,.22);backdrop-filter:blur(3px);-webkit-backdrop-filter:blur(3px);
  cursor:pointer;transition:background .25s ease,border-color .25s ease;
}
.tour-tools button:hover{background:var(--clay,#a8967e);border-color:var(--clay,#a8967e)}
.tour-tools svg{width:18px;height:18px;fill:none;stroke:#fff;stroke-width:1.6;
  stroke-linecap:round;stroke-linejoin:round}
.tour-auto.off svg{opacity:.42}

/* ---------- room picker ----------
   Two dozen viewpoints will not fit a row of buttons, so they live in one
   grouped list opened from a control that always names where the guest is.
   ---------------------------------------------------------------------- */
.tour-rail{
  position:absolute;left:clamp(14px,2.6vw,26px);top:clamp(14px,2.6vw,26px);
  z-index:5;
}

/* the hamburger: same weight as the tool buttons opposite it */
.tour-pick{
  display:grid;place-items:center;
  width:44px;height:44px;cursor:pointer;
  border:1px solid rgba(255,255,255,.5);border-radius:50%;
  background:rgba(31,31,31,.28);
  backdrop-filter:blur(6px);-webkit-backdrop-filter:blur(6px);
  transition:background .25s ease,border-color .25s ease;
}
.tour-pick:hover{background:var(--clay,#a8967e);border-color:var(--clay,#a8967e)}
.tour-pick:focus-visible{outline:2px solid #fff;outline-offset:2px}
.tour-pick-bars{display:block;width:18px;height:13px;position:relative}
.tour-pick-bars i{
  position:absolute;left:0;width:100%;height:1.8px;border-radius:2px;background:#fff;
  transition:transform .3s ease,opacity .2s ease,top .3s ease;
}
.tour-pick-bars i:nth-child(1){top:0}
.tour-pick-bars i:nth-child(2){top:5.6px}
.tour-pick-bars i:nth-child(3){top:11.2px}
/* open: the bars fold into a close cross */
.tour-stage.menu-open .tour-pick-bars i:nth-child(1){top:5.6px;transform:rotate(45deg)}
.tour-stage.menu-open .tour-pick-bars i:nth-child(2){opacity:0}
.tour-stage.menu-open .tour-pick-bars i:nth-child(3){top:5.6px;transform:rotate(-45deg)}

.tour-menu{
  position:absolute;left:0;top:calc(100% + .5rem);
  width:min(320px,72vw);
  background:rgba(251,250,248,.97);
  backdrop-filter:blur(10px);-webkit-backdrop-filter:blur(10px);
  box-shadow:0 26px 54px -22px rgba(31,36,25,.65);
  z-index:4;
}
.tour-menu[hidden]{display:none}
.tour-menu-scroll{
  max-height:min(46vh,320px);
  overflow-y:auto;overscroll-behavior:contain;
  padding:.35rem 0 .5rem;
}
.tour-menu-group + .tour-menu-group{border-top:1px solid rgba(168,150,126,.22)}
.tour-menu-head{
  margin:0;padding:.75rem 1rem .3rem;
  font-family:var(--sans,'Jost',-apple-system,Segoe UI,sans-serif);
  font-size:.62rem;font-weight:500;letter-spacing:.18em;text-transform:uppercase;
  color:var(--clay-dark,#8a7860);
}
.tour-menu-item{
  display:block;width:100%;text-align:left;
  padding:.5rem 1rem;border:0;background:none;cursor:pointer;
  font-family:var(--serif,'Marcellus',Georgia,serif);
  font-size:.95rem;color:var(--ink,#1f1f1f);
  transition:background .18s ease,color .18s ease;
}
.tour-menu-item:hover{background:rgba(168,150,126,.16)}
.tour-menu-item.on{background:var(--clay,#a8967e);color:#fff}
.tour-menu-item:focus-visible{outline:2px solid var(--clay,#a8967e);outline-offset:-2px}

.tour-hint{
  position:absolute;left:50%;bottom:clamp(18px,3.4vh,30px);transform:translateX(-50%);
  color:#fff;font-size:.7rem;letter-spacing:.2em;text-transform:uppercase;
  text-shadow:0 1px 12px rgba(31,31,31,.85);
  pointer-events:none;opacity:.9;transition:opacity .5s ease;
}
.tour-stage.touched .tour-hint{opacity:0}

.tour-loading{
  position:absolute;left:0;right:0;top:0;height:2px;
  background:var(--clay,#a8967e);transform:scaleX(0);transform-origin:left;
  opacity:0;transition:opacity .2s ease;
}
.tour-loading.on{opacity:1;animation:tourBar 1.1s ease-in-out infinite}
@keyframes tourBar{
  0%{transform:scaleX(0);transform-origin:left}
  50%{transform:scaleX(1);transform-origin:left}
  51%{transform:scaleX(1);transform-origin:right}
  100%{transform:scaleX(0);transform-origin:right}
}

.tour-readout{
  position:absolute;right:12px;bottom:12px;display:none;
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:.7rem;
  color:#fff;background:rgba(31,31,31,.55);padding:.35rem .6rem;border-radius:2px;
}
.tour-readout.on{display:block}

/* fallbacks */
.tour-fallback{display:none;position:absolute;inset:0;place-items:center;text-align:center;
  padding:2rem;background:var(--paper-2,#f8f6f1)}
.tour-stage.no-webgl .tour-fallback,.tour-stage.no-image .tour-fallback{display:grid}
.tour-stage.no-webgl .tour-canvas,.tour-stage.no-image .tour-canvas{visibility:hidden}
.tour-fallback p{max-width:44ch;color:var(--grey,#606060)}

@media (max-width:640px){
  .tour-stage{height:min(78vh,620px)}
  .hs-link .hs-label{display:none}
  .hs-nav .hs-label{font-size:calc(.8rem * max(var(--near),.72))}
  .tour-menu-scroll{max-height:min(52vh,320px)}
}
@media (prefers-reduced-motion:reduce){
  .hs-ring svg,.hs-dot,.tour-loading.on{animation:none}
}
