/* Kelosia : feuille de style unique du site.
   Source : docs/charte-kelosia.md (section 8). Aucune couleur hors des tokens. */

/* ---------- Polices (hébergées sur le site, licence OFL) ---------- */
@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('../polices/bricolage-grotesque.woff2') format('woff2');
  font-weight: 600 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Instrument Sans';
  src: url('../polices/instrument-sans.woff2') format('woff2');
  font-weight: 400 600;
  font-style: normal;
  font-display: swap;
}

/* ---------- Tokens (charte, section 8.3, recopiés à l'identique) ---------- */
:root {
  /* Couleurs */
  --k-prune: #7B2A8C;          /* signature, 10 % max */
  --k-prune-eclaircie: #B68AC0; /* accents sur fond anthracite */
  --k-prune-profonde: #5C2069;  /* décor sur fond prune, survol des boutons */
  --k-lilas: #E2D6E5;           /* texte secondaire sur fond prune */
  --k-anthracite: #24221F;      /* textes, fonds sombres */
  --k-texte-2: #3A3632;         /* texte secondaire */
  --k-gris: #5C564F;            /* libellés, légendes */
  --k-lin: #EDE6DD;             /* fond principal */
  --k-greige: #DCD3C8;          /* fonds secondaires */
  --k-blanc-casse: #FAF7F3;     /* cartes, zones de lecture */
  --k-bordure: #C9BFB3;         /* filets, bordures */

  /* Polices */
  --k-font-titre: 'Bricolage Grotesque', system-ui, sans-serif;
  --k-font-texte: 'Instrument Sans', system-ui, sans-serif;

  /* Tailles (mobile -> bureau) */
  --k-h1: clamp(2.75rem, 6vw, 4.5rem);
  --k-h2: clamp(2rem, 4vw, 3rem);
  --k-h3: clamp(1.375rem, 2.2vw, 1.75rem);
  --k-accroche: clamp(1.1875rem, 1.6vw, 1.375rem);
  --k-texte: clamp(1.0625rem, 1.2vw, 1.125rem);
  --k-libelle: 0.875rem;

  /* Espacements (base 8 px) */
  --k-space-1: 8px;  --k-space-2: 16px; --k-space-3: 24px;
  --k-space-4: 32px; --k-space-6: 48px; --k-space-8: 64px;
  --k-space-12: 96px; --k-space-16: 128px;

  /* Formes */
  --k-radius: 4px;
  --k-largeur-max: 1200px;
  --k-largeur-texte: 680px;

  /* Dérivés (aucune nouvelle valeur de couleur) */
  --k-marge: var(--k-space-3);          /* 24 px mobile, 64 px bureau (charte, section 5) */
  --k-transition: 180ms ease;           /* survol uniquement, 150 à 200 ms */
}
@media (min-width: 768px) {
  :root { --k-marge: var(--k-space-8); }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--k-lin);
  color: var(--k-anthracite);
  font-family: var(--k-font-texte);
  font-size: var(--k-texte);
  font-weight: 400;
  line-height: 1.6;
}
img { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-family: var(--k-font-titre);
  color: var(--k-anthracite);
  margin: 0 0 var(--k-space-3);
  font-style: normal;
}
h1, h2 { font-weight: 700; letter-spacing: -0.04em; line-height: 1.05; }
h1 { font-size: var(--k-h1); }
h2 { font-size: var(--k-h2); }
h3 { font-size: var(--k-h3); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; margin-bottom: var(--k-space-2); }
p, ul, ol { margin: 0 0 var(--k-space-2); }
.titre-fort::after { content: "."; color: var(--k-prune); } /* point final des titres forts */

.accroche {
  font-size: var(--k-accroche);
  font-weight: 600;
  line-height: 1.3;
  color: var(--k-texte-2);
  max-width: var(--k-largeur-texte);
}
.texte { max-width: var(--k-largeur-texte); }
.legende { font-size: var(--k-libelle); color: var(--k-gris); line-height: 1.3; }

/* Liens : prune. Dans le texte courant, toujours soulignés (WCAG 1.4.1 : la couleur
   seule ne suffit pas à les distinguer de l'anthracite), soulignement renforcé au survol. */
a { color: var(--k-prune); text-decoration: none; transition: color var(--k-transition), background-color var(--k-transition), border-color var(--k-transition), text-decoration-thickness var(--k-transition); }
a:hover { text-decoration: underline; }
.texte a, .prose a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.texte a:hover, .prose a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 2px solid var(--k-prune); outline-offset: 3px; }

