/* billjalouk.com, Arabic. Plain CSS, no build step. Loaded only by the pages under /ar/, after lang.css.
   It brings three things: the Arabic font, the rules Arabic letters need, and the layout mirrored for a page
   that runs right to left. English and German never load this file.
   Font chosen by Bill on 2026-11-13: IBM Plex Sans Arabic, weights 300 and 700, self-hosted
   (Fontsource 5.3.0, SIL Open Font License, licence text beside the files).
   Layout approved by Bill from pictures on 2026-11-13: every page mirrored. The map, the name object, the
   previews, the binary of the door and the flags stay as they are. */

/* ---------- the font: Arabic letters only. Latin letters and digits stay in Fraunces.
   The two font files are declared in lang.css, which every page loads before this file. ---------- */
:root { --font: "Fraunces", "IBM Plex Sans Arabic"; }

/* ---------- what Arabic letters need ---------- */
/* no letter spacing: it tears joined letters apart. The Latin pieces that are spaced on purpose keep theirs. */
:lang(ar) *:not(.home):not(.e-name):not(.l):not(.access):not(.access-bits):not(.bit):not(.simple-cipher):not(bdi) { letter-spacing: 0; }
/* the marks above and below the letters need more room than Latin capitals */
:lang(ar) :is(.headline, .simple-title, .name, .title, .stop-city, .group-name, .p-title, .tail-title) { line-height: 1.25; }
:lang(ar) .card-title { line-height: 1.3; }

/* ---------- pieces that stay left to right inside the right-to-left page ---------- */
/* the name object: its letters are separate boxes, so their order must not turn. The binary of the door.
   The email and the link. Every canvas: the previews and the wire objects are drawn left to right. */
.e-name, .access-bits, .simple-cipher, .contact-item, canvas { direction: ltr; unicode-bidi: isolate; }
/* a line that is English from start to end runs left to right, and still starts at the right edge */
.certs li[dir="ltr"] { text-align: right; }

/* ---------- homepage ---------- */
.lang-home { left: auto; right: calc(var(--pad) * 0.8 + env(safe-area-inset-right, 0px)); }
.lang-home .lang-menu { left: auto; right: 0; }
.access { right: auto; left: calc(var(--pad) * 0.8 + env(safe-area-inset-left, 0px)); }
.card { padding: 22px 24px 20px 22px; }
.card::before, .lang-menu::before { left: auto; right: -1px; }
.headline .caret { margin-left: 0; margin-right: 0.04em; }
/* words are written from the right. home.js moves the agents the same way. */
.card-title { clip-path: inset(-4px -4px -4px calc((1 - var(--text-in)) * 100%)); }
html:not(.arrived) .lang-home summary { clip-path: inset(-6px -6px -6px calc((1 - var(--lang-in)) * 100%)); }
.lang-d summary::after { margin-left: 0; margin-right: 1px; }
.lang-item.is-on::after { margin-left: 0; margin-right: auto; }
.skip { right: auto; left: calc(6px + env(safe-area-inset-left, 0px)); }
.pause { left: auto; right: calc(6px + env(safe-area-inset-right, 0px)); }

/* ---------- the other pages: the name sits top right, the switch top left ---------- */
.home { left: auto; right: calc(var(--pad) - 10px + env(safe-area-inset-right, 0px)); }
.lang-sub { right: auto; left: calc(var(--pad) - 6px + env(safe-area-inset-left, 0px)); }
.lang-sub .lang-menu { right: auto; left: 0; }

/* ---------- CV ---------- */
.stop { padding: 0 30px clamp(56px, 10vh, 120px) 0; }
.stop-mark { left: auto; right: 0; }
.rail { left: auto; right: 5px; }
.hl li, .certs li { padding-left: 0; padding-right: 18px; }
.hl li::before, .certs li::before { left: auto; right: 0; }
.tail { padding-left: 0; padding-right: 30px; }
.cv .back { margin: 40px 30px 0 0; }
@media (min-width: 1024px) {
  .map, .stack-pin { padding: clamp(32px, 7vh, 80px) var(--pad) clamp(32px, 7vh, 80px) clamp(16px, 2vw, 40px); }
  .text-col { padding: 16svh 0 12vh clamp(32px, 6vw, 120px); }
}
@media (min-width: 1600px) { .text-col { padding-left: clamp(32px, 6vw, 120px); padding-right: clamp(0px, 2vw, 40px); } }

/* ---------- Skills ---------- */
.proof { padding-left: 0; padding-right: 14px; border-left: 0; border-right: 2px solid var(--accent); }
/* The pile and its names are one drawing, placed with arithmetic. It is mirrored whole, so the names sit between
   the pile and the text as they do in English. The names and the symbols are turned back, so they read normally. */
.stage { transform: scaleX(-1); }
.names .name { transform: scaleX(-1); }
.marks .mark { transform: rotateX(-62deg) scaleX(-1); }

/* ---------- Projects ---------- */
.shelf-item::after { transform-origin: 100% 50%; }
.p-result dd { padding-left: 0; padding-right: 12px; border-left: 0; border-right: 2px solid var(--accent); }
.peek-open::before { left: auto; right: -1px; }
.peek-grow { right: auto; left: 0; }
/* the title of the larger preview is written by the script: a Latin name keeps its own direction */
.pd-title { unicode-bidi: plaintext; }
