@charset "utf-8";
/* CSS Document */

/**
 * TourViewerShared.css
 * ─────────────────────────────────────────────────────────────────────────────
 * Shared CSS for the tour viewer system. Included by both:
 *   - 360_editor.php   (Live View preview)
 *   - client_view.php  (public-facing viewer)
 *
 * Rule of thumb for this file:
 *   ✓  Any rule that affects how hotspots look or behave (tooltips, floor rings,
 *      label positions, info panel, flat viewer structure)
 *   ✗  Editor-only chrome (control panel, drag handles, selection rings, scene
 *      manager)
 *   ✗  Client-only chrome (ADA sidebar, mode switcher, embed modal)
 *   ✗  Body / layout rules (each file's page scaffold is different)
 * ─────────────────────────────────────────────────────────────────────────────
 */

/* ── Screen-reader utility ───────────────────────────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}


/* ═══════════════════════════════════════════════════════════════════════════
   PANNELLUM CHROME SUPPRESSION
   ═══════════════════════════════════════════════════════════════════════════ */

.pnlm-about-msg,
.pnlm-load-box { display: none !important; }

/* Hotspot containers must never clip their tooltips */
.pnlm-hotspot-base { overflow: visible !important; }


/* ═══════════════════════════════════════════════════════════════════════════
   HOTSPOT TOOLTIP
   ═══════════════════════════════════════════════════════════════════════════ */

/* Base state: hidden */
.hs-live-tooltip {
    display: none !important;
    position: absolute;

    /* fit-content(320px) = max(min-content, min(max-content, 320px))
       The explicit length argument is NOT constrained by the containing block's
       available space — this fixes full-width stretch on flat (still-image)
       hotspots where the icon is only 32-52px wide and width:max-content would
       get clamped to ~23px of available space.
       width:max-content is kept as the fallback for older browsers. */
    width: max-content;
    width: fit-content(320px);
    max-width: 320px !important;
    white-space: normal !important;
    word-wrap: break-word;
    text-align: center;

    /* Reset line-height: the flat viewer wrappers set line-height:0 to eliminate
       the inline-block gap under the image. Without this reset that zero
       line-height inherits here, collapsing the text to 0px so only padding
       contributes — making small padding values invisible. */
    line-height: 1.3;

    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    font-size: 16px;
    border-radius: 4px;

    /* Slider updates --hs-label-pad-v at runtime; 6px matches the DB default */
    padding: var(--hs-label-pad-v, 6px) var(--hs-label-pad-h, 14px) !important;

    z-index: 9999 !important;
    pointer-events: none;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    border: none !important;
}

/* ── Visibility: hover / focus ───────────────────────────────────────────── */
/* Editor wraps everything in body.live-mode; client has no such wrapper.
   Both selectors are declared so the rule works in either context. */
body.live-mode .pnlm-hotspot-base:not(.hs-label-always):not(.hs-label-hidden):hover .hs-live-tooltip,
body.live-mode .pnlm-hotspot-base:not(.hs-label-always):not(.hs-label-hidden):focus .hs-live-tooltip,
body.live-mode .flat-hs:not(.hs-label-always):not(.hs-label-hidden):hover .hs-live-tooltip,
body.live-mode .flat-hs:not(.hs-label-always):not(.hs-label-hidden):focus .hs-live-tooltip,
body.live-mode .pnlm-hotspot-base.force-tooltip .hs-live-tooltip,
body.live-mode .flat-hs.force-tooltip .hs-live-tooltip,
.pnlm-hotspot-base:not(.hs-label-always):not(.hs-label-hidden):hover .hs-live-tooltip,
.pnlm-hotspot-base:not(.hs-label-always):not(.hs-label-hidden):focus .hs-live-tooltip,
.flat-hs:not(.hs-label-always):not(.hs-label-hidden):hover .hs-live-tooltip,
.flat-hs:not(.hs-label-always):not(.hs-label-hidden):focus .hs-live-tooltip,
.pnlm-hotspot-base.force-tooltip .hs-live-tooltip,
.flat-hs.force-tooltip .hs-live-tooltip { display: block !important; }

