/* ============================================
   USAJO Theme - RTL Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700&family=Amiri:wght@400;700&display=swap');

body {
    direction: rtl;
    unicode-bidi: embed;
    text-align: right;
    font-family: 'Cairo', var(--font-body);
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Cairo', var(--font-heading);
}

/* Float and Align */
.text-left { text-align: right; }
.text-right { text-align: left; }

/* Breadcrumbs & Meta Icons */
.page-hero {
    text-align: right;
}

.breadcrumb {
    font-size: 0.95rem;
}

.journal-meta span {
    flex-direction: row-reverse;
}

.footer-contact p {
    text-align: right;
    display: block;
}

.journal-meta span i,
.journal-meta span span:first-child {
    margin-left: 0.4rem;
    margin-right: 0;
}

/* Navigation */
@media (min-width: 769px) {
    .nav-menu {
        flex-direction: row;
    }
}

.nav-menu a::after {
    left: auto;
    right: 50%;
    transform: translateX(50%);
}

/* Sidebar & Layout */
@media (min-width: 992px) {
    .page-layout {
        grid-template-columns: 1fr 300px; /* Mirrored: 1fr is Right, 300px is Left */
    }
    
    /* Remove any order overrides that break mirroring */
    .sidebar {
        order: initial;
    }
}

/* Footer Links */
.footer-links a:hover {
    padding-left: 0;
    padding-right: 8px;
}

.footer-title::after {
    left: auto;
    right: 0;
}

/* Icons and Arrows */
.btn-primary i, .btn-accent i {
    margin-right: 0.5rem;
    margin-left: 0;
    transform: scaleX(-1);
}

/* Fix for icons if they are characters */
span[style*="color: inherit"] i {
    margin-left: 5px;
    margin-right: 0;
}

/* Table and Lists */
.content-box ul li {
    padding-left: 0;
    padding-right: var(--spacing-sm);
}

.content-box ul li::before {
    left: auto;
    right: 0;
}

.content-box ul, .content-box ol {
    margin-left: 0;
    margin-right: var(--spacing-md);
}

/* WhatsApp Float */
.whatsapp-float {
    right: auto;
    left: 20px;
}

/* Customizer Fixes */
@media (min-width: 992px) {
    .site-logo {
        margin-right: 0;
        margin-left: var(--spacing-xl);
    }
}

.top-bar-info {
    flex-direction: row-reverse;
}

.language-switcher {
    flex-direction: row-reverse;
}

.language-switcher ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 10px;
}

.language-switcher li {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Form RTL Fixes */
.contact-form-wrapper form {
    text-align: right;
}

.contact-form-wrapper p,
.contact-form-wrapper label,
.contact-form-wrapper input,
.contact-form-wrapper textarea {
    text-align: right;
    display: block;
    width: 100%;
}

.contact-form-wrapper label {
    margin-bottom: 8px;
    font-weight: 600;
}

.contact-form-wrapper input[type="submit"],
.contact-form-wrapper button {
    width: 100%;
    font-family: 'Cairo', sans-serif !important;
    cursor: pointer;
    font-weight: 700;
    text-align: center;
}

/* Fix margin for checkboxes or radio if any */
.contact-form-wrapper input[type="checkbox"],
.contact-form-wrapper input[type="radio"] {
    width: auto;
    display: inline-block;
    margin-left: 10px;
}

.language-switcher li::before {
    display: none;
}

/* Sidebar "Latest Publications" Refinement */
.latest-pub-item {
    padding: 12px 0;
    border-bottom: 1px dashed var(--color-gray-light);
}

.latest-pub-item:last-child {
    border-bottom: none;
}

.latest-pub-item a {
    font-weight: 600;
    color: var(--color-primary-dark);
    display: flex;
    align-items: flex-start;
    gap: 8px;
    line-height: 1.4;
}

.latest-pub-item a::before {
    content: '•';
    color: var(--color-accent);
    font-size: 1.2rem;
    line-height: 1;
}

.latest-pub-item a:hover {
    color: var(--color-accent);
}

.footer-contact p {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.footer-contact p a {
    direction: ltr; /* Keeps email/phone left-aligned if desired, or remove for RTL */
    unicode-bidi: embed;
}

.footer-social {
    justify-content: flex-start;
    display: flex;
    gap: 15px;
    margin-top: 15px;
}
