/*
 * RTL Styles for OCOAD Theme
 * منظمة التفاؤل الخيرية للعون والتنمية
 * 
 * This file provides RTL-specific overrides for Arabic and other RTL languages
 */

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

/* Typography Adjustments for Arabic */
body,
h1, h2, h3, h4, h5, h6,
.btn,
.form-control {
    font-family: 'SaudiaSans', 'Segoe UI', Tahoma, sans-serif;
}

/* Navigation - RTL Adjustments */
.nav-menu .sub-menu {
    right: 0;
    left: auto;
}

.nav-menu .sub-menu .sub-menu {
    right: 100%;
    left: auto;
}

/* Mobile Menu RTL - Overridden by style.css for premium design */
/*
@media (max-width: 992px) {
    .nav-menu {
        right: -100%;
        left: auto;
    }
    
    .nav-menu.active {
        right: 0;
        left: auto;
    }
    
    .nav-menu .sub-menu {
        padding-right: var(--spacing-lg);
        padding-left: 0;
    }
}
*/

/* Breadcrumb - RTL */
.breadcrumb {
    flex-direction: row-reverse;
}

.breadcrumb .separator {
    transform: rotate(180deg);
}

/* Cards - RTL Alignment */
.program-card__link,
.post-card__link {
    flex-direction: row-reverse;
}

.program-card__link:hover,
.post-card__link:hover {
    gap: var(--spacing-sm);
}

/* Footer Contact - RTL */
.footer-contact li {
    flex-direction: row-reverse;
}

/* Forms - RTL */
.form-control {
    text-align: right;
}

input[type="email"],
input[type="url"],
input[type="tel"] {
    direction: ltr;
    text-align: left;
}

/* Lists - RTL */
ul, ol {
    padding-right: var(--spacing-lg);
    padding-left: 0;
}

/* Blockquote - RTL */
blockquote {
    border-right: 4px solid var(--color-primary);
    border-left: none;
    padding-right: var(--spacing-lg);
    padding-left: 0;
}

/* Icons with Text - RTL */
.icon-text {
    flex-direction: row-reverse;
}

/* Tables - RTL */
table {
    text-align: right;
}

th, td {
    text-align: right;
}

/* Pagination - RTL */
.pagination {
    flex-direction: row-reverse;
}

.pagination .prev::before {
    content: '→';
}

.pagination .next::after {
    content: '←';
}

/* WordPress Alignment Classes - RTL */
.alignleft {
    float: right;
    margin-left: var(--spacing-lg);
    margin-right: 0;
}

.alignright {
    float: left;
    margin-right: var(--spacing-lg);
    margin-left: 0;
}

/* Gallery - RTL */
.gallery {
    direction: rtl;
}

/* Comments - RTL */
.comment-list {
    padding-right: 0;
}

.comment-list .children {
    padding-right: var(--spacing-2xl);
    padding-left: 0;
}

/* Sidebar - RTL */
.sidebar {
    text-align: right;
}

.widget ul {
    padding-right: 0;
}

.widget li {
    padding-right: var(--spacing-md);
    padding-left: 0;
}

/* Search Form - RTL */
.search-form {
    flex-direction: row-reverse;
}

.search-form .search-field {
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
}

.search-form .search-submit {
    border-radius: var(--radius-md) 0 0 var(--radius-md);
}

/* Meta Information - RTL */
.post-meta,
.entry-meta {
    flex-direction: row-reverse;
}

.post-meta .separator {
    margin: 0 var(--spacing-sm);
}

/* Social Icons - RTL */
.social-icons {
    flex-direction: row-reverse;
}

/* Arrows and Icons that need flipping */
.arrow-icon,
.chevron-icon,
.nav-arrow {
    transform: scaleX(-1);
}

/* Slick/Carousel - RTL */
.slick-slider {
    direction: rtl;
}

.slick-prev {
    right: auto;
    left: -25px;
}

.slick-next {
    left: auto;
    right: -25px;
}

/* Stats Section - RTL number alignment */
.stat-number {
    direction: ltr;
    unicode-bidi: bidi-override;
}

