/* ==========================================================================
   Lyrge UI · base
   Polices, remise à zéro, typographie d’application, focus, sélection,
   barres de défilement, mouvements réduits et utilitaires.
   Se charge après jetons.css. Aucune valeur en dur : tout vient des jetons.
   ========================================================================== */

/* Polices : mêmes fichiers et mêmes déclarations que lyrge.fr (style.css:11-25).
   Chemins relatifs à cette feuille, donc servis en /assets/ui/polices/…
   Les sous-ensembles latins n’ont ni U+202F, ni U+2011, ni → ≈ ✓ : dessiner
   flèches et coches avec les pictogrammes SVG du kit. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("polices/inter-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Inter Tight";
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url("polices/inter-tight-latin.woff2") format("woff2");
}

/* Remise à zéro ------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  background: var(--bg);
  color: var(--ink);
  scroll-padding-top: var(--sp-4);
  scrollbar-color: var(--scroll-thumb) transparent;
}
html:focus-within { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-corps);
  line-height: var(--lh-corps);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
img, video, canvas { display: block; max-width: 100%; height: auto; }
svg { flex-shrink: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, select, textarea, optgroup { font: inherit; color: inherit; }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; }
h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, figure, blockquote, pre { margin: 0; }
ul, ol { padding: 0; list-style: none; }
table { border-collapse: collapse; }
fieldset { margin: 0; min-width: 0; }
hr { height: 1px; margin: var(--sp-6) 0; border: 0; background: var(--line); }
[hidden] { display: none !important; }
/* Un îlot de thème (data-theme sur un conteneur) repeint son fond et son texte */
:where([data-theme]:not(:root)) { background-color: var(--bg); color: var(--ink); }

/* Typographie d’application ---------------------------------------------------
   Titres en Inter Tight serré, texte en Inter ; les composants précisent. */
h1, h2, h3, h4 { color: var(--ink); text-wrap: balance; }
h1 { font-family: var(--font-display); font-size: var(--fs-page); font-weight: 700; line-height: var(--lh-titre); letter-spacing: var(--ls-page); }
h2 { font-family: var(--font-display); font-size: var(--fs-section); font-weight: 700; line-height: var(--lh-titre); letter-spacing: var(--ls-section); }
h3 { font-size: var(--fs-carte); font-weight: 600; line-height: var(--lh-ui); letter-spacing: var(--ls-carte); }
h4 { font-size: var(--fs-corps); font-weight: 600; line-height: var(--lh-ui); }
p { text-wrap: pretty; }
.lead { color: var(--ink-soft); font-size: var(--text-lead); line-height: 1.55; }   /* chapeau des pages publiques (site) */
strong, b { font-weight: 600; }
small { font-size: var(--fs-petit); }
sup { position: relative; top: -.42em; font-size: .7em; line-height: 0; vertical-align: baseline; }   /* 1er, 2e : l’exposant ne décale pas la ligne */
abbr[title] { text-decoration: underline dotted; text-underline-offset: .2em; cursor: help; }

/* Liens dans un texte : soulignés (on ne distingue pas un lien par la seule couleur) */
.prose a, a.lien-texte {
  color: var(--lien);
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--lien-trait);
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
  transition: text-decoration-color var(--dur-rapide) var(--ease);
}
.prose a:hover, a.lien-texte:hover { text-decoration-color: currentColor; }

/* Prose : pages de texte (mentions, confidentialité, aide) */
.prose { max-width: var(--lecture-max); color: var(--text-2); }
.prose > * + * { margin-top: 1em; }
.prose h2, .prose h3 { color: var(--ink); }
.prose > h2 { margin-top: 2em; }
.prose > h3 { margin-top: 1.5em; }
.prose ul { padding-left: 1.25em; list-style: disc; }
.prose ol { padding-left: 1.4em; list-style: decimal; }
.prose li + li { margin-top: .35em; }
.prose li::marker { color: var(--muted); }

/* Focus, sélection : règles du site (style.css:155-156) ---------------------- */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: var(--radius-3xs); }
::selection { background: var(--mint); color: var(--green-deep); }

/* Accessibilité -------------------------------------------------------------- */
.sr-only, .sr {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; left: var(--sp-4); top: calc(var(--sp-16) * -1.25); z-index: var(--z-evitement);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-sm);
  background: var(--green); color: var(--paper);
  font-weight: 600;
  transition: top var(--dur-base) var(--ease);
}
.skip-link:focus { top: var(--sp-4); }
/* Sprite de pictogrammes inclus dans la page (variante du fichier icones.svg) */
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* Touches et code ------------------------------------------------------------ */
kbd {
  display: inline-grid; place-items: center;
  min-width: 1.6em; height: 1.6em; padding: 0 .4em;
  font: 600 var(--fs-xs)/1 var(--font-sans);
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: var(--radius-2xs);
  white-space: nowrap;
}
code {
  padding: .1em .4em;
  font: .88em ui-monospace, "Cascadia Code", Consolas, monospace;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-2xs);
  overflow-wrap: anywhere;
}

/* Barres de défilement : fines, aux couleurs du thème -------------------------- */
* { scrollbar-width: thin; }
::-webkit-scrollbar { width: .625rem; height: .625rem; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--scroll-thumb); border: 2px solid transparent; border-radius: var(--radius-pill); background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: var(--scroll-thumb-hover); }

/* Mouvements réduits : même interrupteur que le site (style.css:412-423) ------- */
@media (prefers-reduced-motion: reduce) {
  html, html:focus-within { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: var(--dur-nulle) !important;
    animation-iteration-count: 1 !important;
    transition-duration: var(--dur-nulle) !important;
  }
}

/* Utilitaires ------------------------------------------------------------------ */
.muted { color: var(--muted); }
.txt { color: var(--ink); }
.txt-2 { color: var(--text-2); }
.txt-ok { color: var(--succes-ink) !important; }
.txt-warn { color: var(--attente-ink) !important; }
.txt-danger { color: var(--erreur-ink) !important; }
.petit { font-size: var(--fs-petit); }
.tiny { font-size: var(--fs-xs); }
.bloc { display: block; }
.nowrap { white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }
.grow { flex: 1 1 12.5rem; }
.tronque { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Deux lignes au plus, coupées entre deux mots (résumés d'appels) */
.coupe-2 { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; }
/* Raccourcis clavier : sans objet au doigt */
@media (pointer: coarse) { .aide-clavier { display: none; } }

/* Aides de mise en page : pile, grappe, grille */
.stack { display: grid; gap: var(--sp-4); align-content: start; }
.stack--serre { gap: var(--sp-2); }
.stack--large { gap: var(--sp-6); }
.cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-2); }
.cluster--large { gap: var(--sp-4); }
.grille { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(min(16rem, 100%), 1fr)); }

/* Contenu selon le thème : .si-clair / .si-sombre */
[data-theme="clair"] .si-sombre, [data-theme="sombre"] .si-clair { display: none; }
@media not (prefers-color-scheme: dark) { [data-theme="auto"] .si-sombre { display: none; } }
@media (prefers-color-scheme: dark) { [data-theme="auto"] .si-clair { display: none; } }
