/*
RTL overrides for Elsabagh Mag.
Loaded automatically when Arabic is active. Logical properties in the main
stylesheet already reverse most layout; this file handles the few places that
need an explicit flip.
*/

/* Mirror the hero slider chevrons so they read correctly in RTL. */
.hero-nav--prev .dashicons,
.hero-nav--next .dashicons {
	transform: scaleX(-1);
}

/* Directional accents flip with the text direction. */
.single-content h2,
.single-content h3 {
	border-inline-start-width: 4px;
}

/* Ticker flows right-to-left. */
:root[dir="rtl"] .news-ticker-list {
	animation-name: elsabagh-ticker-rtl;
}

/* Card "read more" arrow points back toward the text. */
.post-card-more .dashicons,
.section-more .dashicons {
	transform: scaleX(-1);
}

/* Search result thumbnails sit on the reading side. */
:root[dir="rtl"] .search-result a {
	flex-direction: row-reverse;
}

/* Author box avatar mirrors to the start edge. */
:root[dir="rtl"] .elsabagh-author-box {
	flex-direction: row-reverse;
	text-align: right;
}

/* Trending number badge stays pinned to the outer edge. */
:root[dir="rtl"] .trending-item {
	flex-direction: row-reverse;
}

/* Ranked sidebar cards follow the same order as the trending list. */
:root[dir="rtl"] .widget ul.wp-block-latest-posts > li,
:root[dir="rtl"] .widget ul.wp-block-archives-list > li,
:root[dir="rtl"] .widget ul.wp-block-categories-list > li,
:root[dir="rtl"] .widget ol.wp-block-latest-comments > li {
	flex-direction: row-reverse;
}

/* Footer social grid stays centred regardless of direction. */
.footer-social-menu {
	justify-content: flex-start;
}

:root[dir="rtl"] .footer-social-menu {
	justify-content: flex-end;
}

/* Progress bar still fills left-to-right from the start edge. */
.reading-progress-bar {
	transform-origin: left center;
}

:root[dir="rtl"] .reading-progress-bar {
	transform-origin: right center;
}

/* Mobile menu slides in from the reading start edge. */
:root[dir="rtl"] .main-navigation.is-open .primary-menu {
	animation-name: elsabagh-slide-in-rtl;
}

@keyframes elsabagh-ticker-rtl {
	from { transform: translateX(0); }
	to { transform: translateX(100%); }
}

@keyframes elsabagh-slide-in-rtl {
	from { transform: translateX(-100%); }
	to { transform: translateX(0); }
}

/* Wordmark and long titles stay on the start edge. */
:root[dir="rtl"] .site-title,
:root[dir="rtl"] .single-title,
:root[dir="rtl"] .hero-slide-title {
	text-align: right;
}

