/* ============================================================
   MisahaTech - Image Lightbox v1.0
   تكبير الصور داخل المقالات والصفحات عند الضغط عليها
   ============================================================ */

.mt-lightbox-trigger {
    cursor: zoom-in;
    transition: opacity .2s ease;
}
.mt-lightbox-trigger:hover {
    opacity: .92;
}

.mt-lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 17, 23, .92);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease, visibility .25s ease;
}
.mt-lightbox-overlay.is-open {
    opacity: 1;
    visibility: visible;
}

.mt-lightbox-figure {
    margin: 0;
    max-width: 92vw;
    max-height: 86vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.mt-lightbox-img {
    max-width: 100%;
    max-height: 78vh;
    width: auto;
    height: auto;
    border-radius: var(--radius, 10px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, .5);
    cursor: zoom-out;
    transform: scale(.96);
    transition: transform .25s ease;
    background: var(--clr-dark, #22263a);
}
.mt-lightbox-overlay.is-open .mt-lightbox-img {
    transform: scale(1);
}

.mt-lightbox-caption {
    color: rgba(255, 255, 255, .85);
    font-family: var(--font, 'Tajawal', sans-serif);
    font-size: 13px;
    line-height: 1.6;
    text-align: center;
    max-width: 620px;
}

.mt-lightbox-counter {
    color: rgba(255, 255, 255, .45);
    font-family: var(--font, 'Tajawal', sans-serif);
    font-size: 12px;
}

.mt-lightbox-close,
.mt-lightbox-arrow {
    position: absolute;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .2);
    color: #fff;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    cursor: pointer;
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: background .2s ease, border-color .2s ease, transform .2s ease;
}
.mt-lightbox-close:hover,
.mt-lightbox-arrow:hover {
    background: var(--clr-primary, #00DDA2);
    border-color: var(--clr-primary, #00DDA2);
    transform: scale(1.08);
}

.mt-lightbox-close {
    top: 18px;
    right: 18px;
}

.mt-lightbox-arrow--prev {
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
}
.mt-lightbox-arrow--next {
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
}
.mt-lightbox-arrow--prev:hover,
.mt-lightbox-arrow--next:hover {
    transform: translateY(-50%) scale(1.08);
}

/* إخفاء أزرار التنقل عندما توجد صورة واحدة فقط */
.mt-lightbox-overlay:not(.has-multi) .mt-lightbox-arrow {
    display: none;
}

@media (max-width: 640px) {
    .mt-lightbox-close,
    .mt-lightbox-arrow {
        width: 38px;
        height: 38px;
        font-size: 14px;
    }
    .mt-lightbox-overlay {
        padding: 50px 12px;
    }
}
