/*
 * SF Theme — RTL Arabic Stylesheet
 * يُحمَّل تلقائياً عند تفعيل اللغة العربية في ووردبريس
 * Loaded automatically when Arabic / RTL language is active.
 */

/* =========================================================
   1. DOCUMENT DIRECTION
   ========================================================= */
html[dir="rtl"],
body.rtl {
	direction: rtl;
	text-align: start;
}

/* =========================================================
   2. ARABIC TYPOGRAPHY
   ========================================================= */

/* Import IBM Plex Arabic — clean, modern, excellent Arabic rendering */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&display=swap');

/* Override font families for RTL */
html[dir="rtl"] body,
body.rtl {
	font-family: 'IBM Plex Sans Arabic', 'Noto Sans Arabic', system-ui, sans-serif;
	font-feature-settings: "kern" 1;
	-webkit-font-smoothing: antialiased;
	word-spacing: 0.05em;
	letter-spacing: 0;
}

/* Headings: keep display font for Latin, add Arabic fallback */
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3,
html[dir="rtl"] h4,
html[dir="rtl"] h5,
html[dir="rtl"] h6,
body.rtl h1,
body.rtl h2,
body.rtl h3,
body.rtl h4,
body.rtl h5,
body.rtl h6 {
	font-family: 'IBM Plex Sans Arabic', 'Noto Kufi Arabic', system-ui, sans-serif;
	letter-spacing: 0;
	word-spacing: 0.05em;
}

/* =========================================================
   3. HEADER — RTL layout
   ========================================================= */
html[dir="rtl"] .sf-site-header .wp-block-group,
body.rtl .sf-site-header .wp-block-group {
}

/* Navigation links order */
html[dir="rtl"] .sf-nav,
body.rtl .sf-nav {
}

/* =========================================================
   4. NAVIGATION DROPDOWN — RTL positioning
   ========================================================= */
html[dir="rtl"] .sf-dropdown,
body.rtl .sf-dropdown {
	inset-inline-start: auto;
	inset-inline-end: 0;
	transform-origin: top end;
}

html[dir="rtl"] .sf-dropdown-item,
body.rtl .sf-dropdown-item {
	text-align: right;
}

/* =========================================================
   5. MOBILE NAV — slide from right in RTL
   ========================================================= */
html[dir="rtl"] .sf-mobile-nav-panel,
body.rtl .sf-mobile-nav-panel {
	animation-name: sf-slide-in-rtl;
}

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

/* =========================================================
   6. FORM FIELDS — RTL alignment
   ========================================================= */
html[dir="rtl"] input,
html[dir="rtl"] textarea,
html[dir="rtl"] select,
body.rtl input,
body.rtl textarea,
body.rtl select {
	text-align: right;
	direction: rtl;
}

html[dir="rtl"] input::placeholder,
html[dir="rtl"] textarea::placeholder,
body.rtl input::placeholder,
body.rtl textarea::placeholder {
	text-align: right;
}

/* SELECT arrow position for RTL */
html[dir="rtl"] .sf-select,
html[dir="rtl"] .sf-theme select,
body.rtl .sf-select,
body.rtl .sf-theme select {
	background-position: right 0.75rem center;
	padding-inline-start: 0.75rem;
	padding-inline-end: 2.25rem;
}

/* =========================================================
   7. SEARCH OVERLAY — RTL
   ========================================================= */
html[dir="rtl"] .sf-search-input-wrap,
body.rtl .sf-search-input-wrap {
}

html[dir="rtl"] .sf-search-field,
body.rtl .sf-search-field {
	text-align: right;
	direction: rtl;
}

/* =========================================================
   8. COMMENT FORM — RTL
   ========================================================= */
html[dir="rtl"] .comment-form,
html[dir="rtl"] .sf-comment-form,
body.rtl .comment-form,
body.rtl .sf-comment-form {
	direction: rtl;
}

html[dir="rtl"] .sf-comment-list .comment-meta,
body.rtl .sf-comment-list .comment-meta {
}

/* =========================================================
   9. CARD — RTL content alignment
   ========================================================= */
html[dir="rtl"] .sf-card-header,
html[dir="rtl"] .sf-card-content,
html[dir="rtl"] .sf-card-footer,
body.rtl .sf-card-header,
body.rtl .sf-card-content,
body.rtl .sf-card-footer {
	text-align: right;
}

html[dir="rtl"] .sf-card-footer,
body.rtl .sf-card-footer {
}

/* =========================================================
   10. BLOCK — Buttons RTL
   ========================================================= */
html[dir="rtl"] .wp-block-buttons,
body.rtl .wp-block-buttons {
	justify-content: flex-start;
}

html[dir="rtl"] .sf-btn,
body.rtl .sf-btn {
}

/* =========================================================
   11. PULLQUOTE / QUOTE — border direction
   ========================================================= */
html[dir="rtl"] .wp-block-quote,
body.rtl .wp-block-quote {
	border-left: none;
	border-right: 3px solid var(--wp--preset--color--primary-300);
	padding-left: 0;
	padding-right: var(--wp--preset--spacing--md);
}

html[dir="rtl"] .wp-block-pullquote,
body.rtl .wp-block-pullquote {
	border-left: none;
	border-right: 4px solid var(--wp--preset--color--primary-400);
}

/* =========================================================
   12. POST META — RTL
   ========================================================= */
html[dir="rtl"] .wp-block-post-date,
html[dir="rtl"] .wp-block-post-author,
html[dir="rtl"] .wp-block-post-terms,
body.rtl .wp-block-post-date,
body.rtl .wp-block-post-author,
body.rtl .wp-block-post-terms {
	direction: rtl;
	text-align: right;
}

/* =========================================================
   13. SIDEBAR — RTL
   ========================================================= */
html[dir="rtl"] .sf-sidebar,
body.rtl .sf-sidebar {
	direction: rtl;
	text-align: right;
}

html[dir="rtl"] .sf-sidebar .wp-block-heading,
body.rtl .sf-sidebar .wp-block-heading {
	text-align: right;
}

/* =========================================================
   14. FOOTER — RTL column order
   ========================================================= */
html[dir="rtl"] .sf-site-footer .wp-block-columns,
body.rtl .sf-site-footer .wp-block-columns {
}

/* =========================================================
   15. WP CORE BLOCKS — RTL fixes
   ========================================================= */

/* Navigation block */
html[dir="rtl"] .wp-block-navigation__container,
body.rtl .wp-block-navigation__container {
}

html[dir="rtl"] .wp-block-navigation-item__content,
body.rtl .wp-block-navigation-item__content {
}

/* Sub-menu position */
html[dir="rtl"] .wp-block-navigation__submenu-container,
body.rtl .wp-block-navigation__submenu-container {
	inset-inline-start: auto;
	inset-inline-end: 0;
}

/* Gallery */
html[dir="rtl"] .wp-block-gallery,
body.rtl .wp-block-gallery {
	direction: rtl;
}

/* Table */
html[dir="rtl"] .wp-block-table table,
body.rtl .wp-block-table table {
	direction: rtl;
	text-align: right;
}

html[dir="rtl"] .wp-block-table td,
html[dir="rtl"] .wp-block-table th,
body.rtl .wp-block-table td,
body.rtl .wp-block-table th {
	text-align: right;
}
