/* Belovode · virtual museum (секция 60)
   Стили вьюера 360° + админ-редактора маркеров.
   Подключается из inc/virtual-museum/assets.php условно (только на
   странице с шорткодом и в админке vm_location). */

/* =====================================================================
   1. КОНТЕЙНЕР И СТАГ
   ===================================================================== */
.vm-section {
    margin: var(--bel-gap-l) 0;
}

.vm-root {
    position: relative;
    width: 100%;
    height: var(--vm-height, 80vh);
    min-height: 480px;
    background: var(--bel-ink);
    border-radius: var(--bel-radius-lg);
    overflow: hidden;
    box-shadow: var(--bel-shadow-md);
    color: var(--bel-bg);
    isolation: isolate;
    touch-action: none;
}

.vm-root:fullscreen { border-radius: 0; }

.vm-stage {
    position: absolute; inset: 0;
}

.vm-loading,
.vm-empty,
.vm-error {
    position: absolute; inset: 0;
    display: grid; place-items: center;
    color: var(--bel-bg);
    font-family: var(--bel-font-body);
    font-size: 14px;
    background: var(--bel-ink);
    z-index: 2;
}
.vm-error { color: #f3c2b8; }

/* =====================================================================
   2. ТОПБАР И НАВИГАЦИЯ ПО ЛОКАЦИЯМ
   ===================================================================== */
.vm-topbar {
    position: absolute;
    top: 0; left: 0; right: 0;
    padding: 14px 18px 18px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0));
    pointer-events: none;
    z-index: 3;
}
.vm-topbar > * { pointer-events: auto; }

.vm-topbar__title {
    margin: 0 0 8px;
    font-family: var(--bel-font-display);
    font-size: clamp(18px, 2.4vw, 26px);
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.01em;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.vm-topbar__locs {
    display: flex; flex-wrap: wrap; gap: 6px;
}

.vm-locbtn {
    appearance: none; border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font: 500 13px/1.2 var(--bel-font-body);
    padding: 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.vm-locbtn:hover { background: rgba(0, 0, 0, 0.55); }
.vm-locbtn.is-active {
    background: var(--bel-ochre);
    border-color: var(--bel-ochre);
}

/* =====================================================================
   3. КНОПКИ УПРАВЛЕНИЯ (правый нижний угол)
   ===================================================================== */
.vm-controls {
    position: absolute;
    right: 16px; bottom: 16px;
    display: flex; gap: 8px;
    z-index: 3;
}

.vm-btn {
    appearance: none; border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    font: 500 13px/1.2 var(--bel-font-body);
    padding: 8px 12px;
    border-radius: 999px;
    cursor: pointer;
    display: inline-flex; align-items: center; gap: 6px;
    transition: background 0.15s;
}
.vm-btn:hover { background: rgba(0, 0, 0, 0.65); }
.vm-btn.is-active {
    background: var(--bel-ochre);
    border-color: var(--bel-ochre);
}
.vm-btn__ico { font-size: 16px; line-height: 1; }
@media (max-width: 640px) {
    .vm-btn__lbl { display: none; }
    .vm-btn { padding: 10px; }
}

/* =====================================================================
   4. МАРКЕРЫ
   ===================================================================== */
.vm-dot {
    display: block; width: 100%; height: 100%;
    border-radius: 50%;
    background: var(--bel-ochre);
    box-shadow: 0 0 0 4px rgba(185, 109, 61, 0.35),
                0 0 0 12px rgba(185, 109, 61, 0.18);
    transform: scale(0.55);
    transition: transform 0.2s;
    animation: vm-pulse 2.4s ease-in-out infinite;
}
.vm-dot--link {
    background: var(--bel-moss);
    box-shadow: 0 0 0 4px rgba(107, 122, 79, 0.35),
                0 0 0 12px rgba(107, 122, 79, 0.18);
}
.psv-marker:hover .vm-dot { transform: scale(0.75); }

@keyframes vm-pulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(185, 109, 61, 0.35), 0 0 0 12px rgba(185, 109, 61, 0.18); }
    50%      { box-shadow: 0 0 0 6px rgba(185, 109, 61, 0.5),  0 0 0 18px rgba(185, 109, 61, 0); }
}

/* =====================================================================
   5. КАРТОЧКА ЭКСПОНАТА
   ===================================================================== */
