/* Virtual tour viewer. Colors are CSS variables so a tenant stylesheet can retheme it. */
.vt {
    --vt-accent: #e5c37e;
    --vt-glass: rgba(20, 24, 33, .74);
    --vt-glass-border: rgba(255, 255, 255, .14);
    --vt-text: #fff;
    --vt-muted: rgba(255, 255, 255, .68);
    position: relative;
    width: 100%;
    height: 70vh;
    min-height: 420px;
    overflow: hidden;
    background: #0b0c10;
    color: var(--vt-text);
    font-family: inherit;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.vt:fullscreen,
.vt.is-fullscreen {
    height: 100% !important;
    width: 100%;
}

.vt-noscript {
    padding: 2rem;
    text-align: center;
}

.vt-stage {
    position: absolute;
    inset: 0;
    overflow: hidden;
    touch-action: none;
    cursor: grab;
}

.vt-stage.is-dragging {
    cursor: grabbing;
}

/* ---- Scene views (one per photo; two overlap while crossfading) ---- */
.vt-view {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(1.035);
    transition: opacity .6s ease, transform .8s ease;
}

.vt-view.is-in {
    opacity: 1;
    transform: none;
}

.vt-view.is-out {
    opacity: 0;
    transform: scale(.98);
    pointer-events: none;
}

.vt-backdrop {
    position: absolute;
    inset: -40px;
    background-size: cover;
    background-position: center;
    filter: blur(28px) brightness(.55);
}

.vt-layer {
    position: absolute;
    left: 0;
    top: 0;
    transform-origin: 0 0;
    will-change: transform;
}

.vt-layer > img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    display: block;
    pointer-events: none;
    -webkit-user-drag: none;
}

.vt-full {
    opacity: 0;
    transition: opacity .5s ease;
}

.vt-view.is-loaded .vt-full {
    opacity: 1;
}

.vt-loader {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 3px;
    overflow: hidden;
    opacity: 1;
    transition: opacity .3s ease;
    pointer-events: none;
}

.vt-loader::after {
    content: "";
    position: absolute;
    inset: 0;
    width: 35%;
    background: var(--vt-accent);
    animation: vt-load 1.1s ease-in-out infinite;
}

.vt-view.is-loaded .vt-loader {
    opacity: 0;
}

@keyframes vt-load {
    from { transform: translateX(-100%); }
    to { transform: translateX(300%); }
}

/* ---- Hotspots (positioned in image percentages, kept at a constant on-screen size) ---- */
.vt-hs-wrap {
    position: absolute;
    width: 0;
    height: 0;
}

.vt-hs {
    position: absolute;
    left: 0;
    top: 0;
    transform: translate(-50%, -50%) scale(var(--inv, 1));
    transform-origin: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0;
    border: 0;
    background: none;
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.vt-hs-icon {
    position: relative;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: rgba(0, 0, 0, .28);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .45);
    transition: background .2s ease, transform .2s ease;
}

.vt-hs-icon svg {
    width: 18px;
    height: 18px;
}

.vt-hs-nav .vt-hs-icon::before {
    content: "";
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #fff;
}

.vt-hs-nav .vt-hs-icon::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 50%;
    border: 2px solid #fff;
    animation: vt-pulse 2.2s ease-out infinite;
}

@keyframes vt-pulse {
    from { transform: scale(1); opacity: .7; }
    to { transform: scale(1.7); opacity: 0; }
}

.vt-hs:hover .vt-hs-icon,
.vt-hs:focus-visible .vt-hs-icon {
    background: rgba(255, 255, 255, .28);
    transform: scale(1.12);
}

.vt-hs:focus-visible {
    outline: none;
}

.vt-hs:focus-visible .vt-hs-icon {
    box-shadow: 0 0 0 3px var(--vt-accent);
}

.vt-hs-label {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translate(-50%, 6px);
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 240px;
    padding: 5px 14px 5px 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .96);
    color: #1d2230;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 0, 0, .35);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}

