/*
 * Dr. Shahriyari — Arabic global typography v2.6.28
 * Scope: every frontend surface whose document language is Arabic (ar).
 * Font: Tajawal for headings, body copy and interface text.
 * The font binary is not bundled; Google Fonts is loaded only on Arabic pages.
 */

html[lang^="ar"],
body.dsh-lang-ar{
  --dsh-ar-font:"Tajawal","Noto Sans Arabic","Noto Kufi Arabic",Tahoma,Arial,sans-serif;
  --dsh-ar-h1:clamp(2.08rem,4.2vw,3.72rem);
  --dsh-ar-h2:clamp(1.68rem,2.85vw,2.65rem);
  --dsh-ar-h3:clamp(1.20rem,1.65vw,1.55rem);
  --dsh-ar-h4:clamp(1.05rem,1.25vw,1.28rem);
  font-family:var(--dsh-ar-font);
  font-kerning:normal;
  text-rendering:optimizeLegibility;
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

/*
 * Body/UI layer. Loaded after page-specific CSS so legacy Arabic font
 * declarations cannot fragment typography between Home, Blog, services,
 * treatment pages, article pages, navigation, cards, forms or CTAs.
 */
html[lang^="ar"] body,
body.dsh-lang-ar,
html[lang^="ar"] body :where(div,section,article,aside,main,header,footer,nav,p,ul,ol,li,dl,dt,dd,blockquote,figcaption,details,summary,label,a,button,input,textarea,select,option,table,thead,tbody,tfoot,tr,th,td,span,small,strong,b,em,i,time,address),
body.dsh-lang-ar :where(div,section,article,aside,main,header,footer,nav,p,ul,ol,li,dl,dt,dd,blockquote,figcaption,details,summary,label,a,button,input,textarea,select,option,table,thead,tbody,tfoot,tr,th,td,span,small,strong,b,em,i,time,address){
  font-family:var(--dsh-ar-font)!important;
  letter-spacing:0!important;
}

html[lang^="ar"] body,
body.dsh-lang-ar{
  font-size:1rem;
  line-height:1.82;
}

html[lang^="ar"] :where(p,li,dd,blockquote),
body.dsh-lang-ar :where(p,li,dd,blockquote){
  line-height:1.88!important;
}

html[lang^="ar"] :where(button,input,textarea,select,summary,.wp-element-button,.wp-block-button__link),
body.dsh-lang-ar :where(button,input,textarea,select,summary,.wp-element-button,.wp-block-button__link){
  font-size:clamp(.92rem,.9rem + .08vw,1rem);
  line-height:1.62;
  font-weight:500;
}

/*
 * Heading/title layer. Tajawal remains the only Arabic typeface, but semantic
 * hierarchy is created through restrained weight and responsive scale instead
 * of a second display font.
 */
html[lang^="ar"] :where(
  h1,h2,h3,h4,h5,h6,
  .wp-block-post-title,
  .wp-block-site-title,
  .wp-block-query-title,
  .wp-block-heading,
  .dsh-abt260-mast__brand,
  [class*="__title"],
  [class*="-title"]
),
body.dsh-lang-ar :where(
  h1,h2,h3,h4,h5,h6,
  .wp-block-post-title,
  .wp-block-site-title,
  .wp-block-query-title,
  .wp-block-heading,
  .dsh-abt260-mast__brand,
  [class*="__title"],
  [class*="-title"]
){
  font-family:var(--dsh-ar-font)!important;
  font-style:normal;
  font-synthesis:none;
  letter-spacing:0!important;
  word-spacing:normal;
  text-wrap:balance;
}

html[lang^="ar"] :where(h1,.wp-block-post-title,.wp-block-site-title),
body.dsh-lang-ar :where(h1,.wp-block-post-title,.wp-block-site-title){
  font-size:var(--dsh-ar-h1)!important;
  font-weight:800!important;
  line-height:1.24!important;
  max-width:24ch;
}

html[lang^="ar"] :where(h2,.wp-block-query-title),
body.dsh-lang-ar :where(h2,.wp-block-query-title){
  font-size:var(--dsh-ar-h2)!important;
  font-weight:700!important;
  line-height:1.32!important;
}

html[lang^="ar"] h3,
body.dsh-lang-ar h3{
  font-size:var(--dsh-ar-h3)!important;
  font-weight:700!important;
  line-height:1.42!important;
}

html[lang^="ar"] :where(h4,h5,h6),
body.dsh-lang-ar :where(h4,h5,h6){
  font-size:var(--dsh-ar-h4)!important;
  font-weight:700!important;
  line-height:1.48!important;
}

html[lang^="ar"] :where(h1,h2,h3,h4,h5,h6,.wp-block-post-title,.wp-block-site-title,.wp-block-query-title,[class*="__title"],[class*="-title"]) :where(a,span,strong,b,em,i),
body.dsh-lang-ar :where(h1,h2,h3,h4,h5,h6,.wp-block-post-title,.wp-block-site-title,.wp-block-query-title,[class*="__title"],[class*="-title"]) :where(a,span,strong,b,em,i){
  font-family:inherit!important;
  font-weight:inherit!important;
  letter-spacing:inherit!important;
}

/* Preserve component scale for non-heading title elements while standardizing weight. */
html[lang^="ar"] :where([class*="__title"],[class*="-title"]):not(h1):not(h2):not(h3):not(h4):not(h5):not(h6),
body.dsh-lang-ar :where([class*="__title"],[class*="-title"]):not(h1):not(h2):not(h3):not(h4):not(h5):not(h6){
  font-weight:700!important;
  line-height:1.42!important;
}

/* Branding remains authoritative but avoids display-scale inflation in Arabic. */
html[lang^="ar"] .dsh-abt260-mast__brand,
body.dsh-lang-ar .dsh-abt260-mast__brand{
  font-size:clamp(1.9rem,4.5vw,3.25rem)!important;
  font-weight:800!important;
  line-height:1.25!important;
}

/* Navigation, breadcrumbs, buttons, cards, forms and compact UI stay crisp. */
html[lang^="ar"] :where(.dsh-header,.dsh-nav,.dsh-breadcrumb,.dsh-button,.wp-block-navigation,.wp-block-button),
body.dsh-lang-ar :where(.dsh-header,.dsh-nav,.dsh-breadcrumb,.dsh-button,.wp-block-navigation,.wp-block-button){
  font-family:var(--dsh-ar-font)!important;
}

/* Code/technical literals should retain a proper monospace face. */
html[lang^="ar"] :where(code,pre,kbd,samp),
body.dsh-lang-ar :where(code,pre,kbd,samp){
  font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace!important;
  letter-spacing:normal!important;
}

@media (max-width:782px){
  html[lang^="ar"],body.dsh-lang-ar{
    --dsh-ar-h1:clamp(1.95rem,8.4vw,2.72rem);
    --dsh-ar-h2:clamp(1.52rem,6.7vw,2.12rem);
    --dsh-ar-h3:clamp(1.14rem,4.7vw,1.40rem);
  }
  html[lang^="ar"] body,
  body.dsh-lang-ar{
    font-size:1rem;
  }
}

@media (max-width:420px){
  html[lang^="ar"],body.dsh-lang-ar{
    --dsh-ar-h1:clamp(1.86rem,9vw,2.42rem);
    --dsh-ar-h2:clamp(1.44rem,7vw,1.92rem);
  }
}
