/**
 * Per-post / per-comment LTR / RTL (scoped classes).
 */

/* BuddyBoss native placeholder only — block plugin medium-editor duplicate */
#bb-rl-whats-new-form-placeholder #bb-rl-whats-new-placeholder.medium-editor-placeholder::before,
.bb-rl-whats-new-form-placeholder #bb-rl-whats-new-placeholder.medium-editor-placeholder::before,
body.bb-rl-activity-modal-open #bb-rl-whats-new-form #bb-rl-whats-new.medium-editor-placeholder::before,
body.bb-rl-activity-modal-open #bb-rl-whats-new-form #bb-rl-whats-new.medium-editor-placeholder::after {
	content: none !important;
}

/* Hide feed stub pseudo-placeholder while create-post modal is open */
body.bb-rl-activity-modal-open #bb-rl-whats-new-placeholder[contenteditable="true"]:empty:before {
	content: none !important;
}

/* Direction toggle: feed collapsed hidden; modal + comments visible */
#bb-rl-activity-form-placeholder .bbat-text-direction,
body:not(.bb-rl-activity-modal-open) #bb-rl-activity-form:not(.modal-popup) .bbat-text-direction {
	display: none !important;
}

.bbat-text-direction {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	margin: 8px 0 12px;
	flex-wrap: wrap;
	width: 100%;
}

.bbat-text-direction--compact {
	margin: 4px 0 8px;
}

.bbat-text-direction--header {
	display: inline-flex;
	margin: 0;
	width: auto;
	justify-content: flex-start;
}

/* Create-post modal: language toggle beside Public privacy control */
body.bb-rl-activity-modal-open .bb-rl-activity-post-name-status {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	column-gap: 10px;
	row-gap: 6px;
	max-width: none;
	flex: 1;
}

body.bb-rl-activity-modal-open .bb-rl-activity-post-name-status #bb-rl-whats-new-heading {
	flex: 0 0 100%;
	width: 100%;
}

body.bb-rl-activity-modal-open .bb-rl-activity-post-name-status #bb-rl-whats-new-status,
body.bb-rl-activity-modal-open .bb-rl-activity-post-name-status .bbat-text-direction--header {
	flex: 0 0 auto;
}

body.bb-rl-activity-modal-open #bb-rl-whats-new-status #bb-rl-activity-privacy-point {
	margin-top: 0;
}

.bbat-text-direction__options {
	display: inline-flex;
	border: 1px solid #e4e7ec;
	border-radius: 999px;
	overflow: hidden;
	background: #f2f4f7;
	box-shadow: inset 0 1px 0 rgba( 255, 255, 255, 0.8 );
}

.bbat-text-direction__btn {
	appearance: none;
	border: 0;
	background: transparent;
	padding: 7px 14px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	color: #475467;
	transition: background 0.15s ease, color 0.15s ease;
	min-width: 72px;
}

.bbat-text-direction__btn[data-bbat-direction="rtl"] {
	font-family: "Noto Sans Arabic", "Tajawal", "Segoe UI", system-ui, sans-serif;
	font-size: 13px;
}

.bbat-text-direction__btn[data-bbat-direction="ltr"] {
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	letter-spacing: 0.01em;
}

.bbat-text-direction__btn.is-active {
	background: #4946fe;
	color: #fff;
}

.bbat-text-direction__btn:focus-visible {
	outline: 2px solid #4946fe;
	outline-offset: 2px;
}

body.bb-rl-activity-modal-open #bb-rl-whats-new-form #bb-rl-whats-new.bbat-composer-rtl {
	direction: rtl;
	text-align: right;
}

body.bb-rl-activity-modal-open #bb-rl-whats-new-form #bb-rl-whats-new.bbat-composer-ltr {
	direction: ltr;
	text-align: left;
}

/* Feed card chrome stays LTR (author, date, actions) */
li.activity-item.bbat-post-dir-rtl .bb-rl-activity-head,
li.activity-item.bbat-post-dir-rtl .bb-rl-activity-head-group,
li.activity-item.bbat-post-dir-rtl .bb-rl-activity-header,
li.activity-item.bbat-post-dir-rtl .bb-rl-activity-avatar,
li.activity-item.bbat-post-dir-rtl .bb-rl-pin-action,
li.activity-item.bbat-post-dir-rtl .bb-rl-activity-footer-actions,
li.activity-item.bbat-post-dir-rtl .bbat-activity-stats-row,
li.activity-item.bbat-post-dir-rtl .bb-rl-activity-comments,
li.activity-item.bbat-post-dir-ltr .bb-rl-activity-head,
li.activity-item.bbat-post-dir-ltr .bb-rl-activity-head-group,
li.activity-item.bbat-post-dir-ltr .bb-rl-activity-header,
li.activity-item.bbat-post-dir-ltr .bb-rl-activity-avatar,
li.activity-item.bbat-post-dir-ltr .bb-rl-pin-action,
li.activity-item.bbat-post-dir-ltr .bb-rl-activity-footer-actions,
li.activity-item.bbat-post-dir-ltr .bbat-activity-stats-row,
li.activity-item.bbat-post-dir-ltr .bb-rl-activity-comments,
.bb-rl-activity-content .bb-rl-activity-footer-actions {
	direction: ltr !important;
	text-align: left !important;
}

/* Feed — post title + body only (Arabic / RTL) */
li.activity-item.bbat-post-dir-rtl .bb-rl-activity-title,
li.activity-item.bbat-post-dir-rtl .bb-rl-activity-title h2,
.bbat-activity-text.bbat-text-dir-rtl,
.bbat-activity-text.bbat-text-dir-rtl p,
.bbat-activity-text.bbat-text-dir-rtl .bb-content-wrp,
.bbat-activity-text.bbat-text-dir-rtl .bb-content-wrp p,
.bbat-activity-text.bbat-text-dir-rtl .activity-content,
.bbat-activity-text.bbat-text-dir-rtl a {
	direction: rtl !important;
	text-align: right !important;
	color: #0c0c0d;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.45;
	font-family: "Noto Sans Arabic", "Tajawal", "Segoe UI", system-ui, sans-serif;
}

li.activity-item.bbat-post-dir-rtl .bb-rl-activity-title h2 {
	font-weight: 600;
	font-size: 18px;
}

/* Feed — post title + body only (English / LTR) */
li.activity-item.bbat-post-dir-ltr .bb-rl-activity-title,
li.activity-item.bbat-post-dir-ltr .bb-rl-activity-title h2,
.bbat-activity-text.bbat-text-dir-ltr,
.bbat-activity-text.bbat-text-dir-ltr p,
.bbat-activity-text.bbat-text-dir-ltr .bb-content-wrp,
.bbat-activity-text.bbat-text-dir-ltr .bb-content-wrp p,
.bbat-activity-text.bbat-text-dir-ltr .activity-content,
.bbat-activity-text.bbat-text-dir-ltr a {
	direction: ltr !important;
	text-align: left !important;
	color: #0c0c0d;
	font-size: 16px;
	font-weight: 500;
	line-height: 1.45;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

li.activity-item.bbat-post-dir-ltr .bb-rl-activity-title h2 {
	font-weight: 600;
	font-size: 18px;
}

/* Comments use BuddyBoss default LTR layout */
.bb-rl-activity-comments .acomment-content,
.bb-rl-activity-comments .bb-rl-acomment-content,
.bb-rl-activity-comments .ac-input {
	direction: ltr;
	text-align: left;
}
