/* =========================================================
   Sumer — right-to-left layer for the Arabic pages (ar/).
   Loaded after sumer-overrides.css, only on <html dir="rtl">.
   Flex and grid rows flip by themselves; this file handles the
   rest: the Arabic font, letter-spacing, and every left/right
   value in the template and in sumer-overrides.css.
   ========================================================= */

/* ---------- Type ---------- */
html[dir="rtl"] {
  /* main.css sets all text from this one variable (icon font is separate) */
  --font-inter-tight: "IBM Plex Sans Arabic", "Inter Tight", sans-serif;
}
/* any letter-spacing breaks the joins between Arabic letters */
[dir="rtl"] body * { letter-spacing: 0 !important; }
/* Arabic glyphs are taller: give headings and body text more room */
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3 { line-height: 1.4; }
[dir="rtl"] p, [dir="rtl"] li, [dir="rtl"] dd, [dir="rtl"] dt { line-height: 1.8; }
[dir="rtl"] .sumer-word { padding-bottom: 0.2em; margin-bottom: -0.2em; }
/* Latin-only bits stay left-to-right */
[dir="rtl"] .sumer-code pre { direction: ltr; text-align: left; }
[dir="rtl"] input[type="email"], [dir="rtl"] input[type="tel"] { direction: ltr; text-align: right; }
/* the odometer counters draw one column per digit — RTL would reverse "10" into "01" */
/* number-counter.js sizes each digit column from the line-height, so keep the 1.1 from overrides */
[dir="rtl"] .sumer-stat-num { direction: ltr; justify-content: flex-end; line-height: 1.1; font-family: "Inter Tight", sans-serif; }
/* the template's marquee animates assuming left-to-right; captions keep their own direction */
[dir="rtl"] .logos-marquee-container { direction: ltr; }
[dir="rtl"] .logos-marquee-container figcaption { direction: rtl; }

/* ---------- Template utilities with a physical side ---------- */
[dir="rtl"] .text-right { text-align: left; }
[dir="rtl"] .pl-1\.5 { padding-left: 0; padding-right: 0.375rem; }
[dir="rtl"] .pl-\[70px\] { padding-left: 29px; padding-right: 70px; }
[dir="rtl"] .ml-4 { margin-left: 0; margin-right: 1rem; }
[dir="rtl"] .ml-8 { margin-left: 0; margin-right: 2rem; }

/* ---------- Arrows point the reading way ---------- */
[dir="rtl"] .sumer-project-link svg,
[dir="rtl"] .sumer-back svg,
[dir="rtl"] .sumer-next-card svg,
[dir="rtl"] .sumer-sp-other svg { transform: scaleX(-1); }
[dir="rtl"] .sumer-project-card:hover .sumer-project-link svg { transform: scaleX(-1) translateX(3px); }

/* ---------- sumer-overrides.css components ---------- */
[dir="rtl"] .sumer-wall-caption { left: auto; right: 12px; }

[dir="rtl"] .sumer-included li { padding-left: 0; padding-right: 26px; }
[dir="rtl"] .sumer-included li::before { left: auto; right: 0; }

[dir="rtl"] .sumer-mini-timeline { padding-left: 0; padding-right: 26px; }
[dir="rtl"] .sumer-mini-timeline::before { left: auto; right: 6px; }
[dir="rtl"] .sumer-mini-timeline li::before { left: auto; right: -26px; }

[dir="rtl"] .sumer-faq-item p { padding: 0 0 18px 34px; }

[dir="rtl"] .sumer-proof li + li { border-left: 0; border-right: 1px solid var(--color-stroke-1); }
.dark[dir="rtl"] .sumer-proof li + li { border-right-color: var(--color-stroke-6); }
@media (max-width: 47.99rem) { [dir="rtl"] .sumer-proof li + li { border-right: 0; } }

@media (min-width: 48rem) {
  [dir="rtl"] .sumer-stat:first-child { padding-left: 32px; padding-right: 0; }
  [dir="rtl"] .sumer-stat + .sumer-stat { border-left: 0; border-right: 1px solid var(--color-stroke-2); }
  .dark[dir="rtl"] .sumer-stat + .sumer-stat { border-right-color: var(--color-stroke-6); }
}

/* process: the progress line fills from the right */
[dir="rtl"] .sumer-phase-track .progress-line { left: auto; right: 0; background-image: linear-gradient(270deg, #3d82f0, #84b0ff); }

/* services: the wide business-systems card mirrors (text right, dashboard left) */
@media (min-width: 64rem) {
  [dir="rtl"] .sumer-service--systems { padding: 32px 32px 0 0; }
  [dir="rtl"] .sumer-service--systems .sumer-mini-browser { left: auto; right: 40px; border-radius: 0 12px 0 0; }
}

/* screenshot viewer: "previous" sits on the right, "next" on the left */
[dir="rtl"] .sumer-lb-prev { left: auto; right: 20px; }
[dir="rtl"] .sumer-lb-next { right: auto; left: 20px; }
[dir="rtl"] .sumer-lb-prev svg, [dir="rtl"] .sumer-lb-next svg { transform: scaleX(-1); }
@media (max-width: 47.99rem) {
  [dir="rtl"] .sumer-lb-prev { left: auto; right: calc(50% - 60px); }
  [dir="rtl"] .sumer-lb-next { right: auto; left: calc(50% - 60px); }
}

/* language switch */
[dir="rtl"] .sumer-lang { font-family: "Inter Tight", sans-serif; }
