/* Premiers gestes — thème jouets-eveil.com (moteur v2.1). Variables : tokens.css uniquement. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--c-fond); color: var(--c-encre); font-family: var(--f-texte); font-size: var(--t-m); line-height: 1.7; overflow-wrap: break-word; }
img, picture, video, svg { max-width: 100%; height: auto; display: block; }
a { color: var(--c-principale); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--c-principale-fonce); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--c-focus); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3, h4 { font-family: var(--f-titre); font-weight: 600; line-height: 1.18; letter-spacing: -0.01em; color: var(--c-encre); margin: 0; }
p { margin: 0 0 var(--e-4); }
.conteneur { width: 100%; max-width: var(--largeur); margin: 0 auto; padding: 0 var(--e-4); }
@media (min-width: 700px) { .conteneur { padding: 0 var(--e-6); } }
.etroit { max-width: calc(var(--largeur-texte) + 2 * var(--e-6)); }
.evitement { position: absolute; left: -9999px; top: 0; background: var(--c-encre); color: #fff; padding: var(--e-3) var(--e-4); z-index: 10; }
.evitement:focus { left: var(--e-4); top: var(--e-4); }

/* ---------- En-tête : logo + baseline, puis rangée des familles ---------- */
.entete { background: var(--c-fond); border-bottom: 1px solid var(--c-ligne); }
.entete-in { display: flex; align-items: center; justify-content: space-between; gap: var(--e-4); padding-top: var(--e-4); padding-bottom: var(--e-3); }
.marque { display: block; flex: 0 1 auto; }
.marque img { height: 30px; width: auto; }
@media (min-width: 700px) { .marque img { height: 36px; } }
.entete-baseline { display: none; margin: 0; font-family: var(--f-titre); font-size: var(--t-xs); color: var(--c-encre-douce); text-align: right; max-width: 22rem; line-height: 1.4; }
@media (min-width: 860px) { .entete-baseline { display: block; } }
.familles { border-top: 1px dashed var(--c-ligne-forte); }
.familles ul { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--e-1); overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.familles ul::-webkit-scrollbar { display: none; }
.familles li { flex: 0 0 auto; font-family: var(--f-titre); font-size: var(--t-s); color: var(--c-encre-douce); }
.familles a { display: inline-block; padding: var(--e-3) var(--e-3); font-family: var(--f-titre); font-size: var(--t-s); font-weight: 500; color: var(--c-encre); text-decoration: none; border-bottom: 3px solid transparent; }
.familles a:hover { color: var(--c-principale); border-bottom-color: var(--c-accent); }
.familles a[aria-current="page"] { color: var(--c-principale); border-bottom-color: var(--c-principale); }
@media (min-width: 860px) { .familles ul { justify-content: space-between; } .familles a { padding: var(--e-3) var(--e-2); } }

/* ---------- Accueil : image pleine largeur, carte de texte qui la chevauche ---------- */
.une { position: relative; }
.une-media { position: relative; overflow: hidden; width: 100%; height: min(125vw, 72vh); background: var(--c-accent-pale); }
@media (min-width: 700px) { .une-media { height: min(56.25vw, 76vh); } }
.une-media picture, .une-media img, .une-media video { width: 100%; height: 100%; object-fit: cover; }
.une-in { position: relative; margin-top: calc(-1 * var(--e-8)); }
@media (min-width: 900px) { .une-in { margin-top: calc(-1 * var(--e-9) - var(--e-6)); } }
.une-carte { background: var(--c-surface); border-radius: var(--r-l); padding: var(--e-5) var(--e-5) var(--e-5); box-shadow: var(--ombre-douce); max-width: 46rem; }
@media (min-width: 700px) { .une-carte { padding: var(--e-6) var(--e-7) var(--e-6); } }
.une-sur { font-family: var(--f-titre); font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.12em; color: var(--c-accent-texte); font-weight: 600; margin-bottom: var(--e-2); }
.une h1 { font-size: var(--t-3xl); font-weight: 600; }
.une .chapo { margin-top: var(--e-4); font-size: var(--t-l); color: var(--c-encre-douce); line-height: 1.55; }
.ages { margin-top: var(--e-5); }
.ages-titre { font-family: var(--f-titre); font-weight: 600; font-size: var(--t-s); margin-bottom: var(--e-3); }
.ages ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--e-2); }
@media (min-width: 700px) { .ages ul { grid-template-columns: repeat(3, 1fr); } }
.ages a { display: flex; flex-direction: column; gap: 2px; padding: var(--e-3) var(--e-4); border: 1.5px solid var(--c-ligne-forte); border-radius: var(--r-m); text-decoration: none; color: var(--c-encre); transition: border-color var(--duree), background-color var(--duree); height: 100%; }
.ages a:hover { border-color: var(--c-principale); background: var(--c-principale-pale); color: var(--c-encre); }
.ages-tranche { font-family: var(--f-titre); font-weight: 600; font-size: var(--t-l); color: var(--c-principale); }
.ages-geste { font-size: var(--t-s); color: var(--c-encre-douce); line-height: 1.4; }

