/* RTL (Right-to-Left) Styles for Urdu */
body[dir="rtl"] {
    direction: rtl;
    text-align: right;
    font-family: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', 'Noto Naskh Arabic', serif;
}

body[dir="rtl"] header nav {
    flex-direction: row-reverse;
}

body[dir="rtl"] .container {
    direction: rtl;
}

/* Improve Urdu readability to match Nastaliq look */
html[dir="rtl"] body {
    font-size: 17px;
    line-height: 2.05;
}

html[dir="rtl"] .article-content {
    font-size: 18px;
    line-height: 2.25;
}

/* Avoid English-only styling on Urdu headings */
html[dir="rtl"] .column-section-title {
    text-transform: none;
    letter-spacing: 0;
}

html[dir="rtl"] .nav-menu li a {
    letter-spacing: 0;
    text-transform: none;
}

/* Mobile RTL Fixes - Prevent content from going to right side */
@media (max-width: 1024px) {
    html[dir="rtl"] body {
        overflow-x: hidden !important;
    }
    
    html[dir="rtl"] .container {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        padding: 0 15px !important;
    }
    
    html[dir="rtl"] main {
        width: 100% !important;
        overflow-x: hidden !important;
    }
    
    /* Article page mobile fix */
    html[dir="rtl"] .article-detail-layout {
        display: block !important;
        width: 100% !important;
    }
    
    html[dir="rtl"] .article-main {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        float: none !important;
        direction: rtl !important;
        text-align: right !important;
    }
    
    html[dir="rtl"] .article-detail-layout aside {
        width: 100% !important;
        margin-top: 30px !important;
        float: none !important;
    }
    
    /* Article content wrapper fix */
    html[dir="rtl"] .article-content-wrapper {
        width: 100% !important;
        padding: 15px !important;
        direction: rtl !important;
        text-align: right !important;
    }
    
    /* Featured image fix */
    html[dir="rtl"] .article-featured-image-large {
        width: 100% !important;
        margin: 0 !important;
    }
    
    html[dir="rtl"] .article-featured-image-large img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
    }
    
    /* Article header fix */
    html[dir="rtl"] .article-header {
        width: 100% !important;
        text-align: right !important;
    }
    
    html[dir="rtl"] .article-header h1 {
        text-align: right !important;
        word-wrap: break-word !important;
        overflow-wrap: break-word !important;
    }
    
    /* Three column layout mobile fix for RTL */
    html[dir="rtl"] .three-column-layout {
        display: block !important;
        width: 100% !important;
    }
    
    html[dir="rtl"] .column-left,
    html[dir="rtl"] .column-center,
    html[dir="rtl"] .column-right {
        width: 100% !important;
        margin-bottom: 30px !important;
        float: none !important;
    }
}

@media (max-width: 768px) {
    html[dir="rtl"] .excerpt-item {
        flex-direction: column !important;
        width: 100% !important;
    }
    
    html[dir="rtl"] .excerpt-content {
        width: 100% !important;
        text-align: right !important;
    }
    
    html[dir="rtl"] .excerpt-title,
    html[dir="rtl"] .excerpt-text {
        text-align: right !important;
    }
    
    /* Social share mobile fix */
    html[dir="rtl"] .social-share {
        flex-direction: column !important;
        align-items: flex-end !important;
    }
}
