/*
RTL (Right-to-Left) Styles for Mind Media Theme
Supporting Arabic language direction and layout
*/

/* Base RTL Direction */
body {
    direction: rtl;
    text-align: right;
}

/* Typography */
body, input, textarea, select, button {
    font-family: 'Cairo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Header and Navigation */
.site-header {
    direction: rtl;
}

.header-container {
    flex-direction: row-reverse;
}

.main-navigation ul {
    flex-direction: row-reverse;
}

.main-navigation li {
    margin-left: 0;
    margin-right: 2rem;
}

.main-navigation li:last-child {
    margin-right: 0;
}

/* Logo positioning */
.site-logo {
    margin-left: 0;
    margin-right: auto;
}

/* Content Layout */
.container > div[style*="grid-template-columns: 2fr 1fr"] {
    grid-template-columns: 1fr 2fr;
}

/* Service and Work Cards */
.services-grid,
.works-grid {
    direction: rtl;
}

.service-card,
.work-card {
    text-align: right;
}

/* Buttons and Links */
.btn {
    direction: rtl;
}

.btn i {
    margin-left: 0.5rem;
    margin-right: 0;
}

/* Forms */
form {
    direction: rtl;
}

input, textarea, select {
    text-align: right;
    direction: rtl;
}

label {
    text-align: right;
}

/* Contact Form Grid */
form div[style*="grid-template-columns: 1fr 1fr"] {
    direction: rtl;
}

/* Pagination */
.pagination-wrapper {
    direction: rtl;
}

.page-numbers {
    direction: rtl;
}

/* Breadcrumbs and Navigation Links */
.breadcrumb,
.nav-links {
    direction: rtl;
}

/* Back to top and floating elements */
.back-to-top {
    left: 2rem;
    right: auto;
}

/* Social Media Icons */
.social-links {
    flex-direction: row-reverse;
}

/* Sidebar positioning */
.work-sidebar,
.service-sidebar {
    order: -1;
}

/* Media Queries for RTL Responsive Design */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        text-align: center;
    }
    
    .main-navigation ul {
        flex-direction: column;
        text-align: center;
    }
    
    .main-navigation li {
        margin-right: 0;
        margin-bottom: 1rem;
    }
    
    .container > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
    
    .work-sidebar,
    .service-sidebar {
        order: 0;
    }
}

/* Text alignment for Arabic content */
.hero-title,
.section-title,
h1, h2, h3, h4, h5, h6 {
    text-align: right;
}

.hero-tagline,
p, li {
    text-align: right;
    line-height: 1.8;
}

/* List styles for RTL */
ul, ol {
    padding-right: 2rem;
    padding-left: 0;
}

li {
    text-align: right;
}

/* Blockquotes */
blockquote {
    border-right: 4px solid var(--accent-blue);
    border-left: none;
    padding-right: 1.5rem;
    padding-left: 1rem;
    text-align: right;
}

/* Tables */
table {
    direction: rtl;
}

th, td {
    text-align: right;
}

/* Flexbox adjustments */
.flex-reverse {
    flex-direction: row-reverse;
}

/* Grid adjustments for RTL */
.grid-rtl {
    direction: rtl;
}

/* Icon positioning in RTL */
.icon-left {
    margin-left: 0;
    margin-right: 0.5rem;
}

.icon-right {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* Arrow directions for RTL */
.arrow-left::before {
    content: '←';
}

.arrow-right::before {
    content: '→';
}

/* Specific RTL fixes for Mind Media theme */
.service-icon,
.work-icon {
    margin-left: 0;
    margin-right: auto;
}

/* Dashboard RTL support */
.wp-admin {
    direction: rtl;
}

.wrap {
    direction: rtl;
}

/* Contact form specific RTL */
#mindContactForm {
    direction: rtl;
}

#mindContactForm input,
#mindContactForm textarea,
#mindContactForm select {
    text-align: right;
}

/* Filter buttons RTL */
.filter-btn {
    direction: rtl;
}

/* Work and Service detail pages */
.work-content,
.service-content {
    direction: rtl;
    text-align: right;
}

.work-content h2,
.work-content h3,
.service-content h2,
.service-content h3 {
    text-align: right;
}

/* Share buttons RTL */
.share-buttons {
    direction: rtl;
}

/* Related items grid */
.related-items {
    direction: rtl;
}

/* Footer RTL */
.site-footer {
    direction: rtl;
    text-align: center;
}

.footer-content {
    direction: rtl;
}

/* Animation adjustments for RTL */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* RTL specific hover effects */
.service-card:hover,
.work-card:hover {
    transform: translateY(-10px);
}

/* Ensure proper text rendering for Arabic */
* {
    -webkit-font-feature-settings: "liga" 1, "kern" 1;
    -moz-font-feature-settings: "liga" 1, "kern" 1;
    font-feature-settings: "liga" 1, "kern" 1;
}

/* Arabic number formatting */
.arabic-numbers {
    font-variant-numeric: tabular-nums;
}

/* Improve Arabic text readability */
p, li, span, div {
    word-spacing: 0.1em;
    letter-spacing: 0.02em;
}

/* RTL specific margin and padding adjustments */
.mr-auto { margin-right: auto !important; margin-left: 0 !important; }
.ml-auto { margin-left: auto !important; margin-right: 0 !important; }
.pr-0 { padding-right: 0 !important; }
.pl-0 { padding-left: 0 !important; }
.text-right { text-align: right !important; }
.text-left { text-align: left !important; }

/* Ensure icons don't flip in RTL */
.fa, .fas, .far, .fab {
    direction: ltr;
    display: inline-block;
}

/* Special handling for Font Awesome icons that should flip */
.fa-arrow-left,
.fa-arrow-right,
.fa-chevron-left,
.fa-chevron-right {
    transform: scaleX(-1);
}

/* Responsive RTL adjustments */
@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem !important;
        text-align: center;
    }
    
    .section-title {
        font-size: 1.8rem !important;
        text-align: center;
    }
    
    .service-card,
    .work-card {
        text-align: center;
    }
}
