/* ============================================================================
   DOROSHKE — rtl.css  (v1.0, LIGHT MODE ONLY)
   ----------------------------------------------------------------------------
   RTL is the layout of this theme, not a variant. There is no LTR version of
   DOROSHKE. The document is forced to dir="rtl" lang="fa-IR" in
   inc/setup.php, and this file is enqueued unconditionally for that reason —
   it does not wait on is_rtl(), because the theme does not depend on the site
   locale to be right-to-left.

   Consequently this file is deliberately SHORT. Almost nothing needs an RTL
   override, because theme-tokens.css, theme-components.css and
   theme-wordpress.css are written with logical properties throughout
   (margin-inline-start, padding-inline-end, inset-inline-start, text-align:
   start). Physical properties break RTL silently; logical ones simply work.

   What lives here is only:
     1. the guarantees about what must NOT mirror, asserted defensively
     2. the handful of places where WordPress core emits physical CSS
     3. Persian typography rules that are RTL-specific by nature

   Load order: theme-tokens.css -> theme-components.css -> theme-wordpress.css
               -> THIS FILE
   Tokens only. No raw hex, no raw font-size, no radius other than 0.
   ============================================================================ */

/* ------------------------------------------------------- 1. DOCUMENT ------ */
html[dir="rtl"] body.dk-body {
  direction: rtl;
  text-align: start;
}

/* --------------------------------------- 2. WHAT MUST NEVER MIRROR -------- */
/* Cobalt identity: the 45-degree corner cut is retired, so there is no physical
   clip-path left to protect from a logical rewrite. Radii are symmetric and
   mirror-safe by definition. */

/* The logo is never flipped, mirrored, rotated or recoloured. Swap the FILE
   for a dark ground; never transform it. (docs/logo-usage-rules.md.) */
[dir="rtl"] .dk-header__logo,
[dir="rtl"] .dk-footer__mark {
  transform: none;
  filter: none;
  mix-blend-mode: normal;
  opacity: 1;
}

/* -------------------------------- 3. PERSIAN TYPOGRAPHY, RTL-SPECIFIC ----- */
/* Persian is right-aligned and NEVER justified: justification produces rivers
   and forces kashida-like gaps. WordPress and pasted editor markup both emit
   text-align: justify, so it is neutralised at the reading surface. */
[dir="rtl"] .dk-entry,
[dir="rtl"] .dk-entry p,
[dir="rtl"] .dk-entry li,
[dir="rtl"] .dk-entry .has-text-align-justify { text-align: start; }
[dir="rtl"] .dk-entry .has-text-align-left { text-align: start; }
[dir="rtl"] .dk-entry .has-text-align-right { text-align: end; }
[dir="rtl"] .dk-entry .has-text-align-center { text-align: center; }

/* Persian letters join. Letter-spacing breaks the joins, so tracking exists
   only on isolated uppercase Latin eyebrows and on VINs — never on a Persian
   run, and never inherited into one. */
[dir="rtl"] .dk-entry,
[dir="rtl"] .dk-entry p,
[dir="rtl"] .dk-entry h1,
[dir="rtl"] .dk-entry h2,
[dir="rtl"] .dk-entry h3,
[dir="rtl"] .dk-entry h4,
[dir="rtl"] .dk-entry h5,
[dir="rtl"] .dk-entry h6 { letter-spacing: normal; }

/* Vazirmatn has no true italic; a synthetic slant is wrong in Persian. */
[dir="rtl"] .dk-entry * { font-style: normal; }

/* Every Latin run stays LTR inside Persian copy. dir="ltr" alone is not enough
   — punctuation at the run boundary still reorders without isolation. */
[dir="rtl"] .dk-en,
[dir="rtl"] .dk-ltr,
[dir="rtl"] .dk-vin,
[dir="rtl"] .dk-num,
[dir="rtl"] .dk-entry code,
[dir="rtl"] .dk-entry pre,
[dir="rtl"] .dk-entry kbd,
[dir="rtl"] .dk-entry samp { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .dk-entry pre { text-align: start; }

/* ------------------------------- 4. WORDPRESS CORE PHYSICAL OUTPUT -------- */
/* Core emits float alignments as physical left/right and an editor's choice of
   "align left" means left on the page in either direction — so the floats are
   NOT swapped. Only the gutter beside the float is corrected, so the text
   never touches the image edge. */
[dir="rtl"] .dk-entry .alignleft  { float: left;  margin: 0 var(--space-4) var(--space-3) 0; }
[dir="rtl"] .dk-entry .alignright { float: right; margin: 0 0 var(--space-3) var(--space-4); }

/* Core list markup indents with padding-left. */
[dir="rtl"] .dk-entry ul,
[dir="rtl"] .dk-entry ol,
[dir="rtl"] .dk-comments__list .children,
[dir="rtl"] .dk-widget ul ul { padding-left: 0; padding-inline-start: var(--space-4); }
[dir="rtl"] .dk-entry dd { margin-left: 0; margin-inline-start: var(--space-4); }

/* The admin bar is LTR and anchors the sticky header offset; unchanged in RTL,
   restated so the header never loses its clearance under a logical rewrite. */
[dir="rtl"] .admin-bar .dk-header { top: 32px; }
@media screen and (max-width: 782px) {
  [dir="rtl"] .admin-bar .dk-header { top: 46px; }
}

/* ------------------------------------ 5. DIRECTIONAL GLYPHS --------------- */
/* Arrow glyphs are the one family that DOES mirror: in RTL "next" points left.
   Pagination handles this in theme-components.css; post navigation is this
   theme's own component, so it is handled here. One path, no duplicate markup. */
[dir="rtl"] .dk-post-nav__arrow { display: inline-block; }
[dir="rtl"] .dk-post-nav__item--prev .dk-post-nav__arrow { transform: scaleX(-1); }

/* Numeric fields and any tabular column stay LTR so digit groups never reorder. */
[dir="rtl"] .dk-input--latin,
[dir="rtl"] .dk-input--vin { direction: ltr; text-align: start; }
