/* Explain: Styles for the 3D virtual gallery section, stage, room, walls, floor, frames, and modal. */
.vg-section {
    background: linear-gradient(180deg, #17110e 0%, #241b15 100%);
    color: #f4e9d8;
}

.vg-section .lead {
    color: #d9c9b4;
}

.vg-stage {
    position: relative;
    height: 430px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid rgba(201, 154, 58, 0.25);
    background: radial-gradient(120% 80% at 50% 0%, #33271f 0%, #17110e 55%, #0b0806 100%);
    perspective: 1300px;
    perspective-origin: 50% 44%;
    cursor: grab;
    touch-action: pan-y;
    user-select: none;
}

@media (min-width: 768px) {
    .vg-stage {
        height: 520px;
    }
}

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

.vg-room {
    position: absolute;
    inset: 0;
    transform-style: preserve-3d;
    transform: scale(var(--vg-scale, 1)) rotateY(var(--vg-rot, 0deg));
    transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.vg-stage.is-dragging .vg-room {
    transition: none;
}

.vg-wall {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 2600px;
    height: 600px;
    margin: -300px 0 0 -1300px;
    overflow: hidden;
    padding: 46px 0;
    transform: translateZ(-620px);
    background: linear-gradient(180deg, #2e241d 0%, #221a15 60%, #16100c 100%);
    border: 1px solid rgba(201, 154, 58, 0.18);
    box-shadow: inset 0 0 120px rgba(0, 0, 0, 0.7);
}

.vg-track {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 100%;
    width: max-content;
    animation: vg-marquee 64s linear infinite;
    will-change: transform;
}

.vg-stage:hover .vg-track,
.vg-track:focus-within {
    animation-play-state: paused;
}

@keyframes vg-marquee {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-2688px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .vg-track {
        animation: none;
    }
}

.vg-floor {
    position: absolute;
    left: 50%;
    top: 50%;
    pointer-events: none;
    width: 2900px;
    height: 900px;
    margin-left: -1450px;
    transform: translateY(300px) rotateX(90deg);
    transform-origin: top center;
    background:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 120px),
        repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.04) 0 1px, transparent 1px 120px),
        linear-gradient(180deg, #1d1712 0%, #0c0907 100%);
}

.vg-frame {
    position: relative;
    flex: 0 0 auto;
    width: 200px;
    cursor: pointer;
    height: 100%;
    padding: 7px;
    border: 2px solid rgba(201, 154, 58, 0.45);
    background: #0c0907;
    overflow: hidden;
    box-shadow: 0 26px 40px -22px rgba(0, 0, 0, 0.95), 0 0 0 6px rgba(0, 0, 0, 0.3);
    transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.vg-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.vg-frame__label {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1.6rem 0.5rem 0.5rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: #f7ecd9;
    text-align: center;
    background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.85));
}

.vg-frame:hover,
.vg-frame:focus-visible {
    transform: scale(1.04);
    border-color: var(--accent-color);
    box-shadow: 0 30px 50px -20px rgba(0, 0, 0, 0.95), 0 0 26px rgba(201, 154, 58, 0.35);
}

.vg-controls {
    position: absolute;
    left: 50%;
    bottom: 1rem;
    transform: translateX(-50%);
    display: flex;
    gap: 0.6rem;
    z-index: 3;
}

.vg-ctrl {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(201, 154, 58, 0.45);
    background: rgba(15, 11, 8, 0.75);
    color: var(--accent-color);
    backdrop-filter: blur(6px);
    transition: all 0.25s ease;
}

.vg-ctrl:hover {
    background: var(--accent-color);
    color: #241a06;
}

.vg-strip {
    display: flex;
    gap: 0.7rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
}

.vg-thumb {
    flex: 0 0 auto;
    width: 92px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem;
    border-radius: 10px;
    border: 1px solid rgba(201, 154, 58, 0.22);
    background: rgba(255, 255, 255, 0.03);
    transition: all 0.25s ease;
}

.vg-thumb img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: 6px;
}

.vg-thumb span {
    font-size: 0.72rem;
    color: #d9c9b4;
    text-align: center;
}

.vg-thumb:hover {
    border-color: var(--accent-color);
    background: rgba(201, 154, 58, 0.12);
}

.vg-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 70;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.vg-modal.is-open {
    display: flex;
}

.vg-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 8, 6, 0.82);
    backdrop-filter: blur(4px);
}

.vg-modal__panel {
    position: relative;
    z-index: 2;
    width: min(920px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    display: grid;
    gap: 0;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(201, 154, 58, 0.4);
    background: #17110e;
    color: #f4e9d8;
    box-shadow: 0 40px 80px -30px rgba(0, 0, 0, 0.9);
}

@media (min-width: 768px) {
    .vg-modal__panel {
        grid-template-columns: 1fr 1fr;
    }
}

.vg-modal__media {
    position: relative;
    min-height: 240px;
    background: #0b0806;
    display: grid;
    place-items: center;
}

.vg-modal__media img {
    width: 100%;
    height: 100%;
    max-height: 70vh;
    object-fit: cover;
}

.vg-modal__media.is-loading::after {
    content: '';
    position: absolute;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    border: 3px solid rgba(201, 154, 58, 0.25);
    border-top-color: var(--accent-color);
    animation: vg-spin 0.8s linear infinite;
}

@keyframes vg-spin {
    to {
        transform: rotate(360deg);
    }
}

.vg-modal__body {
    padding: 1.6rem 1.5rem 2rem;
}

.vg-modal__body h3 {
    font-size: 1.4rem;
    margin-top: 0.3rem;
}

.vg-modal__body p {
    margin-top: 0.7rem;
    color: #d3c3ae;
    font-size: 0.95rem;
}

.vg-modal__meta {
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-color);
}

.vg-modal__close {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    z-index: 3;
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(201, 154, 58, 0.4);
    background: rgba(12, 9, 7, 0.8);
    color: #f4e9d8;
    transition: all 0.2s ease;
}

.vg-modal__close:hover {
    background: var(--accent-color);
    color: #241a06;
}