/* MomentSphere 3.8.89 — global platform typography bridge */
:root{
  --app-font-family-en:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",Arial,sans-serif;
  --app-font-family-ar:"Cairo","Noto Sans Arabic",Tahoma,Arial,sans-serif;
  --app-font-family:var(--app-font-family-en);
}
html[lang="ar"]{--app-font-family:var(--app-font-family-ar)}
html[lang="en"]{--app-font-family:var(--app-font-family-en)}

/* Admin and every standard public route rendered by render_header(). */
body.app-body,
body.admin-body{font-family:var(--app-font-family)!important}
body.app-body :where(h1,h2,h3,h4,h5,h6,p,a,span,strong,small,label,li,blockquote,figcaption,legend,summary,dt,dd,th,td,button,input,select,textarea,option,optgroup,table,.tooltip,.popover,.modal,.offcanvas,dialog),
body.admin-body :where(h1,h2,h3,h4,h5,h6,p,a,span,strong,small,label,li,blockquote,figcaption,legend,summary,dt,dd,th,td,button,input,select,textarea,option,optgroup,table,.tooltip,.popover,.modal,.offcanvas,dialog){font-family:var(--app-font-family)!important}

/* Direct-rendered occasion/album themes keep their configured heading/body roles.
   When Platform Identity > Apply platform fonts to event themes is enabled, PHP
   resolves both variables to the selected English or Arabic platform preset. */
body.event-theme-page{font-family:var(--event-body,var(--app-font-family))!important}
body.event-theme-page :where(p,a,span,strong,small,label,li,blockquote,figcaption,button,input,select,textarea,option,table,.tooltip,.popover,dialog){font-family:var(--event-body,var(--app-font-family))!important}
body.event-theme-page :where(h1,h2,h3,h4,h5,h6){font-family:var(--event-heading,var(--event-body,var(--app-font-family)))!important}

/* Cinematic Story is rendered outside render_header(), therefore it receives
   dedicated story variables from story.php. */
body.cinematic-story-page{font-family:var(--story-body,var(--app-font-family))!important}
body.cinematic-story-page :where(p,a,span,strong,small,label,li,blockquote,figcaption,button,input,select,textarea,option,table,.tooltip,.popover,dialog){font-family:var(--story-body,var(--app-font-family))!important}
body.cinematic-story-page :where(h1,h2,h3,h4,h5,h6){font-family:var(--story-heading,var(--story-body,var(--app-font-family)))!important}

/* Bilingual fragments may opt into the other configured language family even
   while the surrounding interface uses a different language. */
body :where([lang="ar"],[dir="rtl"]):not(.bi){font-family:var(--app-font-family-ar)!important}
body :where([lang="en"],[dir="ltr"]):not(.bi){font-family:var(--app-font-family-en)!important}

/* Preserve technical and icon typography. */
body :where(code,pre,kbd,samp){font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono",monospace!important}
body :where(.bi){font-family:"bootstrap-icons"!important}

/* Platform Identity must preview the uploaded face itself, not the currently active platform face. */
body.admin-body .custom-font-preview,
body.admin-body .custom-font-preview :where(strong,span){font-family:var(--custom-font),var(--app-font-family)!important}
