/* ═══════════════ e'thix — foundation (loaded after core.css on every page) ═══════════════
   Cross-cutting fixes that belong to no single screen: touch, zoom, viewport, Arabic text, focus, motion.
   Rules here are deliberately low in specificity so a component can still say otherwise on purpose.

   ZOOM. Nothing here (or anywhere) sets user-scalable=no or maximum-scale: people must keep pinch zoom. The two
   accidental zooms are fixed at their cause instead:
   - double-tap zoom on a control that was tapped twice quickly: touch-action:manipulation on controls (pinch still works);
   - iOS zooming into any focused field drawn under 16px: fields are at least 16px on touch screens. */

a,button,summary,label,select,input,textarea,[role="button"],[role="tab"],[role="menuitem"],[role="option"],[role="switch"]{touch-action:manipulation}

@media (pointer:coarse){
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="file"]),
  textarea,select{font-size:max(16px,1em)}
}

/* Controls are not text: a long press on a button or chip must not start a text selection or the iOS callout. */
button,[role="button"],[role="tab"],summary,.chip,.b,.ib{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}

/* Scroll containers keep their own scroll: reaching the end of a sheet or the sidebar must not scroll or bounce the page
   behind it (the scroll-chaining that makes a background move under a modal). */
dialog,[role="dialog"],.sheet,.pop,.menu,.side-scroll,.drawer{overscroll-behavior:contain}

/* Arabic is a joined script: letter-spacing pulls its letters apart and breaks the joins. Tracking stays for Latin labels
   only, wherever a stylesheet added it to a class that also carries Arabic text. */
:lang(ar) .eyebrow,:lang(ar) .kicker,:lang(ar) .eyebrow .ar,:lang(ar) .badge:not([dir="ltr"]){letter-spacing:0}

/* Numbers that sit in rows or change while you watch (money, counts, percentages) keep their width. */
.tnum,time,[data-num]{font-variant-numeric:tabular-nums}

/* Mixed Arabic and Latin: a Latin run (a law code, an e-mail, "Ethix Core") inside Arabic keeps its own direction. */
bdi,.ltr,code,kbd,samp{unicode-bidi:isolate}

/* Long unbroken strings (URLs, file names, hashes) wrap inside their box instead of widening the page. */
p,li,dd,td,th,blockquote,figcaption{overflow-wrap:break-word}

/* Keyboard focus: one visible ring everywhere, never on mouse or touch focus. */
:focus:not(:focus-visible){outline:none}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important;scroll-behavior:auto !important}
}
