/*
 * Nawatej Plus — School Typography System / Phase 3.2
 * Deployment target: school application UI
 * Phase 3 extends the approved identity to legacy standalone school screens and all print/report previews.
 * Typography mirrors the public landing page:
 * - Cairo: display headings
 * - IBM Plex Sans Arabic: body/UI/controls/tables
 */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@600;700;800;900&family=IBM+Plex+Sans+Arabic:wght@400;500;600;700&display=swap');
@import url("/assets/css/nawatej-print-system.css?v=20260812.5");

:root{
    --nw-font-display:"Cairo","Noto Sans Arabic","Segoe UI",Tahoma,Arial,sans-serif;
    --nw-font-body:"IBM Plex Sans Arabic","Noto Sans Arabic","Segoe UI",Tahoma,Arial,sans-serif;
    --nw-font-print:"IBM Plex Sans Arabic","Noto Sans Arabic","Segoe UI",Tahoma,Arial,sans-serif;
}

/*
 * Strong scoped selectors intentionally override the legacy mix of
 * Tahoma/Cairo/Noto/Tajawal inside school pages without touching icons,
 * SVG, QR/barcode rendering, monospace code, or public pages.
 */
html[dir="rtl"] :is(body.nw-school-ui[class],body.nwd-page,body.nw-typography),
html[dir="rtl"] :is(body.nw-school-ui[class],body.nwd-page,body.nw-typography) :where(
    p,a,span,small,strong,b,em,time,label,li,ol,ul,
    button,input,select,textarea,option,
    table,thead,tbody,tfoot,tr,th,td,caption,
    fieldset,legend,blockquote,dl,dt,dd
){
    font-family:var(--nw-font-body)!important;
}

html[dir="rtl"] :is(body.nw-school-ui[class],body.nwd-page,body.nw-typography) :where(h1,h2,h3,h4,h5,h6){
    font-family:var(--nw-font-display)!important;
}

/* Keep technical/verification strings stable. */
html[dir="rtl"] :is(body.nw-school-ui[class],body.nwd-page,body.nw-typography) :where(code,pre,kbd,samp){
    font-family:ui-monospace,SFMono-Regular,Consolas,"Liberation Mono",monospace!important;
}


/* Phase 3: standalone school screens that do not use the unified school shell. */
html[dir="rtl"] body.nw-typography{
    font-family:var(--nw-font-body)!important;
}
html[dir="rtl"] body.nw-typography :where(
    .page-title,.hero-title,.document-title,.doc-title,.report-title,.certificate-title,
    .section-title,.card-title,.panel-title,.modal-title,.print-title
){
    font-family:var(--nw-font-display)!important;
}

/* Dedicated printable documents and report previews. Do not target icon <i> elements,
   SVG, canvas, QR/barcode containers, or monospace verification strings. */
html[dir="rtl"] body.nw-print-document,
html[dir="rtl"] body.nw-print-document :where(
    p,a,span,small,strong,b,em,time,label,li,ol,ul,button,input,select,textarea,option,
    table,thead,tbody,tfoot,tr,th,td,caption,fieldset,legend,blockquote,dl,dt,dd
){
    font-family:var(--nw-font-print)!important;
}
html[dir="rtl"] body.nw-print-document :where(
    h1,h2,h3,h4,h5,h6,.document-title,.doc-title,.report-title,.certificate-title,.print-title
){
    font-family:var(--nw-font-display)!important;
}

/* Make print output inherit the same approved school identity. */
@media print{
    html[dir="rtl"] :is(body.nw-school-ui[class],body.nwd-page,body.nw-typography),
    html[dir="rtl"] :is(body.nw-school-ui[class],body.nwd-page,body.nw-typography) :where(
        p,a,span,small,strong,b,em,time,label,li,ol,ul,
        button,input,select,textarea,option,
        table,thead,tbody,tfoot,tr,th,td,caption,
        fieldset,legend,blockquote,dl,dt,dd
    ){
        font-family:var(--nw-font-print)!important;
    }
    html[dir="rtl"] :is(body.nw-school-ui[class],body.nwd-page,body.nw-typography) :where(h1,h2,h3,h4,h5,h6){
        font-family:var(--nw-font-display)!important;
    }
}


/* Phase 3 print hardening: loaded last to neutralize old Tahoma/Tajawal print rules. */
@media print{
    html[dir="rtl"] body.nw-typography,
    html[dir="rtl"] body.nw-print-document,
    html[dir="rtl"] body.nw-typography :where(p,a,span,small,strong,b,em,time,label,li,ol,ul,table,thead,tbody,tfoot,tr,th,td,caption,fieldset,legend,blockquote,dl,dt,dd),
    html[dir="rtl"] body.nw-print-document :where(p,a,span,small,strong,b,em,time,label,li,ol,ul,table,thead,tbody,tfoot,tr,th,td,caption,fieldset,legend,blockquote,dl,dt,dd){
        font-family:var(--nw-font-print)!important;
    }
    html[dir="rtl"] body.nw-typography :where(h1,h2,h3,h4,h5,h6,.document-title,.doc-title,.report-title,.certificate-title,.print-title),
    html[dir="rtl"] body.nw-print-document :where(h1,h2,h3,h4,h5,h6,.document-title,.doc-title,.report-title,.certificate-title,.print-title){
        font-family:var(--nw-font-display)!important;
    }
}


/* Phase 3.1 — initiative review hardening and legacy text nodes. */
html[dir="rtl"] body.nw-initiative-review-page,
html[dir="rtl"] body.nw-initiative-review-page :where(p,a,span,small,strong,b,em,time,label,button,input,select,textarea,option,table,th,td,li){
    font-family:var(--nw-font-body)!important;
}
html[dir="rtl"] body.nw-initiative-review-page :where(h1,h2,h3,h4,h5,h6,.initiative-detail-head h2,.initiative-card h2){
    font-family:var(--nw-font-display)!important;
}
