/* =========================================================
   ELE MELKI — feuille de style
   Les valeurs de marque sont documentées dans site-config.yaml.
   Modifier une couleur ou une police : changer la variable ici
   ET dans site-config.yaml pour garder les deux alignés.
   ========================================================= */

/* ---------- Polices (hébergées sur le site, licence OFL) ---------- */
@font-face { font-family: "Cormorant Garamond"; src: url("../fonts/cormorant-garamond-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("../fonts/cormorant-garamond-latin-400-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("../fonts/cormorant-garamond-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("../fonts/cormorant-garamond-latin-600-normal.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Jost"; src: url("../fonts/jost-latin-300-normal.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Jost"; src: url("../fonts/jost-latin-400-normal.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Jost"; src: url("../fonts/jost-latin-500-normal.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

/* ---------- Jetons de marque ---------- */
:root {
  --chaux: #F2EBDD;          /* fond dominant */
  --chaux-claire: #F8F4EC;   /* fond secondaire, encarts */
  --sable: #D9C7A7;          /* filets, motifs */
  --pierre: #6B6257;         /* texte secondaire */
  --encre: #1C1A17;          /* texte, logotype */
  --laterite: #B5573A;       /* couleur de marque : décor, grands titres */
  --laterite-aplat: #A34D31; /* fond des blocs avec texte crème (contraste AA) */
  --laterite-profonde: #94432A; /* texte et boutons (contraste AA) */
  --indigo: #1F4E79;         /* accent rare : focus, un détail */

  --serif: "Cormorant Garamond", "Cormorant", Garamond, "Times New Roman", serif;
  --sans: "Jost", "Futura", "Avenir Next", "Segoe UI", sans-serif;

  --mesure: 34rem;           /* longueur de ligne du texte courant */
  --gouttiere: clamp(1rem, 4vw, 3rem);
  --large: 76rem;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }

body {
  margin: 0;
  background: var(--chaux);
  color: var(--encre);
  font-family: var(--sans);
  font-weight: 300;
  font-size: 1.0625rem;      /* 17 px */
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: var(--laterite-profonde); text-decoration-thickness: 1px; text-underline-offset: .2em; }
a:hover { color: var(--encre); }
:focus-visible { outline: 2px solid var(--indigo); outline-offset: 3px; }
p { margin: 0 0 1em; }
h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.1; margin: 0; letter-spacing: .005em; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: .5rem; background: var(--encre); color: var(--chaux); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: .5rem; }

.wrap { width: min(100% - 2 * var(--gouttiere), var(--large)); margin-inline: auto; }

/* ---------- Monogramme E/M ---------- */
.mono { display: inline-grid; grid-template-columns: auto auto; align-items: start; position: relative;
  font-family: var(--serif); font-weight: 500; color: var(--encre); text-decoration: none; line-height: 1; }
.mono span:first-child { font-size: 1.55em; padding-right: .18em; }
.mono span:last-child  { font-size: 1.55em; padding-top: .55em; padding-left: .12em; }
.mono::after { content: ""; position: absolute; left: 50%; top: -.05em; width: 1px; height: 2.6em;
  background: currentColor; transform: translateX(-50%) rotate(25deg); transform-origin: center; }

/* ---------- En-tête ---------- */
.site-header { padding-block: 1.5rem; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.site-header .mono { font-size: 1rem; }
.site-nav ul { list-style: none; display: flex; gap: clamp(1rem, 3vw, 2.25rem); margin: 0; padding: 0; }
.site-nav a { color: var(--encre); text-decoration: none; font-size: .95rem; font-weight: 400; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--laterite-profonde); }
@media (max-width: 40rem) { .site-nav .opt { display: none; } }

/* ---------- Ouverture ---------- */
.hero { padding-block: clamp(2rem, 6vw, 5rem) clamp(3rem, 8vw, 7rem); }
.hero .wrap { display: grid; grid-template-columns: 1.15fr 1fr; gap: clamp(2rem, 6vw, 6rem); align-items: end; }
.logotype { font-family: var(--serif); font-weight: 500; text-transform: uppercase;
  font-size: clamp(2.6rem, 7.2vw, 6.2rem); letter-spacing: .16em; line-height: 1; margin-right: -.16em; }
.signature { font-family: var(--sans); font-weight: 400; font-size: clamp(1rem, 1.6vw, 1.2rem);
  letter-spacing: .04em; margin: 1.5rem 0 0; color: var(--encre); }
.ancrage { font-size: .95rem; color: var(--pierre); letter-spacing: .08em; margin-top: .35rem; }
.lead { font-family: var(--serif); font-weight: 400; font-size: clamp(1.35rem, 2.2vw, 1.75rem); line-height: 1.4;
  max-width: 30ch; margin: clamp(2rem, 5vw, 3.5rem) 0 2rem; }
.actions { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; }

/* L'arche : le signe de la marque, utilisé comme fenêtre sur les photos */
.arche { border-radius: 999px 999px 0 0; overflow: hidden; background: var(--sable); }
.arche img { width: 100%; height: 100%; object-fit: cover; }
.hero .arche { aspect-ratio: 3 / 4.1; }
.hero figure { margin: 0; }

@media (max-width: 52rem) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero figure { order: -1; max-width: 22rem; width: 78%; justify-self: center; }
  .hero .texte { text-align: center; }
  .lead { margin-inline: auto; }
  .actions { justify-content: center; }
}

/* ---------- Boutons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .6rem; min-height: 3rem;
  padding: .7rem 1.6rem; border: 1px solid var(--encre); border-radius: 2px;
  font-family: var(--sans); font-weight: 400; font-size: .98rem; letter-spacing: .03em;
  color: var(--encre); text-decoration: none; background: transparent; transition: background-color .25s, color .25s, border-color .25s; }
.btn:hover { background: var(--encre); color: var(--chaux); }
.btn-plein { background: var(--laterite-profonde); border-color: var(--laterite-profonde); color: var(--chaux); }
.btn-plein:hover { background: var(--encre); border-color: var(--encre); color: var(--chaux); }
.lien-discret { color: var(--encre); font-weight: 400; }

/* ---------- Sections ---------- */
section { padding-block: clamp(4rem, 10vw, 8rem); }
.titre-section { font-size: clamp(2rem, 4.2vw, 3.2rem); max-width: 18ch; }
.intro { font-family: var(--serif); font-size: clamp(1.2rem, 1.8vw, 1.45rem); line-height: 1.5; max-width: var(--mesure); margin-top: 1.5rem; }
.texte-courant { max-width: var(--mesure); }

/* Domaines : des lignes, pas des cartes */
.domaines { border-top: 1px solid var(--encre); }
.domaines .entete { display: grid; grid-template-columns: 1fr 1.2fr; gap: 3rem; margin-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.domaines dl { margin: 0; }
.domaines .ligne { display: grid; grid-template-columns: 1fr 1.2fr; gap: 3rem; padding-block: 1.4rem;
  border-top: 1px solid var(--sable); }
.domaines .ligne:last-child { border-bottom: 1px solid var(--sable); }
.domaines dt { font-family: var(--serif); font-size: clamp(1.35rem, 2vw, 1.65rem); font-weight: 500; line-height: 1.2; }
.domaines dd { margin: 0; color: var(--pierre); max-width: var(--mesure); }
@media (max-width: 46rem) {
  .domaines .entete, .domaines .ligne { grid-template-columns: 1fr; gap: .5rem; }
}

/* Deux rives */
.rives { background: var(--chaux-claire); }
.rives .grille { display: grid; grid-template-columns: 1fr 1.1fr 1fr; gap: clamp(1.5rem, 4vw, 4rem); align-items: center; }
.rives figure { margin: 0; }
.rives .arche { aspect-ratio: 3 / 4.4; }
.rives figcaption { font-size: .9rem; color: var(--pierre); margin-top: .8rem; text-align: center; }
.rives .texte { text-align: center; }
.rives .texte .titre-section { margin-inline: auto; }
.rives .texte p { max-width: 28rem; margin-inline: auto; }
@media (max-width: 52rem) {
  .rives .grille { grid-template-columns: 1fr 1fr; }
  .rives .texte { grid-column: 1 / -1; grid-row: 1; margin-bottom: 1rem; }
}

/* Approche : une vraie séquence, donc numérotée */
.approche .grille { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(2rem, 6vw, 6rem); align-items: start; }
.approche figure { margin: 0; position: sticky; top: 2rem; }
.approche .arche { aspect-ratio: 3 / 4; }
.etapes { list-style: none; margin: 2.5rem 0 0; padding: 0; counter-reset: etape; }
.etapes li { counter-increment: etape; display: grid; grid-template-columns: 3.2rem 1fr; gap: 1rem;
  padding-block: 1.5rem; border-top: 1px solid var(--sable); }
.etapes li::before { content: counter(etape); font-family: var(--serif); font-size: 2rem; line-height: 1;
  color: var(--laterite); }
.etapes h3 { font-size: 1.5rem; margin-bottom: .4rem; }
.etapes p { margin: 0; color: var(--pierre); }
@media (max-width: 52rem) {
  .approche .grille { grid-template-columns: 1fr; }
  .approche figure { position: static; max-width: 20rem; }
}

/* Citation pleine largeur */
.seuil { position: relative; padding: 0; background: var(--encre); color: var(--chaux); }
.seuil img { width: 100%; height: clamp(22rem, 62vw, 40rem); object-fit: cover; opacity: .62; }
.seuil blockquote { position: absolute; inset: auto 0 0 0; margin: 0; padding: clamp(2rem, 6vw, 5rem) var(--gouttiere); }
.seuil blockquote p { font-family: var(--serif); font-weight: 400; font-size: clamp(1.8rem, 4.4vw, 3.4rem);
  line-height: 1.15; max-width: 20ch; margin: 0 auto 0 max(0px, calc((100vw - var(--large)) / 2)); }

/* Parcours */
.parcours .grille { display: grid; grid-template-columns: 1fr 1.25fr; gap: clamp(2rem, 6vw, 6rem); }
.chrono { list-style: none; margin: 0; padding: 0; }
.chrono li { display: grid; grid-template-columns: 7.5rem 1fr; gap: 1.25rem; padding-block: 1.3rem; border-top: 1px solid var(--sable); }
.chrono li:last-child { border-bottom: 1px solid var(--sable); }
.chrono .date { font-size: .95rem; color: var(--pierre); padding-top: .2rem; }
.chrono h3 { font-size: 1.4rem; }
.chrono .lieu { font-size: .95rem; color: var(--pierre); margin: .15rem 0 .4rem; }
.chrono p { margin: 0; }
@media (max-width: 52rem) { .parcours .grille { grid-template-columns: 1fr; } }
@media (max-width: 30rem) { .chrono li { grid-template-columns: 1fr; gap: .25rem; } }

/* Contact */
.contact { background: var(--laterite-aplat); color: var(--chaux); text-align: center; }
.contact .titre-section { margin-inline: auto; }
.contact p { max-width: 30rem; margin: 1.25rem auto 2.25rem; font-size: 1.1rem; }
.contact .actions { justify-content: center; }
.contact .btn { border-color: var(--chaux); color: var(--chaux); }
.contact .btn:hover { background: var(--chaux); color: var(--encre); }
.contact .btn-plein { background: var(--chaux); color: var(--encre); }
.contact .btn-plein:hover { background: var(--encre); color: var(--chaux); border-color: var(--encre); }
.contact :focus-visible { outline-color: var(--chaux); }

/* ---------- Motif sahélien (bande tissée, inspirée du Faso Dan Fani) ---------- */
.tissage { height: 14px; background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='14' viewBox='0 0 28 14'%3E%3Cpath d='M0 14 L7 2 L14 14 Z' fill='%23D9C7A7'/%3E%3Crect x='19' y='5' width='4' height='4' fill='%23B5573A'/%3E%3C/svg%3E");
  background-repeat: repeat-x; background-position: center; }

/* ---------- Pied de page ---------- */
.site-footer { padding-block: 3rem 2.5rem; font-size: .92rem; color: var(--pierre); }
.site-footer .tissage { margin-bottom: 2.5rem; }
.site-footer .wrap { display: grid; grid-template-columns: auto 1fr auto; gap: 1.5rem 2.5rem; align-items: center; }
.site-footer .mono { font-size: .85rem; }
.site-footer ul { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin: 0; padding: 0; justify-self: end; }
.site-footer a { color: var(--encre); }
@media (max-width: 46rem) { .site-footer .wrap { grid-template-columns: 1fr; justify-items: center; text-align: center; } .site-footer ul { justify-self: center; justify-content: center; } }

/* ---------- Page de liens ---------- */
.page-liens { min-height: 100svh; display: flex; flex-direction: column; }
.liens { flex: 1; width: min(100% - 2rem, 28rem); margin-inline: auto; padding-block: 3rem 2rem; text-align: center; }
.liens .arche { width: 9.5rem; aspect-ratio: 3 / 4; margin: 0 auto 2rem; }
.liens .logotype { font-size: clamp(2rem, 9vw, 2.6rem); letter-spacing: .2em; margin-right: -.2em; }
.liens .signature { margin-top: .9rem; }
.liens .ancrage { margin-bottom: 2.5rem; }
.liste-liens { list-style: none; margin: 0; padding: 0; display: grid; gap: .75rem; }
.liste-liens .btn { width: 100%; justify-content: space-between; padding-inline: 1.25rem; background: var(--chaux-claire); border-color: rgba(28,26,23,.35); }
.liste-liens .btn:hover { background: var(--encre); color: var(--chaux); border-color: var(--encre); }
.liste-liens .btn-plein { background: var(--laterite-profonde); border-color: var(--laterite-profonde); color: var(--chaux); }
.liste-liens .btn svg { width: 1.15rem; height: 1.15rem; flex: none; }
.liste-liens .btn span { flex: 1; text-align: left; }
.liste-liens .note { font-size: .82rem; color: var(--pierre); }
.liens .bas { margin-top: 2.5rem; font-size: .9rem; color: var(--pierre); }
.page-liens .tissage { margin-top: auto; }

/* ---------- Pages simples (mentions, 404) ---------- */
.simple { padding-block: 3rem 6rem; }
.simple h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); margin-bottom: 2rem; }
.simple h2 { font-size: 1.6rem; margin: 2.5rem 0 .75rem; }
.simple .texte-courant { max-width: 40rem; }

/* ---------- Entrée de page : un seul moment orchestré ---------- */
@media (prefers-reduced-motion: no-preference) {
  .hero .arche img, .liens .arche img { animation: reveler 1.6s cubic-bezier(.2,.7,.1,1) both; }
  @keyframes reveler { from { transform: scale(1.08); opacity: 0; } to { transform: none; opacity: 1; } }
}

/* Ajustements d'espacement */
.domaines-section { padding-top: 0; }
.domaines .entete { padding-top: clamp(2.5rem, 6vw, 4.5rem); }
