@font-face { font-family: "Grandstander"; src: url(/polices/grandstander-latin-800-normal.woff2) format("woff2"); font-weight: 800; font-display: swap; }
@font-face { font-family: "Grandstander"; src: url(/polices/grandstander-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Kalam"; src: url(/polices/kalam-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Kalam"; src: url(/polices/gochi-hand-latin-400-normal.woff2) format("woff2"); font-weight: 400 700; font-display: swap; unicode-range: U+0152-0153; } /* Kalam n'a pas de « œ » : on l'emprunte à Gochi Hand, au trait proche. */
@font-face { font-family: "Kalam"; src: url(/polices/kalam-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Andika"; src: url(/polices/andika-latin-400-normal.woff2) format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Andika"; src: url(/polices/andika-latin-700-normal.woff2) format("woff2"); font-weight: 700; font-display: swap; }

:root {
  /* Protège-cahiers */
  --rouge: #d11f2a;
  --bleu: #1f5fd6;
  --vert: #15803d;
  --jaune: #f5c400;
  /* Encre et papier */
  --encre: #1b3fa0;
  --texte: #1d2a57;
  --texte-doux: #44507a;
  --papier: #ffffff;
  --seyes-fin: rgb(31 95 214 / 0.08);
  --seyes-fort: rgb(31 95 214 / 0.17);
  --marge: #e8505b;
  --cadre: 0px;
  --gouttiere: clamp(20px, 5vw, 64px);
  --rayon: 12px;
  --ombre-feuille: 0 2px 3px rgb(27 63 160 / 0.10), 0 8px 22px rgb(27 63 160 / 0.12);
  --titre: "Grandstander", "Comic Sans MS", system-ui, sans-serif;
  --corps: "Andika", "Trebuchet MS", system-ui, sans-serif;
  --main: "Kalam", "Segoe Print", "Comic Sans MS", cursive;
  /* Scotch mat (masking tape) : grain léger, bouts déchirés. La teinte (--scotch-c) est mélangée là où le scotch est posé. */
  --scotch-fibres: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='60'%3E%3Cfilter id='f'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.08 0.7' numOctaves='1' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0.45 0 0 0 0 0.42 0 0 0 0 0.36 0 0 0.12 0 -0.04'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23f)'/%3E%3C/svg%3E");
  --scotch-masque:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='14'%3E%3Cpath d='M8 0H3l2 2-3.5 2.5L4 6.5.5 9l3 2L1 14h7z'/%3E%3C/svg%3E") left / 8px 14px repeat-y,
    linear-gradient(#000 0 0) center / calc(100% - 15px) 100% no-repeat,
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='8' height='14'%3E%3Cpath d='M0 0h5L3 2l3.5 2.5L4 6.5 7.5 9l-3 2L7 14H0z'/%3E%3C/svg%3E") right / 8px 14px repeat-y;
  --reflet: linear-gradient(to bottom, rgb(255 255 255 / 0.16), rgb(255 255 255 / 0) 45%, rgb(0 0 0 / 0.06));
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 24px; }
body {
  margin: 0;
  font: 400 1.0625rem/1.6 var(--corps);
  color: var(--texte);
  background-color: var(--papier);
  /* Réglure Seyès : interlignes fins tous les 8 px, ligne forte tous les 32 px, verticales tous les 32 px. */
  background-image:
    repeating-linear-gradient(to bottom, transparent 0 31px, var(--seyes-fort) 31px 32px),
    repeating-linear-gradient(to bottom, transparent 0 7px, var(--seyes-fin) 7px 8px),
    repeating-linear-gradient(to right, transparent 0 31px, var(--seyes-fin) 31px 32px);
  padding: 0 var(--cadre) var(--cadre);
  min-height: 100vh;
  accent-color: var(--bleu);
  caret-color: var(--rouge);
}
/* Marge rouge du cahier */
main { position: relative; padding: 0 var(--gouttiere) 72px calc(var(--gouttiere) + 28px); max-width: 1440px; margin: 0 auto; }
main::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--gouttiere) + 4px); width: 2px; background: var(--marge); opacity: 0.75; }

