/* ------------------------------------------------------------------
 *  Feature media popup — a dark modal that autoplays a video (with sound)
 *  or shows an image plus a description, opened by clicking a feature's
 *  ? icon / label.
 *
 *  Shared by the models.php comparison table and the per-variant detail
 *  pages (classic144.php …) via includes/media-modal.php. Only depends on
 *  the global --c3 token, so it is safe to load anywhere.
 * ------------------------------------------------------------------ */
.cmp-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.78);
    animation: cmp-modal-in 0.18s ease;
}

.cmp-modal[hidden] {
    display: none;
}

.cmp-modal__backdrop {
    position: absolute;
    inset: 0;
}

.cmp-modal__panel {
    position: relative;
    width: min(620px, 100%);
    max-height: 88vh;
    overflow-y: auto;
    background: #16181d;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 1rem;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
    padding: 1.1rem 1.1rem 1.3rem;
    color: #fff;
}

.cmp-modal__close {
    /* Reset the project's global button styles (the detail pages load
       models.css, whose `button { background: red; padding: 1rem 1.5rem;
       text-transform: uppercase; … }` would otherwise turn this into a big red
       block instead of the round X). Keeps the close button identical on
       models.php and the per-variant detail pages. */
    appearance: none;
    margin: 0;
    padding: 0;
    box-shadow: none;
    transform: none;
    text-transform: none;
    letter-spacing: normal;
    font-weight: 400;
    font-family: inherit;
    position: absolute;
    top: 0.5rem;
    right: 0.55rem;
    width: 2.2rem;
    height: 2.2rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.8rem;
    line-height: 1;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.cmp-modal__close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.cmp-modal__media {
    margin: 0.25rem 0 1rem;
    border-radius: 0.6rem;
    overflow: hidden;
    background: #000;
    min-height: 4rem;
}

.cmp-modal__media:empty {
    display: none;
}

.cmp-modal__media video,
.cmp-modal__media img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 62vh;
    object-fit: contain;
}

.cmp-modal__title {
    margin: 0 0 0.5rem;
    padding-right: 2rem;       /* clear the close button */
    font-size: 1.15rem;
    color: #fff;
}

.cmp-modal__desc {
    margin: 0;
    color: var(--c3);
    line-height: 1.55;
    font-size: 0.92rem;
}

@keyframes cmp-modal-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

body.cmp-modal-open {
    overflow: hidden;
}
