/* Video Gallery Block Container */
.video-gallery-block {
    width: 100%;
    margin: 0 auto;
}

/* Grid Layout */
.mtn-video-gallery--grid {
    display: grid;
    gap: 20px;
    margin: 20px;
    /* width: 100%; */
}

.mtn-video-gallery--grid[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.mtn-video-gallery--grid[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.mtn-video-gallery--grid[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

/* Video Items */
.mtn-video-item {
    break-inside: avoid;
    display: flex;
    flex-direction: column;
}

.mtn-video-item .video-wrapper {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.mtn-video-item .video-wrapper:hover {
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* Video Embed Container - RESPONSIVE */
.mtn-video-item .video-embed {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    flex-shrink: 0;
}

/* Embedded videos  */
.mtn-video-item .video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 8px 8px 0 0;
    display: block;
}

/* Video Info  */
.video-info {
    padding: 15px;
    background: #fafafa;
    border-top: 1px solid #eee;
    flex-grow: 1;
    display: flex;
    align-items: center;
}

.video-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #222;
    line-height: 1.4;
    width: 100%;
}

/* Slider Layout */
.mtn-video-gallery--slider .video-gallery-slider {
    display: flex;
    overflow-x: auto;
    gap: 20px;
    padding: 10px 20px;
    scroll-behavior: smooth;
    align-items: stretch;
}

.mtn-video-gallery--slider .mtn-video-item {
    min-width: 300px;
    flex-shrink: 0;
    display: flex;
}

/* Block alignment classes */
.video-gallery-block.alignwide {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.video-gallery-block.alignfull {
    width: 100%;
    max-width: none;
    margin-left: 0;
    margin-right: 0;
}

.video-gallery-block.aligncenter {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
}

/* Scrollbar styling for slider */
.mtn-video-gallery--slider .video-gallery-slider::-webkit-scrollbar {
    height: 8px;
}

.mtn-video-gallery--slider .video-gallery-slider::-webkit-scrollbar-thumb {
    background-color: rgba(0,0,0,0.2);
    border-radius: 4px;
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
    .mtn-video-gallery--grid[data-columns="4"] {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .mtn-video-gallery--grid[data-columns="3"],
    .mtn-video-gallery--grid[data-columns="4"] {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .mtn-video-gallery--slider .mtn-video-item {
        min-width: 280px;
    }
    
    .video-gallery-block.alignwide {
        margin-left: 20px;
        margin-right: 20px;
    }
}

@media (max-width: 480px) {
    .mtn-video-gallery--grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }

    .mtn-video-gallery--slider .mtn-video-item {
        min-width: 85%;
    }
    
    .video-info {
        padding: 12px;
    }
    
    .video-title {
        font-size: 14px;
    }
    
    .video-gallery-block {
        margin: 15px 0;
    }
}

/*  block editor alignment */
@media (min-width: 600px) {
    .video-gallery-block.alignleft {
        float: left;
        margin-right: 2em;
    }
    
    .video-gallery-block.alignright {
        float: right;
        margin-left: 2em;
    }
}