.evitement {
  position: absolute; left: var(--k-space-2); top: -100px;
  background: var(--k-blanc-casse); color: var(--k-anthracite);
  padding: var(--k-space-1) var(--k-space-2); border-radius: var(--k-radius); z-index: 10;
}
.evitement:focus { top: var(--k-space-2); }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; margin: -1px; padding: 0; border: 0;
}

/* ---------- Mise en page ---------- */
.conteneur { max-width: calc(var(--k-largeur-max) + 2 * var(--k-marge)); margin: 0 auto; padding: 0 var(--k-marge); }
.section { padding: var(--k-space-8) 0; position: relative; overflow: hidden; }
@media (min-width: 768px) { .section { padding: var(--k-space-12) 0; } }
.section--greige { background: var(--k-greige); }
.section--blanc { background: var(--k-blanc-casse); }
.section > .conteneur { position: relative; } /* au-dessus du motif du point */

.grille { display: grid; gap: var(--k-space-3); }
@media (min-width: 768px) {
  .grille--2 { grid-template-columns: repeat(2, 1fr); }
  .grille--3 { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- Logo ---------- */
.logo {
  font-family: var(--k-font-titre);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1;
  font-size: 1.75rem;
  color: var(--k-anthracite);
  text-decoration: none;
  display: inline-block;
  min-width: 80px; /* taille minimale de la charte */
}
.logo:hover { text-decoration: none; }
.logo .point { color: var(--k-prune); }
.logo--sombre { color: var(--k-blanc-casse); }
.logo--sombre .point { color: var(--k-prune-eclaircie); }
.logo--sur-prune { color: var(--k-blanc-casse); }
.logo--sur-prune .point { color: var(--k-lin); }

/* ---------- Boutons ---------- */
.bouton {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; padding: 14px 24px;
  border-radius: var(--k-radius);
  font-family: var(--k-font-texte); font-weight: 600; font-size: var(--k-texte); line-height: 1.3;
  text-decoration: none; cursor: pointer;
  background: var(--k-prune); color: var(--k-blanc-casse);
  border: 1.5px solid var(--k-prune);
}
.bouton:hover { background: var(--k-prune-profonde); border-color: var(--k-prune-profonde); text-decoration: none; }
.bouton--secondaire { background: transparent; color: var(--k-anthracite); border-color: var(--k-anthracite); }
.bouton--secondaire:hover { background: var(--k-greige); border-color: var(--k-anthracite); }

/* ---------- Sur-titre ---------- */
.surtitre {
  display: flex; align-items: center; gap: var(--k-space-1);
  font-family: var(--k-font-texte); font-size: var(--k-libelle); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; line-height: 1.3;
  color: var(--k-gris); margin: 0 0 var(--k-space-2);
}
.surtitre::before {
  content: ""; width: 10px; height: 10px; border-radius: 50%;
  background: var(--k-prune); flex: none;
}

/* ---------- Carte ---------- */
.carte { background: var(--k-blanc-casse); border-radius: var(--k-radius); padding: var(--k-space-4); }
.carte > :last-child { margin-bottom: 0; }

/* ---------- Bandeau d'appel à l'action ---------- */
.bandeau { border-radius: var(--k-radius); padding: var(--k-space-6) var(--k-space-3); }
@media (min-width: 768px) { .bandeau { padding: var(--k-space-8); } }
.bandeau h2 { color: var(--k-blanc-casse); }
.bandeau p { color: var(--k-lilas); max-width: var(--k-largeur-texte); }
.bandeau--anthracite { background: var(--k-anthracite); }
.bandeau--anthracite p { color: var(--k-greige); }
.bandeau--anthracite h2::after { color: var(--k-prune-eclaircie); }
.bandeau--prune { background: var(--k-prune); }
.bandeau--prune h2::after { color: var(--k-lin); }
/* Sur fond prune, le bouton s'inverse pour rester visible */
.bandeau--prune .bouton { background: var(--k-blanc-casse); color: var(--k-prune); border-color: var(--k-blanc-casse); }
.bandeau--prune .bouton:hover { background: var(--k-lin); border-color: var(--k-lin); }
.bandeau--prune :focus-visible { outline-color: var(--k-blanc-casse); }

/* ---------- Motif du point (un par page au plus, aria-hidden) ---------- */
.point-deco {
  position: absolute; border-radius: 50%; background: var(--k-prune);
  width: clamp(300px, 30vw, 420px); aspect-ratio: 1;
  pointer-events: none;
}
.point-deco--bas-droite { right: calc(-0.35 * clamp(300px, 30vw, 420px)); bottom: calc(-0.4 * clamp(300px, 30vw, 420px)); }
.point-deco--haut-droite { right: calc(-0.4 * clamp(300px, 30vw, 420px)); top: calc(-0.35 * clamp(300px, 30vw, 420px)); }
@media (max-width: 767px) { .point-deco { display: none; } } /* un seul accent : sur mobile, le bouton suffit */

/* ---------- Formulaire ---------- */
.champ { display: flex; flex-direction: column; gap: var(--k-space-1); margin-bottom: var(--k-space-3); }
.champ label, .champ legend { font-weight: 600; line-height: 1.3; }
.champ input, .champ textarea, .champ select {
  font: inherit; color: var(--k-anthracite);
  background: var(--k-blanc-casse);
  border: 1px solid var(--k-bordure); border-radius: var(--k-radius);
  padding: 12px var(--k-space-2); min-height: 44px;
}
.champ textarea { min-height: 160px; resize: vertical; }
.champ input:focus, .champ textarea:focus, .champ select:focus { outline: 2px solid var(--k-prune); outline-offset: 0; border-color: var(--k-prune); }
.champ .aide { font-size: var(--k-libelle); color: var(--k-gris); }
.choix, .champ .choix { display: flex; align-items: center; gap: var(--k-space-1); font-weight: 400; min-height: 44px; }
.choix input { width: 20px; height: 20px; margin: 0; accent-color: var(--k-prune); flex: none; }
fieldset.champ { border: 0; padding: 0; margin-left: 0; margin-right: 0; }

/* ---------- En-tête ---------- */
.entete { background: var(--k-lin); border-bottom: 1px solid var(--k-bordure); position: sticky; top: 0; z-index: 5; }
.entete .conteneur { display: flex; align-items: center; gap: var(--k-space-2); min-height: 72px; }
.entete .logo { margin-right: auto; }
.entete .bouton { padding: 10px 14px; font-size: var(--k-libelle); white-space: nowrap; }
.menu-bascule {
  font: inherit; font-weight: 600; font-size: var(--k-libelle);
  background: transparent; color: var(--k-anthracite);
  border: 1.5px solid var(--k-anthracite); border-radius: var(--k-radius);
  min-height: 44px; padding: 0 var(--k-space-2); cursor: pointer;
}
.nav ul { list-style: none; margin: 0; padding: 0; }
.nav a { color: var(--k-anthracite); font-weight: 500; display: block; padding: 12px 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--k-prune); }
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }

