/* Site palette: css/customhome.css and css/customsitenew1.css.
   The live site uses Cairo. Its bundled TheSans font is the offline fallback.
   All component styles are scoped to avoid the site's global .modal rules. */
@font-face {
    font-family: "MOF TheSans";
    src: url("assets/TheSans-Plain.woff2") format("woff2");
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
}

.mof-image-popup {
    box-sizing: border-box;
    width: min(860px, calc(100% - 32px));
    max-width: none;
    max-height: calc(100vh - 32px);
    max-height: calc(100dvh - 32px);
    margin: auto;
    padding: 0;
    overflow: auto;
    color: #28546d;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: 24px;
    box-shadow: 0 32px 100px rgba(12, 37, 53, .28), 0 8px 24px rgba(12, 37, 53, .12);
    font-family: "Cairo", "MOF TheSans", sans-serif;
    text-align: start;
    overscroll-behavior: contain;
}

.mof-image-popup[open] {
    animation: mof-popup-enter .32s cubic-bezier(.2, .7, .2, 1) both;
}

@keyframes mof-popup-enter {
    from { opacity: 0; transform: translateY(16px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.mof-image-popup::backdrop {
    background: rgba(15, 36, 49, .52);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.mof-image-popup__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding: 32px 32px 28px;
    background: linear-gradient(120deg, #fff 35%, #f0f7f9 100%);
    border-radius: 23px 23px 0 0;
}

.mof-image-popup__heading { min-width: 0; }

.mof-image-popup__title {
    margin: 0;
    color: #28546d;
    font-size: clamp(22px, 3vw, 32px);
    font-weight: 700;
    line-height: 1.5;
    overflow-wrap: anywhere;
}

.mof-image-popup__description {
    margin: 10px 0 0;
    max-width: 60ch;
    color: #527080;
    font-size: clamp(14px, 2vw, 16px);
    font-weight: 400;
    line-height: 1.8;
    overflow-wrap: anywhere;
}

.mof-image-popup__close {
    display: inline-flex;
    flex: 0 0 44px;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    color: #28546d;
    background: rgba(255, 255, 255, .9);
    border: 1px solid rgba(40, 84, 109, .12);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(40, 84, 109, .04);
    transition: color .2s, background-color .2s, transform .2s;
}

.mof-image-popup__close:hover {
    color: #fff;
    background: #28546d;
    transform: rotate(90deg);
}

.mof-image-popup__close:focus-visible,
.mof-image-popup__redirect:focus-visible,
.mof-popup-demo__open:focus-visible {
    outline: 3px solid #28546d;
    outline-offset: 4px;
}

.mof-image-popup__body { padding: 0 12px 12px; }

.mof-image-popup__image {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
    object-fit: contain;
    border-radius: 14px;
}

.mof-image-popup .mof-image-popup__footer {
    display: flex;
    padding: 12px 32px 28px;
    margin: 0;
    background: #fff;
    border: 0;
    box-shadow: none;
}

.mof-image-popup .mof-image-popup__redirect {
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 48px;
    padding: 12px 24px;
    margin: 0;
    color: #fff;
    background: #28546d;
    border: 1px solid transparent;
    border-radius: 12px;
    font: inherit;
    font-size: 16px;
    line-height: 1.5;
    text-decoration: none;
    transition: background-color .2s, box-shadow .2s;
}

.mof-image-popup .mof-image-popup__redirect:hover {
    color: #fff;
    background: #005976;
    box-shadow: 0 6px 16px rgba(40, 84, 109, .18);
}

.mof-image-popup__redirect svg { flex-shrink: 0; }
.mof-image-popup[dir="ltr"] .mof-image-popup__redirect svg { transform: rotate(180deg); }

@media (max-width: 575px) {
    .mof-image-popup { border-radius: 20px; }
    .mof-image-popup__header { gap: 12px; padding: 24px 20px 22px; border-radius: 19px 19px 0 0; }
    .mof-image-popup__body { padding: 0 8px 8px; }
    .mof-image-popup__image { border-radius: 12px; }
    .mof-image-popup .mof-image-popup__footer { padding: 12px 20px 20px; }
    .mof-image-popup .mof-image-popup__redirect { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .mof-image-popup[open] { animation: none; }
    .mof-image-popup__close { transition: none; }
    .mof-image-popup__redirect { transition: none; }
}

/* Preview page only; omit this section when integrating the component. */
.mof-popup-demo {
    margin: 0;
    min-height: 100vh;
    color: #28546d;
    background: radial-gradient(ellipse at 10% 90%, #daeaf0, transparent 60%), #f6f9fa;
    font-family: "Cairo", "MOF TheSans", sans-serif;
}

.mof-popup-demo__page {
    box-sizing: border-box;
    max-width: 1100px;
    margin: auto;
    padding: 48px 24px;
}

.mof-popup-demo__logo { max-width: 100%; height: auto; }
.mof-popup-demo__page h1 { margin-top: 80px; font-size: clamp(24px, 4vw, 36px); }
.mof-popup-demo__page p { color: #58595b; }

.mof-popup-demo__languages { display: flex; gap: 16px; margin: 24px 0 8px; }
.mof-popup-demo__languages a { color: #28546d; text-underline-offset: 5px; }
.mof-popup-demo__languages a[aria-current="page"] { font-weight: 700; }

.mof-popup-demo__open {
    margin-top: 16px;
    padding: 12px 24px;
    color: #fff;
    background: #28546d;
    border: 1px solid #28546d;
    border-radius: 12px;
    font: inherit;
    cursor: pointer;
}

.mof-popup-demo__open:hover { background: #005976; }