/* ── Visibility: always / hidden ─────────────────────────────────────────── */
.pnlm-hotspot-base.hs-label-always .hs-live-tooltip,
.flat-hs.hs-label-always .hs-live-tooltip { display: block !important; }

.pnlm-hotspot-base.hs-label-hidden .hs-live-tooltip,
.flat-hs.hs-label-hidden .hs-live-tooltip { display: none !important; }

/* ── Info card layout (wide pill with left-aligned text) ─────────────────── */
.pnlm-hotspot-base.hs-is-info .hs-live-tooltip,
.flat-hs.hs-is-info .hs-live-tooltip {
    text-align: left !important;
    line-height: 1.5;
    width: 320px !important;
    --hs-label-pad-h: 20px;
}

/* ── Bar style for custom-icon "always" labels ───────────────────────────── */
.pnlm-hotspot-base.hs-show-text-bar.hs-label-always .hs-live-tooltip,
.flat-hs.hs-show-text-bar.hs-label-always .hs-live-tooltip { background: rgba(0, 0, 0, 0.7); }

/* ── Label position ─────────────────────────────────────────────────────── */
.pnlm-hotspot-base.hs-label-above .hs-live-tooltip,
.flat-hs.hs-label-above .hs-live-tooltip { bottom: calc(100% + 12px) !important; top: auto !important; }

.pnlm-hotspot-base.hs-label-below .hs-live-tooltip,
.flat-hs.hs-label-below .hs-live-tooltip { top: calc(100% + 8px) !important; bottom: auto !important; }


/* ═══════════════════════════════════════════════════════════════════════════
   FLOOR RING HOTSPOT
   ═══════════════════════════════════════════════════════════════════════════ */

.custom-floor-container {
    width: 60px;
    height: 60px;
    margin-left: -30px;
    margin-top: -30px;
}

.custom-floor-container.pnlm-hotspot-base {
    background: none !important;
    border: none !important;
}

/* Hide Pannellum's default span content inside floor rings */
.custom-floor-container span:not(.hs-live-tooltip) { display: none !important; }

/* The tilted ring */
.floor-ring {
    position: relative;
    width: var(--hs-size, 60px);
    height: var(--hs-size, 60px);
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.8);
    background: rgba(0, 0, 0, 0.2);
    box-shadow: 0 0 12px rgba(0, 0, 0, 0.4), inset 0 0 10px rgba(0, 0, 0, 0.4);
    transform: rotateX(65deg);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    cursor: pointer;
    margin: 0 auto;
}

/* Pulsing inner dot */
.floor-ring::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 16px; height: 16px;
    background: #fff;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 10px #fff;
    animation: floor-pulse 1.5s infinite alternate;
}

@keyframes floor-pulse {
    from { opacity: 0.5; transform: translate(-50%, -50%) scale(0.8); }
    to   { opacity: 1;   transform: translate(-50%, -50%) scale(1.2); }
}

/* Hover */
.custom-floor-container:hover .floor-ring {
    background: rgba(77, 166, 255, 0.4);
    border-color: #4da6ff;
    transform: rotateX(65deg) scale(1.1);
}

/* Focus */
.custom-floor-container:focus { outline: none !important; }
.custom-floor-container:focus .floor-ring {
    box-shadow: 0 0 0 5px #4da6ff, 0 0 25px rgba(77, 166, 255, 0.8) !important;
    border-color: #fff !important;
    transform: rotateX(65deg) scale(1.1);
}

/* Tooltip on hover (floor rings aren't pnlm-hotspot-base, need their own rule) */
.custom-floor-container:hover .hs-live-tooltip { display: block !important; }

/* Standard focus ring for non-floor Pannellum hotspots */
.pnlm-hotspot-base:focus { outline: none !important; }
.pnlm-hotspot-base:not(.custom-floor-container):focus {
    box-shadow: 0 0 0 3px #4da6ff, 0 0 15px #4da6ff !important;
    border-radius: 50%;
}


/* ═══════════════════════════════════════════════════════════════════════════
   FLAT (STILL-IMAGE) HOTSPOT
   ═══════════════════════════════════════════════════════════════════════════ */