/* Image d'accueil animée : glissement lent, propre à ce site (vers la gauche et le haut, 34 s) */
@media (prefers-reduced-motion: no-preference) {
  .media-anime img { animation: pg-glisse 34s ease-in-out infinite alternate; transform-origin: 60% 70%; will-change: transform; }
  @keyframes pg-glisse { from { transform: scale(1.02) translate3d(0, 0, 0); } to { transform: scale(1.09) translate3d(-2.2%, -1.4%, 0); } }
}

/* ---------- Blocs de section ---------- */
.bloc { padding: var(--e-8) 0; }
.bloc-pale { background: var(--c-accent-pale); }
.bloc-tete { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--e-3); margin-bottom: var(--e-5); }
.bloc-tete .titre-section { margin-bottom: 0; }
.titre-section { font-size: var(--t-2xl); margin-bottom: var(--e-5); }
.lien-fleche { font-family: var(--f-titre); font-weight: 500; font-size: var(--t-s); }
.lien-fleche::after { content: " \2192"; }
.vide { color: var(--c-encre-douce); font-style: italic; }

/* Six familles : liste numérotée, le geste en grand */
.familles-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--c-ligne-forte); }
@media (min-width: 760px) { .familles-liste { grid-template-columns: 1fr 1fr; column-gap: var(--e-7); } }
.familles-liste li { border-bottom: 1px solid var(--c-ligne-forte); }
.familles-liste a { display: grid; grid-template-columns: 2.2rem 1fr auto; grid-template-areas: "num geste nb" "num nom nb"; align-items: baseline; column-gap: var(--e-3); padding: var(--e-4) 0; text-decoration: none; color: var(--c-encre); }
.fam-num { grid-area: num; font-family: var(--f-titre); font-size: var(--t-s); color: var(--c-accent-texte); font-weight: 600; }
.fam-num::before { content: "0"; }
.fam-geste { grid-area: geste; font-family: var(--f-titre); font-size: var(--t-xl); font-weight: 600; color: var(--c-principale); transition: transform var(--duree); }
.fam-nom { grid-area: nom; font-size: var(--t-s); color: var(--c-encre-douce); }
.fam-nb { grid-area: nb; font-family: var(--f-titre); font-size: var(--t-xs); color: var(--c-encre-douce); white-space: nowrap; }
.familles-liste a:hover .fam-geste { color: var(--c-principale-fonce); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
@media (prefers-reduced-motion: no-preference) { .familles-liste a:hover .fam-geste { transform: translateX(4px); } }

.regles { display: grid; gap: var(--e-5); }
@media (min-width: 900px) { .regles { grid-template-columns: 1fr 1.6fr; gap: var(--e-7); } .regles .titre-section { position: sticky; top: var(--e-5); align-self: start; } }

/* ---------- Cartes ---------- */
.grille-cartes { display: grid; gap: var(--e-5); grid-template-columns: 1fr; }
@media (min-width: 700px) { .grille-cartes { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .grille-cartes { grid-template-columns: repeat(3, 1fr); } }
.carte { position: relative; display: flex; flex-direction: column; background: var(--c-surface); border-radius: var(--r-m); overflow: hidden; border: 1px solid var(--c-ligne); transition: box-shadow var(--duree), border-color var(--duree); }
.carte:hover { box-shadow: var(--ombre-douce); border-color: var(--c-ligne-forte); }
.carte-visuel { aspect-ratio: 3 / 2; background: var(--c-principale-pale); overflow: hidden; display: grid; place-items: center; }
.carte-visuel picture, .carte-visuel img { width: 100%; height: 100%; object-fit: cover; }
.carte-anneau { width: 64px; height: 64px; border-radius: 50%; border: 12px solid var(--c-accent); }
.carte-corps { padding: var(--e-4) var(--e-5) var(--e-5); display: flex; flex-direction: column; flex: 1; }
.carte-famille { display: inline-block; align-self: flex-start; font-family: var(--f-titre); font-size: var(--t-xs); font-weight: 600; color: var(--c-accent-texte); background: var(--c-accent-pale); padding: 2px var(--e-2); border-radius: var(--r-rond); margin-bottom: var(--e-3); }
.carte-titre { font-size: var(--t-l); font-weight: 600; line-height: 1.3; margin-bottom: var(--e-2); }
.carte-titre a { color: var(--c-encre); text-decoration: none; }
.carte-titre a::after { content: ""; position: absolute; inset: 0; }
.carte-titre a:hover { color: var(--c-principale); }
.carte:focus-within { outline: 3px solid var(--c-focus); outline-offset: 2px; }
.carte-titre a:focus-visible { outline: none; }
.carte-desc { font-size: var(--t-s); color: var(--c-encre-douce); line-height: 1.55; margin-bottom: var(--e-3); }
.carte-pied { margin: auto 0 0; font-family: var(--f-titre); font-size: var(--t-xs); color: var(--c-encre-douce); }

/* ---------- Tête de page (fiches, familles, pages) ---------- */
.tete { padding: var(--e-5) 0 var(--e-6); }
.ariane ol { list-style: none; margin: 0 0 var(--e-5); padding: 0; display: flex; flex-wrap: wrap; gap: var(--e-1) var(--e-2); font-family: var(--f-titre); font-size: var(--t-xs); color: var(--c-encre-douce); }
.ariane li + li::before { content: "/"; margin-right: var(--e-2); color: var(--c-ligne-forte); }
.ariane a { color: var(--c-encre-douce); }
.ariane [aria-current] { color: var(--c-encre); }
.tete-texte { max-width: 50rem; }
.famille-etiquette { display: inline-block; font-family: var(--f-titre); font-size: var(--t-xs); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-accent-texte); margin-bottom: var(--e-3); }
.famille-etiquette a { color: var(--c-accent-texte); text-decoration: none; border-bottom: 2px solid var(--c-accent); }
.tete h1 { font-size: var(--t-3xl); }
.tete .chapo { margin-top: var(--e-4); font-size: var(--t-l); line-height: 1.55; color: var(--c-encre-douce); max-width: 42rem; }
.meta-fiche { display: flex; flex-wrap: wrap; gap: var(--e-1) var(--e-4); margin: var(--e-4) 0 0; font-family: var(--f-titre); font-size: var(--t-xs); color: var(--c-encre-douce); }
.tete-img { margin-top: var(--e-5); border-radius: var(--r-l); overflow: hidden; aspect-ratio: 16 / 9; background: var(--c-accent-pale); }
.tete-img picture, .tete-img img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 699px) { .tete-img { aspect-ratio: 4 / 3; border-radius: var(--r-m); } }
.tete-404 .conteneur { display: flex; align-items: center; justify-content: space-between; gap: var(--e-5); }
.anneau-404 { flex: 0 0 auto; width: clamp(80px, 18vw, 180px); aspect-ratio: 1; border-radius: 50%; border: clamp(14px, 3vw, 30px) solid var(--c-accent); }