@media (max-width: 899px) {
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--k-lin); border-bottom: 1px solid var(--k-bordure); }
  .nav.ouvert { display: block; }
  .nav ul { padding: var(--k-space-1) var(--k-marge) var(--k-space-2); }
  .nav li + li { border-top: 1px solid var(--k-bordure); }
  .entete .conteneur { position: relative; }
}
@media (min-width: 900px) {
  .menu-bascule { display: none; }
  .nav { order: 0; }
  .nav ul { display: flex; gap: var(--k-space-4); }
  .entete .bouton { order: 1; padding: 14px 24px; font-size: var(--k-texte); }
}
/* Sans JavaScript, le menu reste visible */
.sans-js .nav { display: block; position: static; }
.sans-js .menu-bascule { display: none; }

/* ---------- Pied de page ---------- */
.pied { background: var(--k-anthracite); color: var(--k-greige); padding: var(--k-space-8) 0 var(--k-space-4); }
.pied .logo { font-size: 2.25rem; }
.pied .signature { font-family: var(--k-font-titre); font-weight: 600; color: var(--k-blanc-casse); font-size: var(--k-h3); letter-spacing: -0.02em; margin: var(--k-space-2) 0 var(--k-space-6); }
.pied .signature .point { color: var(--k-prune-eclaircie); }
.pied h2 { color: var(--k-blanc-casse); font-family: var(--k-font-texte); font-size: var(--k-libelle); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; line-height: 1.3; margin-bottom: var(--k-space-2); }
.pied ul { list-style: none; padding: 0; margin: 0; }
.pied li { margin-bottom: var(--k-space-1); }
.pied a { color: var(--k-blanc-casse); }
.pied a:hover { color: var(--k-prune-eclaircie); }
.pied :focus-visible { outline-color: var(--k-prune-eclaircie); }
.pied .bas { border-top: 1px solid var(--k-gris); margin-top: var(--k-space-6); padding-top: var(--k-space-3); font-size: var(--k-libelle); }

