/*
 * Libria — base : polices embarquées, réinitialisation, document, coque, utilitaires
 * et éléments d'interface élémentaires (boutons, touches). Les composants sont dans
 * composants.css. Toutes les valeurs viennent de jetons.css.
 */

/* ------------------------------------------------------------------ polices */

@font-face {
  font-family: "Inter Libria";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../polices/inter-latin-wght-normal.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;
}
@font-face {
  font-family: "Inter Libria";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../polices/inter-latin-ext-wght-normal.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;
}
@font-face {
  font-family: "Inter Libria";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("../polices/inter-latin-wght-italic.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;
}
@font-face {
  font-family: "Inter Libria";
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: url("../polices/inter-latin-ext-wght-italic.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;
}

/* ------------------------------------------------------------------ réinitialisation */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-gutter: stable;
  -webkit-tap-highlight-color: transparent;
  background: var(--fond);
}
body {
  min-height: 100dvh;
  background: var(--fond);
  color: var(--texte);
  font-family: var(--police);
  font-size: var(--t-3);
  line-height: var(--i-ui);
  font-weight: var(--g-normal);
  font-feature-settings: "cv11", "ss01";   /* Inter : a simple, chiffres ouverts */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video, canvas { display: block; max-width: 100%; }
svg { flex-shrink: 0; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; }
ul, ol { padding: 0; list-style: none; }
input::placeholder, textarea::placeholder { color: var(--texte-3); opacity: 1; }
::selection { background: rgba(255, 46, 147, 0.38); color: var(--texte); }
[hidden] { display: none !important; }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: var(--r-1);
}

/* Barres de défilement discrètes (Windows) */
* { scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.16) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.14); border-radius: 10px; border: 3px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(255, 255, 255, 0.24); }
::-webkit-scrollbar-track { background: transparent; }

/* ------------------------------------------------------------------ utilitaires */

.visuellement-cache {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.chiffres { font-variant-numeric: tabular-nums; font-feature-settings: "tnum", "cv11", "ss01"; }
.texte-degrade {
  background: var(--degrade);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.secondaire { color: var(--texte-2); }
.tertiaire { color: var(--texte-3); }
.tronque { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.titre-1 { font-size: var(--t-6); line-height: var(--i-serre); font-weight: var(--g-noir); letter-spacing: var(--l-grand); }
.titre-2 { font-size: var(--t-5); line-height: var(--i-titre); font-weight: var(--g-gras); letter-spacing: var(--l-titre); }
.titre-3 { font-size: var(--t-4); line-height: var(--i-titre); font-weight: var(--g-gras); letter-spacing: var(--l-titre); }
.titre-4 { font-size: var(--t-3); line-height: var(--i-titre); font-weight: var(--g-semi); letter-spacing: -0.01em; }
.legende { font-size: var(--t-1); line-height: var(--i-ui); color: var(--texte-3); letter-spacing: var(--l-legende); }

/* ------------------------------------------------------------------ boutons */

.bouton {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--e-2);
  height: 40px; padding: 0 var(--e-4);
  border-radius: var(--r-rond);
  background: var(--surface-2);
  color: var(--texte);
  font-size: var(--t-2); font-weight: var(--g-semi); letter-spacing: -0.005em;
  white-space: nowrap;
  transition: background-color var(--d-rapide) var(--c-standard), transform var(--d-rapide) var(--c-sortie), opacity var(--d-rapide);
  user-select: none;
}
.bouton:hover { background: var(--surface-3); }
.bouton:active { transform: scale(0.97); }
.bouton:disabled { opacity: 0.4; transform: none; }
.bouton--principal { background: var(--degrade); color: var(--encre); box-shadow: var(--ombre-accent); }
.bouton--principal:hover { background: var(--degrade); filter: brightness(1.06) saturate(1.05); }
.bouton--fantome { background: transparent; color: var(--texte-2); }
.bouton--fantome:hover { background: var(--survol); color: var(--texte); }
.bouton--petit { height: 32px; padding: 0 var(--e-3); font-size: var(--t-1); }
.bouton--grand { height: 48px; padding: 0 var(--e-5); font-size: var(--t-3); }

.bouton-icone {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px;
  border-radius: var(--r-rond);
  color: var(--texte-2);
  transition: background-color var(--d-rapide) var(--c-standard), color var(--d-rapide), transform var(--d-rapide) var(--c-sortie);
}
.bouton-icone:hover { background: var(--survol); color: var(--texte); }
.bouton-icone:active { transform: scale(0.92); background: var(--appui); }
.bouton-icone--plein { background: var(--surface-2); color: var(--texte); }
.bouton-icone--plein:hover { background: var(--surface-3); }
/* Au doigt, 44 × 44 au moins (recommandation d'Apple). */
@media (pointer: coarse) {
  .bouton-icone { width: var(--cible-tactile); height: var(--cible-tactile); }
}

.touche {
  display: inline-flex; align-items: center; justify-content: center; gap: 2px;
  min-width: 24px; height: 24px; padding: 0 6px;
  border-radius: 6px;
  background: var(--surface-2);
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.35), inset 0 0 0 1px var(--trait);
  color: var(--texte-2);
  font-size: var(--t-1); font-weight: var(--g-semi); line-height: 1;
  font-family: var(--police);
}

/* ------------------------------------------------------------------ coque */

.coque { min-height: 100dvh; position: relative; }

.contenu {
  position: relative;
  min-height: 100dvh;
  padding: var(--e-6) var(--e-7) var(--e-10);
  outline: none;
}
.contenu:focus-visible { outline: none; }

.vue { animation: vue-entree var(--d-normale) var(--c-sortie) both; }
@keyframes vue-entree {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

.colonne { width: 100%; max-width: var(--l-fil); margin-inline: auto; }
.colonne-large { width: 100%; max-width: var(--l-page); margin-inline: auto; }

@media (min-width: 900px) {
  .coque { padding-left: var(--l-barre); }
  .barre-haut, .barre-onglets { display: none !important; }
}

@media (max-width: 899.98px) {
  .barre-laterale { display: none !important; }
  .contenu {
    min-height: calc(100dvh - var(--h-barre-haut) - var(--zs-haut));
    padding: var(--e-3) calc(var(--goutiere) + var(--zs-droite)) calc(var(--h-onglets) + var(--e-8) + var(--zs-bas)) calc(var(--goutiere) + var(--zs-gauche));
  }
  .coque[data-zoom="1"] .contenu { padding-bottom: calc(var(--h-onglets) + var(--h-reglette-integree) + var(--e-8) + var(--zs-bas)); }
}

/* Les animations d'entrée et d'ambiance cessent pour qui l'a demandé. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
    scroll-behavior: auto !important;
  }
}