::selection { background: rgb(245 196 0 / 0.55); color: var(--texte); }
:focus-visible { outline: 3px solid var(--bleu); outline-offset: 3px; border-radius: 6px; }
html { scrollbar-color: var(--bleu) #e8eefb; scrollbar-gutter: stable; }
.entete :focus-visible, .pied :focus-visible { outline-color: var(--jaune); }
a { color: var(--encre); text-underline-offset: 0.18em; text-decoration-thickness: 2px; }
img { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--titre); color: var(--encre); text-wrap: balance; margin: 0; }
p { text-wrap: pretty; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.evitement { position: absolute; left: -999px; top: 8px; z-index: 100; background: #fff; padding: 8px 14px; border-radius: 8px; }
.evitement:focus { left: 24px; }
svg { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- En-tête : protège-cahier bleu ---------- */
.entete {
  position: relative; z-index: 40;
  margin: 0 calc(var(--cadre) * -1);
  display: flex; align-items: center; gap: clamp(12px, 2vw, 28px);
  padding: 14px calc(var(--cadre) + var(--gouttiere) * 0.6);
  background: var(--bleu);
  background-image: var(--reflet);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.12), 0 4px 10px rgb(27 63 160 / 0.10);
}
.logo {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 16px 7px 10px;
  background: #fff; border-radius: 12px;
  box-shadow: inset 0 0 0 2px var(--rouge), inset 0 0 0 5px #fff, inset 0 0 0 6px rgb(209 31 42 / 0.45);
  text-decoration: none;
  font: 800 clamp(1.3rem, 1rem + 1vw, 1.75rem)/1 var(--titre); color: var(--encre); letter-spacing: -0.01em;
}
.logo__crayon { width: 30px; height: 30px; stroke: none; }
.recherche { position: relative; flex: 1; max-width: 560px; display: flex; align-items: center; background: #fff; border-radius: 999px; padding: 0 16px; color: var(--encre); }
.recherche input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; color: var(--texte); padding: 11px 10px; outline: none; }
.recherche input::placeholder { color: var(--texte-doux); }
.recherche:focus-within { box-shadow: 0 0 0 3px var(--jaune); }
.recherche__res { position: absolute; top: calc(100% + 8px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none; background: #fff; border-radius: 14px; box-shadow: var(--ombre-feuille); max-height: 60vh; overflow: auto; }
.recherche__res a { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; border-radius: 9px; text-decoration: none; color: var(--texte); }
.recherche__res a span { color: var(--texte-doux); font-size: 0.875rem; }
.recherche__res a:hover, .recherche__res a[aria-selected="true"] { background: #eef3fd; }
.recherche__res .vide { padding: 9px 12px; color: var(--texte-doux); }

/* ---------- Boutons de couleur (plastique) ---------- */
.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 18px; border-radius: 999px; border: 0;
  font: 700 1rem/1.1 var(--corps); color: #fff; text-decoration: none; cursor: pointer;
  background: var(--c, var(--bleu));
  background-image: linear-gradient(to bottom, rgb(255 255 255 / 0.22), rgb(255 255 255 / 0) 55%);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.35), 0 1px 2px rgb(0 0 0 / 0.18), 0 3px 8px rgb(0 0 0 / 0.10);
  transition: transform 160ms cubic-bezier(0.22, 1, 0.36, 1), filter 160ms;
}
.bouton:hover { filter: brightness(1.06) saturate(1.05); transform: translateY(-1px); }
.bouton:active { transform: translateY(1px); }
.bouton--rouge { --c: var(--rouge); }
.bouton--bleu { --c: var(--bleu); }
.bouton--vert { --c: var(--vert); }
.bouton--jaune { --c: var(--jaune); color: var(--texte); }
.bouton--petit { padding: 8px 14px; font-size: 0.9375rem; }
.entete__cats { white-space: nowrap; box-shadow: inset 0 1px 0 rgb(255 255 255 / 0.35), 0 0 0 2px rgb(255 255 255 / 0.85); }
.bouton-rond { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; color: var(--encre); background: #fff; box-shadow: inset 0 0 0 2px #c9d6f2; transition: box-shadow 160ms; }
.bouton-rond:hover { box-shadow: inset 0 0 0 2px var(--bleu); }

/* ---------- Fil d'Ariane ---------- */
.fil { display: flex; gap: 8px; padding-top: 22px; font-size: 0.9375rem; color: var(--texte-doux); }
.fil a { color: var(--texte-doux); }

/* ---------- La une : titre à gauche, éventail à droite ---------- */
.une { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: center; gap: clamp(24px, 4vw, 64px); padding: clamp(20px, 3vw, 40px) 0 clamp(16px, 2vw, 28px); }
.une--simple { grid-template-columns: 1fr; padding-bottom: 8px; }
.une__texte { container-type: inline-size; }
/* Titre sur une ligne quand la largeur le permet, sinon deux lignes au plus.
   --n et --n2 sont posés par build.mjs ; 0.56 = chasse moyenne mesurée de Grandstander 800 (0.53) plus une marge. */
.une h1 {
  --une-ligne: calc(100cqi / (var(--n, 26) * 0.56));
  --deux-lignes: calc(100cqi / (var(--n2, 14) * 0.56));
  font-weight: 800; line-height: 1.04; letter-spacing: -0.015em;
  font-size: min(3.9rem, max(var(--une-ligne), min(2.35rem, var(--deux-lignes))));
}
/* Trait rouge tiré à la règle sous « à imprimer », tracé à l'arrivée */
.souligne { background: linear-gradient(var(--rouge), var(--rouge)) no-repeat 0 96% / 100% 0.07em; padding-bottom: 0.06em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.js .souligne { animation: regle 650ms 350ms cubic-bezier(0.16, 1, 0.3, 1) backwards; }
@keyframes regle { from { background-size: 0% 0.07em; } }
/* Information pratique, pas un argument : une simple ligne discrète sous le titre. */
.etiquette { margin: 14px 0 0; font-size: 0.9375rem; font-weight: 400; color: color-mix(in srgb, var(--texte) 78%, #fff); }
.une__intro { margin: 18px 0 0; max-width: 54ch; font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.2rem); line-height: 1.6; color: var(--texte); }

.eventail { position: relative; aspect-ratio: 16 / 11; width: 100%; max-width: 620px; justify-self: center; }
.feuille {
  position: absolute; top: 8%; width: 40%; background: #fff; padding: 2.2%;
  border-radius: 4px; box-shadow: var(--ombre-feuille);
  transform-origin: 50% 90%;
  transition: transform 900ms cubic-bezier(0.16, 1, 0.3, 1);
}
.feuille img { border-radius: 2px; }
.feuille--g { left: 4%; transform: rotate(-8deg); }
.feuille--d { right: 4%; transform: rotate(7deg); }
.feuille--m { left: 50%; top: 0; width: 46%; transform: translateX(-50%) rotate(-1.5deg); z-index: 2; box-shadow: 0 3px 4px rgb(27 63 160 / 0.12), 0 16px 34px rgb(27 63 160 / 0.20); }
/* Feuille coloriée de la une : un bout de scotch en haut, une gommette étoile dans le coin. */
.une .feuille--m::before {
  content: ""; position: absolute; z-index: 1; top: -13px; left: 50%; width: 34%; height: 26px;
  transform: translateX(-50%) rotate(-3deg);
  background: var(--scotch-fibres), color-mix(in srgb, var(--scotch-c, #8e9ab3) 8%, rgb(250 249 244 / 0.93));
  -webkit-mask: var(--scotch-masque); mask: var(--scotch-masque);
}
.une .feuille--m::after {
  content: ""; position: absolute; right: -14px; bottom: 9%; width: 52px; height: 52px; transform: rotate(14deg);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 52 52'%3E%3Cpath d='M26 3l6.6 14.2 15.4 1.9-11.4 10.6 3 15.3L26 37.4l-13.6 7.6 3-15.3L4 19.1l15.4-1.9z' fill='%23f5c400' stroke='%23fff' stroke-width='3' stroke-linejoin='round'/%3E%3C/svg%3E") center / contain no-repeat;
  filter: drop-shadow(0 1px 1px rgb(120 80 0 / 0.35)) drop-shadow(0 2px 4px rgb(27 63 160 / 0.15));
  transition: transform 500ms 700ms cubic-bezier(0.16, 1, 0.3, 1);
}
.js .une .eventail:not(.ouvert) .feuille--m::after { transform: rotate(14deg) scale(0); }
/* Le moment : à l'arrivée, les trois feuilles empilées s'ouvrent en éventail. */
.js .une .eventail:not(.ouvert) .feuille--g { transform: translateX(32%) rotate(-2deg); }
.js .une .eventail:not(.ouvert) .feuille--d { transform: translateX(-32%) rotate(2deg); }
.tuile:hover .feuille--g, .tuile:focus-visible .feuille--g { transform: translateX(-6%) rotate(-12deg); }
.tuile:hover .feuille--d, .tuile:focus-visible .feuille--d { transform: translateX(6%) rotate(11deg); }

/* ---------- Pastilles : gommettes découpées aux ciseaux et coloriées au feutre ---------- */
.pastilles { margin: 4px 0 8px; }
.pastilles ul { display: flex; flex-wrap: wrap; gap: 10px 12px; margin: 0; padding: 0; list-style: none; }
.pastille {
  display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 8px 18px 8px 14px;
  font-weight: 700; text-decoration: none; color: #fff;
  /* Bord découpé à la main : rayons inégaux, trois découpes qui alternent. */
  border-radius: 20px 26px 18px 24px / 24px 18px 26px 20px;
  /* Gommette de papier en aplat franc : la couleur reste nette, seul le bord découpé fait « fait main ». */
  background: var(--c);
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--c) 86%, #000), 0 1px 1px rgb(27 63 160 / 0.16), 0 3px 7px rgb(27 63 160 / 0.10);
  transform: rotate(-1deg);
  transition: transform 160ms cubic-bezier(0.22, 1, 0.36, 1);
}
.pastilles li:nth-child(2n) .pastille { transform: rotate(0.8deg); border-radius: 24px 18px 26px 20px / 18px 26px 20px 24px; }
.pastilles li:nth-child(3n) .pastille { transform: rotate(-0.4deg); border-radius: 18px 24px 22px 26px / 26px 20px 18px 24px; }
.pastilles li .pastille:hover { transform: translateY(-1px) rotate(0deg); }
.pastille--rouge { --c: var(--rouge); } .pastille--bleu { --c: var(--bleu); } .pastille--vert { --c: var(--vert); } .pastille--jaune { --c: var(--jaune); color: var(--texte); }
.picto { width: 1.15em; height: 1.15em; fill: currentColor; stroke: none; }
.picto .t { fill: none; stroke: currentColor; stroke-width: 1.8; }
.picto .c { fill: var(--c); }
.pastilles--une { margin: 22px 0 0; }
.pastilles--une .pastille { min-height: 38px; padding: 6px 14px 6px 11px; font-size: 0.9375rem; }
@media (pointer: coarse), (max-width: 640px) { .pastilles--une .pastille { min-height: 44px; } }

/* ---------- Sections ---------- */
.section, .groupe, .autres { padding-top: clamp(40px, 5vw, 64px); }
.section h2, .groupe h2, .autres h2 { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: clamp(1.55rem, 1.2rem + 1vw, 2rem); line-height: 1.1; }
.trait { width: 0.75em; height: 1.05em; stroke: var(--rouge); stroke-width: 3; margin-left: -0.15em; }
.section__texte { margin: 12px 0 0; max-width: 68ch; color: var(--texte); }

/* Colonnes fixes : 12 dessins par section tombent toujours en lignes pleines (6, 4, 3 ou 2 colonnes). */
.grille { --cols: 6; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: clamp(14px, 2vw, 24px); margin: 22px 0 0; padding: 0; list-style: none; }
@media (max-width: 1179px) { .grille { --cols: 4; } }
@media (max-width: 859px) { .grille { --cols: 3; } }
@media (max-width: 559px) { .grille { --cols: 2; } }
.dessin { display: flex; flex-direction: column; background: #fff; border-radius: var(--rayon); padding: 10px 10px 12px; box-shadow: var(--ombre-feuille); scroll-margin-top: 24px; }
.dessin:target { box-shadow: 0 0 0 3px var(--jaune), var(--ombre-feuille); }
.dessin__feuille { display: block; border-radius: 6px; overflow: hidden; outline-offset: -3px; }
.dessin__feuille img { transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1); }
.dessin { transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 220ms; }
.dessin:hover { transform: translateY(-2px) rotate(-0.4deg); box-shadow: 0 3px 4px rgb(27 63 160 / 0.12), 0 14px 30px rgb(27 63 160 / 0.18); }
.dessin__titre { margin: 10px 2px 10px; font-weight: 700; color: var(--encre); line-height: 1.3; flex: 1; }
.dessin__actions { display: flex; align-items: center; gap: 8px; }
.dessin__actions .bouton { flex: 1; }

/* ---------- Tuiles de catégories : la feuille et son éventail, tenue par un bout de scotch où le nom est écrit au feutre ---------- */
.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr)); gap: clamp(26px, 2.4vw, 34px) clamp(16px, 2vw, 26px); margin: 30px 0 0; padding: 0; list-style: none; }
/* Hauteurs égales sur une rangée : la tuile remplit son <li> ; quand un nom passe sur 2 lignes, l'éventail des voisines se centre dans la place restante. */
.tuile {
  position: relative; height: 100%;
  display: grid; grid-template-rows: auto 1fr;
  padding: 0 14px 12px; border-radius: 3px; text-decoration: none; color: var(--encre);
  background: #fff; box-shadow: var(--ombre-feuille);
  transform: rotate(-0.7deg);
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1), box-shadow 220ms;
}
.tuiles > li:nth-child(2n) .tuile { transform: rotate(0.6deg); }
.tuiles > li:nth-child(3n) .tuile { transform: rotate(-0.3deg); }
.tuiles > li .tuile:hover { transform: translateY(-3px) rotate(0deg); box-shadow: 0 3px 4px rgb(27 63 160 / 0.12), 0 14px 30px rgb(27 63 160 / 0.18); }
.tuile--rouge { --scotch-c: var(--rouge); } .tuile--bleu { --scotch-c: var(--bleu); } .tuile--vert { --scotch-c: var(--vert); } .tuile--jaune { --scotch-c: #d9a400; }
.tuile__couv { grid-row: 2; display: grid; align-content: center; padding: 12px 6% 0; }
.tuile__couv .eventail { aspect-ratio: 16 / 10; }
/* Le scotch : à cheval sur le bord haut de la feuille, le nom au feutre, le nombre au crayon. */
.tuile__etiquette {
  grid-row: 1; justify-self: center; position: relative; z-index: 3;
  display: flex; flex-direction: column; align-items: center;
  max-width: 92%; margin-top: -14px; padding: 6px 22px 7px;
  text-align: center; color: var(--encre);
  transform: rotate(-2deg);
  filter: drop-shadow(0 1px 1px rgb(27 63 160 / 0.10));
  transition: transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
.tuile__etiquette::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--scotch-fibres), color-mix(in srgb, var(--scotch-c, #8e9ab3) 8%, rgb(250 249 244 / 0.93)); -webkit-mask: var(--scotch-masque); mask: var(--scotch-masque); }
.tuiles > li:nth-child(2n) .tuile__etiquette { transform: rotate(1.8deg); }
.tuiles > li:nth-child(3n) .tuile__etiquette { transform: rotate(-0.8deg); }
.tuiles > li .tuile:hover .tuile__etiquette { transform: rotate(-0.5deg); }
.tuile__nom { font: 700 1.45rem/1.1 var(--main); text-wrap: balance; }
.tuile:focus-visible { outline-offset: 5px; }
/* Pas de tuile seule sur sa rangée : selon le nombre de colonnes, la première tuile s'agrandit pour que les rangées tombent pleines. */
@media (min-width: 1100px) {
  .tuiles { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  /* 5, 9, 13… : grande tuile 2×2 */
  .tuiles:has(> li:last-child:nth-child(4n+1):not(:only-child)) > li:first-child { grid-column: span 2; grid-row: span 2; }
  .tuiles:has(> li:last-child:nth-child(4n+1):not(:only-child)) > li:first-child .tuile__nom { font-size: 1.9rem; }
}
@media (min-width: 860px) and (max-width: 1099px) {
  .tuiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  /* 4, 7, 10… : la première prend toute la largeur */
  .tuiles:has(> li:last-child:nth-child(3n+1):not(:only-child)) > li:first-child { grid-column: 1 / -1; }
  .tuiles:has(> li:last-child:nth-child(3n+1):not(:only-child)) > li:first-child .eventail { max-width: 440px; }
}
@media (max-width: 859px) {
  .tuiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* nombre impair : la première prend toute la largeur */
  .tuiles:has(> li:last-child:nth-child(odd):not(:only-child)) > li:first-child { grid-column: 1 / -1; }
  .tuiles:has(> li:last-child:nth-child(odd):not(:only-child)) > li:first-child .eventail { max-width: 440px; }
}

/* ---------- Échelle de difficulté ---------- */
.echelle { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 22px); margin: 22px 0 0; padding: 0; list-style: none; }
.echelle a { display: flex; flex-direction: column; text-decoration: none; background: #fff; padding: 8px 8px 12px; border-radius: var(--rayon); box-shadow: var(--ombre-feuille); height: 100%; }
.echelle img { border-radius: 4px; }
.echelle__titre { margin-top: 8px; font-weight: 700; color: var(--encre); line-height: 1.3; flex: 1; }
.echelle__niv { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 0.875rem; color: var(--texte-doux); }
.echelle__niv::before { content: ""; width: 12px; height: 12px; border-radius: 50%; background: var(--g); box-shadow: inset 0 -2px 0 rgb(0 0 0 / 0.15), 0 1px 1px rgb(0 0 0 / 0.2); }
.echelle__niv--facile { --g: var(--vert); } .echelle__niv--moyen { --g: var(--jaune); } .echelle__niv--detaille { --g: var(--rouge); }

/* ---------- Divers ---------- */
.prose { max-width: 68ch; }
.prose h2 { font-size: 1.5rem; margin-top: 32px; }
.recherche-vide { margin: 16px 0 0; font-weight: 700; color: var(--rouge); }
.pied {
  margin: 0 calc(var(--cadre) * -1); padding: 40px calc(var(--cadre) + var(--gouttiere)) 52px;
  background: var(--bleu); background-image: linear-gradient(to bottom, rgb(255 255 255 / 0.12), rgb(255 255 255 / 0) 40%);
  color: #fff;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 32px;
}
.pied p { margin: 0 0 14px; max-width: 60ch; }
.pied__logo { font: 800 1.6rem/1 var(--titre); }
.pied nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.pied a { color: #fff; font-weight: 700; }

/* ---------- Petits écrans ---------- */
@media (max-width: 900px) {
  .une { grid-template-columns: 1fr; }
  .une .eventail { max-width: 440px; }
  .echelle { grid-template-columns: repeat(3, minmax(0, 1fr)); }

}
@media (max-width: 640px) {
  :root { --gouttiere: 14px; }
  main { padding-left: calc(var(--gouttiere) + 16px); }
  main::before { left: calc(var(--gouttiere) + 2px); }
  .entete { flex-wrap: wrap; padding-top: 10px; padding-bottom: 12px; }
  .recherche { order: 3; flex-basis: 100%; max-width: none; }
  .entete__cats span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .entete__cats { margin-left: auto; padding: 10px 12px; }
  .pastilles ul { flex-wrap: nowrap; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: none; }
  .pastille { white-space: nowrap; }
  .dessin { padding: 7px 7px 10px; }
  .dessin__actions .bouton span { font-size: 0.875rem; }
  .bouton-rond { width: 34px; height: 34px; }
  .echelle { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* Tuiles plus serrées sur téléphone : /categories/ reste courte malgré ~74 thèmes. */
  .tuiles { gap: 26px 12px; }
  .tuile { padding: 0 8px 8px; }
  .tuile__couv { padding: 4px 3% 0; }
  .tuile__etiquette { max-width: 100%; margin-top: -13px; padding: 4px 16px 5px; }
  .tuile__nom { font-size: 1.2rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0ms !important; animation: none !important; }
}
@media print {
  body { background: none; padding: 0; }
  body::after, .entete, .pied, .pastilles, .fil { display: none; }
}
.groupe__suite { margin: 22px 0 0; }
/* /categories/ : ~74 tuiles ; le navigateur ne peint que les groupes proches de l'écran. */
.groupe--liste { content-visibility: auto; contain-intrinsic-size: auto 1400px; scroll-margin-top: 16px; }

.tuile .oe { margin-right: -0.16em; } /* le « œ » emprunté à Gochi Hand a une approche plus large */
/* Maillage « Voir aussi » sous le texte de section : discret, lien souligné. */
.section__liens { margin: 6px 0 0; font-size: 0.9375rem; color: color-mix(in srgb, var(--texte) 80%, #fff); }
.section__liens a { color: var(--encre); text-underline-offset: 3px; }
.bouton-pdf { display: inline-flex; align-items: center; width: auto !important; border-radius: 19px; padding: 0 8px 0 6px; gap: 2px; text-decoration: none; flex-shrink: 0; font-size: 0.8125rem; font-weight: 700; }
/* Sur téléphone, deux boutons doivent tenir dans une carte de ~170 px : « PDF » sans icône, Imprimer qui se resserre. */
@media (max-width: 559px) {
  .dessin__actions { gap: 6px; }
  .dessin__actions .bouton { flex: 1 1 auto; min-width: 0; padding-inline: 8px; }
  .bouton-pdf svg { display: none; }
  .bouton-pdf { padding: 0 9px; }
}
