/**
 * AS Plus Restaurant Theme — RTL refinements.
 *
 * Loaded after assets/css/theme.css and only when is_rtl() is true, so for
 * Persian and Arabic locales. Everything here is a correction that CSS logical
 * properties cannot express; all spacing, borders and alignment in theme.css are
 * already logical, which is why this file is small rather than a mirror.
 *
 * Deliberately absent: the role-hub arrow flip, which theme.css already handles
 * through [dir="rtl"] so that it also works for an RTL block inside an LTR page.
 */

/* ---------------------------------------------------------------------
 * 1. Joined scripts and tracking
 *
 * Persian and Arabic are cursive: glyphs join, so horizontal tracking pulls
 * the joins apart and looks broken rather than "airy". Uppercasing has no
 * meaning in these scripts either.
 * ------------------------------------------------------------------ */

.asplus-footer-heading,
.asplus-cat-count,
.asplus-panel-section-title {
	letter-spacing: 0;
	text-transform: none;
}

/* ---------------------------------------------------------------------
 * 2. Vertical room
 *
 * Persian adds ascenders and descenders (گ چ پ ژ) that Latin display sizes do
 * not anticipate. The tightened line-heights in theme.css are tuned for Latin;
 * these loosen them just enough to stop clipping without changing the rhythm.
 * ------------------------------------------------------------------ */

h1,
h2,
h3,
h4,
h5,
h6,
.asplus-hero h1,
.asplus-card-title,
.asplus-article-title,
.asplus-cart-drawer-title,
.asplus-panel-name {
	line-height: 1.5;
}

a.asplus-button,
a.asplus-button:visited,
.asplus-button .elementor-button,
.elementor-element.asplus-button .elementor-button,
.asplus-nav a,
.asplus-cart-drawer .woocommerce-mini-cart__buttons a {
	line-height: 1.6;
}

/* ---------------------------------------------------------------------
 * 3. Mixed-direction content
 *
 * A restaurant page in Persian routinely holds Latin runs: a phone number, an
 * email address, a URL, a basket count. Left to the bidi algorithm inside an
 * RTL paragraph, the trailing punctuation of such a run lands on the wrong
 * side. `plaintext` resolves each element from its own first strong character,
 * so Persian text stays RTL and Latin data becomes LTR — with no direction
 * hard-coded per field.
 * ------------------------------------------------------------------ */

.asplus-contact-value,
.asplus-contact-value a,
.asplus-social-link,
.asplus-header-cart-count,
.asplus-cat-count,
.asplus-article-meta,
.asplus-footer-copy {
	unicode-bidi: plaintext;
}

/* ---------------------------------------------------------------------
 * 4. Form fields that always hold LTR data
 *
 * These types are Latin by definition regardless of the page language, and
 * browsers place their caret and placeholder inconsistently under dir="rtl".
 * ------------------------------------------------------------------ */

.asplus-main input[type="tel"],
.asplus-main input[type="email"],
.asplus-main input[type="url"],
.asplus-main input[type="number"],
.asplus-main input[type="date"],
.asplus-main input[type="time"] {
	direction: ltr;
	text-align: left;
}

/* ---------------------------------------------------------------------
 * 5. Commerce and panel
 *
 * box-shadow offsets are physical, so the drawer's cast has to flip with the
 * panel's edge. Prices, quantities and totals are Latin numerals and currency
 * symbols: without `plaintext` the bidi algorithm can pull a trailing symbol to
 * the wrong side of the number.
 * ------------------------------------------------------------------ */

.asplus-cart-drawer-panel {
	box-shadow: 18px 0 48px rgba(0, 0, 0, 0.45);
}

.asplus-cart-drawer .quantity,
.asplus-cart-drawer .woocommerce-mini-cart__total .amount,
.asplus-woocommerce .price,
.asplus-woocommerce .quantity .qty,
.asplus-woocommerce .cart_totals .amount,
.asplus-panel-email {
	unicode-bidi: plaintext;
}

/* ---------------------------------------------------------------------
 * 6. Directional gradients
 *
 * `linear-gradient()` takes physical directions, so the hero's scrim — which
 * theme.css anchors to the inline start, where Persian text begins — has to be
 * told which way "start" is. Everything else in the hero already uses logical
 * properties and needs nothing here.
 * ------------------------------------------------------------------ */

/* Two classes, to match the LTR rule in theme.css: that one is written as
 * `.e-con.asplus-hero--cinematic` so it outranks Elementor's own `.e-con` min-height,
 * and a single-class override here would simply lose that tie. */
.e-con.asplus-hero--cinematic {
	--asplus-hero-scrim: to left;
}
