/*
RTL Stylesheet for AtoClick Blog Theme
Provides right-to-left language support (Arabic, Hebrew, etc.)
*/

/* Base RTL Direction */
html[dir="rtl"] body,
body.rtl {
    direction: rtl;
    text-align: right;
}

/* Arabic Typography */
html[dir="rtl"] body,
body.rtl {
    font-family: var(--font-arabic);
}

/* Flip margins and paddings */
html[dir="rtl"] ul,
html[dir="rtl"] ol {
    padding-left: 0;
    padding-right: var(--spacing-lg);
}

/* Header adjustments */
html[dir="rtl"] .site-header .site-branding {
    margin-right: 0;
    margin-left: auto;
}

html[dir="rtl"] .site-header .main-navigation {
    margin-left: 0;
    margin-right: auto;
}

html[dir="rtl"] .site-header .header-actions {
    margin-left: 0;
    margin-right: var(--spacing-md);
}

/* Navigation */
html[dir="rtl"] .nav-menu {
    flex-direction: row-reverse;
}

html[dir="rtl"] .mobile-menu-toggle {
    margin-left: 0;
    margin-right: auto;
}

/* Post cards */
html[dir="rtl"] .post-card .post-meta {
    flex-direction: row-reverse;
}

html[dir="rtl"] .post-card .category-badge {
    margin-left: var(--spacing-sm);
    margin-right: 0;
}

/* Author info */
html[dir="rtl"] .author-avatar {
    margin-right: 0;
    margin-left: var(--spacing-sm);
}

html[dir="rtl"] .post-author {
    flex-direction: row-reverse;
}

/* Sidebar */
html[dir="rtl"] .sidebar {
    float: left;
}

html[dir="rtl"] .content-area {
    float: right;
}

/* Search form */
html[dir="rtl"] .search-form .search-field {
    padding-left: var(--spacing-md);
    padding-right: 44px;
}

html[dir="rtl"] .search-form .search-submit {
    left: auto;
    right: 0;
    border-radius: 0 var(--border-radius-md) var(--border-radius-md) 0;
}

/* Breadcrumbs */
html[dir="rtl"] .breadcrumbs {
    flex-direction: row-reverse;
}

html[dir="rtl"] .breadcrumb-separator {
    transform: scaleX(-1);
}

/* Table of Contents */
html[dir="rtl"] .toc-list {
    padding-left: 0;
    padding-right: var(--spacing-md);
}

html[dir="rtl"] .toc-list li::before {
    left: auto;
    right: calc(-1 * var(--spacing-md));
}

/* Share buttons */
html[dir="rtl"] .share-buttons {
    flex-direction: row-reverse;
}

html[dir="rtl"] .share-sticky {
    left: auto;
    right: var(--spacing-md);
}

/* Comments */
html[dir="rtl"] .comment-avatar {
    float: right;
    margin-right: 0;
    margin-left: var(--spacing-md);
}

html[dir="rtl"] .comment-content {
    margin-left: 0;
    margin-right: 68px;
}

html[dir="rtl"] .comment-reply-link {
    float: left;
}

/* Footer */
html[dir="rtl"] .footer-widgets {
    flex-direction: row-reverse;
}

html[dir="rtl"] .social-links {
    flex-direction: row-reverse;
}

/* Buttons with icons */
html[dir="rtl"] .btn svg,
html[dir="rtl"] .btn .icon {
    margin-left: var(--spacing-sm);
    margin-right: 0;
}

/* Lists */
html[dir="rtl"] .widget ul li {
    padding-left: 0;
    padding-right: var(--spacing-md);
}

html[dir="rtl"] .widget ul li::before {
    left: auto;
    right: 0;
}

/* Related posts */
html[dir="rtl"] .related-posts-grid {
    direction: rtl;
}

/* Post navigation */
html[dir="rtl"] .post-navigation .nav-previous {
    float: right;
}

html[dir="rtl"] .post-navigation .nav-next {
    float: left;
}

html[dir="rtl"] .nav-previous .nav-arrow {
    transform: scaleX(-1);
}

html[dir="rtl"] .nav-next .nav-arrow {
    transform: scaleX(-1);
}

/* Forms */
html[dir="rtl"] .form-group label {
    text-align: right;
}

html[dir="rtl"] .newsletter-form .btn {
    margin-left: 0;
    margin-right: var(--spacing-sm);
}

/* Featured image overlay text */
html[dir="rtl"] .featured-hero .hero-content {
    text-align: right;
}

/* Category badges inline */
html[dir="rtl"] .categories-list {
    flex-direction: row-reverse;
}

/* Load more button container - center aligned, no RTL needed */

/* Mobile menu */
html[dir="rtl"] .mobile-menu {
    left: auto;
    right: 0;
    transform: translateX(100%);
}

html[dir="rtl"] .mobile-menu.is-open {
    transform: translateX(0);
}

/* Hamburger icon flip */
html[dir="rtl"] .hamburger {
    transform: scaleX(-1);
}

/* Archive header */
html[dir="rtl"] .archive-header {
    text-align: right;
}

/* Error 404 - center aligned, no RTL needed */

/* Sticky TOC sidebar on single posts */
html[dir="rtl"] .single-post-layout {
    flex-direction: row-reverse;
}

html[dir="rtl"] .toc-sidebar {
    margin-left: 0;
    margin-right: var(--spacing-xl);
}

/* Code blocks - keep LTR for code */
html[dir="rtl"] pre,
html[dir="rtl"] code {
    direction: ltr;
    text-align: left;
}

/* Blockquotes */
html[dir="rtl"] blockquote {
    border-left: none;
    border-right: 4px solid var(--accent-green);
    padding-left: 0;
    padding-right: var(--spacing-lg);
}

/* Reading progress bar - no RTL needed, always left to right */

/* Pagination */
html[dir="rtl"] .pagination {
    flex-direction: row-reverse;
}

html[dir="rtl"] .pagination .prev-page svg {
    transform: scaleX(-1);
}

html[dir="rtl"] .pagination .next-page svg {
    transform: scaleX(-1);
}

/* Widget titles */
html[dir="rtl"] .widget-title::after {
    left: auto;
    right: 0;
}

/* Popular posts widget */
html[dir="rtl"] .popular-post-item {
    flex-direction: row-reverse;
}

html[dir="rtl"] .popular-post-thumb {
    margin-right: 0;
    margin-left: var(--spacing-sm);
}

/* Tags cloud */
html[dir="rtl"] .tagcloud {
    direction: rtl;
}

/* Gallery */
html[dir="rtl"] .gallery {
    direction: rtl;
}

/* Video post format icon position */
html[dir="rtl"] .post-format-icon {
    left: auto;
    right: var(--spacing-md);
}