/* ==============================================
   VV Gallery — Masonry grid + flip cards + lightbox
   ============================================== */

/* Hide the WordPress page title on the gallery page (duplicated by hero) */
.page-id-18016 h1.entry-title,
.page-id-18016 h1.page-title,
.page-id-18016 .entry-header h1,
.page-id-18016 .page-header h1,
.page-id-18016 .btp_inner_page__content > h4.mb-4 {
    display: none;
}

/* Hero promo section */
.vv-gallery-hero {
    background: linear-gradient(135deg, #1a0d2e 0%, #0d0d1a 100%);
    border: 1px solid #2a1040;
    border-radius: 12px;
    padding: 36px 40px;
    margin-bottom: 36px;
}

.vv-gallery-hero-title {
    font-size: 26px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 12px;
    letter-spacing: -0.3px;
}

.vv-gallery-hero-desc {
    font-size: 15px;
    color: #aaa;
    line-height: 1.7;
    max-width: 700px;
    margin: 0 0 28px;
}

.vv-gallery-hero-desc strong {
    color: #d900d9;
}

.vv-gallery-hero-credits {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 28px;
}

.vv-gallery-hero-credit-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(217, 0, 217, 0.08);
    border: 1px solid rgba(217, 0, 217, 0.2);
    border-radius: 8px;
    padding: 12px 18px;
}

.vv-gallery-hero-credit-icon {
    font-size: 22px;
    line-height: 1;
}

.vv-gallery-hero-credit-item strong {
    display: block;
    color: #d900d9;
    font-size: 16px;
    font-weight: 700;
}

.vv-gallery-hero-credit-item span {
    display: block;
    color: #888;
    font-size: 12px;
    margin-top: 2px;
}

.vv-gallery-hero-cta {
    display: inline-block;
    background: #d900d9;
    color: #fff !important;
    font-size: 14px;
    font-weight: 700;
    padding: 12px 28px;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s;
    letter-spacing: 0.3px;
}

.vv-gallery-hero-cta:hover {
    background: #b800b8;
}

@media (max-width: 600px) {
    .vv-gallery-hero { padding: 24px 20px; }
    .vv-gallery-hero-title { font-size: 20px; }
    .vv-gallery-hero-credits { flex-direction: column; gap: 10px; }
}

/* Tabs */
.vv-gallery-tabs-wrap {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
}

.vv-gallery-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 24px;
    border-bottom: 1px solid #2a1a3a;
    padding-bottom: 0;
}

.vv-gallery-tab {
    background: transparent;
    border: none;
    border-bottom: 3px solid transparent;
    color: #888;
    font-size: 15px;
    font-weight: 600;
    padding: 10px 20px;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    margin-bottom: -1px;
}