/* ---------- Composants de pages ---------- */
.heros { padding: var(--k-space-8) 0; position: relative; overflow: hidden; }
@media (min-width: 768px) { .heros { padding: var(--k-space-16) 0 var(--k-space-12); } }
.heros .accroche { margin-bottom: var(--k-space-4); }
.boutons { display: flex; flex-wrap: wrap; gap: var(--k-space-2); }
.entete-section { max-width: var(--k-largeur-texte); margin-bottom: var(--k-space-6); }
.entete-section > :last-child { margin-bottom: 0; }

.lien-suite { font-weight: 600; display: inline-flex; align-items: center; gap: var(--k-space-1); min-height: 44px; }
.carte .liens { list-style: none; padding: 0; margin: var(--k-space-2) 0 0; }
.carte--entree { display: flex; flex-direction: column; }
.carte--entree .liens { margin-top: auto; padding-top: var(--k-space-2); }

.liste { padding-left: 0; list-style: none; max-width: var(--k-largeur-texte); }
.liste li { position: relative; padding-left: var(--k-space-3); margin-bottom: var(--k-space-1); }
.liste li::before {
  content: ""; position: absolute; left: 0; top: 0.65em;
  width: 8px; height: 8px; border-radius: 50%; background: var(--k-anthracite);
}

.etapes { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--k-space-3); counter-reset: etape; }
@media (min-width: 900px) { .etapes--4 { grid-template-columns: repeat(4, 1fr); } .etapes--5 { grid-template-columns: repeat(5, 1fr); } }
.etapes li { counter-increment: etape; border-top: 1px solid var(--k-anthracite); padding-top: var(--k-space-2); }
.etapes li::before {
  content: counter(etape, decimal-leading-zero);
  display: block; font-family: var(--k-font-titre); font-weight: 700; font-size: var(--k-h3);
  letter-spacing: -0.02em; line-height: 1; margin-bottom: var(--k-space-2); color: var(--k-gris);
}
.etapes h3 { font-size: var(--k-accroche); }
.etapes p { margin: 0; }

.fondateur { display: grid; gap: var(--k-space-6); align-items: start; }
@media (min-width: 900px) { .fondateur { grid-template-columns: 5fr 7fr; } }
.fondateur img { border-radius: var(--k-radius); width: 100%; }
.citation {
  margin: var(--k-space-4) 0 0; padding-left: var(--k-space-3);
  border-left: 2px solid var(--k-anthracite); max-width: var(--k-largeur-texte);
}
.citation p { color: var(--k-texte-2); }

.page-legale { max-width: var(--k-largeur-texte); }
.page-legale h1 { font-size: var(--k-h2); }
.page-legale h2 { font-size: var(--k-h3); letter-spacing: -0.02em; line-height: 1.15; margin-top: var(--k-space-6); }
.page-legale .liste { margin-bottom: var(--k-space-2); }
.page-legale .mise-a-jour { margin-top: var(--k-space-6); }

.formulaire { max-width: var(--k-largeur-texte); }
.formulaire .piege { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.message-retour { border-radius: var(--k-radius); padding: var(--k-space-2) var(--k-space-3); margin-bottom: var(--k-space-4); background: var(--k-blanc-casse); border-left: 4px solid var(--k-anthracite); }
.h3-like { font-family: var(--k-font-titre); font-size: var(--k-h3); font-weight: 600; letter-spacing: -0.02em; line-height: 1.15; margin: 0 0 var(--k-space-2); }
.carte .h3-like + p { margin-bottom: var(--k-space-4); }
.champ .choix span { line-height: 1.4; }
.contact-grille { display: grid; gap: var(--k-space-6); }
@media (min-width: 900px) { .contact-grille { grid-template-columns: 7fr 5fr; } }

/* ---------- Repères de contenu manquant ---------- */
.a-completer {
  background: var(--k-greige); color: var(--k-anthracite);
  border: 1px dashed var(--k-gris); border-radius: var(--k-radius);
  padding: 0 var(--k-space-1); font-size: 0.9em;
}
.photo-a-fournir {
  background: var(--k-greige); color: var(--k-gris); border-radius: var(--k-radius);
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 4 / 5; font-size: var(--k-libelle); font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
}

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