/* overflow:visible is the critical rule — lets the tooltip extend outside the
   small icon bounds. display:flex centres the icon within the hotspot div. */
.flat-hs {
    overflow: visible !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

.flat-hs:focus {
    outline: none;
    box-shadow: 0 0 0 3px #4da6ff, 0 0 15px #4da6ff;
    border-radius: 50%;
}


/* ═══════════════════════════════════════════════════════════════════════════
   FLAT IMAGE VIEWER STRUCTURE
   (Both files use the identical nested wrapper; rules here keep it correct.)
   ═══════════════════════════════════════════════════════════════════════════ */

#flat-viewer {
    display: none;
    position: absolute;
    inset: 0;
    background: #111;
    /* overflow must remain visible so tooltips on flat hotspots can escape
       the viewer boundary without being clipped */
    overflow: visible;
}
#flat-viewer.active { display: block; }

#flat-viewer-img {
    display: block;
    max-width: 100%;
    max-height: 100vh;
    width: auto;
    height: auto;
    pointer-events: none;
}

#flat-hotspot-layer {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    overflow: visible;
}


/* ═══════════════════════════════════════════════════════════════════════════
   INFO PANEL (toggle button + sliding panel)
   IDs differ between files but the visual behaviour is identical:
     Editor:  #toggle-desc-overlay  /  #scene-overlay-panel
     Client:  #toggle-info-btn      /  #info-panel
   We target both sets of IDs here so a single change updates both.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Toggle button ───────────────────────────────────────────────────────── */
#toggle-desc-overlay,
#toggle-info-btn {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 600;
    width: auto !important;          /* prevent global button { width:100% } */
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: 1px solid #4da6ff;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    text-align: left !important;
    margin: 0 !important;
    display: none;
}

/* ── Panel ───────────────────────────────────────────────────────────────── */
#scene-overlay-panel,
#info-panel {
    position: absolute;
    right: 20px;
    width: 320px;
    max-height: 70vh;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    color: #fff;
    padding: 20px;
    border-radius: 8px;
    z-index: 599;
    border: 1px solid #444;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.5);
    overflow-y: auto;

    /* Hidden / animated state */
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

#scene-overlay-panel.open,
#info-panel.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* ── Close button inside the panel ─────────────────────────────────────── */
#overlay-close-btn,
#info-panel-close {
    background: none;
    border: none;
    color: #888;
    font-size: 20px;
    cursor: pointer;
    padding: 0 0 0 12px;
    line-height: 1;
    flex-shrink: 0;
    width: auto;       /* override global button { width:100% } in the editor */
    margin: 0;
}
#overlay-close-btn:hover,
#info-panel-close:hover { color: #fff; }
#overlay-close-btn:focus,
#info-panel-close:focus { outline: 2px solid #4da6ff; border-radius: 2px; }


/* ═══════════════════════════════════════════════════════════════════════════
   ADA / ACCESSIBLE MODE BUTTON
   Declared fixed so it's always reachable outside role="application".
   The exact right-offset differs between files and is set in each file's
   own <style> block; only shared visual properties live here.
   ═══════════════════════════════════════════════════════════════════════════ */

#ada-live-btn,
#btn-switch-ada {
    position: fixed;
    top: 20px;
    z-index: 1001;
    width: auto;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #5cdb95;
    color: #5cdb95;
    padding: 8px 14px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
    font-weight: bold;
    display: none;
    align-items: center;
    gap: 8px;
    line-height: 1.2;
    transition: background 0.15s;
    margin-bottom: 0;
    text-decoration: none;
}
#ada-live-btn:hover,
#btn-switch-ada:hover  { background: rgba(26, 107, 58, 0.85); }
#ada-live-btn:focus,
#btn-switch-ada:focus  { outline: 3px solid #5cdb95; outline-offset: 2px; }

/* ── Mobile: scale down flat-scene hotspot labels ────────────────────────── */
@media (max-width: 768px) {
    .flat-hs .hs-live-tooltip {
        font-size: 12px;
        max-width: 200px !important;
    }
}