/* RTL (Right-to-Left) Styles for Style 2 - Bootstrap RTL Support */

/* ============================================
   Base RTL Direction
   ============================================ */
html[dir="rtl"],
body[dir="rtl"] {
    direction: rtl;
    font-family: 'Cairo', 'Segoe UI', Tahoma, Arial, sans-serif;
}

html[dir="rtl"] * {
    direction: inherit;
}

/* ============================================
   RTL Bootstrap Navbar
   ============================================ */
body[dir="rtl"] .navbar {
    direction: rtl;
}

body[dir="rtl"] .navbar-brand {
    margin-right: 0;
    margin-left: auto;
}

body[dir="rtl"] .navbar-nav {
    direction: rtl;
}

body[dir="rtl"] .navbar-nav .nav-link {
    text-align: right;
}

body[dir="rtl"] .navbar-collapse {
    direction: rtl;
}

/* Language dropdown in RTL */
body[dir="rtl"] .language-dropdown-menu {
    right: auto !important;
    left: 0 !important;
}

body[dir="rtl"] .language-option {
    flex-direction: row-reverse;
    text-align: right;
}

body[dir="rtl"] .language-dropdown-btn {
    flex-direction: row-reverse;
}

body[dir="rtl"] .language-arrow {
    transform: scaleX(-1);
}

/* ============================================
   RTL Simple Hero Box
   ============================================ */
body[dir="rtl"] .hero-box-content {
    text-align: center;
}

body[dir="rtl"] .hero-box-title {
    text-align: center;
}

body[dir="rtl"] .hero-box-text {
    text-align: center;
}

/* ============================================
   RTL Modern Categories & Posts Section
   ============================================ */
body[dir="rtl"] .sidebar-title::after {
    left: auto;
    right: 0;
}

body[dir="rtl"] .subcategory-link {
    padding-left: 1rem;
    padding-right: 2rem;
}

body[dir="rtl"] .subcategory-link::before {
    left: auto;
    right: 0.75rem;
}

body[dir="rtl"] .subcategory-link:hover {
    padding-left: 1rem;
    padding-right: 2.25rem;
}

body[dir="rtl"] .subcategory-link.active {
    padding-left: 1rem;
    padding-right: 2.25rem;
}

body[dir="rtl"] .subcategory-list-modern {
    padding-left: 0;
    padding-right: 1rem;
}

body[dir="rtl"] .read-more-btn-modern {
    direction: rtl;
}

body[dir="rtl"] .read-more-btn-modern:hover svg {
    transform: translateX(-4px);
}

/* ============================================
   RTL Posts Section
   ============================================ */
body[dir="rtl"] .section-header-container {
    flex-direction: row;
}

body[dir="rtl"] .section-title {
    text-align: right;
    margin: 0;
    order: 1;
}

body[dir="rtl"] .section-title::after {
    left: auto !important;
    right: 0 !important;
    transform: none !important;
}

body[dir="rtl"] .view-all-link {
    order: 2;
}

body[dir="rtl"] .view-all-link {
    flex-direction: row-reverse;
}

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

body[dir="rtl"] .view-all-link:hover {
    transform: translateX(-5px);
}

body[dir="rtl"] .latest-post-content {
    text-align: right;
}

body[dir="rtl"] .latest-post-title {
    text-align: right;
}

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

body[dir="rtl"] .latest-read-more {
    align-self: flex-end;
}

body[dir="rtl"] .latest-read-more:hover {
    transform: translateX(-5px);
}

body[dir="rtl"] .latest-post-date {
    text-align: right;
}

body[dir="rtl"] .no-posts-message {
    text-align: center;
}

/* ============================================
   RTL Contact Page
   ============================================ */
body[dir="rtl"] .contact-section-title {
    text-align: right;
}

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

body[dir="rtl"] .contact-info-item {
    flex-direction: row-reverse;
}

body[dir="rtl"] .contact-info-content {
    text-align: right;
}

body[dir="rtl"] .contact-social-media {
    justify-content: flex-end;
}

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

body[dir="rtl"] .contact-form-card .form-label {
    text-align: right;
}

body[dir="rtl"] .contact-form-card .form-control {
    text-align: right;
}

body[dir="rtl"] .contact-form-card textarea.form-control {
    text-align: right;
}

/* ============================================
   RTL Mobile Controls
   ============================================ */
body[dir="rtl"] .mobile-controls {
    text-align: right;
}

body[dir="rtl"] .theme-toggle-btn-mobile {
    flex-direction: row-reverse;
}

body[dir="rtl"] .language-option-mobile {
    flex-direction: row-reverse;
    text-align: right;
}

body[dir="rtl"] .language-option-mobile:hover {
    transform: translateX(-5px);
}

body[dir="rtl"] .language-option-mobile .language-flag {
    order: 1;
    margin-right: 0;
    margin-left: 0.75rem;
}

body[dir="rtl"] .language-option-mobile span {
    order: 2;
    text-align: right;
}

