/* BAZSA R11.3.1 — Typography Identity System
 * Licensed IRANSansX Variable (FaNum) is provisioned by the platform owner and
 * injected as @font-face by Assets.php. This file contains no proprietary font binary.
 */
:root{
  --bazsa-font-family:'BAZSA IRANSansX FaNum','BAZSA IRANSansX',Tahoma,Arial,sans-serif;
  --bazsa-font-family-latin:'BAZSA IRANSansX Latin','BAZSA IRANSansX FaNum','BAZSA IRANSansX',Tahoma,Arial,sans-serif;
  --bazsa-font-mono:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,'Liberation Mono',monospace;
  --bz-fw-regular:400;
  --bz-fw-body:450;
  --bz-fw-medium:500;
  --bz-fw-control:550;
  --bz-fw-semibold:600;
  --bz-fw-section:650;
  --bz-fw-bold:700;
  --bz-type-2xs:9px;
  --bz-type-xs:10px;
  --bz-type-sm:11px;
  --bz-type-meta:12px;
  --bz-type-body:13px;
  --bz-type-control:13px;
  --bz-type-card:14px;
  --bz-type-section:16px;
  --bz-type-page:18px;
  --bz-type-display:22px;
  --bz-leading-tight:1.42;
  --bz-leading-compact:1.55;
  --bz-leading-body:1.72;
  --bz-leading-relaxed:1.86;
}

#bazsa-app,
#bazsa-auth,
.bazsa-external-portal,
.bazsa-admin,
.bazsa-admin-wrap,
.bazsa-toasts{
  font-family:var(--bazsa-font-family);
  font-synthesis:none;
  font-kerning:normal;
  text-rendering:optimizeLegibility;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

#bazsa-app :is(button,input,textarea,select,optgroup),
#bazsa-auth :is(button,input,textarea,select,optgroup),
.bazsa-external-portal :is(button,input,textarea,select,optgroup),
.bazsa-admin :is(button,input,textarea,select,optgroup),
.bazsa-admin-wrap :is(button,input,textarea,select,optgroup),
.bazsa-toasts :is(button,input,textarea,select,optgroup){
  font-family:inherit;
}

#bazsa-app :is(code,pre,kbd,samp),
#bazsa-auth :is(code,pre,kbd,samp),
.bazsa-external-portal :is(code,pre,kbd,samp),
.bazsa-admin :is(code,pre,kbd,samp),
.bazsa-admin-wrap :is(code,pre,kbd,samp){
  font-family:var(--bazsa-font-mono);
}


/* Persian UI uses FaNum; identifiers, phone numbers, URLs and explicit LTR data
 * switch to the companion Latin Variable face from the same licensed package. */
#bazsa-app :is([dir="ltr"],.ltr,.is-ltr,input[type="email"],input[type="url"],input[type="tel"]),
#bazsa-auth :is([dir="ltr"],.ltr,.is-ltr,input[type="email"],input[type="url"],input[type="tel"]),
.bazsa-external-portal :is([dir="ltr"],.ltr,.is-ltr,input[type="email"],input[type="url"],input[type="tel"]),
.bazsa-admin :is([dir="ltr"],.ltr,.is-ltr,input[type="email"],input[type="url"],input[type="tel"]),
.bazsa-admin-wrap :is([dir="ltr"],.ltr,.is-ltr,input[type="email"],input[type="url"],input[type="tel"]){
  font-family:var(--bazsa-font-family-latin);
}

/* Stable numeric rhythm for dashboards and dense operational tables. */
#bazsa-app :is(.kpi,.metric,[class*="-kpi"],[class*="-metric"],[data-count],[data-value]) :is(b,strong,em,span),
.bazsa-admin :is(.bazsa-admin-kpi,.bazsa-seat-line) :is(b,strong,span){
  font-variant-numeric:tabular-nums;
}


/* R11.T1.2 — Typography delivery repair.
 * The Settings page may correctly install the licensed font while older UI layers
 * still win the cascade. This final scoped rule makes the application visibly
 * use the provisioned IRANSansX family without touching WordPress admin chrome.
 */
html body #bazsa-app,
html body #bazsa-app :where(.bz-shell,.bz-shell *,.bz-topbar,.bz-topbar *,.bz-sub,.bz-sub *,.bz-main,.bz-main *,.bz-page,.bz-page *,.bz-panel,.bz-panel *,.dr-panel,.dr-panel *,.dr-body,.dr-body *,button,input,textarea,select,optgroup),
html body .bazsa-external-portal,
html body .bazsa-external-portal :where(*,button,input,textarea,select,optgroup),
html body #bazsa-auth,
html body #bazsa-auth :where(*,button,input,textarea,select,optgroup),
html body .bazsa-admin-wrap,
html body .bazsa-admin-wrap :where(*,button,input,textarea,select,optgroup){
  font-family:var(--bazsa-font-family)!important;
}
html body #bazsa-app :where([dir="ltr"],.ltr,.is-ltr,input[type="email"],input[type="url"],input[type="tel"],code,pre,kbd,samp),
html body .bazsa-external-portal :where([dir="ltr"],.ltr,.is-ltr,input[type="email"],input[type="url"],input[type="tel"],code,pre,kbd,samp),
html body #bazsa-auth :where([dir="ltr"],.ltr,.is-ltr,input[type="email"],input[type="url"],input[type="tel"],code,pre,kbd,samp),
html body .bazsa-admin-wrap :where([dir="ltr"],.ltr,.is-ltr,input[type="email"],input[type="url"],input[type="tel"],code,pre,kbd,samp){
  font-family:var(--bazsa-font-family-latin)!important;
}


/* R12.1.1 — Font delivery hardening.
 * Avoid unscoped local('IRANSansX') dependency: the same visual result must appear
 * on machines that do not have the font installed locally. The PHP delivery endpoint
 * provides MIME, CORS, ETag and immutable caching consistently across hosts.
 */
html body #bazsa-app[data-r11-typography="active"],
html body #bazsa-app[data-r11-typography="active"] :where(.bz-shell,.bz-shell *,.bz-topbar,.bz-topbar *,.bz-main,.bz-main *,.bz-page,.bz-page *,.bz-card,.bz-card *,.dr-panel,.dr-panel *,button,input,textarea,select,optgroup){
  font-family:var(--bazsa-font-family)!important;
}
