/* YouTube Grid Manager Styles */

.ygm-video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px; /* Adjust gap as needed */
    margin-bottom: 30px;
}

.ygm-video-item {
    position: relative;
    width: 100%;
}

.ygm-video-thumbnail {
    position: relative;
    display: block;
    width: 100%;
    overflow: hidden;
    margin-bottom: 15px;
    border-radius: 4px; /* Optional rounded corners */
    box-shadow: 0 4px 6px rgba(0,0,0,0.1); /* Subtle shadow */
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.ygm-video-thumbnail:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.2);
}

.ygm-video-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    transition: filter 0.3s ease;
}

.ygm-video-thumbnail:hover img {
    filter: brightness(0.8);
}

/* Play Button Overlay */
.ygm-play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background-color: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease, background-color 0.3s ease;
    pointer-events: none; /* Let clicks pass through to the link */
}

.ygm-video-thumbnail:hover .ygm-play-overlay {
    opacity: 1;
}

.ygm-play-icon {
    width: 0; 
    height: 0; 
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 16px solid #fff;
    margin-left: 4px; /* Visual centering adjustment */
}

.ygm-video-title {
    margin: 0;
    padding: 0;
    line-height: 1.4;
    font-size: 18px; /* Default size, can be overridden by Divi */
}

.ygm-video-title a {
    text-decoration: none;
    color: inherit; /* Inherit Divi's text color */
    transition: color 0.3s ease;
}

.ygm-video-title a:hover {
    color: #e62117; /* YouTube Red or Theme Color */
}

/* Divi Breakpoints */

/* Tablet (980px and below) */
@media (max-width: 980px) {
    .ygm-video-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* Mobile (767px and below) */
@media (max-width: 767px) {
    .ygm-video-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}
