/* ==========================================================================
   RTL (Right-to-Left) Styles for Arabic, Hebrew, Persian, Urdu
   ========================================================================== */

/* --------------------------------------------------------------------------
   Base RTL Settings
   -------------------------------------------------------------------------- */
html[dir="rtl"],
html.translated-rtl,
body.translated-rtl {
    direction: rtl;
    text-align: right;
}

/* Arabic Font Support */
html[dir="rtl"] body,
html[lang="ar"] body {
    font-family: 'Noto Sans Arabic', 'Segoe UI', 'Arial', sans-serif;
    line-height: 1.8;
}

html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3, 
html[dir="rtl"] h4, html[dir="rtl"] h5, html[dir="rtl"] h6 {
    font-family: 'Noto Sans Arabic', 'Segoe UI', 'Arial', sans-serif;
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   Header RTL
   -------------------------------------------------------------------------- */
html[dir="rtl"] .site-header {
    direction: rtl;
}

html[dir="rtl"] .header-top-bar__inner {
    flex-direction: row-reverse;
}

html[dir="rtl"] .header-top-bar__left {
    gap: 20px;
}

html[dir="rtl"] .header-top-bar__right {
    gap: 20px;
}

html[dir="rtl"] .header-main-container {
    flex-direction: row-reverse;
}

html[dir="rtl"] .header-nav {
    margin-right: auto;
    margin-left: 0;
}

html[dir="rtl"] .nav-links {
    flex-direction: row-reverse;
    gap: 25px;
}

html[dir="rtl"] .header-actions {
    flex-direction: row-reverse;
    gap: 15px;
}

html[dir="rtl"] .gtranslate-wrapper {
    margin-right: 0;
    margin-left: 10px;
}

/* --------------------------------------------------------------------------
   Mobile Menu RTL
   -------------------------------------------------------------------------- */
html[dir="rtl"] .mobile-menu {
    right: auto;
    left: 0;
    transform: translateX(-100%);
}

html[dir="rtl"] .mobile-menu.active {
    transform: translateX(0);
}

html[dir="rtl"] .mobile-menu-header {
    flex-direction: row-reverse;
}

html[dir="rtl"] .mobile-menu-close {
    left: 15px;
    right: auto;
}

html[dir="rtl"] .mobile-menu-links {
    text-align: right;
}

html[dir="rtl"] .mobile-menu-links li {
    text-align: right;
}

html[dir="rtl"] .mobile-submenu-toggle {
    left: 15px;
    right: auto;
    transform: scaleX(-1);
}

html[dir="rtl"] .mobile-menu-static-links {
    text-align: right;
}

html[dir="rtl"] .mobile-menu-social {
    justify-content: flex-end;
}

/* --------------------------------------------------------------------------
   Hero Section RTL
   -------------------------------------------------------------------------- */
html[dir="rtl"] .hero-grid {
    direction: rtl;
}

html[dir="rtl"] .hero-sidebar {
    border-left: none;
    border-right: 1px solid #e0e0e0;
}

html[dir="rtl"] .sidebar-article {
    flex-direction: row-reverse;
}

html[dir="rtl"] .sidebar-article-content {
    text-align: right;
    padding-left: 0;
    padding-right: 1rem;
}

/* --------------------------------------------------------------------------
   Home Page Sections RTL
   -------------------------------------------------------------------------- */
html[dir="rtl"] .home2-section-title {
    text-align: right;
}

html[dir="rtl"] .home2-section-title::after {
    left: auto;
    right: 0;
}

html[dir="rtl"] .home2-hero-grid {
    direction: rtl;
}

html[dir="rtl"] .home2-hero-sidebar {
    border-left: none;
    border-right: 1px solid rgba(0,0,0,0.1);
    padding-left: 0;
    padding-right: 20px;
}

html[dir="rtl"] .home2-sidebar-item {
    flex-direction: row-reverse;
    text-align: right;
}

html[dir="rtl"] .home2-sidebar-content {
    padding-left: 0;
    padding-right: 12px;
}

html[dir="rtl"] .home2-block-grid {
    direction: rtl;
}

/* --------------------------------------------------------------------------
   News Cards RTL
   -------------------------------------------------------------------------- */
html[dir="rtl"] .news-card {
    text-align: right;
}

html[dir="rtl"] .news-card-body {
    text-align: right;
}

html[dir="rtl"] .news-card-title {
    text-align: right;
}

html[dir="rtl"] .news-card-excerpt {
    text-align: right;
}

html[dir="rtl"] .news-card-meta {
    flex-direction: row-reverse;
    justify-content: flex-start;
    gap: 10px;
}

html[dir="rtl"] .news-card-meta svg {
    margin-left: 5px;
    margin-right: 0;
}

html[dir="rtl"] .news-list-grid {
    direction: rtl;
}

/* --------------------------------------------------------------------------
   News Detail Page RTL
   -------------------------------------------------------------------------- */
html[dir="rtl"] .breadcrumbs {
    flex-direction: row-reverse;
}

html[dir="rtl"] .breadcrumb-separator {
    transform: scaleX(-1);
}

html[dir="rtl"] .news-header {
    text-align: right;
}

html[dir="rtl"] .news-title {
    text-align: right;
}

html[dir="rtl"] .news-container {
    direction: rtl;
}

html[dir="rtl"] .news-meta-wrapper {
    flex-direction: row-reverse;
}

html[dir="rtl"] .news-meta-primary {
    flex-direction: row-reverse;
    gap: 20px;
}

html[dir="rtl"] .news-meta-item {
    flex-direction: row-reverse;
    gap: 5px;
}

html[dir="rtl"] .news-meta-item svg {
    margin-left: 5px;
    margin-right: 0;
}

html[dir="rtl"] .news-categories {
    flex-direction: row-reverse;
    gap: 10px;
}

html[dir="rtl"] .news-content {
    text-align: right;
}

html[dir="rtl"] .news-content p {
    text-align: right;
}

html[dir="rtl"] .news-content ul,
html[dir="rtl"] .news-content ol {
    padding-right: 1.5em;
    padding-left: 0;
}

html[dir="rtl"] .news-content blockquote {
    border-left: none;
    border-right: 4px solid #c62828;
    padding-left: 0;
    padding-right: 1rem;
}

html[dir="rtl"] .news-sources {
    flex-direction: row-reverse;
}

html[dir="rtl"] .news-source-link i {
    margin-left: 0;
    margin-right: 5px;
    transform: scaleX(-1);
}

html[dir="rtl"] .news-tags {
    flex-direction: row-reverse;
    flex-wrap: wrap;
    gap: 8px;
}

html[dir="rtl"] .news-tag {
    margin-left: 0;
    margin-right: 0;
}

/* --------------------------------------------------------------------------
   Share Buttons RTL
   -------------------------------------------------------------------------- */
html[dir="rtl"] .share-buttons {
    flex-direction: row-reverse;
    gap: 10px;
}

html[dir="rtl"] .share-label {
    margin-right: 0;
    margin-left: 0.5rem;
}

html[dir="rtl"] .news-share {
    flex-direction: row-reverse;
}

/* --------------------------------------------------------------------------
   Sidebar RTL
   -------------------------------------------------------------------------- */
html[dir="rtl"] .sidebar {
    text-align: right;
}

html[dir="rtl"] .sidebar-widget-title {
    text-align: right;
}

html[dir="rtl"] .sidebar-news-item {
    flex-direction: row-reverse;
}

html[dir="rtl"] .sidebar-news-content {
    padding-left: 0;
    padding-right: 12px;
    text-align: right;
}

html[dir="rtl"] .sidebar-news-title {
    text-align: right;
}

html[dir="rtl"] .sidebar-news-date {
    text-align: right;
}

/* --------------------------------------------------------------------------
   News Feed Sidebar RTL
   -------------------------------------------------------------------------- */
html[dir="rtl"] .feed-header {
    flex-direction: row-reverse;
}

html[dir="rtl"] .feed-list {
    text-align: right;
}

html[dir="rtl"] .feed-item {
    text-align: right;
    flex-direction: row-reverse;
}

html[dir="rtl"] .feed-item-time {
    margin-right: 0;
    margin-left: 10px;
}

html[dir="rtl"] .calendar-header {
    flex-direction: row-reverse;
}

html[dir="rtl"] .calendar-nav-prev {
    transform: scaleX(-1);
}

html[dir="rtl"] .calendar-nav-next {
    transform: scaleX(-1);
}

/* --------------------------------------------------------------------------
   Category Page RTL
   -------------------------------------------------------------------------- */
html[dir="rtl"] .category-header {
    text-align: right;
}

html[dir="rtl"] .category-title {
    text-align: right;
}

html[dir="rtl"] .category-layout {
    flex-direction: row-reverse;
}

html[dir="rtl"] .category-content {
    padding-right: 0;
    padding-left: 30px;
}

html[dir="rtl"] .news-grid {
    direction: rtl;
}

/* --------------------------------------------------------------------------
   Search Page RTL
   -------------------------------------------------------------------------- */
html[dir="rtl"] .search-page {
    text-align: right;
}

html[dir="rtl"] .search-form {
    direction: rtl;
}

html[dir="rtl"] .search-input-wrapper {
    flex-direction: row-reverse;
}

html[dir="rtl"] .search-input {
    text-align: right;
    padding-left: 15px;
    padding-right: 15px;
}

html[dir="rtl"] .search-results-header {
    text-align: right;
}

/* --------------------------------------------------------------------------
   Search Panel Modal RTL
   -------------------------------------------------------------------------- */
html[dir="rtl"] .search-panel-form {
    flex-direction: row-reverse;
}

html[dir="rtl"] .search-panel-input {
    text-align: right;
    padding-left: 10px;
    padding-right: 15px;
}

html[dir="rtl"] .search-panel-close {
    left: 15px;
    right: auto;
}

/* --------------------------------------------------------------------------
   Footer RTL
   -------------------------------------------------------------------------- */
html[dir="rtl"] .footer-new {
    direction: rtl;
    text-align: right;
}

html[dir="rtl"] .footer-new__grid {
    direction: rtl;
}

html[dir="rtl"] .footer-new__col {
    text-align: right;
}

html[dir="rtl"] .footer-new__col h4 {
    text-align: right;
}

html[dir="rtl"] .footer-new__col ul {
    text-align: right;
    padding-right: 0;
}

html[dir="rtl"] .footer-sections-columns {
    flex-direction: row-reverse;
}

html[dir="rtl"] .footer-new__bottom {
    text-align: right;
    flex-direction: row-reverse;
}

html[dir="rtl"] .footer-new__social {
    flex-direction: row-reverse;
    gap: 15px;
}

html[dir="rtl"] .subscribe-form__row {
    flex-direction: row-reverse;
}

html[dir="rtl"] .subscribe-form__input {
    text-align: right;
}

/* --------------------------------------------------------------------------
   Pagination RTL
   -------------------------------------------------------------------------- */
html[dir="rtl"] .pagination {
    flex-direction: row-reverse;
}

html[dir="rtl"] .pagination-wrapper {
    direction: rtl;
}

html[dir="rtl"] .page-link {
    transform: scaleX(-1);
}

html[dir="rtl"] .page-link span {
    transform: scaleX(-1);
    display: inline-block;
}

/* --------------------------------------------------------------------------
   Forms RTL
   -------------------------------------------------------------------------- */
html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select {
    text-align: right;
}

html[dir="rtl"] input::placeholder,
html[dir="rtl"] textarea::placeholder {
    text-align: right;
}

/* --------------------------------------------------------------------------
   Comments RTL
   -------------------------------------------------------------------------- */
html[dir="rtl"] .comments-section {
    text-align: right;
}

html[dir="rtl"] .comment {
    text-align: right;
}

html[dir="rtl"] .comment-content {
    flex-direction: row-reverse;
}

html[dir="rtl"] .comment-avatar {
    margin-right: 0;
    margin-left: 1rem;
}

html[dir="rtl"] .comment-header {
    flex-direction: row-reverse;
}

html[dir="rtl"] .comment-body {
    text-align: right;
}

/* --------------------------------------------------------------------------
   Error Pages RTL
   -------------------------------------------------------------------------- */
html[dir="rtl"] .error-page {
    text-align: right;
}

html[dir="rtl"] .error-content {
    text-align: center;
}

html[dir="rtl"] .error-actions {
    flex-direction: row-reverse;
}

/* --------------------------------------------------------------------------
   Ticker/Marquee RTL (Keep LTR for animation)
   -------------------------------------------------------------------------- */
html[dir="rtl"] .ticker-wrapper {
    direction: ltr;
}

/* --------------------------------------------------------------------------
   Bootstrap Utility Overrides for RTL
   -------------------------------------------------------------------------- */
html[dir="rtl"] .text-left {
    text-align: right !important;
}

html[dir="rtl"] .text-right {
    text-align: left !important;
}

html[dir="rtl"] .float-left {
    float: right !important;
}

html[dir="rtl"] .float-right {
    float: left !important;
}

html[dir="rtl"] .ml-auto {
    margin-left: 0 !important;
    margin-right: auto !important;
}

html[dir="rtl"] .mr-auto {
    margin-right: 0 !important;
    margin-left: auto !important;
}

html[dir="rtl"] .pl-0 {
    padding-left: initial !important;
    padding-right: 0 !important;
}

html[dir="rtl"] .pr-0 {
    padding-right: initial !important;
    padding-left: 0 !important;
}

html[dir="rtl"] .ml-2, html[dir="rtl"] .ml-3 {
    margin-left: 0 !important;
    margin-right: 0.5rem !important;
}

html[dir="rtl"] .mr-2, html[dir="rtl"] .mr-3 {
    margin-right: 0 !important;
    margin-left: 0.5rem !important;
}

/* --------------------------------------------------------------------------
   Icons RTL (Mirror directional icons)
   -------------------------------------------------------------------------- */
html[dir="rtl"] .bi-chevron-left,
html[dir="rtl"] .bi-chevron-right,
html[dir="rtl"] .bi-arrow-left,
html[dir="rtl"] .bi-arrow-right,
html[dir="rtl"] .bi-box-arrow-up-right,
html[dir="rtl"] .bi-caret-left,
html[dir="rtl"] .bi-caret-right {
    transform: scaleX(-1);
}

/* --------------------------------------------------------------------------
   Video Section RTL
   -------------------------------------------------------------------------- */
html[dir="rtl"] .video-popup-sidebar {
    border-left: none;
    border-right: 1px solid rgba(255,255,255,0.1);
}

html[dir="rtl"] .video-popup-sidebar-title {
    text-align: right;
}

html[dir="rtl"] .video-popup-item {
    flex-direction: row-reverse;
    text-align: right;
}

html[dir="rtl"] .video-popup-item-content {
    padding-left: 0;
    padding-right: 12px;
}

/* --------------------------------------------------------------------------
   Sponsors/Banners RTL
   -------------------------------------------------------------------------- */
html[dir="rtl"] .sponsors-carousel {
    direction: rtl;
}

html[dir="rtl"] .sponsor-card {
    text-align: right;
}

/* --------------------------------------------------------------------------
   Numbers and Dates (Keep LTR)
   -------------------------------------------------------------------------- */
html[dir="rtl"] .news-date,
html[dir="rtl"] .news-time,
html[dir="rtl"] .news-views,
html[dir="rtl"] time,
html[dir="rtl"] .date,
html[dir="rtl"] .time {
    direction: ltr;
    display: inline-block;
}

html[dir="rtl"] a[href^="tel:"],
html[dir="rtl"] a[href^="mailto:"] {
    direction: ltr;
    unicode-bidi: embed;
}

/* --------------------------------------------------------------------------
   Scroll to Top Button RTL
   -------------------------------------------------------------------------- */
html[dir="rtl"] .scroll-to-top {
    right: auto;
    left: 30px;
}

/* --------------------------------------------------------------------------
   Breadcrumbs RTL
   -------------------------------------------------------------------------- */
html[dir="rtl"] .breadcrumbs {
    flex-direction: row-reverse;
    gap: 8px;
}

html[dir="rtl"] .breadcrumbs a::after {
    content: '/';
    margin-left: 0;
    margin-right: 8px;
}

/* --------------------------------------------------------------------------
   Load More Button RTL
   -------------------------------------------------------------------------- */
html[dir="rtl"] .home2-load-more {
    text-align: center;
}

/* --------------------------------------------------------------------------
   Related News RTL
   -------------------------------------------------------------------------- */
html[dir="rtl"] .related-news {
    direction: rtl;
}

html[dir="rtl"] .related-news-title {
    text-align: right;
}

html[dir="rtl"] .related-news-grid {
    direction: rtl;
}

/* --------------------------------------------------------------------------
   Tag Page RTL
   -------------------------------------------------------------------------- */
html[dir="rtl"] .tag-header {
    text-align: right;
}

html[dir="rtl"] .tag-title {
    text-align: right;
}

/* --------------------------------------------------------------------------
   Static Pages RTL
   -------------------------------------------------------------------------- */
html[dir="rtl"] .page-content {
    text-align: right;
}

html[dir="rtl"] .page-title {
    text-align: right;
}

html[dir="rtl"] .page-builder-content {
    text-align: right;
}

/* --------------------------------------------------------------------------
   Responsive RTL Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
    html[dir="rtl"] .category-layout {
        flex-direction: column;
    }
    
    html[dir="rtl"] .category-content {
        padding-left: 0;
    }
}

@media (max-width: 768px) {
    html[dir="rtl"] .footer-new__grid {
        text-align: right;
    }
    
    html[dir="rtl"] .home2-hero-sidebar {
        border-right: none;
        border-top: 1px solid rgba(0,0,0,0.1);
        padding-right: 0;
        padding-top: 20px;
    }
    
    html[dir="rtl"] .error-actions {
        flex-direction: column;
    }
}
