/* ============================================================
   MOTS — self-hosted fonts
   Replaces fonts.googleapis.com so no client IP is sent to Google.
   Files: /assets/fonts/*.woff2   Subset: latin (covers EN + FR)
   ============================================================ */

@font-face {
  font-family: 'Rajdhani';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/rajdhani-latin-500-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Rajdhani';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/rajdhani-latin-600-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Rajdhani';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/rajdhani-latin-700-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/inter-latin-400-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/inter-latin-500-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/inter-latin-600-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/inter-latin-700-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/inter-latin-800-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url('../fonts/inter-latin-900-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/space-grotesk-latin-500-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/space-grotesk-latin-600-normal.woff2') format('woff2');
}

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('../fonts/space-grotesk-latin-700-normal.woff2') format('woff2');
}



/* ═══════════════════════════════════════════════════════════════════════
   BRAND LOCKUP — one image, v22
   ═══════════════════════════════════════════════════════════════════════
   The markup is partials/brand_lockup.php and it renders a single <img>.

   There is nothing to derive any more. The mark is slanted — the S's
   top-right tip sits ~100px further right than its bottom (824px bounding
   box against ~723px from M-bottom to S-bottom) — so a symmetric CSS inset
   could never align PERFORMANCE to it. The artwork carries the alignment.

   Sized by WIDTH so the MOTS mark stays exactly the size it was; the height
   follows the 824:237 aspect ratio. The width arrives inline from the
   partial, which is where the two sizes live.
   ═══════════════════════════════════════════════════════════════════════ */
.brand {
  display: block;
  flex-shrink: 0;
  text-decoration: none;
  direction: ltr;            /* the lockup never mirrors, in any language */
  line-height: 0;            /* no descender gap under the image */
}

.brand-mark {
  display: block;
  height: auto;              /* width is set inline; height follows the ratio */
  max-width: none;
}

/* ═══════════════════════════════════════════════════════════════════════
   LATIN / TECHNICAL FIELDS — never mirror
   ═══════════════════════════════════════════════════════════════════════
   An <input> with no direction of its own inherits the page's. On the Arabic
   pages that is RTL, and @ . + - / _ are bidi-NEUTRAL characters, so the
   browser reorders the runs around them for display only:

       typed   c.benzaamouche@gmail.com
       painted gmail.comc.benzaamouche@

   The value posted and the value stored are correct either way. The damage is
   that the visitor cannot read back what they typed, assumes they made a
   mistake, and abandons the signup — which is exactly what happened.

   dir="ltr" on the element already implies text-align:start, i.e. left, and
   that attribute is the real fix because it does not depend on this file
   arriving. The declarations below restate it so that no form-level
   text-align can win, and the type selectors catch any field added later
   without the attribute.

   This lives in fonts.css because it is the ONE stylesheet every page loads —
   signup.php, check.php and payment.php load nothing else.
   ═══════════════════════════════════════════════════════════════════════ */
input[dir="ltr"],
textarea[dir="ltr"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="url"],
input[type="number"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="month"],
input[type="week"] {
  direction: ltr;
  text-align: left;
}

/* Human-language fields follow whatever the person types: Arabic goes RTL,
   Latin goes LTR, and the alignment follows the direction rather than fighting
   it. text-align:start is what makes an Arabic name sit on the right. */
input[dir="auto"],
textarea[dir="auto"] {
  text-align: start;
}

/* ═══════════════════════════════════════════════════════════════════════
   ARABIC LINE HEIGHT — descenders need room
   ═══════════════════════════════════════════════════════════════════════
   Arabic sits in a deeper box than Latin. The tails on ي ج ص ط are painted
   BELOW the line box, so a line-height tuned on Latin does not overflow —
   scrollHeight still equals clientHeight — it simply gets cut by whatever
   overflow:hidden is nearby. That is why this was invisible to every
   measurement we had: nothing was overflowing, the ink was just outside.

   Measured on the Arabic pages before this rule:
     index.php  h1        34px / 34.68px   = 1.02x
     index.php  .price    42px / 42px      = 1.00x
     check.php  h1        25px / 31.25px   = 1.25x
     check.php  h2        19px / 25.65px   = 1.35x

   ONE rule, here, because fonts.css is the only stylesheet every page
   loads — the same reason the brand lockup lives here. Per-page copies of
   this would drift within two releases.

   The baseline is inherited, so it only reaches elements that do not set
   their own. Components that DO set a tight value are listed below and
   need !important to beat a style= attribute; that list is deliberately
   short and names categories rather than pages.
   ═══════════════════════════════════════════════════════════════════════ */
:lang(ar) {
  line-height: 1.75;
}

/* Display type: 1.75 on a 34px headline is too airy, but 1.02 cuts the
   glyph. 1.45 clears the descender and still reads as a headline. */
:lang(ar) h1,
:lang(ar) h2,
:lang(ar) h3,
:lang(ar) h4,
:lang(ar) .price,
:lang(ar) .price small {
  line-height: 1.45 !important;
}

/* Buttons, chips, tabs, badges and pills: these are the fixed-height
   things, and a tight line-height inside a fixed box is what clips.
   overflow is deliberately NOT touched — several of these rely on it for
   truncation, and loosening the line is enough to clear the ink. */
