/* =========================================================================
   AfriCraft — thème "maison" Artisan
   Palette terre cuite / ocre / argile, motifs géométriques (adinkra / kente /
   bogolan) rendus en CSS pur. Tout est préfixé .afc- ; les couleurs s'appuient
   sur les variables Bootstrap (--bs-*) pour rester cohérentes avec le mode nuit.
   ========================================================================= */

/* ---- 1. Palette & tokens ------------------------------------------------ */
:root {
  /* Identité AfriCraft */
  --afc-clay:     #c0532b;   /* terre cuite, couleur signature */
  --afc-clay-deep:#9c3f1e;
  --afc-ochre:    #d99a2b;   /* ocre / safran */
  /* Variantes -rgb : indispensables pour rgba(var(--x-rgb), a). Sans elles,
     les motifs décoratifs figeaient la couleur en dur (rgba(217,154,43,.25)
     dans home.html) et ne suivaient ni la charte ni le mode nuit. */
  --afc-ochre-rgb: 217, 154, 43;
  --afc-olive:    #7a7340;   /* vert savane désaturé */
  --afc-espresso: #3a2a1f;   /* brun profond (texte) */
  --afc-ink:      #2a1d14;
  --afc-sand:     #e8d6bb;   /* sable / argile claire */
  --afc-sand-soft:#f1e6d3;
  --afc-cream:    #fbf5ec;   /* fond */
  --afc-cream-rgb: 251, 245, 236;

  /* Remappage Bootstrap (le skin vanilla suit ainsi notre palette) */
  --bs-primary:        var(--afc-clay);
  --bs-primary-rgb:    192, 83, 43;
  --bs-secondary:      var(--afc-ochre);
  --bs-secondary-rgb:  217, 154, 43;
  --bs-body-bg:        var(--afc-cream);
  --bs-body-color:     var(--afc-espresso);
  --bs-body-font-family: "Iowan Old Style", "Palatino Linotype", Palatino,
                         Georgia, "Times New Roman", serif;
  --bs-link-color:        var(--afc-clay-deep);
  --bs-link-color-rgb:    156, 63, 30;
  --bs-link-hover-color:  var(--afc-clay);
  --bs-link-hover-color-rgb: 192, 83, 43;
  --bs-border-color:      rgba(58, 42, 31, .15);
  --bs-heading-color:     var(--afc-espresso);

  --afc-shadow: 0 14px 38px -18px rgba(58, 42, 31, .45);
  --afc-radius: 14px;
}

/* Mode nuit : dark-mode.css (de _shared) pose data-bs-theme="dark" ; on
   réajuste seulement nos tokens d'ambiance pour rester chaleureux. */
[data-bs-theme="dark"] {
  --afc-cream:    #1e1712;
  --afc-cream-rgb: 30, 23, 18;
  --afc-sand:     #2a2018;
  --afc-sand-soft:#241b14;
  --afc-espresso: #f1e6d3;
  /* --afc-ink NON inversé : il sert UNIQUEMENT de fond au footer, qui doit
     rester une bande sombre (texte crème) en mode jour ET nuit. L'inverser
     rendait le footer clair avec un texte crème -> invisible. */
  --bs-body-bg:        #1a140f;
  --bs-body-color:     #f1e6d3;
  --bs-heading-color:  #f6efe2;
  --bs-border-color:   rgba(241, 230, 211, .14);
  --bs-link-color:        var(--afc-ochre);
  /* AUDIT CONTRASTE — Bootstrap 5.3 colore les <a> via rgba(var(--bs-link-color-rgb)) :
     sans remap le rgb restait sur l'argile sombre du jour (illisible en nuit). */
  --bs-link-color-rgb:    217, 154, 43;
  --bs-link-hover-color:  #f0c060;
  --bs-link-hover-color-rgb: 240, 192, 96;
  --afc-shadow: 0 16px 40px -16px rgba(0, 0, 0, .7);
}

/* ---- 2. Typographie ----------------------------------------------------- */
body { font-family: var(--bs-body-font-family); letter-spacing: .1px; }

.afc-display,
.afc-hero h1,
section[class*="afc-"] h2.afc-title {
  font-family: var(--bs-body-font-family);
  font-weight: 700;
  letter-spacing: -.4px;
  line-height: 1.05;
}

.afc-eyebrow {
  font-family: "Segoe UI", system-ui, sans-serif;
  text-transform: uppercase;
  letter-spacing: .28em;
  font-size: .72rem;
  font-weight: 700;
  color: var(--afc-clay);
  display: inline-flex;
  align-items: center;
  gap: .6rem;
}
.afc-eyebrow::before {
  content: "";
  width: 26px; height: 2px;
  background: var(--afc-ochre);
}

