/* Hotspot engine – shared styles */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; font-family: system-ui, sans-serif; }
body { background: #1a1a1a; display: flex; align-items: center; justify-content: center; }

.hotspot-engine-missing-media {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 18px;
    background: #111;
    color: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.12);
    text-align: center;
    font-size: 14px;
    line-height: 1.4;
}
.hotspot-engine-missing-media strong {
    display: block;
    margin-bottom: 6px;
    color: #fff;
    font-weight: 600;
}

.hotspot-engine-notice {
    position: fixed;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2147483646;
    max-width: min(720px, calc(100vw - 20px));
    padding: 8px 10px;
    background: rgba(0, 0, 0, 0.78);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 8px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    font-size: 12px;
    line-height: 1.3;
    backdrop-filter: blur(6px);
    cursor: pointer;
    user-select: none;
}
.hotspot-engine-notice code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
}
.hotspot-engine-notice.is-hidden {
    display: none;
}

.hotspot-engine-audio-dock {
    position: fixed;
    top: 12px;
    left: 12px;
    right: auto;
    /* Must be above the fullscreen modal (which uses 2147483647). */
    z-index: 2147483647;
    width: min(340px, calc(100vw - 12px - 12px));
    height: 44px;
    display: flex;
    align-items: center;
    background: #000;
    border: 2px solid #000;
    border-radius: 0;
    box-shadow: none;
    padding: 0 6px;
    box-sizing: border-box;
}
.hotspot-engine-audio-dock.is-hidden {
    display: none;
}
.hotspot-engine-audio-dock audio {
    display: block;
    width: 100%;
    height: 100%;
    max-height: 40px;
    margin: 0;
    padding: 0;
    background: transparent;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}
