/* Panorama 360 · Adriana Zanoteli Atelier */

/* ---------- Componente .pano ---------- */
.pano {
  --pano-r: 16px;
  --pano-inset: 0px;
  --pano-hint-b: 22px;
  position: relative; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(70% 60% at 50% 48%, #fdfbf8 0%, rgba(251, 248, 244, .85) 35%, rgba(245, 239, 232, 0) 75%),
    radial-gradient(140% 110% at 50% 45%, var(--g-50, #f5efe8) 0%, var(--bg-alt, #ebe4dd) 70%, #e2dad2 100%);
  touch-action: pan-y;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  cursor: grab; outline: none;
}
.pano.is-dragging { cursor: grabbing; }
.pano:focus-visible { box-shadow: inset 0 0 0 2px rgba(170, 134, 94, .55); }

.pano__view {
  position: absolute; inset: var(--pano-inset);
  perspective-origin: 50% 50%;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 13%, #000 87%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 13%, #000 87%, transparent 100%);
  opacity: 0; transform: scale(.96);
  transition: opacity 1.2s var(--ease), transform 1.6s var(--ease);
}
.pano.is-ready .pano__view { opacity: 1; transform: none; }
.pano.is-ready .pano__view.is-swap { opacity: 0; transform: scale(.985); transition: opacity .4s var(--ease), transform .5s var(--ease); }

.pano__world {
  position: absolute; inset: 0;
  transform-style: preserve-3d; will-change: transform;
}

/* chão: brilho suave, sem reflexo escuro */
.pano__floor {
  position: absolute; left: 8%; right: 8%; bottom: 0; height: 26%; z-index: -1; pointer-events: none;
  background: radial-gradient(50% 60% at 50% 100%, rgba(255, 255, 255, .7), rgba(255, 255, 255, 0) 70%);
}

/* ---------- Cartões ---------- */
.pano__tile {
  position: absolute; left: 50%; top: 50%;
  width: var(--tw, 150px); height: var(--th, 200px);
  margin: calc(var(--th, 200px) / -2) 0 0 calc(var(--tw, 150px) / -2);
  padding: 0; border: 0; background: none; color: inherit; font: inherit;
  cursor: pointer; outline: none;
  -webkit-backface-visibility: hidden; backface-visibility: hidden;
  -webkit-tap-highlight-color: transparent;
}
.pano.is-dragging .pano__tile { cursor: grabbing; }
.pano__card {
  position: absolute; inset: 0; display: block; overflow: hidden;
  border-radius: var(--pano-r);
  background: var(--bg-alt, #ebe4dd);
  box-shadow: 0 1px 2px rgba(43, 37, 33, .05), 0 10px 26px rgba(43, 37, 33, .1);
  transform: perspective(800px) rotateX(0) rotateY(0) scale(1);
  transition: transform .9s var(--ease), box-shadow .9s var(--ease);
}
.pano__tile.is-hover .pano__card {
  transition: transform .35s var(--ease), box-shadow .6s var(--ease);
  box-shadow: 0 2px 6px rgba(43, 37, 33, .06), 0 22px 44px rgba(43, 37, 33, .16);
}
.pano__card img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  border-radius: inherit; opacity: 0; transition: opacity .8s var(--ease);
  pointer-events: none;
}
.pano__card img.is-loaded { opacity: 1; }
.pano__glare {
  position: absolute; inset: 0; pointer-events: none; border-radius: inherit; z-index: 1;
  background: radial-gradient(75% 60% at var(--gx, 50%) var(--gy, 25%), rgba(255, 255, 255, .34), rgba(255, 255, 255, 0) 62%);
  opacity: 0; transition: opacity .6s var(--ease);
}
.pano__tile.is-hover .pano__glare { opacity: 1; }
.pano__badge {
  position: absolute; top: 9px; right: 9px; z-index: 2; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(251, 248, 244, .8);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  box-shadow: 0 2px 8px rgba(43, 37, 33, .12);
}
.pano__badge svg { width: 11px; height: 11px; fill: var(--gold-deep, #86683a); margin-left: 2px; }
.pano__badge[hidden] { display: none; }

/* ---------- Dicas ---------- */
.pano__ui {
  position: absolute; left: 50%; bottom: var(--pano-hint-b); z-index: 3;
  transform: translateX(-50%);
  display: flex; gap: 8px; align-items: center; justify-content: center;
  pointer-events: none;
}
.pano__ui .chip {
  pointer-events: auto; white-space: nowrap; font-size: 13px; padding: 8px 14px;
  background: var(--glass, rgba(251, 248, 244, .72)); border: 1px solid var(--glass-line, rgba(255, 255, 255, .6));
  -webkit-backdrop-filter: saturate(1.6) blur(18px); backdrop-filter: saturate(1.6) blur(18px);
}
.pano__hint { transition: opacity .9s var(--ease), transform .9s var(--ease); }
.pano__hint.is-gone { opacity: 0; transform: translateY(6px); pointer-events: none !important; }
.pano__motion { cursor: pointer; color: var(--ink-2, #4a413b); }
.pano__motion[aria-pressed="true"] { background: var(--ink, #2b2521); color: var(--card, #fbf8f4); border-color: transparent; }

@media (max-width: 599px) {
  .pano__badge { top: 7px; right: 7px; width: 26px; height: 26px; }
  .pano__badge svg { width: 10px; height: 10px; }
  .pano__ui .chip { font-size: 12.5px; padding: 7px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .pano__view, .pano__card, .pano__hint { transition: none !important; }
  .pano__view { opacity: 1; transform: none; }
}

/* ---------- Página Galeria (tela cheia) ---------- */
html:has(body.page-gallery), html.is-gallery, body.page-gallery {
  height: 100%; overflow: hidden; overscroll-behavior: none;
}
body.page-gallery { background: var(--bg-alt); padding-bottom: 0 !important; }
.page-gallery .cta, .page-gallery .footer { display: none !important; }

.gal { position: relative; width: 100%; height: 100vh; height: 100svh; }
.gal__pano {
  position: absolute; inset: 0; touch-action: none;
  --pano-inset: calc(var(--nav-h) + 24px) 0 76px;
  --pano-fill: .8;
  --pano-hint-b: 92px;
}

/* cabeçalho em vidro */
.gal__head {
  position: absolute; z-index: 5;
  top: calc(12px + var(--nav-h) + 16px);
  left: max(24px, calc((100% - 1120px) / 2));
  padding: 20px 26px 22px; border-radius: var(--r-lg);
  background: var(--glass); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: saturate(1.8) blur(22px); backdrop-filter: saturate(1.8) blur(22px);
  box-shadow: var(--shadow-sm);
  pointer-events: none;
}
.gal__head .eyebrow { margin-bottom: 10px; }
.gal__head h1 { margin: 0; font-size: clamp(30px, 3.2vw, 46px); line-height: 1.02; }

/* filtro */
.gal__filter {
  position: absolute; z-index: 5; left: 50%; bottom: 24px; transform: translateX(-50%);
}
.gal__filter .segmented { position: relative; top: auto; margin: 0; box-shadow: var(--shadow-md); }
.gal__filter .segmented button small { display: inline; }

@media (max-width: 860px) {
  .gal__pano {
    --pano-inset: calc(8px + var(--nav-h) + 76px) 0 calc(8px + var(--tabbar-h) + 64px + var(--safe-b));
    --pano-fill: .9;
    --pano-hint-b: calc(8px + var(--tabbar-h) + 70px + var(--safe-b));
  }
  .gal__head {
    top: calc(8px + var(--nav-h) + 10px); left: 12px; right: auto;
    padding: 11px 16px 12px; border-radius: var(--r-md);
  }
  .gal__head .eyebrow { margin-bottom: 6px; font-size: 10.5px; }
  .gal__head h1 { font-size: 27px; }
  .gal__filter {
    left: 12px; right: 12px; transform: none;
    bottom: calc(8px + var(--tabbar-h) + 12px + var(--safe-b));
  }
  .gal__filter .segmented { display: grid; width: 100%; }
  .gal__filter .segmented button { padding: 0 6px; font-size: 13.5px; }
  .gal__filter .segmented button small { display: inline; }
}
@media (max-width: 860px) and (max-height: 640px) {
  .gal__head { display: none; }
  .gal__pano { --pano-inset: calc(8px + var(--nav-h) + 8px) 0 calc(8px + var(--tabbar-h) + 64px + var(--safe-b)); }
}

.page-gallery .lightbox__stage > img, .page-gallery .lightbox__stage > video { touch-action: pan-y; user-select: none; -webkit-user-select: none; }