.afc-section-head { max-width: 46rem; }
.afc-section-head h2.afc-title {
  font-size: clamp(1.9rem, 4vw, 3rem);
  margin: .5rem 0 0;
}
.afc-section-head p { color: var(--bs-secondary-color); font-size: 1.08rem; }

/* ---- 3. Motifs géométriques (CSS pur) ----------------------------------- */
/* Bogolan / mud-cloth : fond sable tramé */
.afc-mudcloth {
  background-color: var(--afc-sand-soft);
  background-image:
    repeating-linear-gradient(45deg,
      rgba(58,42,31,.05) 0 2px, transparent 2px 13px),
    repeating-linear-gradient(-45deg,
      rgba(58,42,31,.05) 0 2px, transparent 2px 13px);
}

/* Bandeau kente : rubans verticaux clay / ocre / espresso */
.afc-kente {
  height: 14px;
  background: repeating-linear-gradient(90deg,
    var(--afc-clay)    0 12px,
    var(--afc-ochre)  12px 20px,
    var(--afc-espresso) 20px 24px,
    var(--afc-olive)  24px 36px,
    var(--afc-cream)  36px 40px);
  border-block: 2px solid var(--afc-espresso);
}

/* Frise de triangles (séparateur adinkra) */
.afc-triangles {
  height: 18px;
  background:
    linear-gradient(135deg, var(--afc-clay) 50%, transparent 50%) 0 0 / 18px 18px repeat-x,
    linear-gradient(225deg, var(--afc-clay) 50%, transparent 50%) 9px 0 / 18px 18px repeat-x;
  opacity: .9;
}

/* Filet diamant en bordure de carte */
.afc-diamond-rule {
  height: 8px;
  background-image:
    linear-gradient(45deg, var(--afc-ochre) 25%, transparent 25%, transparent 75%, var(--afc-ochre) 75%),
    linear-gradient(45deg, var(--afc-ochre) 25%, transparent 25%, transparent 75%, var(--afc-ochre) 75%);
  background-size: 12px 12px;
  background-position: 0 0, 6px 6px;
  opacity: .55;
}

/* ---- 4. Hero ------------------------------------------------------------ */
.afc-hero {
  position: relative;
  overflow: hidden;
  color: var(--afc-cream);
  background:
    radial-gradient(120% 120% at 85% 10%, rgba(217,154,43,.35), transparent 55%),
    linear-gradient(150deg, var(--afc-clay-deep), var(--afc-espresso) 78%);
  padding: clamp(4rem, 9vw, 8rem) 0 clamp(3rem, 7vw, 6rem);
}
[data-bs-theme="dark"] .afc-hero { color: #f6efe2; }

.afc-hero::before {  /* trame adinkra en filigrane */
  content: "";
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at center, rgba(251,245,236,.10) 2px, transparent 2.5px),
    repeating-linear-gradient(60deg, rgba(251,245,236,.05) 0 1px, transparent 1px 22px);
  background-size: 34px 34px, auto;
  pointer-events: none;
}
.afc-hero > .container { position: relative; z-index: 1; }

.afc-hero h1 { font-size: clamp(2.6rem, 6.5vw, 5rem); color: inherit; }
.afc-hero .afc-eyebrow { color: var(--afc-ochre); }
.afc-hero .afc-eyebrow::before { background: var(--afc-ochre); }
.afc-hero .afc-lead {
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  max-width: 40rem;
  color: rgba(251,245,236,.85);
}
.afc-typed { color: var(--afc-ochre); font-style: italic; }

/* ---- 5. Boutons --------------------------------------------------------- */
.btn-primary {
  --bs-btn-bg: var(--afc-clay);
  --bs-btn-border-color: var(--afc-clay);
  --bs-btn-hover-bg: var(--afc-clay-deep);
  --bs-btn-hover-border-color: var(--afc-clay-deep);
  --bs-btn-active-bg: var(--afc-clay-deep);
  --bs-btn-active-border-color: var(--afc-clay-deep);
  --bs-btn-color: #fff;
  --bs-btn-hover-color: #fff;
}
.btn-outline-primary {
  --bs-btn-color: var(--afc-clay);
  --bs-btn-border-color: var(--afc-clay);
  --bs-btn-hover-bg: var(--afc-clay);
  --bs-btn-hover-border-color: var(--afc-clay);
  --bs-btn-active-bg: var(--afc-clay-deep);
}
.afc-btn-ochre {
  --bs-btn-bg: var(--afc-ochre);
  --bs-btn-border-color: var(--afc-ochre);
  --bs-btn-hover-bg: #c4882140;
  --bs-btn-color: var(--afc-espresso);
  --bs-btn-hover-color: var(--afc-espresso);
}
.btn {
  --bs-btn-border-radius: 999px;
  --bs-btn-padding-x: 1.5rem;
  --bs-btn-padding-y: .6rem;
  --bs-btn-font-weight: 600;
  font-family: "Segoe UI", system-ui, sans-serif;
  letter-spacing: .02em;
}

