/* khls — design system « Le Reçu », feuille commune aux pages de contenu.
 *
 * Chemin d'accès : app/_redirects réécrit khls.app/* vers /site/:splat, donc ce
 * fichier (app/site/assets/contenu.css) répond sur https://khls.app/assets/contenu.css.
 * Ne pas le confondre avec app/assets/, qui sert le CRM sur les sous-domaines.
 *
 * La landing (index.html) garde son CSS en ligne : elle porte beaucoup plus de
 * composants (cockpit, séquence épinglée, chat) et n'a pas à payer une requête
 * bloquante. Les pages de contenu, elles, partagent tout et vivent ici.
 */

:root {
  --encre: #141414;
  --papier: #FFF6E9;
  --creuse: #FAE8CB;
  --rouge: #E8432D;
  --rouge-txt: #C0301C;
  --safran: #FFC933;
  --majorelle: #2F49D1;
  --vert: #2FA45C;
  --sourdine: #6E6455;
  --font-display: "Archivo Black", "Arial Black", sans-serif;
  --font-body: "Space Grotesk", -apple-system, sans-serif;
  --font-mono: "Space Mono", ui-monospace, monospace;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-body); background: var(--papier); color: var(--encre);
  font-size: 17px; line-height: 1.68; -webkit-font-smoothing: antialiased;
}
::selection { background: var(--safran); color: var(--encre); }
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: var(--papier); border-left: 2px solid var(--encre); }
::-webkit-scrollbar-thumb { background: var(--safran); border: 2.5px solid var(--encre); }

/* le grain — la texture « papier » */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 999; pointer-events: none;
  opacity: .045; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.wrap { max-width: 780px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 40px); }

/* ---------- logotype et navigation ---------- */
.wm {
  position: relative; display: inline-block; font-family: var(--font-display);
  font-weight: 400; line-height: 1; letter-spacing: .01em; white-space: nowrap;
  text-decoration: none; color: inherit;
}
.wm::after {
  content: ""; position: absolute; left: -7%; right: -12%; top: 55%; height: .13em;
  background: var(--rouge); border-radius: 2px; transform: rotate(-1.4deg);
}
header.nav { border-bottom: 3px solid var(--encre); background: var(--papier); position: sticky; top: 0; z-index: 50; }
.nav-in { max-width: 1080px; margin: 0 auto; padding: 15px clamp(20px, 4vw, 40px); display: flex; align-items: center; gap: 22px; }
.nav .wm { font-size: 25px; }
.nav-links { display: flex; gap: 20px; margin-left: auto; align-items: center; }
.nav-links a:not(.btn) {
  color: var(--encre); text-decoration: none; font-size: 14.5px; font-weight: 600;
  position: relative; padding: 2px 3px; z-index: 0;
}
.nav-links a:not(.btn)::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 1px; height: 7px;
  background: var(--safran); z-index: -1; transition: right .2s var(--ease-out);
}
.nav-links a:not(.btn):hover::after { right: 0; }
@media (max-width: 640px) { .nav-links a:not(.btn) { display: none; } }

/* ---------- boutons — la presse mécanique ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 9px; padding: 12px 24px;
  border-radius: 8px; font-weight: 700; font-size: 15.5px; text-decoration: none;
  border: 3px solid var(--encre); cursor: pointer; font-family: var(--font-body);
  background: #fff; color: var(--encre); box-shadow: 5px 5px 0 var(--encre);
  transition: transform .12s ease-out, box-shadow .12s ease-out;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--encre); }
.btn:active { transform: translate(5px, 5px); box-shadow: 0 0 0 var(--encre); }
.btn:focus-visible { outline: 3px solid var(--rouge); outline-offset: 3px; }
.btn--encre { background: var(--encre); color: var(--papier); }
.btn--laiton { background: var(--safran); }
.nav .btn { padding: 9px 18px; font-size: 14px; box-shadow: 4px 4px 0 var(--encre); }

/* ---------- fil d'Ariane ---------- */
.miette { padding: 26px 0 0; font-family: var(--font-mono); font-size: 12.5px; color: var(--sourdine); }
.miette a { color: var(--rouge-txt); text-decoration: none; font-weight: 700; }
.miette a:hover { text-decoration: underline; }