/* ---------- Fiche : rail du déroulé + corps ---------- */
.fiche { display: grid; gap: var(--e-5); padding-bottom: var(--e-8); }
@media (min-width: 1060px) { .fiche { grid-template-columns: 250px minmax(0, var(--largeur-texte)); column-gap: var(--e-8); justify-content: center; } .fiche-rail { position: sticky; top: var(--e-5); align-self: start; } }
.fiche-corps { min-width: 0; }
.corps { padding-bottom: var(--e-7); }

.deroule { border-left: 3px solid var(--c-accent); padding: var(--e-2) 0 var(--e-2) var(--e-4); font-family: var(--f-titre); }
.deroule-titre { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 600; color: var(--c-accent-texte); margin-bottom: var(--e-2); }
.deroule ol { margin: 0; padding-left: 1.2rem; font-size: var(--t-s); line-height: 1.45; }
.deroule li { margin-bottom: var(--e-2); padding-left: var(--e-1); }
.deroule li::marker { color: var(--c-encre-douce); font-size: var(--t-xs); }
.deroule a { color: var(--c-encre); text-decoration: none; }
.deroule a:hover { color: var(--c-principale); text-decoration: underline; }

/* ---------- Prose ---------- */
.prose { max-width: var(--largeur-texte); }
.prose :where(p, ul, ol) { margin: 0; }
.prose > * + * { margin-top: var(--e-4); }
.prose h2 { font-size: var(--t-xl); margin-top: var(--e-7); scroll-margin-top: var(--e-5); }
.prose h3 { font-size: var(--t-l); margin-top: var(--e-6); scroll-margin-top: var(--e-5); }
.prose h2 + *, .prose h3 + * { margin-top: var(--e-3); }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0; }
.prose li { margin-top: var(--e-2); }
.prose li::marker { color: var(--c-accent-texte); }
.prose strong { font-weight: 650; }
.prose blockquote { margin-left: 0; padding-left: var(--e-4); border-left: 3px solid var(--c-principale); font-style: italic; color: var(--c-encre-douce); }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--t-s); display: block; overflow-x: auto; }
.prose th, .prose td { text-align: left; padding: var(--e-2) var(--e-3); border-bottom: 1px solid var(--c-ligne); vertical-align: top; }
.prose th { font-family: var(--f-titre); font-weight: 600; background: var(--c-accent-pale); }
.prose hr { border: 0; border-top: 1px dashed var(--c-ligne-forte); margin: var(--e-6) 0; }
.figure { margin: var(--e-6) 0 0; }
.figure img { border-radius: var(--r-m); }
.figure figcaption { font-size: var(--t-xs); font-family: var(--f-titre); color: var(--c-encre-douce); margin-top: var(--e-2); }

