/* ═══════════════════════════════════════════════════════════════════
   ARTBOX — PANORAMA ARQUITETÔNICO INTERATIVO
   Módulo isolado: todas as regras são escopadas em #ax-panorama.
   Não depende de GSAP / ScrollTrigger / artbox-scene / artbox-motion.
   ═══════════════════════════════════════════════════════════════════ */

#ax-panorama {
  --pano-ratio: 3;                                   /* 2172 × 724 (proporção original) */
  --pano-h: clamp(420px, 68vh, 780px);               /* altura alvo no desktop */
  --pano-ink: var(--cream, #f0ece0);
  --pano-accent: var(--accent, #8fbc8f);
  --pano-olive: var(--olive-light, #6a9070);
  --pano-bg: var(--graphite, #1a1a18);
  --pano-ease: cubic-bezier(0.16, 1, 0.3, 1);

  position: relative;
  padding: 0;                                        /* anula o padding global de <section> */
  background: var(--pano-bg);
  color: var(--pano-ink);
  overflow: hidden;
  isolation: isolate;
}

/* ── Cabeçalho ─────────────────────────────────────────────────────── */
#ax-panorama .ax-pano-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  padding: 96px 5% 40px;
}
#ax-panorama .ax-pano-head .section-label { margin-bottom: 18px; }
#ax-panorama .ax-pano-title {
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: clamp(30px, 4.2vw, 58px);
  line-height: 1.02;
  letter-spacing: -0.01em;
  color: var(--pano-ink);
  margin: 0;
}
#ax-panorama .ax-pano-title em {
  font-family: 'Cormorant Garamond', serif;
  font-style: italic;
  font-weight: 500;
  color: var(--pano-accent);
}
#ax-panorama .ax-pano-hint {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin: 0 0 6px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--sand-dark, #c8c2ae);
  white-space: nowrap;
  transition: opacity .6s var(--pano-ease);
}
#ax-panorama .ax-pano-hint i {
  position: relative;
  display: block;
  width: 42px;
  height: 1px;
  background: currentColor;
  opacity: .55;
  overflow: hidden;
}
#ax-panorama .ax-pano-hint i::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--pano-ink);
  transform: translateX(-100%);
  animation: axPanoHint 2.6s var(--pano-ease) infinite;
}
@keyframes axPanoHint { 60%, 100% { transform: translateX(100%); } }
#ax-panorama.has-interacted .ax-pano-hint { opacity: .35; }

/* ── Janela de navegação ──────────────────────────────────────────── */
#ax-panorama .ax-pano-frame { position: relative; }

#ax-panorama .ax-pano-viewport {
  position: relative;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;                    /* evita “voltar página” no trackpad */
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  touch-action: pan-x pan-y;                         /* dedo: horizontal no panorama, vertical na página */
  cursor: grab;
  outline: none;
  container-type: inline-size;
}
#ax-panorama .ax-pano-viewport::-webkit-scrollbar { display: none; }
#ax-panorama .ax-pano-viewport.is-dragging { cursor: grabbing; user-select: none; -webkit-user-select: none; }
#ax-panorama .ax-pano-viewport:focus-visible { box-shadow: inset 0 0 0 1px rgba(143, 188, 143, .55); }

#ax-panorama .ax-pano-stage {
  /* largura = maior valor entre a largura útil e altura × proporção → nunca deforma */
  /* (mínimo de 115% garante percurso horizontal mesmo em telas ultrawide) */
  --pano-w: max(115vw, calc(var(--pano-h) * var(--pano-ratio)));
  --pano-w: max(115cqw, calc(var(--pano-h) * var(--pano-ratio)));
  position: relative;
  width: var(--pano-w);
  height: calc(var(--pano-w) / var(--pano-ratio));
  container-type: size;
}
#ax-panorama .ax-pano-stage picture,
#ax-panorama .ax-pano-img {
  display: block;
  width: 100%;
  height: 100%;
}
#ax-panorama .ax-pano-img {
  object-fit: fill;                                  /* o palco já tem a proporção exata da imagem */
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
  opacity: 0;
  transform: scale(1.025);
  transition: opacity 1.2s var(--pano-ease), transform 1.8s var(--pano-ease);
}
#ax-panorama .ax-pano-img.is-loaded { opacity: 1; transform: none; }

