.sp-grid-container-c671efbf {
    --sp-columns: 3;
    --sp-gap: 40px;
    width: 100%;
    position: relative;
    visibility: hidden; /* Hidden until masonry initializes */
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sp-grid-container-c671efbf.sp-loaded {
    visibility: visible;
    opacity: 1;
}

.sp-grid-sizer-c671efbf,
.sp-item-c671efbf {
    width: calc((100% - ((var(--sp-columns) - 1) * var(--sp-gap))) / var(--sp-columns));
    margin-bottom: var(--sp-gap);
}

.sp-item-inner-c671efbf {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 8px; /* Default */
    background: #000;
    cursor: pointer;
}

.sp-item-inner-c671efbf video,
.sp-item-inner-c671efbf img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
    transition: transform 0.4s ease;
}

/* Auto-sizing handles the ratio dynamically based on the video content */
/* The masonry layout will naturally accommodate varying aspect ratios */

.sp-play-overlay-c671efbf {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    pointer-events: none; /* Let clicks pass to the container */
    transition: opacity 0.3s ease;
}

.sp-item-inner-c671efbf.is-playing .sp-play-overlay-c671efbf {
    opacity: 0;
}

.sp-play-btn-c671efbf {
    background: rgba(0, 0, 0, 0.5);
    border: none;
    border-radius: 50%;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: transform 0.2s ease, background 0.2s ease;
}

.sp-play-btn-c671efbf svg {
    fill: #fff;
    width: 30px;
    height: 30px;
}

.sp-item-inner-c671efbf:hover .sp-play-btn-c671efbf {
    transform: scale(1.1);
    background: rgba(0, 0, 0, 0.7);
}

.sp-overlay-c671efbf {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px 20px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, rgba(0,0,0,0) 100%);
    color: #fff;
    opacity: 1; /* Permanent display */
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    pointer-events: none;
    z-index: 2;
}

.sp-title-c671efbf {
    margin: 0;
    font-size: 1.2rem;
    color: #fff;
}

/* Mobile Responsive Adjustments */
@media (max-width: 1024px) {
    .sp-grid-sizer-c671efbf,
    .sp-item-c671efbf {
        /* Fallback to 2 columns on tablet if Elementor vars fail */
        width: calc((100% - var(--sp-gap)) / 2);
    }
    .sp-grid-container-c671efbf {
        --sp-columns: 2 !important;
    }
}

@media (max-width: 767px) {
    .sp-grid-sizer-c671efbf,
    .sp-item-c671efbf {
        /* Fallback to 1 column on mobile */
        width: 100%;
    }
    .sp-grid-container-c671efbf {
        --sp-columns: 1 !important;
    }
    .sp-title-c671efbf {
        font-size: 1rem;
    }
    .sp-play-btn-c671efbf {
        width: 50px;
        height: 50px;
    }
    .sp-play-btn-c671efbf svg {
        width: 24px;
        height: 24px;
    }
}
