/**
 * ElemenTrans Arabic Typography Enhancements
 *
 * Provides optimal typography settings for Arabic text rendering
 * across all major browsers. Loaded on all Arabic (/ar/) pages
 * regardless of theme RTL support.
 *
 * @package ElemenTrans
 * @since   1.0.0
 */

/* Arabic text rendering optimization */
body.elementrans-rtl {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

/* Arabic-specific line height and letter spacing */
body.elementrans-rtl p,
body.elementrans-rtl li,
body.elementrans-rtl td,
body.elementrans-rtl th,
body.elementrans-rtl dd,
body.elementrans-rtl dt,
body.elementrans-rtl blockquote,
body.elementrans-rtl figcaption,
body.elementrans-rtl label,
body.elementrans-rtl span {
	line-height: 1.8;
}

body.elementrans-rtl h1,
body.elementrans-rtl h2,
body.elementrans-rtl h3,
body.elementrans-rtl h4,
body.elementrans-rtl h5,
body.elementrans-rtl h6 {
	line-height: 1.5;
	letter-spacing: 0;
}

/* Arabic word spacing for readability */
body.elementrans-rtl p,
body.elementrans-rtl li,
body.elementrans-rtl blockquote {
	word-spacing: 0.05em;
}

/* Arabic diacritics (tashkeel) rendering */
body.elementrans-rtl {
	font-feature-settings: "liga" 1, "calt" 1;
}

/* Prevent Arabic text overflow in narrow containers */
body.elementrans-rtl .entry-content,
body.elementrans-rtl .post-content,
body.elementrans-rtl .page-content,
body.elementrans-rtl article,
body.elementrans-rtl .elementor-widget-container,
body.elementrans-rtl .elementor-text-editor {
	overflow-wrap: break-word;
	word-wrap: break-word;
	hyphens: none;
}

/* Arabic input placeholder styling */
body.elementrans-rtl input::placeholder,
body.elementrans-rtl textarea::placeholder {
	text-align: right;
	direction: rtl;
}

/* Arabic number display - keep numbers LTR within RTL context */
body.elementrans-rtl .elementrans-ltr-numbers,
body.elementrans-rtl time,
body.elementrans-rtl .entry-date,
body.elementrans-rtl .posted-on,
body.elementrans-rtl .post-date {
	direction: ltr;
	unicode-bidi: embed;
}

/* Mixed content bidi isolation */
body.elementrans-rtl code,
body.elementrans-rtl pre,
body.elementrans-rtl kbd,
body.elementrans-rtl samp,
body.elementrans-rtl var {
	direction: ltr;
	unicode-bidi: isolate;
}

/* Arabic link underline offset for better readability */
body.elementrans-rtl a {
	text-underline-offset: 0.2em;
}

/* Table cell Arabic text alignment */
body.elementrans-rtl table {
	direction: rtl;
}

body.elementrans-rtl th,
body.elementrans-rtl td {
	text-align: right;
}

/* Arabic breadcrumb separator direction */
body.elementrans-rtl .breadcrumbs,
body.elementrans-rtl .breadcrumb,
body.elementrans-rtl nav[aria-label="Breadcrumb"],
body.elementrans-rtl .rank-math-breadcrumb,
body.elementrans-rtl .yoast-breadcrumb {
	direction: rtl;
}

/* WordPress caption and gallery text */
body.elementrans-rtl .wp-caption-text,
body.elementrans-rtl .gallery-caption {
	text-align: right;
}

/* Comment and form layout */
body.elementrans-rtl .comment-body,
body.elementrans-rtl .comment-content,
body.elementrans-rtl .comment-meta {
	text-align: right;
}

/* Elementor specific Arabic typography */
body.elementrans-rtl .elementor-widget-text-editor,
body.elementrans-rtl .elementor-widget-heading .elementor-heading-title,
body.elementrans-rtl .elementor-widget-theme-post-content {
	line-height: 1.8;
}

/* Print styles for Arabic */
@media print {
	body.elementrans-rtl {
		direction: rtl;
		text-align: right;
	}
}