/* Match theme audio controls: white icons on black. */
.hotspot-engine-audio-dock audio::-webkit-media-controls-panel {
    background: #000;
}
.hotspot-engine-audio-dock audio::-webkit-media-controls-play-button,
.hotspot-engine-audio-dock audio::-webkit-media-controls-mute-button,
.hotspot-engine-audio-dock audio::-webkit-media-controls-timeline {
    filter: invert(1);
}
.hotspot-engine-audio-dock audio::-webkit-media-controls-current-time-display,
.hotspot-engine-audio-dock audio::-webkit-media-controls-time-remaining-display {
    color: #fff;
    font-family: Borna, sans-serif;
    font-size: 12px;
}
.hotspot-engine-audio-dock audio::-webkit-media-controls-overflow-button {
    display: none !important;
    visibility: hidden !important;
    width: 0 !important;
    height: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.hotspot-engine .image-wrap {
    position: relative;
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}
.hotspot-engine .image-wrap img,
.hotspot-engine .image-wrap .hotspot-engine-bg-video {
    display: block;
    max-width: 100%;
    max-height: 100vh;
    width: auto;
    height: auto;
    vertical-align: middle;
}
/* Background clip is non-interactive so hotspot buttons always receive clicks (video layer can otherwise sit above siblings in some engines). */
.hotspot-engine .image-wrap .hotspot-engine-bg-video {
    position: relative;
    z-index: 0;
    pointer-events: none;
}
.hotspot-engine .hotspots {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
}
.hotspot-engine .hotspots .hotspot {
    pointer-events: auto;
    position: absolute;
    width: 2%;
    height: auto;
    aspect-ratio: 1;
    min-width: 20px;
    min-height: 20px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: rgba(255, 200, 80, 0.85);
    border: 2px solid rgba(255, 255, 255, 0.9);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.hotspot-engine .hotspots .hotspot:hover {
    transform: translate(-50%, -50%) scale(1.2);
    box-shadow: 0 0 0 4px rgba(255, 200, 80, 0.5);
}
.hotspot-engine .hotspot-inline-audio {
    position: fixed;
    z-index: 2147483647;
    transform: translate(-50%, -50%);
    pointer-events: auto;
}
.hotspot-engine .hotspot-inline-audio.is-in-small-window {
    position: static;
    z-index: 2;
    transform: none;
}
.hotspot-engine .hotspot-inline-audio.is-in-inline-row {
    position: static;
    z-index: 2;
    transform: none;
}
.hotspot-engine .hotspot-inline-audio.is-in-inline-row .hotspot-inline-audio-btn img {
    width: 52px;
    height: 52px;
}
.hotspot-engine .hotspot-inline-audio.is-in-small-window .hotspot-inline-audio-btn img {
    width: 51px;
    height: 51px;
}
.hotspot-engine .hotspot-inline-audio.is-hidden {
    display: none;
}
.hotspot-engine .hotspot-inline-audio-btn {
    border: none;
    background: transparent;
    line-height: 0;
    padding: 0;
    cursor: pointer;
}
.hotspot-engine .hotspot-inline-audio-btn:hover {
    opacity: 0.95;
}
.hotspot-engine .hotspot-inline-audio-btn img {
    display: block;
    width: 84px;
    height: 84px;
}
@media (max-width: 768px) {
    .hotspot-engine .hotspot-inline-audio-btn img {
        width: 42px;
        height: 42px;
    }
}
body.debug-mode .hotspot-engine .hotspots .hotspot {
    cursor: grab;
    border-color: #0f0;
}
body.debug-mode .hotspot-engine .hotspots .hotspot:active {
    cursor: grabbing;
}

/* Modal shell – fullscreen, close on top of iframe close */
.hotspot-engine .modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 2147483647;
    background: #000;
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
}
.hotspot-engine .modal.is-open {
    display: flex;
}
.hotspot-engine .modal-inner {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #111;
    overflow: hidden;
}
/* Matches .lndm-viewer-fs-close (close iframe) in theme style.css */
.hotspot-engine .modal-close {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 2147483647;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 2px solid #000;
    border-radius: 0;
    background: rgba(255, 255, 255, 0.9);
    color: #000;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    transition: background 0.15s ease;
}
.hotspot-engine .modal-close:hover {
    background: #fff;
}
.hotspot-engine .modal-close:focus {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}
.hotspot-engine .modal-close .lndm-close-icon {
    width: 28px;
    height: 28px;
    display: block;
}
.hotspot-engine .modal-title {
    flex-shrink: 0;
    order: 1;
    padding: 12px 12px 12px 12px;
    background: #222;
    color: #eee;
    font-size: 14px;
}
.hotspot-engine .modal-body {
    flex: 1;
    order: 0;
    overflow: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
}
.hotspot-engine .modal-body video {
    display: block;
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
/* Audio popup: small centered window (not fullscreen) */
.hotspot-engine .modal.modal--audio {
    background: rgba(0, 0, 0, 0.55);
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(2px);
}
.hotspot-engine .modal.modal--audio .modal-inner {
    position: relative;
    width: min(520px, calc(100vw - 40px));
    max-width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    flex: 0 0 auto;
    border-radius: 10px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.14);
    overflow: hidden;
}
.hotspot-engine .modal.modal--audio .modal-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2;
}
.hotspot-engine .modal.modal--audio .modal-title {
    order: -1;
    padding: 14px 52px 12px 16px;
    border-radius: 0;
    border-bottom: 1px solid #333;
    font-size: 15px;
}
.hotspot-engine .modal.modal--audio .modal-body {
    flex: 0 0 auto;
    padding: 18px 20px 22px;
    width: 100%;
}

/* Wider audio player inside the small window */
.hotspot-engine .modal-body .modal-audio-wrap {
    width: min(220px, calc(100% - 24px));
    max-width: 100%;
    margin: 8px auto;
    padding: 0 8px;
    box-sizing: border-box;
}
.hotspot-engine .modal.modal--audio .modal-body .modal-audio-wrap {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}
.hotspot-engine .modal-body .modal-audio-wrap audio {
    display: block;
    width: 100%;
}

/* Gallery popup (grid fallback) */
.hotspot-engine .modal-gallery {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    justify-content: center;
    align-content: flex-start;
}
.hotspot-engine .modal-gallery img {
    max-width: 100%;
    height: auto;
    max-height: calc(100vh - 80px);
    object-fit: contain;
    border-radius: 4px;
}