/* acabamento: fusão suave com o grafite nas bordas */
#ax-panorama .ax-pano-frame::before,
#ax-panorama .ax-pano-frame::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  width: clamp(28px, 6vw, 110px);
  z-index: 3;
  pointer-events: none;
  transition: opacity .5s var(--pano-ease);
}
#ax-panorama .ax-pano-frame::before { left: 0;  background: linear-gradient(90deg, var(--pano-bg), rgba(26, 26, 24, 0)); }
#ax-panorama .ax-pano-frame::after  { right: 0; background: linear-gradient(270deg, var(--pano-bg), rgba(26, 26, 24, 0)); }
#ax-panorama .ax-pano-frame.at-start::before,
#ax-panorama .ax-pano-frame.at-end::after { opacity: 0; }
#ax-panorama .ax-pano-stage::after {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(26, 26, 24, .55) 0%, rgba(26, 26, 24, 0) 12%),
    linear-gradient(0deg,   rgba(26, 26, 24, .65) 0%, rgba(26, 26, 24, 0) 14%);
}

/* ── Marcadores ───────────────────────────────────────────────────── */
#ax-panorama .ax-pano-markers {
  list-style: none;
  margin: 0;
  padding: 0;
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
#ax-panorama .ax-pano-marker {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
#ax-panorama .ax-pano-marker.is-open { z-index: 2; }

/* área sensível (cobre a construção) */
#ax-panorama .ax-pano-zone {
  position: absolute;
  left:   calc(var(--zl) * 1%);
  top:    calc(var(--zt) * 1%);
  width:  calc(var(--zw) * 1%);
  height: calc(var(--zh) * 1%);
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  pointer-events: auto;
  -webkit-tap-highlight-color: transparent;
  outline: none;
}
#ax-panorama .ax-pano-viewport.is-dragging .ax-pano-zone { cursor: grabbing; }

/* ponto de identificação */
#ax-panorama .ax-pano-dot {
  position: absolute;
  left: calc(var(--x) * 1%);
  top:  calc(var(--y) * 1%);
  width: 9px;
  height: 9px;
  margin: -4.5px 0 0 -4.5px;
  border-radius: 50%;
  background: var(--pano-ink);
  box-shadow: 0 0 0 1px rgba(26, 26, 24, .35), 0 0 14px rgba(240, 236, 224, .55);
  pointer-events: none;
  opacity: 0;
  transform: scale(.4);
  transition: opacity .7s var(--pano-ease), transform .7s var(--pano-ease);
  transition-delay: calc(var(--i, 0) * 90ms + 250ms);
}
#ax-panorama .ax-pano-dot::after {                  /* anel discreto */
  content: '';
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1px solid rgba(240, 236, 224, .55);
  animation: axPanoRing 3.2s var(--pano-ease) infinite;
  animation-delay: calc(var(--i, 0) * 260ms);
}
@keyframes axPanoRing {
  0%   { transform: scale(.55); opacity: 0; }
  35%  { opacity: .9; }
  100% { transform: scale(1.5); opacity: 0; }
}
#ax-panorama.is-in .ax-pano-dot { opacity: 1; transform: scale(1); }
#ax-panorama .ax-pano-marker.is-open .ax-pano-dot {
  transform: scale(1.25);
  background: var(--pano-accent);
  transition-delay: 0s;
}
#ax-panorama .ax-pano-marker.is-open .ax-pano-dot::after { animation: none; opacity: 0; }