/* QafPost share bar: force fresh, consistent social icon rendering */
.qaf-article-share{box-sizing:border-box!important;display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:flex-start!important;gap:20px!important;width:100%!important;direction:rtl!important;flex-wrap:wrap!important;margin:34px 0 28px!important;padding:20px 0!important;border-top:1px dotted #d9e0e5!important}
.qaf-article-share h2{box-sizing:border-box!important;display:flex!important;flex:0 0 auto!important;align-items:center!important;gap:9px!important;margin:0!important;padding:0!important;color:#102f43!important;font-size:24px!important;font-weight:800!important;line-height:1.4!important;white-space:nowrap!important}
.qaf-share-heading-icon{display:inline-flex!important;flex:0 0 28px!important;align-items:center!important;justify-content:center!important;width:28px!important;height:28px!important}
.qaf-share-heading-icon svg{display:block!important;width:25px!important;height:25px!important;fill:none!important;stroke:currentColor!important;stroke-width:2!important;stroke-linecap:round!important;stroke-linejoin:round!important}
.qaf-share-actions{box-sizing:border-box!important;display:flex!important;flex:0 0 auto!important;flex-direction:row!important;align-items:center!important;justify-content:flex-start!important;gap:8px!important;direction:ltr!important;flex-wrap:nowrap!important;width:auto!important;max-width:100%!important}
.qaf-article-share .qaf-share-btn{box-sizing:border-box!important;display:inline-flex!important;flex:0 0 44px!important;align-items:center!important;justify-content:center!important;width:44px!important;min-width:44px!important;max-width:44px!important;height:44px!important;min-height:44px!important;max-height:44px!important;margin:0!important;padding:0!important;border:0!important;border-radius:7px!important;color:#fff!important;text-decoration:none!important;line-height:1!important;overflow:hidden!important;box-shadow:none!important;cursor:pointer!important}
.qaf-article-share .qaf-share-btn svg{display:block!important;width:23px!important;height:23px!important;max-width:23px!important;max-height:23px!important;fill:currentColor!important;stroke:currentColor!important;stroke-width:1.6!important;stroke-linecap:round!important;stroke-linejoin:round!important}
.qaf-article-share .qaf-share-copy{background:#62b7bd!important}.qaf-article-share .qaf-share-telegram{background:#269bd7!important}.qaf-article-share .qaf-share-linkedin{background:#087eae!important}.qaf-article-share .qaf-share-whatsapp{background:#16bd67!important}.qaf-article-share .qaf-share-x{background:#050505!important}.qaf-article-share .qaf-share-facebook{background:#1877f2!important}
.qaf-article-share .qaf-share-copy svg,.qaf-article-share .qaf-share-telegram svg,.qaf-article-share .qaf-share-linkedin svg,.qaf-article-share .qaf-share-whatsapp svg,.qaf-article-share .qaf-share-x svg,.qaf-article-share .qaf-share-facebook svg{fill:currentColor!important;stroke:currentColor!important}
@media(max-width:600px){.qaf-article-share{align-items:flex-start!important;gap:14px!important}.qaf-article-share h2{font-size:21px!important}.qaf-share-actions{flex-wrap:wrap!important;gap:7px!important}.qaf-article-share .qaf-share-btn{flex-basis:40px!important;width:40px!important;min-width:40px!important;height:40px!important;min-height:40px!important}}

/* QafPost 1.4.36: clear share icon and compact mobile layout */
.qaf-share-heading-icon svg{display:block!important;width:29px!important;height:29px!important;fill:none!important;stroke:currentColor!important;stroke-width:2.1!important;stroke-linecap:round!important;stroke-linejoin:round!important}
@media(max-width:600px){
 .qaf-article-share{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:flex-start!important;flex-wrap:nowrap!important;gap:9px!important;direction:rtl!important}
 .qaf-article-share h2{display:flex!important;flex:0 0 30px!important;width:30px!important;min-width:30px!important;max-width:30px!important;align-items:center!important;justify-content:center!important;gap:0!important;margin:0!important;padding:0!important;font-size:0!important;white-space:normal!important}
 .qaf-article-share .qaf-share-heading-text{display:none!important;visibility:hidden!important}
 .qaf-article-share .qaf-share-heading-icon{display:inline-flex!important;flex:0 0 30px!important;width:30px!important;height:30px!important}
 .qaf-article-share .qaf-share-heading-icon svg{width:27px!important;height:27px!important}
 .qaf-article-share .qaf-share-actions{display:flex!important;flex:1 1 auto!important;flex-wrap:nowrap!important;align-items:center!important;justify-content:flex-start!important;gap:5px!important;min-width:0!important}
 .qaf-article-share .qaf-share-btn{flex:0 0 34px!important;width:34px!important;min-width:34px!important;max-width:34px!important;height:36px!important;min-height:36px!important;max-height:36px!important;border-radius:6px!important}
 .qaf-article-share .qaf-share-btn svg{width:20px!important;height:20px!important;max-width:20px!important;max-height:20px!important}
}
@media(max-width:360px){.qaf-article-share{gap:6px!important}.qaf-article-share .qaf-share-actions{gap:4px!important}.qaf-article-share .qaf-share-btn{flex-basis:32px!important;width:32px!important;min-width:32px!important;max-width:32px!important}}


/* QafPost 1.4.38 — keep the category tag icon compact beside the category name */
.single-article .single-header .qaf-single-category,
.single-article .single-header .qaf-single-category a {
    display: flex !important;
    align-items: center !important;
    width: auto !important;
    max-width: max-content !important;
    height: auto !important;
}
.single-article .single-header .qaf-single-category a {
    flex-direction: row !important;
    gap: 8px !important;
}
.single-article .single-header .qaf-single-category .qaf-category-icon {
    display: inline-block !important;
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    max-width: 22px !important;
    min-height: 22px !important;
    max-height: 22px !important;
    flex: 0 0 22px !important;
    overflow: visible !important;
}
.single-article .single-header .qaf-single-category a::before {
    content: none !important;
    display: none !important;
}


/* QafPost 1.4.40 — final single article heading and category treatment */
body.single-post .site-main--single .single-header {
    padding-top: 36px !important;
}
body.single-post .site-main--single .single-header .qaf-single-category {
    display: flex !important;
    align-items: center !important;
    margin: 8px 0 21px !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
}
body.single-post .site-main--single .single-header .qaf-single-category a {
    display: inline-flex !important;
    align-items: center !important;
    flex-direction: row !important;
    gap: 8px !important;
    color: #20bdb2 !important;
    text-decoration: none !important;
}
body.single-post .site-main--single .single-header .qaf-single-category .qaf-category-icon {
    display: inline-block !important;
    width: 22px !important;
    height: 22px !important;
    min-width: 22px !important;
    max-width: 22px !important;
    flex: 0 0 22px !important;
    color: #20bdb2 !important;
    vertical-align: middle !important;
}
body.single-post .site-main--single .single-header .single-title {
    font-size: 34px !important;
    line-height: 1.45 !important;
    margin: 0 0 17px !important;
    padding: 0 !important;
}
@media (max-width: 767px) {
    body.single-post .site-main--single .single-header {
        padding-top: 24px !important;
    }
    body.single-post .site-main--single .single-header .qaf-single-category {
        margin: 6px 0 16px !important;
    }
    body.single-post .site-main--single .single-header .single-title {
        font-size: 25px !important;
        line-height: 1.5 !important;
    }
}
