/* ==========================================================
   MFF Hero — صورة خلفية كاملة + نص فوقها (RTL) + زرّان
   ========================================================== */

.mff-hero {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start; /* RTL: يبدأ المحتوى من اليمين */
    direction: rtl;
    min-height: 620px;
    padding: var(--mff-hero-padding, 80px) clamp(20px, 6vw, 110px);
    overflow: hidden;
    isolation: isolate;
    background: var(--mff-hero-bg, #1A6788);
    border-radius: 0 0 var(--mff-hero-radius, 40px) var(--mff-hero-radius, 40px);
    box-sizing: border-box;
}

.mff-hero--compact { min-height: 440px }
.mff-hero--medium { min-height: 540px }
.mff-hero--large { min-height: 620px }
.mff-hero--fullscreen { min-height: calc(100svh - 82px) }

/* الصورة الخلفية */
.mff-hero__bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    max-width: none;
}

/* الطبقة فوق الصورة: تدرّج يبدأ من جهة النص (اليمين) */
.mff-hero__overlay {
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(
        to left,
        rgba(var(--mff-hero-overlay-rgb, 15, 63, 85), var(--mff-hero-overlay-opacity, .7)) 0%,
        rgba(var(--mff-hero-overlay-rgb, 15, 63, 85), calc(var(--mff-hero-overlay-opacity, .7) * .72)) 50%,
        rgba(var(--mff-hero-overlay-rgb, 15, 63, 85), calc(var(--mff-hero-overlay-opacity, .7) * .2)) 100%
    );
}

/* المحتوى */
.mff-hero__content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 660px;
    text-align: right;
}

.mff-hero--align-center { justify-content: center }
.mff-hero--align-center .mff-hero__content { text-align: center }
.mff-hero--align-center .mff-hero__overlay {
    background: rgba(var(--mff-hero-overlay-rgb, 15, 63, 85), calc(var(--mff-hero-overlay-opacity, .7) * .8));
}

.mff-hero--align-left { direction: ltr }
.mff-hero--align-left .mff-hero__content { text-align: left }
.mff-hero--align-left .mff-hero__overlay {
    background: linear-gradient(
        to right,
        rgba(var(--mff-hero-overlay-rgb, 15, 63, 85), var(--mff-hero-overlay-opacity, .7)) 0%,
        rgba(var(--mff-hero-overlay-rgb, 15, 63, 85), calc(var(--mff-hero-overlay-opacity, .7) * .72)) 50%,
        rgba(var(--mff-hero-overlay-rgb, 15, 63, 85), calc(var(--mff-hero-overlay-opacity, .7) * .2)) 100%
    );
}