.vt-hs-label.no-thumb {
    padding-left: 14px;
}

.vt-hs-label img {
    position: static;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
    flex: none;
}

.vt-hs-label span {
    overflow: hidden;
    text-overflow: ellipsis;
}

.vt-hs:hover .vt-hs-label,
.vt-hs:focus-visible .vt-hs-label {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (hover: none) {
    .vt-hs-label {
        opacity: 1;
        transform: translate(-50%, 0);
        font-size: 12px;
    }
}

/* ---- Overlay UI ---- */
.vt-ui {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.vt-ui > * {
    pointer-events: auto;
}

/* Springy easing shared by the control bar animations. */
.vt {
    --vt-spring: cubic-bezier(.34, 1.56, .64, 1);
    --vt-ease-out: cubic-bezier(.2, .8, .2, 1);
}

.vt-bar {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    align-items: center;
    max-width: calc(100% - 20px);
}

.vt.is-collapsed .vt-bar {
    pointer-events: none;
}

/*
 * Show/hide: each pill drops away in turn (right to left, starting from the hide button) and rises back
 * left to right once the round show button has gone. --i / --rev are each pill's position, set by the script.
 */
.vt-bar > .vt-pill {
    transition:
        opacity .3s ease calc(.12s + var(--i, 0) * 60ms),
        transform .5s var(--vt-spring) calc(.12s + var(--i, 0) * 60ms),
        visibility 0s linear 0s;
}

.vt.is-collapsed .vt-bar > .vt-pill,
.vt.vt-autohide:not(.is-peek) .vt-bar > .vt-pill {
    opacity: 0;
    visibility: hidden;
    transform: translateY(36px) scale(.85);
    transition:
        opacity .22s ease calc(var(--rev, 0) * 50ms),
        transform .3s var(--vt-ease-out) calc(var(--rev, 0) * 50ms),
        visibility 0s linear calc(.3s + var(--rev, 0) * 50ms);
}

/*
 * Auto-hide (mouse devices, set by the script): the bar's own box stays hoverable while its pills are hidden,
 * and an invisible margin around it (down to the bottom edge) makes the spot easy to hit. The pills rise
 * without the wait the show button needs. Manual hide/show is not needed here, so those buttons go.
 */
.vt.vt-autohide .vt-bar::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: -24px -32px -18px;
}

.vt.vt-autohide.is-peek .vt-bar > .vt-pill {
    transition-delay: calc(var(--i, 0) * 50ms), calc(var(--i, 0) * 50ms), 0s;
}

.vt.vt-autohide .vt-collapse,
.vt.vt-autohide .vt-pill-tools > .vt-sep,
.vt.vt-autohide .vt-pill-collapse-only,
.vt.vt-autohide .vt-expand {
    display: none;
}

.vt-pill {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 6px;
    border-radius: 999px;
    background: var(--vt-glass);
    border: 1px solid var(--vt-glass-border);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, .35);
}

.vt-btn {
    flex: none;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s ease, opacity .15s ease, scale .35s var(--vt-spring);
}

/* Press feedback: buttons sink while held and spring back on release. */
.vt-btn:active:not(:disabled) {
    scale: .86;
    transition-duration: .15s, .15s, .08s;
}

.vt-expand:active {
    scale: .86;
}

.vt-btn:hover:not(:disabled):not(:active) {
    scale: 1.06;
}

/* Previous/next arrows nudge in the direction of travel (also on keyboard and swipe). */
.vt-btn.vt-nudge-prev svg {
    animation: vt-nudge-prev .4s var(--vt-ease-out);
}

.vt-btn.vt-nudge-next svg {
    animation: vt-nudge-next .4s var(--vt-ease-out);
}

@keyframes vt-nudge-prev {
    40% { transform: translateX(-5px); }
}

@keyframes vt-nudge-next {
    40% { transform: translateX(5px); }
}