/* ---------- en-tête d'article ---------- */
.chapeau { padding: 22px 0 44px; }
.tampon-cat {
  display: inline-block; font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; color: var(--rouge-txt);
  border: 2.5px solid var(--rouge); border-radius: 6px; padding: 6px 12px;
  transform: rotate(-2deg); margin-bottom: 22px;
}
h1 {
  font-family: var(--font-display); font-weight: 400; text-transform: uppercase;
  font-size: clamp(27px, 4.2vw, 42px); line-height: 1.08; letter-spacing: -.005em;
  text-wrap: balance; margin-bottom: 20px;
}
h1 mark { background: linear-gradient(0deg, var(--safran) 44%, transparent 44%); color: inherit; padding: 0 .04em; }
.lede { font-size: 19px; font-weight: 500; color: #3A342C; }
/* le slogan « Paie khls » — paie, et c'est réglé (khlas, en darija) */
.slogan {
  font-family: var(--font-mono); font-weight: 700; font-size: 15px; color: var(--rouge-txt);
  letter-spacing: .01em; margin: -8px 0 18px;
}

/* bandeau de brouillon — tarifs proposés, non validés. À retirer avant publication. */
.brouillon {
  background: var(--rouge); color: #fff; border-bottom: 3px solid var(--encre);
  font-family: var(--font-mono); font-weight: 700; font-size: 13px; letter-spacing: .04em;
  text-align: center; padding: 10px 16px;
}
.meta-art {
  margin-top: 24px; font-family: var(--font-mono); font-size: 12px; color: var(--sourdine);
  border-top: 2px dashed var(--encre); padding-top: 14px;
}

/* ---------- corps de l'article ---------- */
article { padding-bottom: 30px; }
article h2 {
  font-family: var(--font-display); font-weight: 400; font-size: clamp(21px, 3vw, 28px);
  line-height: 1.15; margin: 52px 0 6px; text-wrap: balance;
}
article h2::after {
  content: ""; display: block; width: 58px; height: 6px; margin-top: 14px;
  background: var(--rouge); transform: rotate(-1deg);
}
article h3 { font-family: var(--font-display); font-weight: 400; font-size: 18px; margin: 30px 0 8px; }
article p { margin-bottom: 18px; }
article p + h3 { margin-top: 28px; }
article a {
  color: var(--rouge-txt); font-weight: 600; text-decoration: underline;
  text-decoration-thickness: 2px; text-underline-offset: 2px;
}
article a:hover { background: var(--safran); color: var(--encre); }
article ul { list-style: none; display: grid; gap: 11px; margin: 0 0 20px; }
article ul li { padding-left: 30px; position: relative; }
article ul li::before {
  content: ""; position: absolute; left: 0; top: 8px; width: 15px; height: 8px;
  border-left: 3.5px solid var(--rouge); border-bottom: 3.5px solid var(--rouge);
  transform: rotate(-45deg);
}
article strong { font-weight: 700; }
.mono { font-family: var(--font-mono); font-weight: 700; font-size: .92em; }

/* ---------- deux fiches comparées, tamponnées ---------- */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin: 26px 0 30px; }
@media (max-width: 660px) { .duo { grid-template-columns: 1fr; } }
.fiche { background: #fff; border: 3px solid var(--encre); border-radius: 10px; padding: 22px 20px; box-shadow: 6px 6px 0 var(--encre); }
.fiche--auth { box-shadow: 6px 6px 0 var(--rouge); }
.fiche-tampon {
  display: inline-block; font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 6px;
  border: 2.5px solid var(--encre); background: var(--safran); transform: rotate(-2deg); margin-bottom: 14px;
}
.fiche--auth .fiche-tampon { border-color: var(--rouge); color: var(--rouge-txt); background: #fff; }
.fiche h3 { margin: 0 0 10px; font-size: 16.5px; }
.fiche p { font-size: 14.5px; margin-bottom: 12px; }
.fiche ul { gap: 8px; margin-bottom: 0; }
.fiche ul li { font-size: 14px; padding-left: 24px; }
.fiche ul li::before { top: 7px; width: 12px; height: 6px; border-width: 3px; }
.fiche-delai {
  margin-top: 14px; padding-top: 12px; border-top: 2px dashed var(--encre);
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 700;
}

/* ---------- grille de catégories (4 fiches) ---------- */
.cats { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 26px 0 30px; }
@media (max-width: 660px) { .cats { grid-template-columns: 1fr; } }
.cat { background: #fff; border: 3px solid var(--encre); border-radius: 10px; padding: 20px 18px; box-shadow: 5px 5px 0 var(--encre); }
.cat--gratuit { box-shadow: 5px 5px 0 var(--vert); }
.cat-nom { font-family: var(--font-display); font-weight: 400; font-size: 16px; margin-bottom: 4px; }
.cat-prix {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; display: inline-block; padding: 3px 9px; border-radius: 5px;
  border: 2px solid var(--encre); background: var(--safran); margin-bottom: 12px;
}
.cat--gratuit .cat-prix { background: var(--vert); color: #fff; }
.cat p { font-size: 14.5px; margin-bottom: 0; }

/* ---------- encadré « reçu » pour les points clés ---------- */
.recu {
  background: #fff; border: 3px solid var(--encre); border-radius: 10px;
  box-shadow: 8px 8px 0 var(--safran); padding: 24px 22px; margin: 32px 0;
}
.recu-cap {
  font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; padding-bottom: 12px; border-bottom: 2px dashed var(--encre); margin-bottom: 16px;
}
.recu ul { margin-bottom: 0; }
.recu p:last-child { margin-bottom: 0; }

/* ---------- mise en garde (rouge) et avis daté (safran) ---------- */
.garde { border: 3px dashed var(--rouge); border-radius: 10px; padding: 20px 22px; margin: 36px 0; background: rgba(232, 67, 45, .05); }
.garde p { font-size: 15px; margin-bottom: 0; }
.garde b { color: var(--rouge-txt); }
.alerte { border: 3px solid var(--encre); border-left-width: 10px; border-radius: 10px; padding: 20px 22px; margin: 30px 0; background: var(--creuse); }
.alerte-date {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: var(--rouge-txt); margin-bottom: 8px;
}
.alerte p:last-child { margin-bottom: 0; }

/* ---------- sanctions / lignes chiffrées ---------- */
.sanctions { display: grid; gap: 12px; margin: 24px 0 28px; }
.sanction {
  display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap;
  background: #fff; border: 3px solid var(--encre); border-radius: 9px; padding: 14px 16px;
}
.sanction .art {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; background: var(--encre); color: var(--papier);
  padding: 4px 9px; border-radius: 5px; flex: 0 0 auto;
}
.sanction .quoi { flex: 1 1 220px; font-size: 14.5px; font-weight: 500; }
.sanction .combien { font-family: var(--font-mono); font-weight: 700; font-size: 15px; color: var(--rouge-txt); }

/* ---------- FAQ ---------- */
.faq { margin: 22px 0 0; }
.faq details { border-bottom: 2px dashed var(--encre); }
.faq summary {
  cursor: pointer; list-style: none; display: flex; justify-content: space-between;
  align-items: center; gap: 16px; padding: 19px 4px; font-weight: 700; font-size: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary:hover { color: var(--rouge-txt); }
.faq summary .plus {
  flex: 0 0 auto; width: 24px; height: 24px; position: relative;
  border: 2.5px solid var(--encre); border-radius: 6px; background: var(--safran);
  transition: transform .2s var(--ease-out);
}
.faq details[open] summary .plus { transform: rotate(90deg); }
.faq summary .plus::before, .faq summary .plus::after { content: ""; position: absolute; background: var(--encre); transition: transform .3s var(--ease-out); }
.faq summary .plus::before { left: 50%; top: 22%; bottom: 22%; width: 2.5px; transform: translateX(-50%); }
.faq summary .plus::after { top: 50%; left: 22%; right: 22%; height: 2.5px; transform: translateY(-50%); }
.faq details[open] summary .plus::before { transform: translateX(-50%) scaleY(0); }
.faq details p { padding: 0 4px 20px; font-size: 15.5px; }

/* ---------- grille tarifaire ---------- */
.grille { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin: 30px 0 14px; align-items: start; }
@media (max-width: 820px) { .grille { grid-template-columns: 1fr; } }
.palier {
  background: #fff; border: 3px solid var(--encre); border-radius: 10px; padding: 24px 20px;
  box-shadow: 6px 6px 0 var(--encre); display: flex; flex-direction: column; height: 100%;
}
.palier--vedette { background: var(--safran); box-shadow: 8px 8px 0 var(--rouge); transform: rotate(-.7deg); }
.palier-taille {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; border: 2px solid var(--encre); background: var(--safran);
  padding: 4px 10px; border-radius: 6px; align-self: flex-start; transform: rotate(-2deg); margin-bottom: 16px;
}
.palier--vedette .palier-taille { background: #fff; }
.palier-nom { font-family: var(--font-display); font-weight: 400; font-size: 19px; margin-bottom: 6px; }
.palier-pour { font-size: 14px; color: var(--sourdine); margin-bottom: 18px; }
.palier--vedette .palier-pour { color: #4A3A10; }
.prix { font-family: var(--font-mono); font-weight: 700; font-size: 27px; line-height: 1.1; letter-spacing: -.02em; }
.prix-unite { font-family: var(--font-body); font-size: 13.5px; font-weight: 600; color: var(--sourdine); margin-top: 4px; }
.palier--vedette .prix-unite { color: #4A3A10; }
.palier-sep { margin: 18px 0; border: 0; border-top: 2px dashed var(--encre); }
.palier ul { list-style: none; display: grid; gap: 8px; margin: 0 0 20px; font-size: 14px; }
.palier ul li { padding-left: 24px; position: relative; }
.palier ul li::before {
  content: ""; position: absolute; left: 0; top: 7px; width: 12px; height: 6px;
  border-left: 3px solid var(--rouge); border-bottom: 3px solid var(--rouge); transform: rotate(-45deg);
}
.palier--vedette ul li::before { border-color: var(--encre); }
.palier .btn { margin-top: auto; justify-content: center; }
.palier--vedette .btn { background: var(--encre); color: var(--papier); box-shadow: 5px 5px 0 #fff; }
.palier--vedette .btn:hover { box-shadow: 7px 7px 0 #fff; }
.palier--vedette .btn:active { box-shadow: 0 0 0 #fff; }

/* emplacement de prix non encore arrêté — impossible à confondre avec un tarif réel */
.tbd {
  display: inline-block; font-family: var(--font-mono); font-size: 15px; font-weight: 700;
  color: var(--rouge-txt); background: repeating-linear-gradient(45deg, #fff, #fff 6px, #FFE9E5 6px, #FFE9E5 12px);
  border: 2.5px dashed var(--rouge); border-radius: 6px; padding: 3px 10px; letter-spacing: .02em;
}

/* tout est inclus partout — le tableau des fonctions communes */
.inclus { background: #fff; border: 3px solid var(--encre); border-radius: 10px; box-shadow: 6px 6px 0 var(--vert); padding: 24px 22px; margin: 30px 0; }
.inclus-cap {
  font-family: var(--font-mono); font-size: 12px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; padding-bottom: 12px; border-bottom: 2px dashed var(--encre); margin-bottom: 16px;
}
.inclus ul { columns: 2; column-gap: 26px; gap: 0 !important; display: block !important; }
@media (max-width: 620px) { .inclus ul { columns: 1; } }
.inclus ul li { font-size: 14.5px; margin-bottom: 9px; break-inside: avoid; }

/* ---------- sources ---------- */
.sources { margin: 40px 0 0; padding-top: 20px; border-top: 3px solid var(--encre); }
.sources h2 { font-size: 17px !important; margin: 0 0 14px !important; }
.sources h2::after { display: none; }
.sources ul { gap: 9px; }
.sources li { font-size: 14.5px; }
.sources li::before { border-color: var(--sourdine) !important; }

/* ---------- bandeau final et pied ---------- */
.final { background: var(--encre); color: var(--papier); margin-top: 56px; padding: 52px 0; }
.final h2 {
  font-family: var(--font-display); font-weight: 400; font-size: clamp(21px, 3vw, 29px);
  line-height: 1.14; margin-bottom: 14px; text-transform: uppercase;
}
.final h2::after { content: ""; display: block; width: 58px; height: 6px; margin-top: 14px; background: var(--safran); transform: rotate(-1deg); }
.final p { color: #D8CBB4; margin: 16px 0 26px; font-weight: 500; }
.final .btn { border-color: var(--papier); box-shadow: 5px 5px 0 var(--rouge); }
.final .btn:hover { box-shadow: 7px 7px 0 var(--rouge); }
.final .btn:active { box-shadow: 0 0 0 var(--rouge); }

footer { background: var(--encre); color: #C9BCA4; border-top: 4px solid var(--rouge); }
.foot-in {
  max-width: 1080px; margin: 0 auto; padding: 28px clamp(20px, 4vw, 40px);
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 700;
}
.foot-in a { color: var(--papier); text-decoration: none; }
.foot-in a:hover { color: var(--safran); }
.foot-spacer { flex: 1; }
@media (max-width: 640px) { .foot-spacer { display: none; } }

/* ---------- Académie : la grille d'articles et le corps d'un article ----------
 * Pages générées par scripts/generer-academie.js à partir des mêmes fichiers
 * Markdown que le panneau 📚 du CRM. Une carte d'article porte un <h2> (le <h1>
 * est le titre de la page) : .fiche h3 ne suffisait donc pas.
 */
.grille--articles { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 820px) { .grille--articles { grid-template-columns: 1fr; } }
a.fiche { display: block; text-decoration: none; color: inherit; transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out); }
a.fiche:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--rouge); }
.fiche h2 { margin: 0 0 10px; font-size: 17px; line-height: 1.3; }
.fiche .meta-art { margin: 12px 0 0; }
/* Le corps d'un article : les titres de section sortent du Markdown, donc on
   les habille ici plutôt que dans le rendu — le même .md sert aussi le CRM. */
article h2 { margin: 40px 0 12px; }
article h3 { margin: 26px 0 8px; font-size: 17px; }
article blockquote {
  border-left: 5px solid var(--safran); background: var(--creuse);
  margin: 22px 0; padding: 14px 20px; border-radius: 0 8px 8px 0; font-weight: 500;
}
article pre {
  background: var(--encre); color: var(--papier); border-radius: 8px;
  padding: 16px 18px; overflow-x: auto; margin: 20px 0;
  font-family: var(--font-mono); font-size: 13.5px; line-height: 1.6;
}
article pre code { background: none; padding: 0; color: inherit; }
article code {
  font-family: var(--font-mono); font-size: .88em;
  background: var(--creuse); border-radius: 4px; padding: 2px 6px;
}
article hr { border: 0; border-top: 3px solid var(--encre); opacity: .18; margin: 40px 0 28px; }

/* ---------- réduction de mouvement ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn:hover, .btn:active { transform: none; }
}