/* Les repères en bref : liste numérotée, chiffres en pastilles olive */
.reperes { background: var(--c-surface); border: 1px solid var(--c-ligne); border-radius: var(--r-m); padding: var(--e-5); }
.reperes-titre { font-family: var(--f-titre); font-weight: 600; font-size: var(--t-m); margin-bottom: var(--e-3) !important; }
.reperes ol { list-style: none; counter-reset: rep; padding: 0; margin: 0; }
.reperes li { counter-increment: rep; position: relative; padding-left: 2.6rem; margin-top: var(--e-3); line-height: 1.55; }
.reperes li::before { content: counter(rep); position: absolute; left: 0; top: 0.05em; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--c-accent); color: var(--c-encre); font-family: var(--f-titre); font-weight: 600; font-size: var(--t-s); display: grid; place-items: center; }

/* Encadré « Le geste à essayer » */
.geste { background: var(--c-principale-pale); border-radius: var(--r-m); padding: var(--e-5); margin-top: var(--e-6) !important; }
.geste-titre { display: flex; align-items: center; gap: var(--e-3); font-family: var(--f-titre); font-weight: 600; font-size: var(--t-l); color: var(--c-principale-fonce); margin-bottom: var(--e-3) !important; }
.geste-anneau { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; border: 5px solid var(--c-principale); }
.geste-corps > * + * { margin-top: var(--e-3); }
.geste-corps ul, .geste-corps ol { padding-left: 1.3rem; }

