/* ============================================================
   Video Gallery Plugin — Frontend Styles
   ============================================================ */

/* ---------- Gallery Grid ---------- */
.vg-gallery {
    display: grid;
    gap: 20px;
    margin: 1.5em 0;
}

.vg-cols-1 { grid-template-columns: 1fr; }
.vg-cols-2 { grid-template-columns: repeat(2, 1fr); }
.vg-cols-3 { grid-template-columns: repeat(3, 1fr); }
.vg-cols-4 { grid-template-columns: repeat(4, 1fr); }
.vg-cols-5 { grid-template-columns: repeat(5, 1fr); }
.vg-cols-6 { grid-template-columns: repeat(6, 1fr); }

@media (max-width: 900px) {
    .vg-cols-4,
    .vg-cols-5,
    .vg-cols-6 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
    .vg-cols-3,
    .vg-cols-4,
    .vg-cols-5,
    .vg-cols-6 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 400px) {
    .vg-gallery { grid-template-columns: 1fr !important; }
}

/* ---------- Gallery Thumbnails ---------- */
.vg-item { display: flex; flex-direction: column; }

.vg-trigger {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    text-align: left;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.vg-trigger:focus-visible {
    outline: 3px solid #0073aa;
    outline-offset: 2px;
    border-radius: 4px;
}

.vg-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #111;
    border-radius: 6px;
    overflow: hidden;
}

.vg-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease, filter 0.3s ease;
}

.vg-trigger:hover .vg-thumb img,
.vg-trigger:focus  .vg-thumb img {
    transform: scale(1.05);
    filter: brightness(0.8);
}

.vg-thumb-placeholder {
    width: 100%;
    height: 100%;
    background: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
}

.vg-thumb-placeholder .vg-play-icon {
    font-size: 3rem;
    color: rgba(255,255,255,0.45);
}

.vg-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    opacity: 0.85;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
}

.vg-trigger:hover .vg-play-overlay,
.vg-trigger:focus .vg-play-overlay {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.12);
}

.vg-title {
    margin: 8px 0 0;
    font-size: 0.9em;
    font-weight: 600;
    line-height: 1.4;
    color: inherit;
}

.vg-empty { color: #777; font-style: italic; }

/* ============================================================
   Lightbox — Revolution-style
   ============================================================ */

/* Overlay */
.vg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 64px;           /* side gutters for the arrows */
    box-sizing: border-box;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.32s ease, visibility 0.32s ease;
}

.vg-lightbox.vg-is-open {
    opacity: 1;
    visibility: visible;
}

/* Backdrop */
.vg-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.94);
    cursor: pointer;
}

/* ---- Stage (centred column: video + caption + dots) ---- */
.vg-lightbox-stage {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: vg-stage-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes vg-stage-in {
    from { opacity: 0; transform: scale(0.96) translateY(16px); }
    to   { opacity: 1; transform: scale(1)    translateY(0); }
}

/* ---- Video wrap (16:9 box with shadow) ---- */
.vg-lightbox-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #000;
    border-radius: 4px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(255,255,255,0.06);
    overflow: hidden;
}

/* ---- Video iframe ---- */
.vg-lightbox-body {
    position: absolute;
    inset: 0;
}

.vg-lightbox-body iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    opacity: 1;
    transition: opacity 0.28s ease;
}

.vg-lightbox-body iframe.vg-fade-out {
    opacity: 0;
}

/* ---- Close button (top-right corner of video box) ---- */
.vg-lightbox-close {
    position: absolute;
    top: -14px;
    right: -14px;
    z-index: 10;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fff;
    border: none;
    color: #111;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
    transition: background 0.15s, color 0.15s, transform 0.15s;
}

.vg-lightbox-close:hover {
    background: #e5e5e5;
    transform: scale(1.12) rotate(90deg);
}

/* ---- Caption (title below video) ---- */
.vg-lightbox-caption {
    margin-top: 16px;
    color: rgba(255, 255, 255, 0.85);
    font-size: 1rem;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-weight: 500;
    text-align: center;
    letter-spacing: 0.01em;
    min-height: 1.4em;
    text-shadow: 0 1px 4px rgba(0,0,0,0.6);
}

/* ---- Dot navigation ---- */
.vg-lightbox-dots {
    display: flex;
    gap: 8px;
    margin-top: 14px;
    align-items: center;
    justify-content: center;
    min-height: 12px;
}

.vg-lightbox-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: rgba(255, 255, 255, 0.35);
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.vg-lightbox-dot.vg-dot-active {
    background: #fff;
    transform: scale(1.3);
}

.vg-lightbox-dot:hover {
    background: rgba(255, 255, 255, 0.7);
}

/* ---- Prev / Next arrows (sides of the viewport) ---- */
.vg-lightbox-prev,
.vg-lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.18s, border-color 0.18s, opacity 0.18s, transform 0.18s;
    opacity: 0;                /* hidden until lightbox hover */
}

.vg-lightbox.vg-is-open:hover .vg-lightbox-prev,
.vg-lightbox.vg-is-open:hover .vg-lightbox-next,
.vg-lightbox-prev:focus,
.vg-lightbox-next:focus {
    opacity: 1;
}

.vg-lightbox-prev { left: 12px; }
.vg-lightbox-next { right: 12px; }

.vg-lightbox-prev:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.45);
    transform: translateY(-50%) scale(1.08);
}

.vg-lightbox-next:hover {
    background: rgba(255, 255, 255, 0.18);
    border-color: rgba(255, 255, 255, 0.45);
    transform: translateY(-50%) scale(1.08);
}

.vg-lightbox-prev:disabled,
.vg-lightbox-next:disabled {
    opacity: 0 !important;
    pointer-events: none;
}

/* ---- Responsive ---- */
@media (max-width: 600px) {
    .vg-lightbox { padding: 0 44px; }

    .vg-lightbox-prev { left: 4px; }
    .vg-lightbox-next { right: 4px; }

    .vg-lightbox-prev,
    .vg-lightbox-next { width: 40px; height: 40px; opacity: 1; }

    .vg-lightbox-close { top: -10px; right: -10px; width: 30px; height: 30px; }
}
