/*==============================*/
/*           RTL Fix            */
/*==============================*/

/* Không cho bất kỳ phần tử con nào của header kéo giãn document width */
body.imc-rtl {
    overflow-x: hidden;
}

body.imc-rtl #im-header,
body.imc-rtl #im-header .uk-navbar-container {
    max-width: 100%;
    overflow-x: clip;
}

/* Mega dropdown không được vượt quá viewport trên mobile/tablet */
body.imc-rtl #im-header .uk-navbar-dropdown-width-4 {
    max-width: min(966px, 100vw);
    box-sizing: border-box;
}

body.imc-rtl h1.site-title,
body.imc-rtl div.site-title {
    text-indent: 0;           /* Bỏ indent âm */
    overflow: visible;        /* Cho phép hiển thị bình thường */
}

/* Giữ visually-hidden cho accessibility */
body.imc-rtl h1.site-title .visually-hidden,
body.imc-rtl div.site-title .visually-hidden {
    position: absolute;
    left: -10000px;           /* LTR: đẩy ra trái */
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* RTL: đổi left → right cho visually-hidden */
body.imc-rtl h1.site-title .visually-hidden,
body.imc-rtl div.site-title .visually-hidden {
    left: auto;
    right: -10000px;          /* RTL: đẩy ra phải, không ảnh hưởng layout */
}

body.imc-rtl #announcement-bar .uk-alert .uk-alert-close {
    right: unset;
}

body.imc-rtl .iue-dashboard {
    left: 0;
    right: auto;
}

body.imc-rtl .uk-navbar-left {
    margin-left: auto;
    margin-right: unset;
}

body.imc-rtl .uk-button-group .uk-button:first-child {
    border-top-right-radius: 500px;
    border-bottom-right-radius: 500px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

body.imc-rtl .uk-button-group .uk-button:last-child {
    border-top-left-radius: 500px;
    border-bottom-left-radius: 500px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

body.imc-rtl .uk-flex-left {
    justify-content: flex-start;
}

body.imc-rtl .nav-share-btn {
    margin-left: 15px;
}

body.imc-rtl .like-share-section .uk-float-right,
body.imc-rtl #view-long-text.uk-float-right {
    float: left;
}

body.imc-rtl .uk-margin-small-right {
    margin-right: unset !important;
    margin-left: 10px !important;
}

body.imc-rtl .uk-margin-xsmall-right {
    margin-right: unset !important;
    margin-left: 5px !important;
}

body.imc-rtl .iue-password-toggle {
    right: unset;
    left: 0;
}

body.imc-rtl #init-review-modal .init-review-modal-close,
body.imc-rtl #iep-modal .iep-modal-close,
body.imc-rtl #init-user-engine-login-modal .iue-close,
body.imc-rtl #iue-modal .iue-modal-close {
    right: unset;
    left: 10px;
}
