/* Grid container */
.mvg-grid {
    display: grid;
    grid-gap: 20px;
}

/* Dynamic columns based on class (desktop default) */
.mvg-columns-1 { grid-template-columns: repeat(1, 1fr); }
.mvg-columns-2 { grid-template-columns: repeat(2, 1fr); }
.mvg-columns-3 { grid-template-columns: repeat(3, 1fr); }
.mvg-columns-4 { grid-template-columns: repeat(4, 1fr); }

/* Tablet: cap at 2 columns */
@media (max-width: 1024px) {
    .mvg-columns-3,
    .mvg-columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Phone: single column */
@media (max-width: 600px) {
    .mvg-columns-2,
    .mvg-columns-3,
    .mvg-columns-4 {
        grid-template-columns: repeat(1, 1fr);
    }
}

/* Visual affordance for whatever element the modal-open dynamic tag was attached to */
[data-mvg-embed-url] {
    cursor: pointer;
}

/* Add this CSS Class to an Image widget to make it fill/cover its container like a background —
   use this instead of a Container's Background Image field, which doesn't repeat correctly per
   post inside a looped Elementor template. The container itself needs position:relative. */
.mvg-fill-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

/* Elementor's CSS Classes control lands on the widget's wrapper div, not the <img> itself —
   the wrapper is now correctly sized/positioned above, but object-fit does nothing on a div.
   Target the actual <img> inside it so it covers/crops rather than keeping its own aspect ratio. */
.mvg-fill-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Add this to the CONTAINER that holds a .mvg-fill-image (instead of/alongside position:relative).
   A fill-image has no height of its own to give the container — this pins a real, scaling height
   via aspect-ratio so the image always has something to fill, at any column count. Adjust the
   ratio if your video thumbnails aren't 16:9. */
.mvg-cover-container {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

/* Card styling */
.mvg-card {
    background: #fff;
    border: 0px solid #ddd;
    border-radius: 10px;
    padding: 0px;
    text-align: center;
    transition: box-shadow 0.2s ease;
    overflow: hidden;
    cursor: pointer;
    background-repeat: no-repeat;
    background-position: bottom left;
    background-size: 100px;
}

button.mvg-modal-close {
    padding: 0px 0px 6px;
    width: 30px;
    height: 30px;
    border-radius: 40px;
    font-size: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1 !important;
    background: #000;
    color: #fff;
    font-weight: 700;
}

.mvg-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
}

.mvg-card h4 {
    font-size: 15px;
    font-weight: 700;
    text-align: left;
    padding: 0px 20px 5px;
    color: #32174D;
}

/* Elementor-templated cards bring their own design — drop the built-in card chrome.
   Compound selector (both classes) so this reliably outranks .mvg-card above regardless of order. */
.mvg-card.mvg-card-elementor {
    background: none;
    box-shadow: none;
    border-radius: 0;
    cursor: default;
}

.mvg-card.mvg-card-elementor:hover {
    box-shadow: none;
}

/* Modal styling — display is set directly by JS (inline, with real !important priority) on
   open/close, so this base rule is just the sane pre-JS default. Printed once in the footer
   (see MVG_UI), never nested inside page content, so no ancestor can trap or outrank it. */
.mvg-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}

.mvg-modal-backdrop {
    position: absolute;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
}

.mvg-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 90%;
    max-width: 900px;
    transform: translate(-50%, -50%);
    background: #000;
    border-radius: 6px;
    overflow: hidden;
    padding: 0;
}

.mvg-modal-player {
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 ratio */
    position: relative;
}

.mvg-modal-player iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.mvg-modal-close {
    position: absolute;
    top: 8px;
    right: 12px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    z-index: 2;
}
