/* ========================================================================
   vr-viewer.css — chrome for the shared 360° panorama overlay (vr-viewer.js).
   Split out of search_detail.css for task147/CQ5, which opens the same viewer
   from the search list; the list page loads search_lists.css, not the detail
   sheet, so the overlay came up unstyled (a full-bleed black canvas with no
   close button in sight).

   ponytail: search_detail.css still carries its own copy of these rules — the
   detail page and property-detail.html were owned by another change in flight.
   Dedupe = delete the "VR Panorama Viewer (T1-14)" block there and link this
   file from templates/property-detail.html and templates/search/search_detail.html.
   ======================================================================== */
.vr-overlay {
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 6000;   /* was 1000 — must outrank the fixed header (common.css:159 → 5000) */
}

/* lock the page behind the panorama (mirrors body.nav_open, common.css:382) */
body.vr_open {
    overflow: hidden;
}

.vr-canvas {
    display: block;
    width: 100%;
    height: 100%;
    touch-action: none;
}

.vr-controls {
    position: absolute;
    top: 24px;
    left: 24px;
    right: 24px;
    display: flex;
    justify-content: space-between;
    gap: 16px;
    z-index: 1001;
}

.vr-controls__left {
    display: flex;
    gap: 12px;
}

.vr-btn {
    background: var(--premium-black);
    color: var(--white);
    border: 1px solid var(--neutral-gray-02);
    border-radius: 50px;
    padding: 14px 28px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
}

.vr-btn--close {
    min-width: 56px;
}

.vr-info {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--premium-black);
    color: var(--white);
    padding: 16px 32px;
    border-radius: 50px;
    font-size: 14px;
    border: 1px solid var(--neutral-gray-02);
}

.vr-info__sp {
    display: none;
}

/* common.css:136-146 kills the outline on every button, so without this the
   overlay's focus trap moves focus somewhere invisible. */
.vr-btn:focus-visible {
    outline: 3px solid var(--white);
    outline-offset: 2px;
    box-shadow: 0 0 0 5px rgba(0, 0, 0, .6);
}

/* T1-64 — panorama switcher, its own row just above the hint bar. */
.vr-switch {
    position: absolute;
    bottom: 96px;        /* ponytail: clears .vr-info (bottom:32px + ~50px tall) */
    left: 24px;
    right: 24px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    /* The active pill is white-on-panorama. Japanese interiors are mostly white
       walls, where that measured 1.32:1 against the photo behind it (WCAG 1.4.11
       wants 3:1) and the only "which one am I on" cue disappeared. The scrim
       gives the pills a guaranteed backdrop instead of dropping the inversion. */
    background: rgba(0, 0, 0, .5);
    padding: 6px;
    border-radius: 999px;
}

/* UA [hidden]{display:none} loses to the author display:flex above — restore it */
.vr-switch[hidden] {
    display: none;
}

.vr-switch .vr-btn--switch {
    padding: 10px 20px;
    font-size: 14px;
}

.vr-switch .vr-btn--switch.is-active {
    background: var(--white);
    color: var(--premium-black);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .65);
}

.vr-switch .vr-btn--switch[aria-busy="true"] {
    opacity: .6;
}

@media(max-width:768px){
    .vr-controls {
        top: 4vw;
        left: 4vw;
        right: 4vw;
        gap: 2vw;
    }
    .vr-controls__left {
        gap: 2vw;
    }
    .vr-btn {
        padding: 2.5vw 4vw;
        font-size: 3.5vw;
        border-radius: 8vw;
    }
    .vr-btn--close {
        min-width: 10vw;
    }
    .vr-switch {
        /* Measured, not derived: .vr-info's top edge sits 20.26-20.62vw above the
           viewport bottom across 320-768px (its 3vw font + 3vw padding render
           taller than a line-height:1.5 estimate suggests). 18vw overlapped the
           hint bar by 8-17px. 24vw leaves >=3.3vw everywhere in that range. */
        bottom: 24vw;
        left: 4vw;
        right: 4vw;
        gap: 1.5vw;
    }
    .vr-switch .vr-btn--switch {
        padding: 2vw 3.2vw;
        font-size: 3vw;
        /* vw padding gave 28.8-34px tall pills with ~5px between them; ten
           identical targets that size in the thumb zone mis-fire. */
        min-height: 44px;
    }
    .vr-info {
        bottom: 5vw;
        padding: 3vw 5vw;
        font-size: 3vw;
        border-radius: 8vw;
    }
    .vr-info__pc {
        display: none;
    }
    .vr-info__sp {
        display: inline;
    }
}
