.fmef-modal {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: none;
}

.fmef-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.fmef-modal__dialog {
    position: relative;
    background: #fff;
    max-width: 960px;
    margin: 4vh auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
    max-height: 92vh;
    display: flex;
    flex-direction: column;
}

.fmef-modal__close {
    position: absolute;
    top: 8px;
    right: 12px;
    border: 0;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    padding: 6px 10px;
}

.fmef-modal__content {
    overflow: auto;
    padding: 24px;
}

.fmef-modal__header {
    margin-bottom: 12px;
    border-bottom: 1px solid #eee;
    padding-bottom: 8px;
}

.fmef-modal__title {
    margin: 0;
    font-size: 1.6rem;
    line-height: 1.2;
}

.fmef-modal__meta {
    color: #444;
    font-size: 0.95rem;
    margin-top: 6px;
}

.fmef-meta-list {
    list-style: none;
    margin: 6px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.fmef-meta-item strong {
    font-weight: 600;
    margin-right: 4px;
}

.fmef-modal__body img {
    max-width: 100%;
    height: auto;
}

.fmef-modal__loader {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid #ddd;
    border-top-color: #333;
    animation: fmefspin 1s linear infinite;
    margin: 40px auto;
}

@keyframes fmefspin {
    to {
        transform: rotate(360deg);
    }
}

body.fmef-modal-opened {
    overflow: hidden;
}

.fmef-modal--mobile .fmef-modal__dialog {
    width: var(--fmef-mobile-width, 420px);
    max-width: none;
    margin: 4vh auto;
    min-height: auto;
    max-height: 92vh;
}

@media (max-width: 768px) {
    .fmef-modal__dialog {
        margin: 0;
        max-width: 100%;
        border-radius: 0;
        min-height: 100vh;
        max-height: 100vh;
    }

    .fmef-modal--mobile .fmef-modal__dialog {
        width: 100%;
    }

    .fmef-modal__content {
        padding: 16px;
    }
}
