/* MisahaTech - بلوك «مقارنة صورتين بالسحب» (الموقع + المحرر)
 * --pos = موضع الفاصل من اليسار. الصورة الأولى (قبل) على اليمين، الثانية (بعد) على اليسار. */
.mt-cmp { margin: 1.8em 0 !important; direction: rtl }

.mt-cmp__stage {
    --pos: 50%;
    position: relative;
    overflow: hidden;
    border-radius: 14px;
    background: var(--clr-light, #f5f7fa);
    direction: ltr;
    user-select: none;
    touch-action: pan-y
}

.mt-cmp__img {
    position: absolute !important;
    inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    object-fit: cover;
    margin: 0 !important;
    border-radius: 0 !important;
    pointer-events: none
}

.mt-cmp__img--before { clip-path: inset(0 0 0 var(--pos)) }

.mt-cmp__bar {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--pos);
    width: 3px;
    margin-left: -1.5px;
    background: #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .15);
    pointer-events: none
}

.mt-cmp__knob {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 42px;
    height: 42px;
    transform: translate(-50%, -50%);
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .25)
}

.mt-cmp__knob::before,
.mt-cmp__knob::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 0;
    height: 0;
    border: 6px solid transparent;
    transform: translateY(-50%)
}

.mt-cmp__knob::before { left: 7px; border-right-color: #22263a }
.mt-cmp__knob::after { right: 7px; border-left-color: #22263a }

.mt-cmp__lbl {
    position: absolute;
    top: 12px;
    padding: 4px 11px;
    border-radius: 999px;
    font-size: .82rem;
    font-weight: 800;
    color: #fff;
    background: rgba(20, 22, 32, .62);
    pointer-events: none;
    direction: rtl
}

.mt-cmp__lbl--before { right: 12px }
.mt-cmp__lbl--after { left: 12px }

/* شريط التمرير الشفاف فوق الصورة: السحب بالفأرة واللمس ولوحة المفاتيح */
.mt-cmp__range {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: ew-resize;
    -webkit-appearance: none;
    appearance: none
}

.mt-cmp__range::-webkit-slider-thumb { -webkit-appearance: none; width: 48px; height: 100vh }
.mt-cmp__range::-moz-range-thumb { width: 48px; height: 100vh; border: 0 }
.mt-cmp__stage:has(.mt-cmp__range:focus-visible) .mt-cmp__knob { outline: 3px solid var(--clr-primary, #00dda2); outline-offset: 2px }

.mt-cmp__cap { font-size: .88rem; color: var(--clr-muted, #666); text-align: center; margin-top: 8px }

@media (max-width: 600px) { .mt-cmp__knob { width: 36px; height: 36px } .mt-cmp__lbl { font-size: .75rem; top: 8px } }

/* المحرر */
.mt-cmp--ed .mt-cmp__slots { display: grid; grid-template-columns: 1fr 1fr; gap: 12px }
.mt-cmp__slot { position: relative; aspect-ratio: 16/10; border: 1px dashed #c3c7cf; border-radius: 10px; background: #f5f7fa; cursor: pointer; overflow: hidden; display: grid; place-items: center; font-size: 2rem; padding: 0 }
.mt-cmp__slot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover }
.mt-cmp__slot small { position: absolute; top: 8px; right: 8px; font-size: 12px; font-weight: 700; background: rgba(20, 22, 32, .65); color: #fff; padding: 2px 9px; border-radius: 99px }
.mt-cmp__hint { font-size: 12px; color: #757575; margin: 8px 0 0 }