/* Icon swap (fullscreen on/off) spins the new icon in. */
.vt-btn.vt-icon-swap svg {
    animation: vt-icon-in .4s var(--vt-spring);
}

@keyframes vt-icon-in {
    from { opacity: 0; transform: scale(.5) rotate(-90deg); }
}

/* Map button stays highlighted while its panel is open. */
.vt-btn[aria-expanded="true"] {
    background: rgba(255, 255, 255, .2);
}

.vt-btn svg {
    width: 20px;
    height: 20px;
}

.vt-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, .16);
}

.vt-btn:focus-visible {
    outline: 2px solid var(--vt-accent);
    outline-offset: 1px;
}

.vt-btn:disabled {
    opacity: .35;
    cursor: default;
}

.vt-btn-round {
    width: 46px;
    height: 46px;
    background: #fff;
    color: #1d2230;
}

.vt-btn-round:hover:not(:disabled) {
    background: #f1f1f1;
}

.vt-sep {
    width: 1px;
    height: 22px;
    margin: 0 4px;
    background: var(--vt-glass-border);
}

.vt-album-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 190px;
    padding: 4px 10px 4px 6px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    color: #fff;
    text-align: left;
    cursor: pointer;
    font: inherit;
    transition: background .15s ease, scale .35s var(--vt-spring);
}

.vt-album-btn:hover,
.vt-album-btn[aria-expanded="true"] {
    background: rgba(255, 255, 255, .16);
}

.vt-album-btn:active {
    scale: .95;
    transition-duration: .15s, .08s;
}

/* Scene change: the thumbnail pops in and the counter slides in from the direction of travel. */
.vt-album-btn.vt-swap img {
    animation: vt-thumb-in .45s var(--vt-spring);
}

.vt-album-btn.vt-swap small {
    display: inline-block;
    animation: vt-count-in .35s var(--vt-ease-out);
}

@keyframes vt-thumb-in {
    from { opacity: .2; transform: scale(.6) rotate(calc(var(--vt-dir, 1) * 25deg)); }
}

@keyframes vt-count-in {
    from { opacity: 0; transform: translateX(calc(var(--vt-dir, 1) * 10px)); }
}

.vt-album-btn:focus-visible {
    outline: 2px solid var(--vt-accent);
}

.vt-album-btn img {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex: none;
    border: 2px solid rgba(255, 255, 255, .85);
}

.vt-album-text {
    flex: 1;
    min-width: 0;
    line-height: 1.2;
}

.vt-album-text b {
    display: block;
    font-size: 13px;
    font-weight: 600;
}

.vt-album-text small {
    font-size: 11px;
    color: var(--vt-muted);
}

.vt-album-btn svg {
    width: 16px;
    height: 16px;
    flex: none;
    transition: transform .2s ease;
}

.vt-album-btn[aria-expanded="true"] svg {
    transform: rotate(180deg);
}

/* The show button waits for the pills to drop away, then pops up in their place. */
.vt-expand {
    position: absolute;
    left: 50%;
    bottom: 18px;
    transform: translate(-50%, 24px) scale(.4);
    display: flex;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition:
        opacity .18s ease,
        transform .25s var(--vt-ease-out),
        visibility 0s linear .25s,
        scale .35s var(--vt-spring);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--vt-glass-border);
    background: var(--vt-glass);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    color: #fff;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.vt-expand svg {
    width: 20px;
    height: 20px;
}

.vt.is-collapsed .vt-expand {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0) scale(1);
    transition:
        opacity .25s ease .22s,
        transform .5s var(--vt-spring) .22s,
        visibility 0s linear 0s,
        scale .35s var(--vt-spring);
}

.vt-expand:hover {
    scale: 1.08;
}

.vt-expand:focus-visible {
    outline: 2px solid var(--vt-accent);
    outline-offset: 2px;
}

