/* ==========================================================================
   CORE — QR
   --------------------------------------------------------------------------
   Charte de Core : violet #6355e0 unique accent, lavande, Lexend Deca.
   Les jetons viennent de site/src/styles/01-tokens.css de core-agency.be.
   ⚠️ UN SEUL ACCENT, ET IL TIENT TOUTE LA PAGE. Seuls le vert et l'ambre des
   verdicts y échappent, parce qu'ils portent une INFORMATION — le code se
   lira ou ne se lira pas — et non une décoration.
   ========================================================================== */

/* Polices embarquées, jamais appelées chez Google : un appel externe romprait
   la promesse « aucune requête réseau ». Licence OFL, voir
   fonts/LICENCE-DES-POLICES.md. */
@font-face {
  font-family: 'Lexend Deca';
  src: url('../fonts/lexend-deca-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Lexend Deca';
  src: url('../fonts/lexend-deca-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'JetBrains Mono';
  src: url('../fonts/jetbrains-mono-var.woff2') format('woff2');
  font-weight: 100 800; font-style: normal; font-display: swap;
}

/* `[hidden]` a une spécificité nulle : toute classe posant un `display` le
   bat. On le verrouille ici. */
[hidden] { display: none !important; }

*, *::before, *::after { box-sizing: border-box; }

:root {
  --papier: #F1EFFD;
  --carte:  #FFFFFF;
  --encre:  #0E0E12;
  --douce:  #6B6B7A;
  --filet:  rgba(14, 14, 18, .12);
  --accent: #6355E0;
  --accent-pale: #E7E3FB;
  --juste:  #0A7D5A;
  --juste-pale: #E4F4EE;
  --tiede:  #8A5A00;
  --tiede-pale: #FBF2E0;
  --faux:   #A33325;
  --faux-pale: #FBEAE7;
  --rayon:  10px;
  --ui: 'Lexend Deca', -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  --chiffres: 'JetBrains Mono', ui-monospace, Consolas, monospace;
}

body {
  margin: 0;
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.55;
  color: var(--encre);
  background: var(--papier);
  -webkit-font-smoothing: antialiased;
}

.entete { max-width: 1060px; margin: 0 auto; padding: 2rem 1.5rem 0; }
.entete__marque { display: flex; align-items: center; gap: .8rem; }
.signe { display: block; border-radius: 7px; }
.entete h1 { margin: 0; font-size: 1.28rem; font-weight: 700; letter-spacing: -.02em; }
.entete p { margin: .1rem 0 0; font-size: .87rem; color: var(--douce); }
.entete__lien { color: var(--accent); text-decoration: none; border-bottom: 1px solid currentColor; }
.entete__lien:hover { color: var(--encre); }
.entete__tiret { color: var(--accent); }

.page { max-width: 1060px; margin: 0 auto; padding: 1.6rem 1.5rem 3rem; }

/* L'aperçu reste visible pendant qu'on règle : c'est la seule raison de
   passer à deux colonnes, et elle tombe dès que la place manque. */
.atelier {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.2rem;
  align-items: start;
}
@media (max-width: 860px) {
  .atelier { grid-template-columns: minmax(0, 1fr); }
}

/* ------------------------------------------------------------- OUTILS */

.outil {
  margin-bottom: 1.2rem;
  padding: 1.4rem;
  background: var(--carte);
  border: 1px solid var(--filet);
  border-radius: var(--rayon);
}
.outil:last-child { margin-bottom: 0; }
.outil__titre { margin: 0 0 .3rem; font-size: 1.02rem; font-weight: 700; letter-spacing: -.01em; }
.outil__intro {
  margin: 0 0 1.1rem;
  font-size: .86rem; line-height: 1.5;
  color: var(--douce); max-width: 62ch;
}
.outil__intro code {
  padding: .05rem .3rem;
  font-family: var(--chiffres); font-size: .82em;
  background: var(--accent-pale); border-radius: 4px;
}

.rangee {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: .8rem;
  margin-bottom: 1rem;
}
.rangee:last-child { margin-bottom: 0; }
.champ { display: block; min-width: 0; }
.champ--large { grid-column: 1 / -1; }
.champ__nom {
  display: block; margin-bottom: .35rem;
  font-size: .78rem; font-weight: 600; color: var(--douce);
}
.champ__groupe { display: flex; align-items: center; gap: .4rem; }
.unite { font-size: .88rem; color: var(--douce); white-space: nowrap; }

.saisie {
  width: 100%;
  padding: .55rem .7rem;
  font: inherit; font-size: .9rem;
  color: var(--encre); background: var(--papier);
  border: 1px solid var(--filet); border-radius: 7px;
}
.saisie:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
textarea.saisie { resize: vertical; min-height: 5rem; font-family: var(--chiffres); font-size: .82rem; }

.bouton {
  padding: .55rem .9rem;
  font: inherit; font-size: .84rem; font-weight: 550;
  border-radius: 7px; border: 1px solid var(--filet);
  cursor: pointer; white-space: nowrap;
}
.bouton--discret { color: var(--encre); background: var(--papier); }
.bouton--discret:hover { border-color: var(--accent); color: var(--accent); }
.bouton--plein { color: #fff; background: var(--accent); border-color: var(--accent); }
.bouton--plein:hover { background: #5245c9; }
.bouton:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bouton[disabled] { opacity: .45; cursor: not-allowed; }

/* --------------------------------------------------------- ONGLETS */

.onglets {
  display: flex; flex-wrap: wrap; gap: .3rem;
  margin-bottom: 1.1rem;
  padding: .25rem;
  background: var(--papier);
  border-radius: 9px;
}
.onglet {
  flex: 1 1 auto;
  padding: .45rem .7rem;
  font: inherit; font-size: .82rem; font-weight: 550;
  color: var(--douce); background: none;
  border: none; border-radius: 7px; cursor: pointer;
}
.onglet:hover { color: var(--encre); }
.onglet[aria-selected="true"] { color: #fff; background: var(--accent); }
.onglet:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ------------------------------------------------------ NIVEAUX */

.niveaux { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .6rem; }
.niveau { position: relative; display: block; cursor: pointer; }
.niveau input { position: absolute; opacity: 0; width: 0; height: 0; }
.niveau__corps {
  display: block; height: 100%;
  padding: .7rem .8rem;
  background: var(--papier);
  border: 1px solid var(--filet); border-radius: 9px;
}
.niveau input:checked + .niveau__corps {
  background: var(--accent-pale);
  border-color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}
.niveau input:focus-visible + .niveau__corps { outline: 2px solid var(--accent); outline-offset: 2px; }
.niveau__lettre { font-family: var(--chiffres); font-size: 1.1rem; font-weight: 700; }
.niveau__taux { margin-left: .35rem; font-size: .78rem; color: var(--douce); }
.niveau__quoi { display: block; margin-top: .15rem; font-size: .76rem; line-height: 1.4; color: var(--douce); }

/* ------------------------------------------------------- COULEURS */

.couleur { display: flex; align-items: center; gap: .5rem; }
.couleur input[type="color"] {
  width: 42px; height: 34px; padding: 2px;
  background: var(--papier);
  border: 1px solid var(--filet); border-radius: 7px; cursor: pointer;
}
.couleur .saisie { font-family: var(--chiffres); font-size: .82rem; text-transform: uppercase; }

/* ------------------------------------------------------ VERDICTS */

.verdict {
  margin: .8rem 0 0;
  padding: .65rem .9rem;
  font-size: .84rem; line-height: 1.5;
  border-radius: 8px; overflow-wrap: anywhere;
}
.verdict--neutre { color: var(--douce); background: var(--papier); }
.verdict--vrai { color: var(--juste); background: var(--juste-pale); }
.verdict--tiede { color: var(--tiede); background: var(--tiede-pale); }
.verdict--faux { color: var(--faux); background: var(--faux-pale); }
.verdict strong { font-weight: 700; }

.note { margin: .6rem 0 0; font-size: .78rem; line-height: 1.5; color: var(--douce); max-width: 68ch; }
.note a { color: var(--accent); }

.filet { margin: 1.2rem 0; border: none; border-top: 1px solid var(--filet); }

/* --------------------------------------------------------- APERÇU */

.apercu { position: sticky; top: 1.2rem; }
@media (max-width: 860px) { .apercu { position: static; } }

.apercu__cadre {
  padding: 1rem;
  background: var(--carte);
  border: 1px solid var(--filet);
  border-radius: var(--rayon);
}
/* Le damier rappelle qu'un fond transparent n'est pas un fond blanc. */
.apercu__scene {
  display: grid; place-items: center;
  padding: .8rem;
  border-radius: 8px;
  background-color: #fff;
  background-image:
    linear-gradient(45deg, #EDEDF2 25%, transparent 25%, transparent 75%, #EDEDF2 75%),
    linear-gradient(45deg, #EDEDF2 25%, transparent 25%, transparent 75%, #EDEDF2 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
}
.apercu__scene svg { display: block; width: 100%; height: auto; max-width: 260px; }

.apercu__faits {
  display: grid; grid-template-columns: 1fr auto;
  gap: .3rem .8rem;
  margin: .9rem 0 0;
  font-size: .8rem;
}
.apercu__faits dt { color: var(--douce); }
.apercu__faits dd { margin: 0; text-align: right; font-family: var(--chiffres); }

.jauge {
  grid-column: 1 / -1;
  height: 4px; margin-top: .3rem;
  background: var(--accent-pale); border-radius: 999px; overflow: hidden;
}
.jauge__part { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.jauge__part--pleine { background: var(--faux); }

.apercu__actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .9rem; }
.apercu__actions .bouton { width: 100%; text-align: center; }
.apercu__actions .bouton--large { grid-column: 1 / -1; }

/* --------------------------------------------------------- PLANCHE */

.planche__sortie { margin-top: 1rem; }
.planche__grille {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: .6rem;
}
.etiquette {
  padding: .6rem .4rem .5rem;
  text-align: center;
  background: var(--carte);
  border: 1px solid var(--filet);
  border-radius: 8px;
  break-inside: avoid;
}
.etiquette svg { display: block; width: 100%; height: auto; }
.etiquette__nom {
  margin: .35rem 0 0;
  font-size: .72rem; font-weight: 700; letter-spacing: .02em;
}
.etiquette__quoi { margin: 0; font-size: .62rem; color: var(--douce); }

/* --------------------------------------------------------- PIED */

.pied {
  max-width: 1060px; margin: 0 auto;
  padding: 0 1.5rem 3rem;
  font-size: .8rem; color: var(--douce);
}
.pied p { margin: 0 0 .5rem; max-width: 66ch; }
.pied a { color: var(--encre); }
.pied__avertissement {
  padding: .6rem .8rem;
  background: var(--carte);
  border-left: 2px solid var(--accent);
  border-radius: 0 6px 6px 0;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* --------------------------------------------------------- IMPRESSION
   Seule la planche s'imprime : le reste de l'atelier n'a rien à faire
   sur une feuille d'autocollants. */
@media print {
  @page { size: A4; margin: 12mm; }
  body { background: #fff; font-size: 11px; }
  .entete, .pied, .atelier, .planche__reglages,
  .outil__intro, .planche h2 { display: none !important; }
  .planche { border: none; }
  .page { max-width: none; padding: 0; }
  .planche, .planche__sortie { margin: 0; padding: 0; border: none; background: none; }
  .planche__grille { grid-template-columns: repeat(4, 1fr); gap: 6mm; }
  .etiquette { border: 1px dashed #999; border-radius: 0; }
}

/* ------------------------------------------------------------ FAMILLE
   Les sept outils de Core ne se connaissaient pas entre eux. Quelqu'un
   qui arrive ici par une recherche n'avait aucun moyen d'apprendre que
   les six autres existent — c'est le seul lien qui manquait. */
.famille {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .3rem .75rem;
  margin: 0 0 .7rem;
  padding-top: .8rem;
  border-top: 1px solid var(--filet);
  font-size: .78rem;
}
.famille__titre { font-weight: 600; color: var(--encre); }
.famille a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid transparent;
}
.famille a:hover { border-bottom-color: currentColor; }
.famille a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
