/* La fonte de l'application, portée de `Fonte` dans `Theme.swift`.
 *
 * Un seul dessin pour toute l'application depuis le 5 octobre 2026 : Source
 * Serif 4, en quatre coupes optiques. **La taille choisit le fichier**, et
 * c'est tout l'intérêt d'une famille à tailles optiques — un caractère dessiné
 * pour vingt-quatre points et réduit à neuf ferme ses contrepoinçons. Les
 * seuils sont ceux d'Adobe, repris de `Fonte.nomPostScript` :
 *
 *   corps < 14 px        → SmText     var(--fonte-petite)
 *   14 px ≤ corps < 24   → Text       var(--fonte-texte)
 *   24 px ≤ corps < 36   → Subhead    var(--fonte-sous-titre)
 *   corps ≥ 36 px        → Display    var(--fonte-titre)
 *
 * Source Serif n'a pas de demi-gras intermédiaire : `font-weight: 500` tombe
 * donc sur le Semibold, comme `.medium` le fait côté Swift. L'italique
 * n'existe qu'en SmText et en Text ; les deux coupes de titre retombent sur
 * le romain, ce que le navigateur fait seul faute de fichier.
 *
 * Les fichiers sont ceux du paquet macOS (`Resources/Polices/`), licence OFL
 * à côté d'eux dans `polices/`. */

/* Le 18 novembre 2026 : chaque coupe est servie en WOFF2 d'abord, la même police compressée sans perte (glyphes et
   métriques relus identiques), 44 % du poids des OTF. Mathis, le même jour : « l'ouverture de l'app doit se faire en
   moins de temps ». L'OTF reste en repli, et pour les factures en fac-similé, qui l'embarquent dans le PDF
   (`espace-factures-facsimile.js`). */