.vv-gallery-tab:hover { color: #d900d9; }
.vv-gallery-tab.active {
    color: #d900d9;
    border-bottom-color: #d900d9;
}

.vv-gallery-panel { display: none; }
.vv-gallery-panel.active { display: block; }

/* Grid */
.vv-gallery-wrap {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 16px 0;
}

.vv-gallery-grid {
    columns: 2;
    column-gap: 12px;
}

@media (min-width: 640px)  { .vv-gallery-grid { columns: 3; } }
@media (min-width: 960px)  { .vv-gallery-grid { columns: 4; } }
@media (min-width: 1280px) { .vv-gallery-grid { columns: 5; } }

.vv-gallery-empty {
    text-align: center;
    color: #888;
    padding: 60px 0;
    font-size: 16px;
}

/* Card */
.vv-gallery-card {
    break-inside: avoid;
    margin-bottom: 12px;
    perspective: 900px;
    cursor: pointer;
}

.vv-gc-inner {
    position: relative;
    width: 100%;
    transition: transform 0.45s cubic-bezier(.4,0,.2,1);
    transform-style: preserve-3d;
}

.vv-gallery-card:hover .vv-gc-inner,
.vv-gallery-card.flipped .vv-gc-inner {
    transform: rotateY(180deg);
}

.vv-gc-front,
.vv-gc-back {
    border-radius: 8px;
    overflow: hidden;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

/* Front */
.vv-gc-front {
    position: relative;
    background: #111;
}

.vv-gc-thumb {
    display: block;
    width: 100%;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.vv-gc-thumb img,
.vv-gc-thumb video {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.vv-gc-video-thumb:hover img {
    transform: scale(1.04);
}

.vv-gc-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.35);
    color: #fff;
    font-size: 28px;
    opacity: 0;
    transition: opacity 0.2s;
    pointer-events: none;
}

.vv-gc-video-thumb:hover .vv-gc-play {
    opacity: 1;
}

/* Workflow badge on front */
.vv-gc-wf-badge {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(0,0,0,0.75);
    color: #fff;
    font-size: 10px;
    padding: 3px 7px;
    border-radius: 20px;
    white-space: nowrap;
    max-width: calc(100% - 16px);
    overflow: hidden;
    text-overflow: ellipsis;
    pointer-events: none;
}

/* Back */
.vv-gc-back {
    position: absolute;
    inset: 0;
    transform: rotateY(180deg);
    background: linear-gradient(160deg, #1a0d2e 0%, #0d1a2e 100%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 14px;
    border-radius: 8px;
    box-sizing: border-box;
    min-height: 160px;
}

.vv-gc-back-wf {
    font-size: 11px;
    font-weight: 700;
    color: #d900d9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.vv-gc-back-prompt {
    flex: 1;
    font-size: 12px;
    line-height: 1.5;
    color: #ccc;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    margin-bottom: 12px;
    word-break: break-word;
}

.vv-gc-back-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.vv-gc-btn {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: opacity 0.2s;
}

.vv-gc-btn:hover { opacity: 0.85; }

.vv-gc-btn-remix {
    background: #d900d9;
    color: #fff !important;
}

.vv-gc-btn-play {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

/* Load More */
.vv-gallery-load-more-wrap {
    text-align: center;
    margin: 32px 0 16px;
}

.vv-gallery-load-more {
    background: #d900d9;
    color: #fff;
    border: none;
    padding: 12px 40px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.2s;
}

.vv-gallery-load-more:hover    { opacity: 0.85; }
.vv-gallery-load-more:disabled { opacity: 0.5; cursor: default; }

/* Lightbox */
.vv-gallery-lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.93);
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
}

.vv-gallery-lb-inner {
    max-width: 90vw;
    max-height: 90vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vv-gallery-lb-inner video,
.vv-gallery-lb-inner img {
    max-width: 90vw;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 0 60px rgba(217,0,217,0.3);
}

.vv-gallery-lb-close {
    position: fixed;
    top: 20px;
    right: 24px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 36px;
    cursor: pointer;
    line-height: 1;
    z-index: 100000;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.vv-gallery-lb-close:hover { opacity: 1; }

/* Disable pointer events on front face when card is flipped/hovered (so back buttons work) */
/* Only apply hover rule on real hover devices — touch devices use JS flip instead */
@media (hover: hover) {
    .vv-gallery-card:hover .vv-gc-front {
        pointer-events: none;
    }
}
.vv-gallery-card.flipped .vv-gc-front {
    pointer-events: none;
}

/* Mobile — tap to flip */
@media (hover: none) {
    .vv-gallery-card:hover .vv-gc-inner {
        transform: none;
    }
    .vv-gallery-card.flipped .vv-gc-inner {
        transform: rotateY(180deg);
    }
    .vv-gc-play { opacity: 1; }
}

/* ==============================================
   Studio submit button (injected by JS)
   ============================================== */

.vv-gallery-submit-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.vv-gallery-submit-btn {
    background: transparent;
    border: 1.5px solid #d900d9;
    color: #d900d9;
    padding: 7px 16px;
    border-radius: 5px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.vv-gallery-submit-btn:hover {
    background: #d900d9;
    color: #fff;
}

.vv-gallery-submit-btn.submitted {
    border-color: #4caf50;
    color: #4caf50;
    cursor: default;
    pointer-events: none;
}

.vv-gallery-submit-hint {
    font-size: 11px;
    color: #888;
}

.vv-gal-hist-btn {
    background: transparent;
    border: 1.5px solid #d900d9;
    color: #d900d9;
    padding: 4px 10px;
    border-radius: 5px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
    line-height: 1.4;
    flex-shrink: 0;
}

.vv-gal-hist-btn:hover {
    background: #d900d9;
    color: #fff;
}

.vv-gal-hist-btn--done {
    border-color: #4caf50;
    color: #4caf50;
    cursor: default;
    pointer-events: none;
}

.vv-gal-hist-label {
    font-size: 11px;
    color: #888;
    white-space: nowrap;
}

@media (max-width: 480px) {
    .vv-gal-hist-btn { font-size: 11px; padding: 3px 8px; }
    .vv-gal-hist-label { font-size: 10px; }
}

/* Remix banner on studio page */
.vv-remix-banner {
    background: linear-gradient(90deg, #1a0d2e, #0d1a2e);
    border: 1px solid #d900d9;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 13px;
    color: #ccc;
    display: flex;
    align-items: center;
    gap: 10px;
}

.vv-remix-banner strong { color: #d900d9; }