/* Gallery slider (one image + description at bottom + prev/next) */
.hotspot-engine .modal-gallery-slider {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 0;
}
.hotspot-engine .modal-gallery-slide {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 12px;
}
.hotspot-engine .modal-gallery-slide img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
}
.hotspot-engine .modal-gallery-desc-row {
    flex-shrink: 0;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 12px 8px;
    background: #222;
    border-top: 1px solid #333;
}
.hotspot-engine .modal-gallery-audio-slot {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.hotspot-engine .modal-gallery-desc-row-single {
    padding: 12px 16px;
}
.hotspot-engine .modal-gallery-desc-row-single .modal-gallery-desc {
    padding: 0;
}
.hotspot-engine .modal-gallery-desc {
    flex: 1;
    min-width: 0;
    padding: 0 8px;
    color: #eee;
    font-size: 21px;
    line-height: 1.5;
}
.hotspot-engine .modal-gallery-desc b,
.hotspot-engine .modal-gallery-desc strong {
    font-weight: 700;
    color: #fff;
}
@media (max-width: 1200px) and (orientation: landscape) {
    .hotspot-engine .modal-gallery-desc {
        font-size: 14px;
    }
}
.hotspot-engine .modal-gallery-prev,
.hotspot-engine .modal-gallery-next {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 2px solid rgba(255,255,255,0.5);
    border-radius: 0;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}
.hotspot-engine .modal-gallery-prev {
    margin-right: 12px;
}
.hotspot-engine .modal-gallery-next {
    margin-left: 12px;
}
.hotspot-engine .modal-gallery-prev:hover,
.hotspot-engine .modal-gallery-next:hover {
    background: rgba(255,255,255,0.2);
    border-color: rgba(255,255,255,0.8);
}

/* Small infowindow (popupType: infowindow) */
.hotspot-engine .hotspot-infowindow {
    display: none;
    position: fixed;
    z-index: 10000;
    max-width: 280px;
    background: rgba(0, 0, 0, 0.92);
    color: #eee;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 6px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
    padding: 10px 32px 10px 12px;
}
.hotspot-engine .hotspot-infowindow.is-open {
    display: block;
}
.hotspot-engine .hotspot-infowindow-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: rgba(255,255,255,0.8);
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}
.hotspot-engine .hotspot-infowindow-close:hover {
    color: #fff;
}
.hotspot-engine .hotspot-infowindow-title {
    font-weight: 700;
    font-size: 13px;
    margin-bottom: 4px;
    color: #fff;
}
.hotspot-engine .hotspot-infowindow-body {
    font-size: 12px;
    line-height: 1.45;
}
.hotspot-engine .hotspot-infowindow-body b,
.hotspot-engine .hotspot-infowindow-body strong {
    font-weight: 700;
    color: #fff;
}

/* Small card popup (popupType: small-window) */
.hotspot-engine .hotspot-small-window {
    display: none;
    position: fixed;
    z-index: 10001;
    width: min(280px, calc(100vw - 20px));
    max-height: calc(100vh - 20px);
    overflow: auto;
    background: rgba(255, 255, 255, 0.97);
    color: #1f1f1f;
    border: 1px solid rgba(0, 0, 0, 0.14);
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    padding: 14px 14px 12px;
}
.hotspot-engine .hotspot-small-window.is-open {
    display: block;
}
@media (min-width: 769px) {
    .hotspot-engine .hotspot-small-window {
        width: min(375px, calc(100vw - 20px));
    }
}
.hotspot-engine .hotspot-small-window-close {
    position: static;
    flex-shrink: 0;
    width: 39px;
    height: 39px;
    padding: 0;
    border: none;
    background: transparent;
    color: rgba(0,0,0,0.7);
    font-size: 33px;
    line-height: 1;
    cursor: pointer;
}
.hotspot-engine .hotspot-small-window-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}
.hotspot-engine .hotspot-small-window-audio-slot {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}
.hotspot-engine .hotspot-small-window-title {
    flex: 1;
    min-width: 0;
    margin-bottom: 8px;
    font-size: 22px;
    line-height: 1.1;
    font-weight: 700;
    text-transform: uppercase;
}
.hotspot-engine .hotspot-small-window-body {
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.35;
    color: #333;
}
.hotspot-engine .hotspot-small-window-image-wrap {
    width: 100%;
    border-radius: 10px;
    overflow: hidden;
    background: #f3f3f3;
}
.hotspot-engine .hotspot-small-window-image {
    display: block;
    width: 100%;
    height: auto;
}
@media (max-width: 768px) {
    .hotspot-engine .hotspot-small-window-title {
        font-size: 18px;
    }
    .hotspot-engine .hotspot-small-window-body {
        font-size: 13px;
    }
}