@font-face { font-family: "Source Serif 4 SmText"; font-weight: 400; font-style: normal; src: url("../polices/SourceSerif4SmText-Regular.woff2") format("woff2"), url("../polices/SourceSerif4SmText-Regular.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "Source Serif 4 SmText"; font-weight: 500 600; font-style: normal; src: url("../polices/SourceSerif4SmText-Semibold.woff2") format("woff2"), url("../polices/SourceSerif4SmText-Semibold.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "Source Serif 4 SmText"; font-weight: 700; font-style: normal; src: url("../polices/SourceSerif4SmText-Bold.woff2") format("woff2"), url("../polices/SourceSerif4SmText-Bold.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "Source Serif 4 SmText"; font-weight: 400; font-style: italic; src: url("../polices/SourceSerif4SmText-It.woff2") format("woff2"), url("../polices/SourceSerif4SmText-It.otf") format("opentype"); font-display: swap; }

@font-face { font-family: "Source Serif 4"; font-weight: 400; font-style: normal; src: url("../polices/SourceSerif4-Regular.woff2") format("woff2"), url("../polices/SourceSerif4-Regular.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "Source Serif 4"; font-weight: 500 600; font-style: normal; src: url("../polices/SourceSerif4-Semibold.woff2") format("woff2"), url("../polices/SourceSerif4-Semibold.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "Source Serif 4"; font-weight: 700; font-style: normal; src: url("../polices/SourceSerif4-Bold.woff2") format("woff2"), url("../polices/SourceSerif4-Bold.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "Source Serif 4"; font-weight: 400; font-style: italic; src: url("../polices/SourceSerif4-It.woff2") format("woff2"), url("../polices/SourceSerif4-It.otf") format("opentype"); font-display: swap; }

@font-face { font-family: "Source Serif 4 Subhead"; font-weight: 400; font-style: normal; src: url("../polices/SourceSerif4Subhead-Regular.woff2") format("woff2"), url("../polices/SourceSerif4Subhead-Regular.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "Source Serif 4 Subhead"; font-weight: 500 600; font-style: normal; src: url("../polices/SourceSerif4Subhead-Semibold.woff2") format("woff2"), url("../polices/SourceSerif4Subhead-Semibold.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "Source Serif 4 Subhead"; font-weight: 700; font-style: normal; src: url("../polices/SourceSerif4Subhead-Bold.woff2") format("woff2"), url("../polices/SourceSerif4Subhead-Bold.otf") format("opentype"); font-display: swap; }

@font-face { font-family: "Source Serif 4 Display"; font-weight: 400; font-style: normal; src: url("../polices/SourceSerif4Display-Regular.woff2") format("woff2"), url("../polices/SourceSerif4Display-Regular.otf") format("opentype"); font-display: swap; }
@font-face { font-family: "Source Serif 4 Display"; font-weight: 500 700; font-style: normal; src: url("../polices/SourceSerif4Display-Semibold.woff2") format("woff2"), url("../polices/SourceSerif4Display-Semibold.otf") format("opentype"); font-display: swap; }

:root {
  --fonte-petite: "Source Serif 4 SmText", "Source Serif 4", Georgia, serif;
  --fonte-texte: "Source Serif 4", Georgia, serif;
  --fonte-sous-titre: "Source Serif 4 Subhead", "Source Serif 4", Georgia, serif;
  --fonte-titre: "Source Serif 4 Display", "Source Serif 4", Georgia, serif;

  /* La feuille du site pose `--serif` et `--lineale` sur les fontes du
     système. L'application n'a qu'un dessin : les deux noms mènent au même. */
  --serif: var(--fonte-texte);
  --lineale: var(--fonte-texte);

  /* Les trois rangs d'étiquette de `Fonte` : la case, la rubrique, le
     panneau. Corps, graisse et interlettrage vont ensemble. */
  --etiquette-taille: 9.5px;
  --etiquette-de-rubrique-taille: 10.5px;
  --etiquette-de-panneau-taille: 11.5px;
  --etiquette-ecart: 1.05px;

  /* La ligne du fichier : (1,036 + 0,335) fois le corps, sans interligne
     propre. Pour la prose, dont la ligne est le « pas » du moteur de texte
     (`MoteurDeProse.pas`) plus l'interligne demandé, et qui doit donc s'écrire
     en nombre ; ailleurs `line-height: normal` rend la même chose. */
  --ligne-naturelle: 1.371;
}

/* Les corps de la chrome, repris de `Fonte` : adresse 13, libellé 12,5,
   mention 11, onglet 11,5, raccourci 12, compteur 11,5 demi-gras à chasse
   fixe. Une classe par rang, et les chiffres toujours à chasse fixe.

   **La hauteur de ligne est celle de la fonte**, `normal`, et non un rapport
   choisi à l'œil. Un `Text` SwiftUI mesure sa ligne sur l'ascendante et la
   descendante du fichier (Source Serif 4 : 1,036 et 0,335 du corps, sans
   interligne propre, soit 1,371) ; 1,3 ou 1,35 retirait un demi-point à
   chaque ligne et décalait d'autant tout ce qui se compose en dessous. Les
   quatre coupes optiques ont les mêmes métriques, relevées dans leur table
   `hhea`. */
.adresse { font: 400 13px/normal var(--fonte-petite); }
.adresse-domaine { font: 500 13px/normal var(--fonte-petite); }
.libelle { font: 400 12.5px/normal var(--fonte-petite); }
.mention { font: 400 11px/normal var(--fonte-petite); }
.onglet { font: 400 11.5px/normal var(--fonte-petite); }
.raccourci { font: 400 12px/normal var(--fonte-petite); }
.fonte-compteur { font: 600 11.5px/normal var(--fonte-petite); font-variant-numeric: tabular-nums; }

/* L'étiquette, portée de `Etiquette` : capitales espacées, encre douce.
   `kerning` de SwiftUI pose l'approche après chaque caractère, le dernier
   compris : c'est `letter-spacing`. */
.etiquette {
  font: 600 var(--etiquette-taille)/normal var(--fonte-petite);
  letter-spacing: var(--etiquette-ecart);
  text-transform: uppercase;
  color: var(--encre-douce);
}
.etiquette[data-rang="rubrique"] { font-size: var(--etiquette-de-rubrique-taille); font-weight: 700; }
.etiquette[data-rang="panneau"] { font-size: var(--etiquette-de-panneau-taille); font-weight: 700; }

/* Au format du téléphone (`format-du-telephone.js`), les deux premiers rangs montent d'un point : neuf points et demi
   tiennent sous un pointeur, à soixante centimètres d'un écran, pas sous un pouce. Le relevé du 11 novembre 2026
   comptait cent quarante étiquettes sous onze points dans dix sections, dont soixante dans les tarifs des Courtiers.
   L'interlettrage suit le corps. Le rang du panneau, qui fait déjà onze et demi, ne bouge pas. */
@media (max-width: 759px) {
  :root {
    --etiquette-taille: 10.5px;
    --etiquette-de-rubrique-taille: 11.5px;
    --etiquette-ecart: 1.15px;
  }
}
