/**
 * RTL Overrides
 * Arabic/RTL-specific style adjustments
 *
 * The theme is built with logical properties (inset-inline-*, margin-inline-*, etc.)
 * so most layout works automatically in RTL. This file handles cases where
 * we need explicit RTL adjustments (transforms, animations, icons, etc.)
 *
 * @package TheOneOne
 */

/* ==========================================================================
   GLOBAL TYPOGRAPHY ADJUSTMENTS
   ========================================================================== */

[dir="rtl"] body {
	font-family: var(--tos-font-display), "Cairo", "Segoe UI", Tahoma, sans-serif;
	letter-spacing: 0;
}

[dir="rtl"] h1,
[dir="rtl"] h2,
[dir="rtl"] h3,
[dir="rtl"] h4,
[dir="rtl"] h5,
[dir="rtl"] h6 {
	letter-spacing: 0;
	line-height: 1.4;
}

/* Adjust line-height for Arabic — taller diacritics */
[dir="rtl"] p,
[dir="rtl"] li {
	line-height: 1.85;
}

/* ==========================================================================
   ICON FLIPS — directional icons need mirroring
   ========================================================================== */

[dir="rtl"] .tos-icon--arrow-right svg,
[dir="rtl"] .tos-btn .tos-icon--arrow-right svg,
[dir="rtl"] .tos-program-card__cta .tos-icon svg,
[dir="rtl"] .site-footer__list a::before,
[dir="rtl"] .tos-breadcrumbs__sep {
	transform: scaleX(-1);
}

/* Hover translate direction reversed */
[dir="rtl"] .tos-btn:hover .tos-icon--arrow-right svg {
	transform: scaleX(-1) translateX(4px);
}

/* Program card CTA on hover */
[dir="rtl"] .tos-program-card:hover .tos-program-card__cta .tos-icon svg {
	transform: scaleX(-1) translateX(4px);
}

/* Footer list arrow */
[dir="rtl"] .site-footer__list a::before {
	content: "‹";
}

/* Breadcrumb separator */
[dir="rtl"] .tos-breadcrumbs__sep {
	content: "‹";
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */

[dir="rtl"] .tos-primary-nav .sub-menu {
	text-align: right;
}

[dir="rtl"] .tos-primary-nav .menu-item-has-children > a::after,
[dir="rtl"] .tos-primary-nav .has-dropdown > a::after {
	margin-left: 0;
	margin-right: 6px;
}

/* Mobile drawer slides from the right in RTL */
[dir="rtl"] .tos-mobile-drawer__panel {
	right: 0;
	left: auto;
	transform: translateX(100%);
}

[dir="rtl"] .tos-mobile-drawer.is-open .tos-mobile-drawer__panel {
	transform: translateX(0);
}

/* Burger button alignment */
[dir="rtl"] .tos-burger__lines span:nth-child(1) {
	transform-origin: right;
}

[dir="rtl"] .tos-burger__lines span:nth-child(3) {
	transform-origin: right;
}

/* ==========================================================================
   HERO & SECTIONS
   ========================================================================== */

[dir="rtl"] .tos-hero__eyebrow {
	letter-spacing: 1px;
}

[dir="rtl"] .tos-section__eyebrow {
	letter-spacing: 1px;
}

[dir="rtl"] .tos-section__eyebrow::before,
[dir="rtl"] .tos-section__eyebrow::after {
	/* logical properties keep these working automatically */
}

/* Hero scroll arrow flip */
[dir="rtl"] .tos-hero__scroll svg {
	transform: rotate(0deg); /* down stays down */
}

/* ==========================================================================
   FORMS
   ========================================================================== */

[dir="rtl"] .tos-form__input,
[dir="rtl"] .tos-form__textarea,
[dir="rtl"] .tos-form__select {
	text-align: right;
	font-family: var(--tos-font-display), "Cairo", sans-serif;
}

[dir="rtl"] .tos-form__select {
	background-position: left 12px center;
	padding-inline-end: var(--tos-space-md);
	padding-inline-start: 36px;
}

/* Custom search icon position */
[dir="rtl"] .tos-search-form__input {
	padding-inline-end: 48px;
	padding-inline-start: var(--tos-space-md);
}

/* ==========================================================================
   PROGRAM CARDS
   ========================================================================== */

[dir="rtl"] .tos-program-card__features li {
	padding-inline-start: 28px;
	padding-inline-end: 0;
}

[dir="rtl"] .tos-program-card__features li::before {
	left: auto;
	right: 0;
}

/* ==========================================================================
   SINGLE PROGRAM
   ========================================================================== */

[dir="rtl"] .tos-program-single__features-list li::before {
	margin-left: 12px;
	margin-right: 0;
}

[dir="rtl"] .tos-program-single__price {
	text-align: right;
}

/* ==========================================================================
   CLIENTS MARQUEE — handled in slider.css with tos-marquee-rtl
   ========================================================================== */

/* ==========================================================================
   TESTIMONIALS
   ========================================================================== */

[dir="rtl"] .tos-testimonial__quote-icon {
	transform: scaleX(-1);
}

[dir="rtl"] .tos-testimonial__quote {
	font-family: var(--tos-font-display), "Cairo", sans-serif;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

[dir="rtl"] .site-footer__list a {
	padding-inline-start: 20px;
}

[dir="rtl"] .site-footer__contact-item .tos-icon {
	flex-shrink: 0;
}

/* ==========================================================================
   WHATSAPP FLOAT — flip mirror
   ========================================================================== */

[dir="rtl"] .tos-wa-float {
	inset-inline-end: 24px; /* in RTL, inset-inline-end = left edge */
}

/* ==========================================================================
   LANGUAGE SWITCHER
   ========================================================================== */

[dir="rtl"] .tos-lang-switcher {
	font-family: var(--tos-font-display), "Cairo", sans-serif;
}

/* ==========================================================================
   COMMENTS / BLOG
   ========================================================================== */

[dir="rtl"] .tos-comment__meta {
	text-align: right;
}

[dir="rtl"] .tos-pagination {
	direction: rtl;
}

/* ==========================================================================
   ADMIN BAR FIX (WP)
   ========================================================================== */

[dir="rtl"] #wpadminbar {
	direction: ltr;
}

/* ==========================================================================
   MIXED-DIRECTION CONTENT
   ========================================================================== */

/* Phone numbers — always LTR */
[dir="rtl"] .tos-tel,
[dir="rtl"] a[href^="tel:"],
[dir="rtl"] .tos-topbar__item a[href^="tel:"],
[dir="rtl"] .site-footer__contact-item a[href^="tel:"] {
	direction: ltr;
	unicode-bidi: embed;
	display: inline-block;
}

/* Emails — always LTR */
[dir="rtl"] a[href^="mailto:"] {
	direction: ltr;
	unicode-bidi: embed;
	display: inline-block;
}

/* URLs in content */
[dir="rtl"] code,
[dir="rtl"] pre {
	direction: ltr;
	text-align: left;
}