/* FAQ */
.questions { margin-top: var(--e-7) !important; }
.questions h2 { font-size: var(--t-xl); margin-bottom: var(--e-4); }
.questions details { border-top: 1px solid var(--c-ligne-forte); }
.questions details:last-of-type { border-bottom: 1px solid var(--c-ligne-forte); }
.questions summary { cursor: pointer; list-style: none; position: relative; padding: var(--e-4) 2.4rem var(--e-4) 0; font-family: var(--f-titre); font-weight: 500; line-height: 1.4; }
.questions summary::-webkit-details-marker { display: none; }
.questions summary::after { content: ""; position: absolute; right: 0.3rem; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 50%; border: 3px solid var(--c-accent); transition: background-color var(--duree); }
.questions details[open] summary::after { background: var(--c-accent); }
.questions details p { padding-bottom: var(--e-4); color: var(--c-encre); }

/* Relais IA : une bande fine, liens en ligne */
.relais { margin-top: var(--e-7) !important; padding: var(--e-4) 0; border-top: 3px solid var(--c-encre); border-bottom: 1px solid var(--c-ligne-forte); font-family: var(--f-titre); }
.relais-titre { font-size: var(--t-s); font-weight: 600; margin-bottom: var(--e-3) !important; }
.relais-liste { list-style: none; padding: 0 !important; display: flex; flex-wrap: wrap; gap: var(--e-2); }
.relais-liste li { margin: 0; }
.relais-liste a { display: inline-block; font-size: var(--t-s); padding: var(--e-1) var(--e-3); border: 1px solid var(--c-ligne-forte); border-radius: var(--r-rond); text-decoration: none; color: var(--c-encre); background: var(--c-surface); }
.relais-liste a:hover { border-color: var(--c-principale); color: var(--c-principale); }
.relais-md { margin-top: var(--e-3) !important; font-size: var(--t-xs); display: flex; flex-wrap: wrap; align-items: center; gap: var(--e-3); }
.relais-md button { font: inherit; font-size: var(--t-xs); background: none; border: 0; padding: 0; color: var(--c-principale); text-decoration: underline; cursor: pointer; }
.relais-note { font-size: var(--t-xs); color: var(--c-encre-douce); margin-top: var(--e-2) !important; }

/* À lire ensuite */
.suite { padding: var(--e-8) 0; background: var(--c-accent-pale); }

/* ---------- Pied ---------- */
.pied { background: var(--c-inverse); color: var(--c-sur-inverse-doux); padding: var(--e-8) 0 var(--e-5); font-family: var(--f-titre); font-size: var(--t-s); }
.pied a { color: var(--c-sur-inverse); text-decoration: none; }
.pied a:hover { text-decoration: underline; color: var(--c-sur-inverse); }
.pied-in { display: grid; gap: var(--e-6); }
@media (min-width: 800px) { .pied-in { grid-template-columns: 1.4fr 1fr 1fr; } }
.pied-marque img { height: 32px; width: auto; margin-bottom: var(--e-3); }
.pied-titre { color: var(--c-sur-inverse); font-weight: 600; margin-bottom: var(--e-3); }
.pied-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--e-2); }
.pied-bas { margin-top: var(--e-7); padding-top: var(--e-4); border-top: 1px solid rgba(255, 255, 255, 0.18); font-size: var(--t-xs); line-height: 1.6; }
.pied-bas p { margin-bottom: var(--e-2); }

@media print { .entete, .familles, .pied, .relais, .suite, .fiche-rail { display: none; } body { background: #fff; } }
.prose td:first-child, .prose th:first-child { white-space: nowrap; }