/* identificador: linha fina + nome, crescendo a partir do ponto */
#ax-panorama .ax-pano-label {
  position: absolute;
  left: calc(var(--x) * 1%);
  bottom: calc(100% - var(--y) * 1%);
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  transform: translateX(-50%);
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0s linear .55s;
}
#ax-panorama .ax-pano-line {
  display: block;
  width: 1px;
  /* sobe do ponto até acima da cobertura da construção */
  height: 72px;
  height: calc((var(--y) - var(--zt)) * 1cqh + 3.5cqh + 6px);
  margin-top: 8px;
  background: linear-gradient(0deg, rgba(240, 236, 224, .9), rgba(240, 236, 224, .35));
  transform: scaleY(0);
  transform-origin: 50% 100%;
  transition: transform .45s var(--pano-ease) .1s;
}
#ax-panorama .ax-pano-tag {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 4px 6px;
  color: var(--pano-ink);
  text-decoration: none;
  text-align: center;
  white-space: nowrap;
  text-shadow: 0 1px 14px rgba(0, 0, 0, .75), 0 0 2px rgba(0, 0, 0, .45);
  /* halo difuso para leitura sobre o céu — sem caixa nem borda */
  background: radial-gradient(closest-side, rgba(20, 20, 18, .42), rgba(20, 20, 18, 0));
  padding: 14px 26px;
  margin-bottom: -6px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .35s var(--pano-ease), transform .45s var(--pano-ease);
  outline: none;
}
#ax-panorama .ax-pano-idx {
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: .3em;
  color: var(--pano-accent);
  font-weight: 500;
}
#ax-panorama .ax-pano-name {
  font-family: 'Syne', sans-serif;
  font-weight: 600;
  font-size: clamp(13px, 1.05vw, 16px);
  letter-spacing: .16em;
  text-transform: uppercase;
}
#ax-panorama .ax-pano-go {
  position: relative;
  font-family: 'DM Mono', monospace;
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: rgba(240, 236, 224, .82);
  padding-bottom: 3px;
}
#ax-panorama .ax-pano-go::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(.25);
  transition: transform .45s var(--pano-ease);
}
#ax-panorama a.ax-pano-tag:hover .ax-pano-go,
#ax-panorama a.ax-pano-tag:focus-visible .ax-pano-go { color: var(--pano-ink); }
#ax-panorama a.ax-pano-tag:hover .ax-pano-go::after,
#ax-panorama a.ax-pano-tag:focus-visible .ax-pano-go::after { transform: scaleX(1); }

/* estado aberto (hover, foco ou fixado pelo clique/toque) */
#ax-panorama .ax-pano-marker.is-open .ax-pano-label {
  visibility: visible;
  transition-delay: 0s;
}
#ax-panorama .ax-pano-marker.is-open .ax-pano-label a.ax-pano-tag { pointer-events: auto; }
#ax-panorama .ax-pano-marker.is-open .ax-pano-line { transform: scaleY(1); transition-delay: 0s; }
#ax-panorama .ax-pano-marker.is-open .ax-pano-tag {
  opacity: 1;
  transform: none;
  transition-delay: .18s;
}
/* saída: o nome sai antes da linha recolher */
#ax-panorama .ax-pano-marker:not(.is-open) .ax-pano-tag { transition-delay: 0s; }

/* ── Rodapé: progresso + empreendimento em foco ───────────────────── */
#ax-panorama .ax-pano-foot {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 26px 5% 88px;
  font-family: 'DM Mono', monospace;
  font-size: 11px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--sand-dark, #c8c2ae);
}
#ax-panorama .ax-pano-progress {
  position: relative;
  flex: 1;
  height: 1px;
  background: rgba(230, 226, 211, .14);
  overflow: hidden;
}
#ax-panorama .ax-pano-progress span {
  position: absolute;
  inset: 0;
  background: var(--pano-olive);
  transform-origin: 0 50%;
  transform: scaleX(var(--p, 0));
}
#ax-panorama .ax-pano-current { min-width: 13ch; text-align: right; white-space: nowrap; }
#ax-panorama .ax-pano-current b { color: var(--pano-ink); font-weight: 500; }

/* ── Mobile / toque ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  #ax-panorama { --pano-h: clamp(340px, 60svh, 560px); }
  #ax-panorama .ax-pano-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    padding: 72px 6% 28px;
  }
  #ax-panorama .ax-pano-foot { padding: 20px 6% 64px; gap: 16px; font-size: 10px; letter-spacing: .2em; }
  #ax-panorama .ax-pano-frame::before,
  #ax-panorama .ax-pano-frame::after { width: 16px; }
}
@media (max-width: 480px) {
  #ax-panorama { --pano-h: clamp(320px, 56svh, 500px); }
  #ax-panorama .ax-pano-name { font-size: 12.5px; letter-spacing: .12em; }
  #ax-panorama .ax-pano-current { min-width: 0; }
}
@media (hover: none) {
  #ax-panorama .ax-pano-viewport { cursor: auto; }
}

/* ── Movimento reduzido ───────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  #ax-panorama .ax-pano-img,
  #ax-panorama .ax-pano-dot,
  #ax-panorama .ax-pano-line,
  #ax-panorama .ax-pano-tag { transition-duration: .01s !important; transition-delay: 0s !important; }
  #ax-panorama .ax-pano-dot::after,
  #ax-panorama .ax-pano-hint i::after { animation: none; }
  #ax-panorama .ax-pano-img { transform: none; }
}
