/* ------------------------------------------------------ */
/*  1) Base Container for the Video Grid                  */
/* ------------------------------------------------------ */
.yvg-video-grid {
    display: grid;
    gap: 16px;
    padding: 20px;
    /* The specific number of columns at large screens is determined
       by the .columns-N class added in the plugin’s shortcode output. */
}

/* ------------------------------------------------------ */
/*  2) Column Classes for Different Desktop Settings      */
/* ------------------------------------------------------ */
.yvg-video-grid.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.yvg-video-grid.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.yvg-video-grid.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

.yvg-video-grid.columns-5 {
    grid-template-columns: repeat(5, 1fr);
}

/* ------------------------------------------------------ */
/*  3) Responsive Overrides                               */
/*      - 2 columns at <= 1200px                          */
/*      - 1 column at <= 550px                            */
/* ------------------------------------------------------ */
@media (max-width: 1350px) {
    .yvg-video-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 550px) {
    .yvg-video-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ------------------------------------------------------ */
/*  4) Individual Video Item                              */
/* ------------------------------------------------------ */
.yvg-video-item {
    background-color: #212121;
    border-radius: 15px;
    overflow: hidden;
    transition: transform 0.3s;
}

.yvg-video-item:hover {
    transform: scale(1.05);
}

/* ------------------------------------------------------ */
/*  5) Thumbnail Container                                */
/* ------------------------------------------------------ */
.yvg-video-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* Maintain 16:9 aspect ratio */
    background-color: #000; /* Fallback color */
    overflow: hidden; /* Ensure the image doesn't exceed container bounds */
}

.yvg-video-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100% !important;
    object-fit: cover; /* Ensures the image fills the container without distortion */
    border: none; /* Remove any border or default styles */
    border-radius: 15px !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
}

/* ------------------------------------------------------ */
/*  6) Video Duration Overlay                             */
/* ------------------------------------------------------ */
.yvg-video-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    padding: 2px 4px;
    border-radius: 2px;
    font-size: 12px;
}

/* ------------------------------------------------------ */
/*  7) Video Information Container                        */
/* ------------------------------------------------------ */
.yvg-video-info {
    display: flex;
    align-items: center;
    padding: 12px;
}

/* ------------------------------------------------------ */
/*  8) Author Avatar                                      */
/* ------------------------------------------------------ */
.yvg-author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    margin-right: 12px;
}

/* ------------------------------------------------------ */
/*  9) Video Title                                        */
/* ------------------------------------------------------ */
.yvg-video-title {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;  /* Limits title to 2 lines */
    -webkit-box-orient: vertical;
}