/* Multi Column Video Gallery Block Styles */
.multi-column-video-gallery {
    width: 100%;
    margin: 0 auto;
    padding: 20px 0;
}

/* Video Gallery Grid */
.video-gallery-grid {
    display: grid;
    width: 100%;
}

/* Column Settings */
.multi-column-video-gallery {
    --desktop-cols: 3;
    --tablet-cols: 2;
    --mobile-cols: 1;
}

.cols-desktop-1 { --desktop-cols: 1; }
.cols-desktop-2 { --desktop-cols: 2; }
.cols-desktop-3 { --desktop-cols: 3; }
.cols-desktop-4 { --desktop-cols: 4; }
.cols-desktop-5 { --desktop-cols: 5; }
.cols-desktop-6 { --desktop-cols: 6; }

.cols-tablet-1 { --tablet-cols: 1; }
.cols-tablet-2 { --tablet-cols: 2; }
.cols-tablet-3 { --tablet-cols: 3; }
.cols-tablet-4 { --tablet-cols: 4; }

.cols-mobile-1 { --mobile-cols: 1; }
.cols-mobile-2 { --mobile-cols: 2; }

/* Apply columns */
.video-gallery-grid {
    grid-template-columns: repeat(var(--desktop-cols), 1fr);
}

/* Video Item */
.video-item {
    display: flex;
    flex-direction: column;
}

/* Video Container */
.video-container {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* Aspect Ratios */
.aspect-16-9 .video-container {
    aspect-ratio: 16 / 9;
}

.aspect-4-3 .video-container {
    aspect-ratio: 4 / 3;
}

.aspect-1-1 .video-container {
    aspect-ratio: 1 / 1;
}

.aspect-9-16 .video-container {
    aspect-ratio: 9 / 16;
}

/* Video Embeds */
.video-embed,
.video-self-hosted {
    width: 100%;
    height: 100%;
}

.video-embed iframe,
.video-self-hosted video {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Video Caption */
.video-caption {
    margin-top: 12px;
    padding: 0 5px;
    text-align: center;
    font-family: Helvetica, Arial, sans-serif;
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    font-weight: 400;
}

/* Gallery Gaps */
.gap-none .video-gallery-grid {
    gap: 0;
}

.gap-small .video-gallery-grid {
    gap: 15px;
}

.gap-medium .video-gallery-grid {
    gap: 25px;
}

.gap-large .video-gallery-grid {
    gap: 35px;
}

.gap-none .video-caption {
    padding: 0;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .video-gallery-grid {
        grid-template-columns: repeat(var(--tablet-cols), 1fr);
    }
    
    .video-caption {
        font-size: 13px;
        margin-top: 10px;
    }
}

@media (max-width: 768px) {
    .video-gallery-grid {
        grid-template-columns: repeat(var(--mobile-cols), 1fr);
    }
    
    .video-caption {
        font-size: 12px;
        margin-top: 8px;
        padding: 0 2px;
    }
    
    .gap-large .video-gallery-grid {
        gap: 25px;
    }
}

@media (max-width: 480px) {
    .multi-column-video-gallery {
        padding: 15px 0;
    }
    
    .video-caption {
        font-size: 11px;
    }
    
    .gap-medium .video-gallery-grid,
    .gap-large .video-gallery-grid {
        gap: 15px;
    }
}

/* Loading States */
.video-container {
    background: #f8f8f8;
}

.video-embed iframe,
.video-self-hosted video {
    background: #000;
}

/* Focus styles for accessibility */
.video-embed iframe:focus,
.video-self-hosted video:focus {
    outline: 2px solid #007cba;
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .multi-column-video-gallery {
        break-inside: avoid;
    }
    
    .video-gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .video-embed iframe {
        display: none;
    }
    
    .video-caption {
        border: 1px solid #ccc;
        padding: 8px;
        background: #f9f9f9;
        font-size: 12px;
    }
}

/* Hover effects for better interactivity */
.video-item:hover .video-caption {
    color: #007cba;
}

/* Ensure consistent video sizing */
.video-embed iframe,
.video-self-hosted video {
    border-radius: 4px;
}