/* Entrada na ficha e visualizador panorâmico NR+. */
.project-story #projectTourAction {
  margin-top: 25px;
}

.project-tour-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 18px;
  border: 1px solid var(--ink);
  padding: 8px 14px;
  color: var(--ink);
  font-size: 0.875rem;
  text-decoration: none;
}

.project-tour-link:is(:hover, :focus-visible) {
  color: var(--off-white);
  background: var(--ink);
}

.tour-page {
  --tour-gutter: clamp(16px, 3vw, 48px);
  --tour-vh: 100vh;
  --tour-height: max(400px, calc(var(--tour-vh) - 124px));
}

@supports (height: 100dvh) {
  .tour-page { --tour-vh: 100dvh; }
}

.tour-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(12px, 2vw, 26px);
  padding: 14px var(--tour-gutter) 16px;
  border-bottom: 1px solid var(--border);
}

.tour-brand {
  display: block;
  width: clamp(40px, 4.1vw, 52px);
}

.tour-brand img {
  width: 100%;
  height: auto;
  mix-blend-mode: multiply;
}

.tour-heading h1 {
  margin: 1px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.375rem, 3.15vw, 3.25rem);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}

.tour-heading .eyebrow {
  color: var(--text-muted);
}

.tour-return {
  display: flex;
  min-height: 44px;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 0.85rem;
  text-decoration: none;
}

.tour-return:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.tour-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(190px, 21vw, 292px);
  gap: clamp(14px, 2.3vw, 38px);
  padding: 18px var(--tour-gutter) 24px;
}

.tour-stage {
  position: relative;
  min-width: 0;
  height: 70vh;
  height: var(--tour-height);
  background: var(--surface-media);
}

.tour-stage:fullscreen {
  width: 100%;
  height: 100%;
}

#tour-panorama {
  width: 100%;
  height: 100%;
}

.tour-stage [hidden] {
  display: none;
}

.tour-gesture,
.tour-controls,
.tour-error {
  position: absolute;
  z-index: 2;
  margin: 0;
  color: var(--off-white);
  background: rgba(5, 5, 5, 0.82);
}

.tour-gesture {
  bottom: max(12px, env(safe-area-inset-bottom));
  left: max(12px, env(safe-area-inset-left));
  padding: 7px 10px;
  font-size: 0.75rem;
  line-height: 1.3;
  pointer-events: none;
}

.tour-controls {
  right: max(12px, env(safe-area-inset-right));
  bottom: max(12px, env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
}

.tour-controls button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  color: inherit;
  background: transparent;
  font-size: 1.15rem;
  cursor: pointer;
}

.tour-controls button + button {
  border-left: 1px solid var(--line);
}

.tour-controls [data-tour-fullscreen] {
  font-size: 0.78rem;
}

.tour-controls button:hover {
  background: rgba(255, 255, 255, 0.14);
}

.tour-error {
  inset: auto 16px 16px;
  padding: 12px;
  text-align: center;
}

.tour-rail {
  display: flex;
  min-width: 0;
  min-height: 0;
  max-height: 70vh;
  max-height: var(--tour-height);
  flex-direction: column;
}

.tour-rail h2 {
  margin: 0 0 10px;
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 400;
}

.tour-scenes {
  display: grid;
  gap: 4px;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.tour-scene {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  min-height: 62px;
  align-items: center;
  gap: 11px;
  padding: 6px;
  border: 1px solid transparent;
  color: var(--ink);
  background: transparent;
  text-align: left;
  font-size: 0.875rem;
  line-height: 1.3;
  cursor: pointer;
}

.tour-scene img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--surface-placeholder);
}

.tour-scene[aria-current="true"] {
  border-color: var(--ink);
  font-weight: 600;
}

.tour-scene:disabled {
  cursor: default;
}

.tour-scene:not(:disabled):hover {
  background: var(--surface-placeholder);
}

.tour-page :is(a, button, #tour-panorama):focus-visible {
  outline: 2px solid currentColor;
  outline-offset: -2px;
}

.tour-status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 740px) {
  .tour-page {
    --tour-height: max(270px, calc(var(--tour-vh) - 230px));
  }

  .tour-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 13px;
    padding-top: 12px;
  }

  .tour-rail {
    max-height: none;
  }

  .tour-scenes {
    grid-auto-flow: column;
    grid-auto-columns: 112px;
    overflow: auto hidden;
    scroll-snap-type: x proximity;
    padding-bottom: 6px;
  }

  .tour-scene {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    align-items: start;
    gap: 5px;
    min-height: 0;
    font-size: 0.75rem;
    scroll-snap-align: start;
  }

  .tour-gesture {
    top: max(12px, env(safe-area-inset-top));
    bottom: auto;
  }
}

@media (max-width: 460px) {
  .tour-return {
    min-width: 44px;
    justify-content: center;
    font-size: 1.25rem;
  }

  .tour-return-label {
    display: none;
  }
}