/* A soft ring pulses once after the show button appears, so it is easy to spot. */
.vt.is-collapsed .vt-expand::after {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .7);
    opacity: 0;
    animation: vt-pulse 1.1s ease-out .55s 2;
    pointer-events: none;
}

/* ---- Album tray, floor plan and info card ---- */
.vt-tray,
.vt-map,
.vt-card {
    position: absolute;
    border-radius: 16px;
    background: var(--vt-glass);
    border: 1px solid var(--vt-glass-border);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    box-shadow: 0 10px 40px rgba(0, 0, 0, .45);
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, transform .3s cubic-bezier(.2, .8, .2, 1), visibility .3s;
}

.vt-tray.is-open,
.vt-map.is-open,
.vt-card.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.vt-tray {
    left: 50%;
    bottom: 80px;
    width: min(720px, calc(100% - 24px));
    max-height: min(52%, 420px);
    overflow-y: auto;
    padding: 14px 16px 16px;
    transform: translate(-50%, 16px) scale(.96);
    transform-origin: 50% 100%;
}

.vt-tray.is-open {
    transform: translate(-50%, 0);
}

.vt-tray h4 {
    margin: 10px 0 8px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--vt-muted);
}

.vt-tray h4:first-child {
    margin-top: 0;
}

/* One horizontally scrolling row per group. */
.vt-tray-grid {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 6px;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, .35) transparent;
}

.vt-tray-grid::-webkit-scrollbar {
    height: 6px;
}

.vt-tray-grid::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .35);
    border-radius: 3px;
}

.vt-tray-grid::-webkit-scrollbar-track {
    background: transparent;
}

/* Edge fades hint that the row continues; they ease in and out as the row reaches either end. */
@property --vt-fade-start {
    syntax: "<length>";
    inherits: false;
    initial-value: 0px;
}

@property --vt-fade-end {
    syntax: "<length>";
    inherits: false;
    initial-value: 0px;
}

.vt-tray-grid {
    --vt-fade-start: 0px;
    --vt-fade-end: 0px;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 var(--vt-fade-start), #000 calc(100% - var(--vt-fade-end)), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 var(--vt-fade-start), #000 calc(100% - var(--vt-fade-end)), transparent 100%);
    transition: --vt-fade-start .3s ease, --vt-fade-end .3s ease;
}

.vt-tray-grid.has-more-start {
    --vt-fade-start: 36px;
}

.vt-tray-grid.has-more-end {
    --vt-fade-end: 36px;
}

/* Per-frame wheel gliding is driven from JS; snapping would pull against it. */
.vt-tray-grid.is-gliding {
    scroll-snap-type: none;
}

@media (prefers-reduced-motion: no-preference) {
    .vt-tray-grid {
        scroll-behavior: smooth;
    }

    .vt-tray-grid.is-gliding {
        scroll-behavior: auto;
    }

    /* Thumbnails fade and grow in as they scroll into the row, and recede as they leave it. */
    .vt-tray-grid.vt-reveal .vt-thumb {
        opacity: .35;
        transform: scale(.9);
        transition: opacity .4s ease, transform .45s cubic-bezier(.2, .8, .2, 1), border-color .2s ease;
    }

    .vt-tray-grid.vt-reveal .vt-thumb.is-visible {
        opacity: 1;
        transform: none;
    }
}

.vt-thumb {
    flex: 0 0 128px;
    scroll-snap-align: start;
    position: relative;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    background: #000;
    cursor: pointer;
    aspect-ratio: 3 / 2;
    color: #fff;
}

.vt-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .25s ease;
}

.vt-thumb:hover img {
    transform: scale(1.06);
}

.vt-thumb.is-current {
    border-color: var(--vt-accent);
}

.vt-thumb:focus-visible {
    outline: 2px solid #fff;
}