/* ---- 6. Navigation ------------------------------------------------------ */
.afc-navbar {
  background: rgba(251, 245, 236, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--bs-border-color);
  box-shadow: 0 1px 0 rgba(192,83,43,.18);
}
[data-bs-theme="dark"] .afc-navbar { background: rgba(26, 20, 15, .92); }
.afc-navbar .navbar-brand {
  font-weight: 800;
  letter-spacing: -.3px;
  font-size: 1.35rem;
  color: var(--afc-espresso);
  display: inline-flex; align-items: center; gap: .55rem;
}
[data-bs-theme="dark"] .afc-navbar .navbar-brand { color: #f6efe2; }
.afc-navbar .navbar-brand::before {
  content: "";
  width: 16px; height: 16px;
  background: var(--afc-clay);
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
}
.afc-navbar .nav-link {
  font-family: "Segoe UI", system-ui, sans-serif;
  font-weight: 600;
  font-size: .95rem;
}
.afc-navbar .nav-link:hover,
.afc-navbar .nav-link.active { color: var(--afc-clay); }

/* ---- 7. Cartes ---------------------------------------------------------- */
.afc-card {
  background: var(--bs-body-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: var(--afc-radius);
  overflow: hidden;
  height: 100%;
  transition: transform .25s ease, box-shadow .25s ease;
  position: relative;
}
.afc-card::after {  /* liseré ocre en haut */
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: linear-gradient(90deg, var(--afc-clay), var(--afc-ochre));
  transform: scaleX(0); transform-origin: left; transition: transform .3s ease;
}
.afc-card:hover { transform: translateY(-5px); box-shadow: var(--afc-shadow); }
.afc-card:hover::after { transform: scaleX(1); }
.afc-card .afc-card-body { padding: 1.5rem; }
.afc-card h3, .afc-card .h5 { color: var(--bs-heading-color); }
.afc-card-img { aspect-ratio: 16/10; object-fit: cover; width: 100%; }

.afc-icon-badge {
  width: 56px; height: 56px;
  display: inline-grid; place-items: center;
  border-radius: 14px;
  background: rgba(var(--bs-primary-rgb), .12);
  color: var(--afc-clay);
  font-size: 1.5rem;
  border: 1px solid rgba(var(--bs-primary-rgb), .25);
}

/* ---- 8. Bandeau d'en-tête de page --------------------------------------- */
.afc-pagehead {
  position: relative;
  color: var(--afc-cream);
  background:
    radial-gradient(110% 120% at 90% 0%, rgba(217,154,43,.30), transparent 55%),
    linear-gradient(150deg, var(--afc-clay-deep), var(--afc-espresso));
  padding: clamp(3rem, 7vw, 5.5rem) 0 clamp(2.5rem, 5vw, 4rem);
  overflow: hidden;
}
.afc-pagehead h1 { color: inherit; font-weight: 700; font-size: clamp(2rem, 5vw, 3.4rem); }
.afc-pagehead .breadcrumb { --bs-breadcrumb-divider-color: rgba(251,245,236,.5); }
.afc-pagehead .breadcrumb a { color: var(--afc-ochre); text-decoration: none; }
.afc-pagehead .breadcrumb-item.active { color: rgba(251,245,236,.8); }

/* ---- 9. Sections génériques --------------------------------------------- */
.afc-section { padding: clamp(3.5rem, 7vw, 6rem) 0; }
.afc-section--sand { background: var(--afc-sand-soft); }

.afc-stat-value {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  font-weight: 800; color: var(--afc-clay); line-height: 1;
}
.afc-stat-label {
  font-family: "Segoe UI", system-ui, sans-serif;
  text-transform: uppercase; letter-spacing: .12em;
  font-size: .8rem; color: var(--bs-secondary-color);
}

/* Liste de compétences / barres */
.afc-skill-bar { height: 8px; background: var(--afc-sand); border-radius: 999px; overflow: hidden; }
.afc-skill-bar > span { display:block; height:100%; background: linear-gradient(90deg, var(--afc-clay), var(--afc-ochre)); }

/* Timeline (expériences / formations) */
.afc-timeline { position: relative; padding-left: 1.75rem; }
.afc-timeline::before {
  content:""; position:absolute; left:6px; top:4px; bottom:4px; width:2px;
  background: linear-gradient(var(--afc-clay), var(--afc-ochre));
}
.afc-timeline-item { position: relative; padding-bottom: 1.75rem; }
.afc-timeline-item::before {
  content:""; position:absolute; left:-1.75rem; top:5px; width:14px; height:14px;
  background: var(--afc-cream); border:3px solid var(--afc-clay);
  transform: rotate(45deg);
}

/* Citations / témoignages */
.afc-quote {
  border-left: 0; position: relative; padding: 2rem 1.75rem 1.75rem;
  background: var(--bs-body-bg); border: 1px solid var(--bs-border-color);
  border-radius: var(--afc-radius);
}
.afc-quote::before {
  content: "\201C"; position: absolute; top: -.3rem; left: 1rem;
  font-size: 4rem; color: var(--afc-ochre); line-height: 1; font-family: Georgia, serif;
}

/* Tag / pill */
.afc-tag {
  display: inline-block; font-family: "Segoe UI", system-ui, sans-serif;
  font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: .28rem .7rem; border-radius: 999px;
  background: rgba(var(--bs-primary-rgb), .12); color: var(--afc-clay-deep);
}
[data-bs-theme="dark"] .afc-tag { color: var(--afc-ochre); }

/* ---- 10. Footer --------------------------------------------------------- */
.afc-footer {
  background: var(--afc-ink);
  color: rgba(251,245,236,.8);
  padding-top: 3.5rem;
}
.afc-footer h5 { color: var(--afc-ochre); font-family: "Segoe UI", system-ui, sans-serif; letter-spacing: .04em; }
.afc-footer a { color: rgba(251,245,236,.78); text-decoration: none; }
.afc-footer a:hover { color: var(--afc-ochre); }
/* Liens rapides étalés sur 3 colonnes (col-lg-8 large) -> plus de colonne
   unique qui laisse les 2/3 droite vides. Repli responsive. */
.afc-footer-links { columns: 3; column-gap: 2rem; }
.afc-footer-links li { margin-bottom: .5rem; break-inside: avoid; }
@media (max-width: 767.98px) { .afc-footer-links { columns: 2; } }
@media (max-width: 479.98px) { .afc-footer-links { columns: 1; } }
.afc-footer .afc-social a {
  width: 40px; height: 40px; display: inline-grid; place-items: center;
  border: 1px solid rgba(251,245,236,.2); border-radius: 50%; margin-right: .4rem;
  transition: background .2s, border-color .2s;
}
.afc-footer .afc-social a:hover { background: var(--afc-clay); border-color: var(--afc-clay); color: #fff; }
.afc-footer-bottom { border-top: 1px solid rgba(251,245,236,.12); margin-top: 2.5rem; padding: 1.25rem 0; font-size: .85rem; }

/* ---- 11. Utilitaires ---------------------------------------------------- */
.afc-prose { max-width: 44rem; }
.afc-prose p { line-height: 1.8; }
.afc-prose img { max-width: 100%; border-radius: var(--afc-radius); }
.afc-sticky-side { position: sticky; top: 90px; }

@media (max-width: 575.98px) {
  .afc-sticky-side { position: static; }
}

/* =========================================================================
   AUDIT CONTRASTE — WCAG AA (themes/audit/)
   ========================================================================= */

/* Footer : les liens _shared portent .link-body-emphasis, qui lit
   --bs-emphasis-color-rgb (noir par défaut) -> noir sur la bande sombre.
   On scope le token à la crème du footer (identique jour/nuit). */
.afc-footer {
  --bs-emphasis-color:     #fbf5ec;
  --bs-emphasis-color-rgb: 251, 245, 236;
}

/* Jour : .text-secondary résout sur l'ocre brute (--bs-secondary-rgb),
   illisible sur crème/sable (ratio ~2.3). Ocre assombrie, même famille ;
   la nuit garde l'ocre claire d'origine (lisible sur brun profond). */
.text-secondary { color: #7a5718 !important; }
[data-bs-theme="dark"] .text-secondary { color: var(--afc-ochre) !important; }