:lang(ar) button,
:lang(ar) .btn,
:lang(ar) .btn-gold,
:lang(ar) .btn-ghost,
:lang(ar) [class*="chip"],
:lang(ar) [class*="tab"],
:lang(ar) [class*="badge"],
:lang(ar) [class*="pill"],
:lang(ar) .sc-name {
  line-height: 1.6 !important;
}

/* ── Arabic is cursive: never track it, never case it ──────────────────
   assets/css/client-shell.css has carried this rule since v17, but that
   stylesheet is loaded by the CLIENT pages only. index.php, signup.php,
   check.php, payment.php and login.php load fonts.css and nothing else, so
   the rule never reached the pages an Arabic buyer sees FIRST. Measured at
   386px before this block: 39 letter-spaced or uppercased Arabic elements
   on index.php, 33 on signup.php, 43 on check.php.

   letter-spacing on Arabic forces the joined letterforms apart, which is
   what makes the script look broken rather than merely wide.
   text-transform has nothing to act on — Arabic has no case — but it is
   normalised here too so a Latin word inside an Arabic sentence is not
   shouted.

   Same shape as the client-shell rule, including !important: it is one
   declaration instead of an edit to every component and every style=
   attribute on five pages. */
:lang(ar), :lang(ar) * {
  letter-spacing: normal !important;
  text-transform: none !important;
}

/* Latin islands on an Arabic page keep their own treatment: the language
   switcher's code (AR / FR / EN) and the wordmark are Latin by definition.
   Values are restated rather than reverted — `revert` would go to the
   browser default, not to the rule these are excepted from. */
:lang(ar) .mots-lang > summary {
  letter-spacing: .08em !important;
}

/* ═══════════════════════════════════════════════════════════════════════
   16px FLOOR ON EVERY FORM CONTROL — stops iOS Safari zooming
   ═══════════════════════════════════════════════════════════════════════
   iOS Safari zooms the whole page when a focused input's computed
   font-size is under 16px. That is the only trigger. It is not a viewport
   problem and it must NOT be "fixed" with maximum-scale=1 or
   user-scalable=no: that stops the zoom by stopping pinch-zoom entirely,
   which is an accessibility failure and something Google Play flags.
   16px is the actual fix.

   HERE, not in mots.css. 17 pages load fonts.css and NOT mots.css —
   including signup.php, check.php, payment.php and every client page.
   A rule in mots.css would miss the signup email field, which is the exact
   field that triggered this. fonts.css is the only stylesheet all 44 pages
   load; same reason the brand lockup lives here.

   !important because there are 42 existing rules and 11 inline styles that
   set a control below 16px, and nearly all of them are more specific than
   a bare element selector — `.field input { font-size:14px }` beats
   `input { font-size:16px }` on specificity no matter the load order.
   One declaration instead of 53 edits across 30 files.

   Nothing in the codebase sets a form control ABOVE 16px, checked, so this
   is a floor and cannot shrink anything.
   ═══════════════════════════════════════════════════════════════════════ */
input,
select,
textarea {
  font-size: 16px !important;
}

/* v79 — ARABIC. IBM Plex Sans Arabic (SIL OFL 1.1), self-hosted like the rest.
   Declared UNDER the Inter and Rajdhani names, restricted to Arabic code
   points: every stack that already says 'Inter' or 'Rajdhani' now draws
   Arabic with Plex instead of whatever the phone happens to have, and
   Latin text is untouched. A browser downloads these files only when a
   page actually shows Arabic. */
@font-face { font-family:'Inter'; font-style:normal; font-weight:400; font-display:swap;
  src:url('../fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2') format('woff2'); unicode-range:U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E; }
@font-face { font-family:'Inter'; font-style:normal; font-weight:500; font-display:swap;
  src:url('../fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2') format('woff2'); unicode-range:U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E; }
@font-face { font-family:'Inter'; font-style:normal; font-weight:600; font-display:swap;
  src:url('../fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2') format('woff2'); unicode-range:U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E; }
@font-face { font-family:'Inter'; font-style:normal; font-weight:700; font-display:swap;
  src:url('../fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2') format('woff2'); unicode-range:U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E; }
@font-face { font-family:'Inter'; font-style:normal; font-weight:800; font-display:swap;
  src:url('../fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2') format('woff2'); unicode-range:U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E; }
@font-face { font-family:'Inter'; font-style:normal; font-weight:900; font-display:swap;
  src:url('../fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2') format('woff2'); unicode-range:U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E; }
@font-face { font-family:'Rajdhani'; font-style:normal; font-weight:400; font-display:swap;
  src:url('../fonts/ibm-plex-sans-arabic-arabic-400-normal.woff2') format('woff2'); unicode-range:U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E; }
@font-face { font-family:'Rajdhani'; font-style:normal; font-weight:500; font-display:swap;
  src:url('../fonts/ibm-plex-sans-arabic-arabic-500-normal.woff2') format('woff2'); unicode-range:U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E; }
@font-face { font-family:'Rajdhani'; font-style:normal; font-weight:600; font-display:swap;
  src:url('../fonts/ibm-plex-sans-arabic-arabic-600-normal.woff2') format('woff2'); unicode-range:U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E; }
@font-face { font-family:'Rajdhani'; font-style:normal; font-weight:700; font-display:swap;
  src:url('../fonts/ibm-plex-sans-arabic-arabic-700-normal.woff2') format('woff2'); unicode-range:U+0600-06FF, U+0750-077F, U+0870-089F, U+08A0-08FF, U+FB50-FDFF, U+FE70-FEFF, U+200C-200E; }