/* Debug panel */
#hotspot-debug-panel {
    display: none;
    position: fixed;
    top: 10px;
    left: 10px;
    right: auto;
    /* Fixed width so the panel can be positioned via left/top (draggable). */
    width: min(900px, calc(100vw - 20px));
    max-height: 40vh;
    min-width: 260px;
    min-height: 140px;
    overflow: auto;
    z-index: 500;
    background: rgba(0,0,0,0.9);
    color: #8f8;
    padding: 12px;
    font-size: 12px;
    font-family: monospace;
    border: 1px solid #363;
    border-radius: 6px;
}
body.debug-mode #hotspot-debug-panel {
    display: block;
}
#hotspot-debug-panel h3 {
    margin: 0 0 8px 0;
    font-size: 11px;
    text-transform: uppercase;
    color: #afa;
    /* Drag handle (only used when debug-mode is enabled). */
    user-select: none;
}
body.debug-mode #hotspot-debug-panel h3 {
    cursor: move;
}
#hotspot-debug-panel .hotspot-debug-resize-handle {
    position: absolute;
    right: 6px;
    bottom: 6px;
    width: 16px;
    height: 16px;
    cursor: nwse-resize;
    background: transparent;
    /* Keeps the handle visible/clickable above scroll content. */
    z-index: 2;
}
#hotspot-debug-panel .hotspot-debug-resize-handle:before {
    content: '';
    position: absolute;
    right: 0;
    bottom: 0;
    width: 12px;
    height: 12px;
    border-right: 2px solid rgba(160, 255, 160, 0.7);
    border-bottom: 2px solid rgba(160, 255, 160, 0.7);
}
#hotspot-debug-panel .hint {
    color: #888;
    margin-bottom: 8px;
}
#hotspot-debug-panel pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
}
#hotspot-debug-click {
    margin-top: 8px;
    color: #ff8;
}
#hotspot-debug-panel .hotspot-debug-source {
    margin-bottom: 10px;
    padding: 8px;
    background: rgba(0, 80, 40, 0.35);
    border-radius: 4px;
    color: #9df;
    line-height: 1.45;
}
#hotspot-debug-panel .hotspot-debug-json-wrap {
    margin-bottom: 10px;
    color: #aaa;
}
#hotspot-debug-panel .hotspot-debug-json-wrap summary {
    cursor: pointer;
    color: #8cf;
    margin-bottom: 6px;
}
#hotspot-debug-panel .hotspot-debug-config-json {
    max-height: 28vh;
    overflow: auto;
    font-size: 10px;
    background: #111;
    padding: 8px;
    border-radius: 4px;
    border: 1px solid #333;
    color: #ccc;
}

#hotspot-debug-panel .hotspot-debug-copy-block {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(160, 255, 160, 0.2);
}
#hotspot-debug-panel .hotspot-debug-copy-title {
    margin-bottom: 6px;
    color: #9df;
    line-height: 1.35;
}
.hotspot-debug-copy-json-btn {
    display: inline-block;
    margin-bottom: 8px;
    padding: 6px 10px;
    border: 1px solid rgba(160, 255, 160, 0.45);
    background: rgba(0, 60, 30, 0.35);
    color: #9df;
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
}
.hotspot-debug-copy-json-btn:hover {
    background: rgba(0, 90, 45, 0.5);
}
