/*
 * Image frame: always shows the WHOLE image (no cropping of logos, text or EU banners)
 * inside a fixed-ratio box, so cards stay the same height. Empty space around images
 * with a different shape is filled with a blurred, darkened copy of the same image.
 *
 *   <div class="media-frame" style="--media-bg: url('…')">
 *       <img src="…" alt="…">
 *   </div>
 *
 * Ratio modifiers: media-frame--wide (16:9), media-frame--cover-photo (16:10, max 70vh).
 */

.media-frame {
    position: relative;
    display: block;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    border-radius: 14px;
    background-color: #eef2f7;
    isolation: isolate;
}

.media-frame::before {
    content: "";
    position: absolute;
    inset: -24px;
    z-index: -1;
    background-image: var(--media-bg, none);
    background-position: center;
    background-size: cover;
    filter: blur(20px) brightness(0.85) saturate(1.1);
    transform: scale(1.08);
}

/* Beats theme rules such as ".course-box img { height: … }" */
.media-frame > img,
.course-box .media-frame > img,
.course-box .figure-box .media-frame > img {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    max-width: none;
    object-fit: contain;
    object-position: center;
    border-radius: 0;
    margin: 0;
    transition: transform 0.4s ease;
}

a.media-frame:hover > img,
.course-box:hover .media-frame > img {
    transform: scale(1.03);
}

.media-frame--wide {
    aspect-ratio: 16 / 9;
}

.media-frame--cover-photo {
    aspect-ratio: 16 / 10;
    max-height: 70vh;
    width: 100%;
}

@media (max-width: 575.98px) {
    .media-frame--cover-photo {
        aspect-ratio: 4 / 3;
    }
}