.vm-card {
    position: absolute;
    right: 16px; top: 80px; bottom: 80px;
    width: min(420px, 92vw);
    background: var(--bel-bg);
    color: var(--bel-ink);
    border-radius: var(--bel-radius-lg);
    box-shadow: var(--bel-shadow-md);
    padding: 24px 22px 20px;
    overflow: auto;
    z-index: 4;
    font-family: var(--bel-font-body);
    line-height: 1.55;
}
.vm-card[hidden] { display: none; }

.vm-card__close {
    position: absolute; top: 8px; right: 10px;
    appearance: none; border: 0; background: transparent;
    font-size: 26px; line-height: 1;
    color: var(--bel-ink-soft);
    cursor: pointer; padding: 4px 8px;
}
.vm-card__close:hover { color: var(--bel-burgundy); }

.vm-card__title {
    margin: 0 0 12px;
    font-family: var(--bel-font-display);
    font-size: 20px;
    color: var(--bel-burgundy);
}

.vm-card__image img {
    width: 100%; height: auto; display: block;
    border-radius: var(--bel-radius);
    margin-bottom: 14px;
}

.vm-card__body p { margin: 0 0 12px; }
.vm-card__body p:last-child { margin-bottom: 0; }

@media (max-width: 720px) {
    .vm-card {
        right: 8px; left: 8px; bottom: 80px; top: auto;
        width: auto; max-height: 65vh;
    }
}

/* =====================================================================
   6. ФОЛБЭК ДЛЯ NO-JS / SEO
   ===================================================================== */
.vm-noscript {
    background: var(--bel-bg-deep);
    padding: 14px 18px;
    border-radius: var(--bel-radius);
    margin-top: 18px;
}
.vm-fallback {
    margin-top: 28px;
    background: var(--bel-bg-alt);
    border-radius: var(--bel-radius-lg);
    padding: 16px 20px;
}
.vm-fallback summary {
    cursor: pointer;
    font-family: var(--bel-font-display);
    font-weight: 700;
    color: var(--bel-ink);
    margin-bottom: 8px;
}
.vm-fallback__list {
    list-style: none; padding: 0; margin: 12px 0 0;
}
.vm-fallback__item {
    margin: 16px 0;
    padding: 14px 16px;
    background: var(--bel-bg);
    border-radius: var(--bel-radius);
}
.vm-fallback__item h3 {
    margin: 0 0 8px;
    font-family: var(--bel-font-display);
    font-size: 18px;
}
.vm-fallback__item img {
    max-width: 320px; height: auto; border-radius: var(--bel-radius);
}
.vm-fallback__exhibits {
    margin-top: 8px; padding-left: 18px;
}

/* =====================================================================
   7. АДМИНКА: РЕДАКТОР МАРКЕРОВ
   ===================================================================== */
.vm-admin-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
    gap: 16px;
}
@media (max-width: 1080px) {
    .vm-admin-grid { grid-template-columns: 1fr; }
}

.vm-admin-viewer {
    width: 100%;
    height: 60vh;
    min-height: 420px;
    background: #111;
    border-radius: 4px;
    overflow: hidden;
}

.vm-admin-sidebar {
    background: #fff;
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 14px 16px;
    max-height: 60vh;
    overflow: auto;
}

.vm-admin-list {
    list-style: none; padding: 0; margin: 14px 0 0;
    display: flex; flex-direction: column; gap: 12px;
}

.vm-admin-mitem {
    border: 1px solid #dcdcde;
    border-radius: 4px;
    padding: 10px 12px;
    background: #fafafa;
}
.vm-admin-mitem__head {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 8px;
}
.vm-admin-mitem__no { color: #1d2327; font-size: 13px; }
.vm-admin-coords {
    font: 12px/1.4 monospace;
    color: #50575e;
    flex: 1;
}
.vm-admin-mitem__row {
    display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
    margin-bottom: 6px;
}
.vm-admin-mitem__row label {
    display: flex; flex-direction: column; gap: 2px;
    font-size: 12px; color: #50575e;
}
.vm-admin-mitem__row input,
.vm-admin-mitem__row select {
    width: 100%; box-sizing: border-box;
}

.vm-admin-raw {
    margin-top: 16px;
    border-top: 1px dashed #dcdcde; padding-top: 12px;
}
.vm-admin-raw summary { cursor: pointer; color: #50575e; font-size: 12px; }

.vm-admin-media .vm-admin-thumb img {
    display: block; max-width: 100%; height: auto;
    border: 1px solid #dcdcde; border-radius: 3px;
    margin: 6px 0;
}
.vm-admin-media .vm-admin-audio audio {
    display: block; width: 100%; margin: 6px 0;
}
.vm-admin-media input[type="number"] {
    width: 90px;
}