.vt-thumb span {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 14px 6px 4px;
    font-size: 11px;
    line-height: 1.2;
    text-align: left;
    background: linear-gradient(transparent, rgba(0, 0, 0, .75));
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.vt-map {
    left: 18px;
    bottom: 80px;
    width: min(380px, calc(100% - 36px));
    padding: 10px;
    transform: translateY(16px) scale(.96);
    transform-origin: 0 100%;
}

.vt-map-inner {
    position: relative;
    line-height: 0;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
}

.vt-map-inner img {
    width: 100%;
    height: auto;
    display: block;
    max-height: 52vh;
    object-fit: contain;
}

.vt-marker {
    position: absolute;
    width: 22px;
    height: 22px;
    margin: -11px 0 0 -11px;
    padding: 0;
    border-radius: 50%;
    border: 3px solid #fff;
    background: #4a5568;
    box-shadow: 0 1px 5px rgba(0, 0, 0, .5);
    cursor: pointer;
    transition: transform .15s ease;
}

.vt-marker:hover {
    transform: scale(1.2);
}

.vt-marker.is-current {
    background: var(--vt-accent);
    box-shadow: 0 0 0 4px rgba(229, 195, 126, .45), 0 1px 5px rgba(0, 0, 0, .5);
}

.vt-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, .5);
}

.vt-close svg {
    width: 16px;
    height: 16px;
}

.vt-card {
    left: 50%;
    top: 50%;
    width: min(420px, calc(100% - 32px));
    max-height: calc(100% - 40px);
    overflow-y: auto;
    padding: 0;
    transform: translate(-50%, calc(-50% + 12px));
}

.vt-card.is-open {
    transform: translate(-50%, -50%);
}

.vt-card img {
    display: block;
    width: 100%;
    max-height: 240px;
    object-fit: cover;
    border-radius: 16px 16px 0 0;
}

.vt-card-body {
    padding: 18px 20px 20px;
}

.vt-card-body h3 {
    margin: 0 0 8px;
    font-size: 1.15rem;
    color: #fff;
}

.vt-card-body p {
    margin: 0;
    white-space: pre-line;
    line-height: 1.55;
    color: rgba(255, 255, 255, .88);
    user-select: text;
    -webkit-user-select: text;
}

/* ---- Small screens: zoom is by pinch, so its pill is dropped; the rest wraps tightly ---- */
@media (max-width: 640px) {
    .vt-pill-zoom {
        display: none;
    }

    .vt-bar {
        gap: 6px;
        bottom: 12px;
    }

    .vt-album-btn {
        width: 132px;
    }

    .vt-album-btn svg {
        display: none;
    }

    .vt-btn-round {
        width: 42px;
        height: 42px;
    }

    .vt-tray,
    .vt-map {
        bottom: 72px;
    }

    .vt-map {
        left: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .vt-view,
    .vt-full,
    .vt-tray,
    .vt-map,
    .vt-card,
    .vt-btn,
    .vt-album-btn,
    .vt-expand,
    .vt.is-collapsed .vt-expand,
    .vt-bar > .vt-pill,
    .vt.is-collapsed .vt-bar > .vt-pill,
    .vt.vt-autohide.is-peek .vt-bar > .vt-pill,
    .vt.vt-autohide:not(.is-peek) .vt-bar > .vt-pill {
        transition-duration: .01s;
        transition-delay: 0s;
    }

    .vt-btn:hover:not(:disabled):not(:active),
    .vt-btn:active:not(:disabled),
    .vt-album-btn:active,
    .vt-expand:hover,
    .vt-expand:active {
        scale: none;
    }

    .vt-hs-nav .vt-hs-icon::after,
    .vt-loader::after,
    .vt-album-btn.vt-swap img,
    .vt-album-btn.vt-swap small,
    .vt-btn.vt-nudge-prev svg,
    .vt-btn.vt-nudge-next svg,
    .vt-btn.vt-icon-swap svg,
    .vt.is-collapsed .vt-expand::after {
        animation: none;
    }
}
