.mg-pagination {
    width: 100%;
    margin: 34px 0 10px;
}

.mg-pagination:empty {
    display: none;
}

.mg-pagination .mg-blog-pages {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    margin: 0;
    direction: rtl;
    font-family: Vazirmatn, Vazir, Tahoma, Arial, sans-serif;
}

.mg-pagination .mg-page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 0;
}

.mg-pagination .mg-blog-pages a,
.mg-pagination .mg-blog-pages span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 13px;
    box-sizing: border-box;
    border: 1px solid #cdddf1;
    border-radius: 11px;
    background: #ffffff;
    color: #1769d5;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 6px 16px rgba(24, 74, 130, .07);
    transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}

.mg-pagination .mg-blog-pages a:hover {
    border-color: #1769d5;
    background: #edf5ff;
    color: #0e55b6;
    transform: translateY(-1px);
}

.mg-pagination .mg-blog-pages a:focus-visible {
    outline: 3px solid rgba(23, 105, 213, .24);
    outline-offset: 2px;
}

.mg-pagination .mg-page-current {
    border-color: #1769d5;
    background: #1769d5;
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(23, 105, 213, .22);
}

.mg-pagination .mg-page-disabled {
    background: #f4f7fb;
    color: #91a2b7;
    cursor: not-allowed;
    box-shadow: none;
}

.mg-pagination .mg-page-dots {
    min-width: 26px;
    padding: 0 3px;
    border-color: transparent;
    background: transparent;
    color: #788aa2;
    box-shadow: none;
}

.mg-pagination .mg-page-nav {
    min-width: 84px;
}

@media (max-width: 640px) {
    .mg-pagination {
        margin-top: 26px;
    }

    .mg-pagination .mg-blog-pages {
        display: grid;
        grid-template-columns: minmax(72px, 1fr) auto minmax(72px, 1fr);
        gap: 7px;
    }

    .mg-pagination .mg-page-numbers {
        gap: 5px;
    }

    .mg-pagination .mg-blog-pages a,
    .mg-pagination .mg-blog-pages span {
        min-width: 36px;
        height: 40px;
        padding: 0 9px;
        border-radius: 10px;
        font-size: 12px;
    }

    .mg-pagination .mg-page-nav {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 380px) {
    .mg-pagination .mg-blog-pages {
        grid-template-columns: minmax(64px, 1fr) auto minmax(64px, 1fr);
        gap: 5px;
    }

    .mg-pagination .mg-page-numbers {
        gap: 4px;
    }

    .mg-pagination .mg-blog-pages a,
    .mg-pagination .mg-blog-pages span {
        min-width: 32px;
        height: 38px;
        padding: 0 7px;
    }
}
