/* Hub VMaths — feuille de style. Jetons du socle 2.1, thème clair, police système. */
:root {
  --fond: #f8fafc;
  --carte: #ffffff;
  --bordure: #e2e8f0;
  --bordure-douce: #eef2f7;
  --texte: #0f172a;
  --texte-2: #334155;
  --texte-3: #475569;
  --aide: #64748b;
  --accent: #4f46e5;
  --accent-fonce: #4338ca;
  --accent-tres-fonce: #3730a3;
  --accent-pale: #eef2ff;
  --accent-bord: #c7d2fe;
  --zone-resultat: #f5f7ff;
  --contour-champ: #7c8799;
  --ombre: 0 10px 30px rgba(15, 23, 42, 0.08);
  --rayon-carte: 16px;
  --rayon-tuile: 12px;
  --rayon-champ: 10px;
  --police: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
body { margin: 0; background: var(--fond); color: var(--texte); font-family: var(--police); font-size: 16px; line-height: 1.5; }
a { color: var(--accent-fonce); }
a:hover { color: var(--accent-tres-fonce); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }

.conteneur { width: 100%; max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

.evitement { position: absolute; left: 8px; top: -60px; padding: 10px 14px; background: var(--texte); color: #fff; border-radius: var(--rayon-champ); z-index: 10; }
.evitement:focus { top: 8px; color: #fff; }

/* Barre haute */
.barre { background: var(--carte); border-bottom: 1px solid var(--bordure); }
.barre .conteneur { display: flex; align-items: center; min-height: 56px; }
.marque { font-weight: 800; font-size: 20px; letter-spacing: -0.02em; color: var(--texte); text-decoration: none; padding: 6px 0; }
.marque span { color: var(--accent); }
.marque:hover { color: var(--texte); }

.principal { display: flex; flex-direction: column; gap: 44px; padding-block: 40px 64px; }

/* Ouverture */
.ouverture { display: flex; flex-direction: column; gap: 18px; max-width: 780px; }
.surtitre { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent); }
h1 { margin: 0; font-size: clamp(32px, 5vw, 52px); line-height: 1.05; font-weight: 800; letter-spacing: -0.03em; text-wrap: balance; }
.h1-suite { color: var(--aide); }
.promesse { margin: 0; font-size: 18px; color: var(--texte-2); }

/* Recherche */
.recherche { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.recherche-etiquette { font-size: 14px; font-weight: 600; color: var(--texte-2); }
.recherche-champ { position: relative; display: flex; align-items: center; }
.recherche-loupe { position: absolute; left: 16px; fill: none; stroke: var(--aide); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.recherche input { width: 100%; height: 58px; padding: 0 56px 0 50px; font: inherit; font-size: 18px; color: var(--texte); background: var(--carte); border: 1.5px solid var(--contour-champ); border-radius: var(--rayon-tuile); box-shadow: var(--ombre); -webkit-appearance: none; appearance: none; }
.recherche input::placeholder { color: var(--aide); opacity: 1; }
.recherche input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-bord), var(--ombre); }
.recherche input::-webkit-search-cancel-button { -webkit-appearance: none; }
.recherche-effacer { position: absolute; right: 7px; width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 0; background: transparent; border-radius: var(--rayon-champ); color: var(--texte-3); cursor: pointer; }
.recherche-effacer svg { fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; }
.recherche-effacer:hover { background: var(--accent-pale); color: var(--accent-tres-fonce); }
.aide { margin: 0; font-size: 13px; color: var(--aide); }

/* Résultats */
.resultats { display: flex; flex-direction: column; gap: 14px; }
.resultats-titre { margin: 0; font-size: 22px; font-weight: 700; letter-spacing: -0.01em; }
.facettes { display: flex; flex-wrap: wrap; gap: 8px; }
.facettes:empty { display: none; }
.facette { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid #cbd5e1; background: var(--carte); color: #1e293b; font: inherit; font-size: 14px; cursor: pointer; }
.facette:hover { border-color: var(--accent); color: var(--accent-tres-fonce); }
.facette[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.facette-nb { font-variant-numeric: tabular-nums; opacity: 0.8; }
.liste-resultats { list-style: none; margin: 0; padding: 0; background: var(--carte); border: 1px solid var(--bordure); border-radius: var(--rayon-carte); box-shadow: var(--ombre); overflow: hidden; }
.liste-resultats:empty { display: none; }
.liste-resultats li + li { border-top: 1px solid var(--bordure-douce); }
.resultat { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; padding: 14px 18px; color: inherit; text-decoration: none; }
.resultat:hover, .resultat.actif { background: var(--zone-resultat); color: inherit; }
.resultat.actif { box-shadow: inset 4px 0 0 var(--accent); }
.resultat-texte { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 320px; }
.resultat-nom { font-size: 17px; font-weight: 650; color: var(--texte); }
.resultat-suite { font-size: 14px; color: var(--texte-3); }
.resultat-rubrique { flex: 0 0 auto; font-size: 13px; color: var(--accent-fonce); background: var(--accent-pale); border-radius: 999px; padding: 4px 10px; }
mark { background: #e0e7ff; color: #1e1b4b; border-radius: 3px; padding: 0 1px; }
.aucun { display: flex; flex-direction: column; gap: 10px; padding: 22px; background: var(--carte); border: 1px solid var(--bordure); border-radius: var(--rayon-carte); }
.aucun p { margin: 0; color: var(--texte-2); }
.aucun .aucun-titre { font-size: 17px; font-weight: 600; color: var(--texte); }
.suggestion { border: 0; background: none; padding: 0; color: var(--accent-fonce); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.partiels h3 { margin: 0 0 10px; font-size: 15px; font-weight: 700; color: var(--texte-2); }
.liste-partiels { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr)); gap: 8px; }
.liste-partiels a { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--carte); border: 1px solid var(--bordure); border-radius: var(--rayon-tuile); color: var(--texte); text-decoration: none; font-weight: 600; }
.liste-partiels a span { font-size: 13px; font-weight: 400; color: var(--texte-3); }
.liste-partiels a:hover { border-color: #a5b4fc; }

/* Rubriques */
h2 { margin: 0; font-size: 22px; font-weight: 750; letter-spacing: -0.01em; }
.rubriques { display: flex; flex-direction: column; gap: 16px; }
.rubriques > h2 { font-size: 26px; letter-spacing: -0.02em; }
.tuiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.tuiles li { display: flex; }
.tuile { flex: 1; display: flex; flex-direction: column; gap: 6px; padding: 16px; min-height: 44px; background: var(--carte); border: 1px solid var(--bordure); border-radius: var(--rayon-tuile); color: var(--texte); text-decoration: none; }
.tuile:hover { border-color: #a5b4fc; color: var(--texte); }
.tuile-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.tuile-nom { font-weight: 700; }
.tuile-nb { flex: 0 0 auto; font-size: 13px; color: var(--texte-3); font-variant-numeric: tabular-nums; }
.tuile-intro { font-size: 13px; color: var(--texte-3); line-height: 1.4; }

/* Catalogue */
.catalogue { display: flex; flex-direction: column; gap: 36px; }
.rubrique { display: flex; flex-direction: column; gap: 12px; }
.rubrique-tete { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; }
.compte { font-size: 15px; font-weight: 500; color: var(--aide); font-variant-numeric: tabular-nums; white-space: nowrap; }
.retour { font-size: 14px; text-decoration: none; padding: 10px 0; }
.retour:hover { text-decoration: underline; }
.rubrique-intro { margin: 0; color: var(--texte-3); max-width: 70ch; }
.outils { list-style: none; margin: 0; padding: 6px 16px; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); column-gap: 24px; background: var(--carte); border: 1px solid var(--bordure); border-radius: var(--rayon-carte); }
.outils li { border-bottom: 1px solid #f1f5f9; display: flex; }
.outil { flex: 1; display: flex; flex-direction: column; justify-content: center; min-height: 52px; padding: 10px 0; text-decoration: none; color: var(--texte); }
.outil-nom { font-weight: 600; color: var(--accent-tres-fonce); }
.outil-suite { font-size: 13px; color: var(--texte-3); }
.outil:hover .outil-nom { text-decoration: underline; }
.js .outils.replie > li:nth-child(n+10) { display: none; }
.deplier { display: none; align-self: flex-start; min-height: 44px; padding: 0 16px; border: 1px solid var(--accent-bord); background: var(--accent-pale); color: var(--accent-tres-fonce); border-radius: var(--rayon-champ); font: inherit; font-weight: 600; cursor: pointer; }
.js .deplier { display: inline-flex; align-items: center; }
.deplier:hover { background: #e0e7ff; }
.nouveaux { display: flex; flex-direction: column; gap: 12px; }

/* FAQ */
.faq { display: flex; flex-direction: column; gap: 12px; max-width: 780px; }
.faq details { background: var(--carte); border: 1px solid var(--bordure); border-radius: var(--rayon-tuile); padding: 0 16px; }
.faq summary { cursor: pointer; font-weight: 600; padding: 14px 0; min-height: 44px; }
.faq details p { margin: 0 0 14px; color: var(--texte-2); }

/* Pied de page */
.pied { background: var(--carte); border-top: 1px solid var(--bordure); }
.pied .conteneur { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; padding-block: 16px; font-size: 14px; color: var(--texte-3); }
.pied a { display: inline-flex; align-items: center; min-height: 44px; }

@media (max-width: 640px) {
  .principal { gap: 36px; padding-block: 28px 48px; }
  .promesse { font-size: 17px; }
  .recherche input { font-size: 17px; }
  .resultat { padding: 12px 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}
.resultat-plus { margin: 0; padding: 12px 18px; font-size: 14px; color: var(--texte-3); }