body[dir="rtl"] .language-option-mobile .language-check {
    order: 3;
    margin-right: auto;
    margin-left: 0;
}

/* ============================================
   RTL Responsive
   ============================================ */
@media (max-width: 768px) {
    body[dir="rtl"] .navbar-nav .nav-link {
        text-align: right;
        padding-right: 1rem !important;
        padding-left: 1rem !important;
    }
    
    /* Footer Responsive RTL */
    body[dir="rtl"] .footer-section h3 {
        text-align: center;
        font-size: 1.1rem;
    }
}

/* ============================================
   RTL Modern Events Section
   ============================================ */
body[dir="rtl"] .events-title {
    text-align: right;
}

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

body[dir="rtl"] .event-number-modern {
    right: auto;
    left: 1.5rem;
}

body[dir="rtl"] .event-btn-modern {
    direction: rtl;
}

body[dir="rtl"] .event-btn-modern:hover svg,
body[dir="rtl"] .event-btn-modern:hover .btn-icon {
    transform: translateX(-4px);
}

body[dir="rtl"] .event-btn-modern .btn-icon {
    transform: scaleX(-1);
}

body[dir="rtl"] .event-btn-modern[data-expanded="true"] .btn-icon {
    transform: scaleX(-1) rotate(180deg);
}

/* ============================================
   RTL Expandable Event Cards
   ============================================ */
body[dir="rtl"] .events-carousel-modern {
    direction: rtl;
}

body[dir="rtl"] .event-card-expandable {
    border-right: none;
    border-left: 1px solid rgba(255, 255, 255, 0.05);
}

body[dir="rtl"] .event-card-expandable:last-child {
    border-left: none;
}

body[dir="rtl"] .event-card-expandable.active {
    border-left: 1px solid rgba(0, 0, 0, 0.1);
    border-right: none;
    color: #000000 !important;
}

body[dir="rtl"] .event-card-expandable.active * {
    color: #000000 !important;
}

body[dir="rtl"] .event-card-expandable.active .event-title-expandable {
    color: #000000 !important;
}

body[dir="rtl"] .event-card-expandable.active .event-text-expandable {
    color: #000000 !important;
}

body[dir="rtl"] .event-card-expandable.active .event-btn-expandable {
    color: #000000 !important;
}

body[dir="rtl"] .event-card-expandable.active .event-btn-expandable span {
    color: #000000 !important;
}

body[dir="rtl"] .event-number-expandable {
    right: auto;
    left: 3rem;
}

body[dir="rtl"] .event-card-expandable.active .event-number-expandable {
    color: #00000030 !important;
}

/* Hero Slide and Video Hero Content - Center Alignment */
body[dir="rtl"] .hero-content-inner {
    text-align: center !important;
}

body[dir="rtl"] .video-hero-content {
    text-align: center !important;
}

body[dir="rtl"] .video-hero-content h2,
body[dir="rtl"] .video-hero-content p {
    text-align: center;
}

/* Hero Title and Description - Center Alignment */
body[dir="rtl"] .hero-title {
    text-align: center !important;
}

body[dir="rtl"] .hero-description {
    text-align: center !important;
}

body[dir="rtl"] .hero-slide.active .hero-title {
    transform: translateY(0px);
    opacity: 1;
}

/* Center All Headings in RTL */
body[dir="rtl"] h1,
body[dir="rtl"] h2,
body[dir="rtl"] h3,
body[dir="rtl"] h4,
body[dir="rtl"] h5,
body[dir="rtl"] h6 {
    text-align: center;
}

/* Related Posts RTL */
body[dir="rtl"] .related-post-read-more svg {
    transform: scaleX(-1);
}

body[dir="rtl"] .related-post-card-link:hover .related-post-read-more svg {
    transform: translateX(-4px) scaleX(-1);
}

body[dir="rtl"] .post-card-link-modern {
    text-align: right;
}

body[dir="rtl"] .latest-post-link {
    text-align: right;
}

@media (max-width: 768px) {
    body[dir="rtl"] .event-card-expandable {
        border-left: none;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    body[dir="rtl"] .event-card-expandable.active {
        border-left: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        color: #000000 !important;
    }
    
    body[dir="rtl"] .event-card-expandable.active * {
        color: #000000 !important;
    }
    
    body[dir="rtl"] .event-number-expandable {
        left: 1.5rem;
        right: auto;
    }
}

@media (max-width: 768px) {
    body[dir="rtl"] .event-number-modern {
        left: 1rem;
        right: auto;
    }
}

/* Partners Section RTL */
body[dir="rtl"] .partners-title-modern {
    text-align: center;
}

body[dir="rtl"] .partners-title-modern::after {
    left: 50%;
    transform: translateX(-50%);
}

body[dir="rtl"] .partner-modal-title {
    text-align: right;
}

body[dir="rtl"] .partner-modal-close {
    margin-right: auto;
    margin-left: 0;
}
