/* Layout and state rules for a WebGL section: poster, canvas and the content above them. */
[data-sp3d] { position: relative; isolation: isolate; }

/* The faded poster still sits under the canvas; without pointer-events: none a drag on the map starts a native image drag. */
[data-sp3d] .sp3d-poster { position: absolute; inset: 0; z-index: 0; display: block; width: 100%; height: 100%; object-fit: cover; object-position: var(--photo-focus, 50% 25%); pointer-events: none; user-select: none; -webkit-user-drag: none; }

[data-sp3d] .sp3d-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1;
  opacity: 0; transition: opacity .4s ease; pointer-events: none; }
[data-sp3d].is-3d-ready .sp3d-canvas { opacity: 1; }
/* The poster fades rather than leaving the DOM, so its alt text stays in the page. */
[data-sp3d].is-3d-ready .sp3d-poster { opacity: 0; }
[data-sp3d].is-3d-lost .sp3d-canvas { opacity: 0; }
[data-sp3d].is-3d-lost .sp3d-poster,
[data-sp3d].is-3d-fallback .sp3d-poster { opacity: 1; }
[data-sp3d].is-3d-fallback .sp3d-canvas { display: none; }

[data-sp3d] > :not(.sp3d-poster):not(.sp3d-canvas) { position: relative; z-index: 2; }

@media (prefers-reduced-motion: reduce) { .sp3d-canvas { transition: none; } }
