/* ==========================================================================
   RTL Typography Polish  (task 038, wave A)
   --------------------------------------------------------------------------
   Hebrew-only refinements layered on top of css/styles.css. Everything here
   is gated behind [dir="rtl"], so the LTR render is byte-for-byte unchanged.
   Scope is deliberately narrow — three things the base sheet leaves rough:
     1. number / Latin direction inside RTL runs (prices, product names)
     2. punctuation spacing (the "·" middot eyebrows, the "←" CTA arrow)
     3. quotation marks (Hebrew convention for any <q>/<blockquote>)
   No text-align or layout rules live here — styles.css already owns those
   (see its [dir="rtl"] block); duplicating them would fight the cascade.
   Load order: this file must come AFTER css/styles.css.
   ========================================================================== */

/* --- 1. Number & Latin direction ---------------------------------------- */

/* Numeric UI atoms (hero telemetry counters: 10, 15, 84, 96,000) are pure
   Latin/digit runs sitting in an RTL document. Isolating them keeps the
   thousands separator grouped and stops the surrounding Hebrew from dragging
   a digit or comma to the wrong edge. Lining + tabular figures render the
   counter animation without vertical jitter. */
[dir="rtl"] .stat-number {
    unicode-bidi: isolate;
    font-variant-numeric: lining-nums tabular-nums;
    font-feature-settings: "tnum" 1, "lnum" 1;
}

/* Mixed atoms whose base direction is Latin but that sit in RTL flow:
   the "$/חודש" telemetry label, inline product/tech names, code spans.
   `isolate` gives each its own bidi context so a leading "$" or a trailing
   period lands on the correct side instead of leaking across the boundary. */
[dir="rtl"] .stat-label,
[dir="rtl"] .tech-tag,
[dir="rtl"] .portfolio-meta,
[dir="rtl"] code,
[dir="rtl"] kbd,
[dir="rtl"] samp {
    unicode-bidi: isolate;
}

/* Paragraph-level copy carries embedded Latin runs (Rust, Claude CLI,
   TSC TE210, 500$, ($500/month)). `plaintext` lets the browser resolve each
   line's base direction from its first strong character, so the Hebrew stays
   RTL while embedded ASCII clauses — and their brackets/prices — stay
   internally LTR and correctly ordered. */
[dir="rtl"] #about p,
[dir="rtl"] .service-card p,
[dir="rtl"] .portfolio-card p,
[dir="rtl"] .section-subtitle {
    unicode-bidi: plaintext;
}

/* --- 2. Punctuation spacing --------------------------------------------- */

/* Eyebrows read "02 · מי אנחנו": the number is Latin, the middot is a shared
   separator. Isolating the whole run keeps "02" LTR and gives the middot even
   breathing room on both sides regardless of the neighbouring script. */
[dir="rtl"] .section-eyebrow,
[dir="rtl"] .hero-eyebrow {
    unicode-bidi: isolate;
}

/* The card CTA is "קרא עוד ←": in RTL the arrow is the leading glyph and must
   sit at the visual left with a consistent gap. Flexbox keeps the arrow and
   label from being re-ordered by the bidi algorithm and gives a stable space
   in place of the collapsed literal " " before the arrow. */
[dir="rtl"] .learn-more {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35em;
    unicode-bidi: isolate;
}

/* --- 3. Quotation marks -------------------------------------------------- */

/* Hebrew uses low-9 / high-9 double quotes and matching singles. Applies to
   any <q>/<blockquote> the copy introduces later; harmless where none exist. */
[dir="rtl"] {
    quotes: "\201F" "\201D" "\2018" "\2019";
}

[dir="rtl"] q::before  { content: open-quote;  }
[dir="rtl"] q::after   { content: close-quote; }
