/*
 * RTL (Arabic) Overrides — CV Creator Blog v2
 * Loaded only when WordPress locale is RTL
 *
 * NOTE: <html dir="rtl"> already reverses flex row order automatically.
 * Do NOT add flex-direction: row-reverse here — it would double-reverse
 * and cancel out the RTL mirroring.
 */

/* ── Font override ────────────────────────────── */
body,
.search-form input[type="search"],
.comment-respond input,
.comment-respond textarea,
.sidebar-widget__title,
.post-toc__title,
.category-pill,
.newsletter-banner__form input,
.breadcrumbs li,
.share-buttons__label,
.archive-header__count,
.author-card__label,
.author-card__name {
    font-family: 'IBM Plex Sans Arabic', 'Space Grotesk', system-ui, sans-serif;
    line-height: 1.8;
}

h1, h2, h3, h4, h5, h6,
.post-card__title,
.related-post-card__title,
.blog-hero__title,
.blog-hero__secondary-content h3,
.single-post__title,
.related-posts__title,
.inline-cta h3,
.newsletter-banner__text h3,
.sidebar-cta h3,
.comments-area h2,
.comments-area h3 {
    font-family: 'IBM Plex Sans Arabic', 'Fraunces', Georgia, serif;
    line-height: 1.4;
    letter-spacing: 0;
}

/* ── Direction & alignment ────────────────────── */
body {
    direction: rtl;
    text-align: right;
}

/* ── Navigation ───────────────────────────────── */
.mobile-nav-toggle { margin-right: 0; margin-left: -0.5rem; }

@media (max-width: 767px) {
    .nav-links.open { text-align: right; }
}

/* ── Blog layout — natural RTL mirroring places sidebar on left ── */

/* ── Hero section ─────────────────────────────── */
.blog-hero__badge {
    left: auto;
    right: 0.75rem;
}

/* ── Category pills ───────────────────────────── */
.category-pills__scroll {
    direction: rtl;
}
.category-pill {
    direction: rtl;
}

/* ── Post cards ───────────────────────────────── */
.post-card__body { text-align: right; }
.post-card__meta { justify-content: flex-end; }
.post-card__read-more svg { transform: scaleX(-1); }

/* ── Breadcrumbs ──────────────────────────────── */
.breadcrumbs__sep svg { transform: scaleX(-1); }

/* ── Single post ──────────────────────────────── */
.single-post__meta { justify-content: flex-end; }

/* ── TOC ──────────────────────────────────────── */
@media (min-width: 1024px) {
    .single-post__body.has-toc {
        grid-template-columns: 1fr 220px;
    }
    .post-toc {
        order: 1;
    }
}
.post-toc__list {
    border-left: none;
    border-right: 2px solid var(--gray-200);
    padding-left: 0;
    padding-right: 0.875rem;
}
.post-toc__item--h3 {
    padding-left: 0;
    padding-right: 0.75rem;
}

/* ── Share buttons ────────────────────────────── */
@media (min-width: 1024px) {
    .share-buttons {
        left: auto;
        right: max(1rem, calc((100vw - 80rem) / 2 - 4rem));
    }
}

/* ── Post content ─────────────────────────────── */
.post-content { text-align: right; }
.post-content ul, .post-content ol { padding-left: 0; padding-right: 1.5rem; }
.post-content blockquote {
    border-left: none;
    border-right: 3px solid var(--indigo-600);
    border-radius: 0 0.5rem 0.5rem 0;
}
.post-content th, .post-content td { text-align: right; }

/* ── Author card ──────────────────────────────── */
.author-card { text-align: right; }

/* ── Related posts ────────────────────────────── */
.related-post-card__body { text-align: right; }

/* ── Sidebar ──────────────────────────────────── */
.sidebar-widget { text-align: right; }
.sidebar-widget li a { text-align: right; }
.tag-cloud { text-align: right; }

/* ── Newsletter banner ────────────────────────── */
@media (min-width: 640px) {
    .newsletter-banner__inner { text-align: right; }
}

/* ── Footer ───────────────────────────────────── */
@media (max-width: 639px) {
    .site-footer__inner { text-align: right; }
    .footer-left { justify-content: flex-start; }
    .footer-nav { justify-content: flex-start; }
}

/* ── Search form ──────────────────────────────── */
.search-form input[type="search"] { text-align: right; direction: rtl; }

/* ── Comments ─────────────────────────────────── */
.comment { text-align: right; }
.comment-respond { text-align: right; }

/* ── Reading progress bar ─────────────────────── */
.reading-progress {
    left: auto;
    right: 0;
}

/* ── Archive header ───────────────────────────── */
.archive-header { text-align: right; }
