/*
 |-----------------------------------------------------------------------------
 | Typographie globale — Sora
 |-----------------------------------------------------------------------------
 | Fichier statique (PAS compilé par Laravel Mix) : chargé via <link> dans les
 | blades, après les autres feuilles de style.
 |
 | Pourquoi ici et pas dans le bundle :
 |  - les .woff2 sont auto-hébergés (public/fonts/sora) -> aucune dépendance à
 |    Google Fonts, l'app garde sa police sur un réseau hôpital sans Internet ;
 |  - un @font-face en CSS statique évite la réécriture des url() par webpack.
 |
 | Pourquoi les sélecteurs sont doublés (.v-application.v-application) :
 |  vuetify.min.css est injecté à l'exécution par style-loader, donc APRÈS ce
 |  <link>. Ses 48 règles `.v-application .text-h1 { font-family: Roboto
 |  !important }` gagneraient à spécificité égale. Doubler la classe (0,3,0)
 |  fait gagner Sora quel que soit l'ordre d'insertion.
 |
 | Hors périmètre volontaire : les documents d'impression / PDF (composants
 | Rapports/Finances/*.vue, resources/views/print|pdf/*, contrôleurs Pdf_*)
 | gardent leurs polices (Times New Roman, DejaVu Sans, Arial).
 */

/* latin-ext */
@font-face {
    font-family: 'Sora';
    font-style: normal;
    font-weight: 100 800;
    font-display: swap;
    src: url('/fonts/sora/sora-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* latin */
@font-face {
    font-family: 'Sora';
    font-style: normal;
    font-weight: 100 800;
    font-display: swap;
    src: url('/fonts/sora/sora-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --dio-font: 'Sora', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
}

/* Base — couvre aussi les pages Bootstrap (auth / frontend). */
html,
body {
    font-family: var(--dio-font);
}

/* SPA Vuetify : racine. */
.v-application.v-application {
    font-family: var(--dio-font);
}

/* SPA Vuetify : classes typographiques (Roboto !important dans vuetify.min.css).
   [class*="text-"] couvre les 5 breakpoints d'un coup (text-h1, text-sm-h1, …). */
.v-application.v-application .headline,
.v-application.v-application .title,
.v-application.v-application .caption,
.v-application.v-application .overline,
.v-application.v-application [class*='display-'],
.v-application.v-application [class*='subtitle-'],
.v-application.v-application [class*='body-'],
.v-application.v-application [class*='text-'] {
    font-family: var(--dio-font) !important;
}

/* Exception : les polices d'icônes ne doivent JAMAIS être remplacées. Un
   <v-icon class="text-subtitle-1"> serait sinon attrapé par la règle ci-dessus
   et afficherait le nom de la ligature au lieu du glyphe. Même spécificité
   (0,3,0) + !important, placée après -> gagne. */
.v-application.v-application .material-icons {
    font-family: 'Material Icons' !important;
}
.v-application.v-application .mdi-set,
.v-application.v-application [class*='mdi-']::before {
    font-family: 'Material Design Icons' !important;
}

/* Éditeurs de texte riche : ils embarquent leur propre pile Helvetica/Arial,
   injectée à l'exécution (donc après ce fichier) -> spécificité renforcée. */
html:root {
    --ck-font-face: var(--dio-font); /* CKEditor 5 (surcharge son :root) */
}
.ck.ck-content,
.ck.ck-editor__editable,
.ql-container.ql-container,
.ql-snow.ql-snow,
.ql-toolbar.ql-toolbar {
    font-family: var(--dio-font);
}