.mff-hero__eyebrow {
    display: inline-flex;
    margin-bottom: 18px;
    padding: 7px 16px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .14);
    border: 1px solid rgba(255, 255, 255, .22);
    color: var(--mff-hero-eyebrow-color, #DFF2DE);
    font-size: 14px;
    font-weight: 800;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.mff-hero__title {
    margin: 0 0 18px;
    color: var(--mff-hero-title-color, #fff);
    font-size: clamp(34px, 5vw, 56px);
    line-height: 1.4;
    font-weight: 850;
    text-shadow: 0 2px 18px rgba(0, 0, 0, .25);
}

.mff-hero__description {
    max-width: 580px;
    margin: 0 0 30px;
    color: var(--mff-hero-body-color, #E8F3F0);
    font-size: clamp(16px, 1.5vw, 20px);
    line-height: 1.9;
}

.mff-hero--align-center .mff-hero__description { margin-inline: auto }

/* الأزرار */
.mff-hero__actions {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    flex-wrap: wrap;
}

.mff-hero--align-center .mff-hero__actions { justify-content: center }

.mff-hero__button,
.mff-hero__secondary-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    width: max-content;
    max-width: 100%;
    padding: 0 28px;
    border-radius: 12px;
    border: 1px solid transparent;
    text-decoration: none;
    font-size: 16px;
    font-weight: 800;
    box-sizing: border-box;
    transition: transform .18s, box-shadow .18s, background .18s, color .18s;
}

.mff-hero__button {
    background: var(--mff-hero-primary-bg, #389E87);
    color: var(--mff-hero-primary-text, #fff);
    box-shadow: 0 10px 30px rgba(56, 158, 135, .3);
}

.mff-hero__secondary-button {
    background: var(--mff-hero-secondary-bg, rgba(255, 255, 255, .12));
    color: var(--mff-hero-secondary-text, #fff);
    border-color: var(--mff-hero-secondary-border, #fff);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
}

.mff-hero__button:hover,
.mff-hero__secondary-button:hover { transform: translateY(-2px) }

.mff-hero__button:hover {
    background: var(--mff-hero-primary-hover, #1A6788);
    color: var(--mff-hero-primary-text, #fff);
}

.mff-hero__secondary-button:hover {
    background: var(--mff-hero-secondary-hover, #DFF2DE);
    border-color: var(--mff-hero-secondary-hover, #DFF2DE);
    color: #1A6788;
}

/* ================= الموبايل ================= */
@media (max-width: 900px) {
    .mff-hero {
        min-height: 520px;
        padding: var(--mff-hero-mobile-padding, 34px) 18px;
        border-radius: 0 0 var(--mff-hero-mobile-radius, 25px) var(--mff-hero-mobile-radius, 25px);
    }

    .mff-hero--mobile-height-compact { min-height: 440px }
    .mff-hero--mobile-height-medium { min-height: 560px }
    .mff-hero--mobile-height-fullscreen { min-height: calc(100svh - 70px) }

    /* الصورة تبقى ظاهرة، فوقها طبقة داكنة + بلور */
    .mff-hero .mff-hero__overlay {
        background: rgba(var(--mff-hero-overlay-rgb, 15, 63, 85), calc(var(--mff-hero-overlay-opacity, .7) * .85));
        -webkit-backdrop-filter: blur(var(--mff-hero-mobile-blur, 6px));
        backdrop-filter: blur(var(--mff-hero-mobile-blur, 6px));
    }

    .mff-hero__content { max-width: 760px }

    .mff-hero--mobile-align-right { justify-content: flex-start }
    .mff-hero--mobile-align-right .mff-hero__content { text-align: right }
    .mff-hero--mobile-align-center .mff-hero__content { text-align: center; margin-inline: auto }
    .mff-hero--mobile-align-center .mff-hero__description { margin-inline: auto }
    .mff-hero--mobile-align-left .mff-hero__content { text-align: left }

    .mff-hero__title {
        font-size: var(--mff-hero-mobile-title, 32px);
        line-height: 1.45;
    }

    .mff-hero__description {
        font-size: var(--mff-hero-mobile-desc, 16px);
        margin-bottom: 24px;
    }

    .mff-hero__actions { gap: var(--mff-hero-mobile-btn-gap, 10px) }
    .mff-hero--mobile-align-center .mff-hero__actions { justify-content: center }
    .mff-hero--mobile-align-right .mff-hero__actions,
    .mff-hero--mobile-align-left .mff-hero__actions { justify-content: flex-start }

    .mff-hero__button,
    .mff-hero__secondary-button {
        min-height: var(--mff-hero-mobile-btn-h, 48px);
        padding-inline: var(--mff-hero-mobile-btn-x, 20px);
        font-size: 15px;
    }

    .mff-hero--mobile-buttons-stack .mff-hero__actions { flex-direction: column; align-items: flex-start }
    .mff-hero--mobile-align-center.mff-hero--mobile-buttons-stack .mff-hero__actions { align-items: center }

    .mff-hero--mobile-button-width-full .mff-hero__button,
    .mff-hero--mobile-button-width-full .mff-hero__secondary-button { width: 100% }
    .mff-hero--mobile-button-width-full .mff-hero__actions { width: 100% }
}

@media (max-width: 520px) {
    .mff-hero { padding-inline: 16px }
    .mff-hero__eyebrow { font-size: 13px; margin-bottom: 14px }
    .mff-hero__actions { width: 100% }
    .mff-hero--mobile-buttons-fit .mff-hero__actions { width: auto }
    .mff-hero--mobile-buttons-stack .mff-hero__button,
    .mff-hero--mobile-buttons-stack .mff-hero__secondary-button { width: 100% }
}