/*
 * Site-wide self-hosted webfonts + anti-FOUT fallback metrics
 * (migration de l'ancien snippet eds_snippet 11341).
 *
 * Fichiers servis depuis assets/fonts/ — fichiers identiques à ceux de Google
 * Fonts (téléchargés depuis fonts.gstatic.com), donc rendu pixel-perfect.
 * Préchargés via wp_head dans functions.php.
 *
 * Combiné aux fallback @font-face calibrés (Times/Arial), élimine tout FOUT.
 */

/* ─── Self-hosted webfonts (Google source) ─── */

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('../fonts/cormorant-garamond/cormorant-garamond-latin.woff2') format('woff2');
  unicode-range: U+0-FF, U+131, U+152-153, U+2BB-2BC, U+2C6, U+2DA, U+2DC, U+304, U+308, U+329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Cormorant Garamond';
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/cormorant-garamond/cormorant-garamond-latin-italic.woff2') format('woff2');
  unicode-range: U+0-FF, U+131, U+152-153, U+2BB-2BC, U+2C6, U+2DA, U+2DC, U+304, U+308, U+329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Montserrat';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/montserrat/montserrat-latin.woff2') format('woff2');
  unicode-range: U+0-FF, U+131, U+152-153, U+2BB-2BC, U+2C6, U+2DA, U+2DC, U+304, U+308, U+329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Montserrat';
  font-style: italic;
  font-weight: 400 600;
  font-display: swap;
  src: url('../fonts/montserrat/montserrat-latin-italic.woff2') format('woff2');
  unicode-range: U+0-FF, U+131, U+152-153, U+2BB-2BC, U+2C6, U+2DA, U+2DC, U+304, U+308, U+329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* EB Garamond italic — utilisée uniquement dans les ornements SVG "En / plus" du catalogue */
@font-face {
  font-family: 'EB Garamond';
  font-style: italic;
  font-weight: 400 500;
  font-display: swap;
  src: url('../fonts/eb-garamond/eb-garamond-latin-italic.woff2') format('woff2');
  unicode-range: U+0-FF, U+131, U+152-153, U+2BB-2BC, U+2C6, U+2DA, U+2DC, U+304, U+308, U+329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ─── Fallback metric overrides (anti-reflow) ─── */

@font-face {
  font-family: 'Cormorant Garamond Fallback';
  src: local('Times New Roman'), local('Times'), local('Liberation Serif');
  size-adjust: 108.5%;
  ascent-override: 88.4%;
  descent-override: 23.6%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Cormorant Garamond Fallback';
  font-style: italic;
  src: local('Times New Roman Italic'), local('Times Italic');
  size-adjust: 84%;
  ascent-override: 114%;
  descent-override: 30.5%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Montserrat Fallback';
  src: local('Arial'), local('Helvetica Neue'), local('Helvetica'), local('Liberation Sans');
  size-adjust: 107.8%;
  ascent-override: 90.7%;
  descent-override: 23.5%;
  line-gap-override: 0%;
}
@font-face {
  font-family: 'Montserrat Fallback';
  font-style: italic;
  src: local('Arial Italic'), local('Helvetica Neue Italic'), local('Helvetica Italic');
  size-adjust: 107.8%;
  ascent-override: 90.7%;
  descent-override: 23.5%;
  line-gap-override: 0%;
}

/* ─── CSS vars du thème : injection du fallback ─── */

:root, body {
  --ff-serif: "Cormorant Garamond", "Cormorant Garamond Fallback", "Cormorant", Georgia, serif !important;
  --ff-caps: "Montserrat", "Montserrat Fallback", "Karla", ui-sans-serif, system-ui, sans-serif !important;
  --ff-sans: "Karla", "Montserrat Fallback", ui-sans-serif, system-ui, sans-serif !important;
  --global-heading-font-family: "Cormorant Garamond", "Cormorant Garamond Fallback", "Cormorant", Georgia, serif !important;
  --global-body-font-family: "Montserrat", "Montserrat Fallback", "Karla", ui-sans-serif, system-ui, sans-serif !important;
}