/* Phone and Numbers - LTR within RTL */
.phone-number,
.tel-link,
[dir="ltr"] {
    direction: ltr;
    unicode-bidi: embed;
}

/* Email addresses - LTR */
.email-link,
a[href^="mailto:"] {
    direction: ltr;
    unicode-bidi: embed;
}

/* URLs - LTR */
.url-link,
a[href^="http"] {
    word-break: break-all;
}

/* Checkbox and Radio - RTL */
input[type="checkbox"],
input[type="radio"] {
    margin-left: var(--spacing-sm);
    margin-right: 0;
}

/* Button Icons - RTL */
.btn .icon-left {
    order: 1;
}

.btn .icon-right {
    order: -1;
}

/* Progress Bar - RTL */
.progress-bar {
    direction: rtl;
}

.progress-fill {
    transform-origin: right center;
}

/* Tooltips - RTL */
.tooltip {
    text-align: right;
}

/* Modals - RTL */
.modal-close {
    left: var(--spacing-md);
    right: auto;
}

/* Accordion - RTL */
.accordion-icon {
    margin-left: 0;
    margin-right: auto;
}

/* Tabs - RTL */
.tabs-nav {
    flex-direction: row-reverse;
}

/* FAQ Accordion - RTL */
.faq-question::after {
    margin-left: 0;
    margin-right: auto;
}

/* Team Cards - RTL */
.team-social {
    flex-direction: row-reverse;
}

/* Partners Logos - RTL */
.partners-grid {
    direction: rtl;
}

/* Contact Info - RTL */
.contact-info-item {
    flex-direction: row-reverse;
    text-align: right;
}

.contact-info-icon {
    margin-left: var(--spacing-md);
    margin-right: 0;
}

/* Map Container - Keep LTR */
.map-container {
    direction: ltr;
}

/* Video Container - Keep LTR */
.video-container {
    direction: ltr;
}

/* Code blocks - Keep LTR */
code, pre, .code-block {
    direction: ltr;
    text-align: left;
}

/* Print RTL */
@media print {
    body {
        direction: rtl;
        text-align: right;
    }
}

/* ===================================
   News Ticker - RTL Overrides
   =================================== */

/* Label arrow pointing correct direction in RTL */
.news-ticker__label::after {
    left: -20px;
    right: auto;
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
}

/* Ensure proper scroll direction for RTL */
.news-ticker__track {
    animation-name: ticker-scroll-rtl;
}

/* Content fade mask for RTL */
.news-ticker__content {
    mask-image: linear-gradient(
        to left,
        transparent 0%,
        black 3%,
        black 97%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to left,
        transparent 0%,
        black 3%,
        black 97%,
        transparent 100%
    );
}

/* ===================================
   Sidebar & Widget RTL Styles
   =================================== */

/* Widget title underline - RTL position */
.widget-title::after,
.sidebar-widget h3::after {
    right: 0;
    left: auto;
}

/* Widget link hover direction */
.widget a:hover,
.sidebar-widget a:hover {
    transform: translateX(4px);
}

/* Related projects list bullet */
.related-projects-list a::before {
    margin-inline-end: var(--space-2);
}

/* View all link arrow */
.view-all-link .material-symbols-outlined {
    transform: scaleX(-1);
}

/* Post navigation text alignment */
.post-navigation .nav-next {
    text-align: left;
}

/* Entry content blockquote */
.entry-content blockquote {
    border-right: 4px solid var(--primary-500);
    border-left: none;
    padding-right: var(--space-8);
    padding-left: var(--space-6);
}

/* Story impact border */
.story-impact {
    border-right: 4px solid var(--success-500);
    border-left: none;
}

/* Share buttons - ensure proper spacing in RTL */
.share-buttons {
    flex-direction: row;
}

/* Project details grid in RTL */
.project-details-card .project-details-list li {
    direction: rtl;
}

/* Sidebar sticky position adjustment for RTL */
.sidebar {
    /* Same as LTR - no changes needed */
}
