/* Site vitrine Khitba. Charte : docs/design/charte-graphique.md (émeraude, or mat, ivoire). */

@font-face { font-family: 'Reem Kufi'; src: url('fonts/ReemKufi_500Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Readex Pro'; src: url('fonts/ReadexPro_400Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Readex Pro'; src: url('fonts/ReadexPro_500Medium.woff2') format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Readex Pro'; src: url('fonts/ReadexPro_600SemiBold.woff2') format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Amiri'; src: url('fonts/Amiri_400Regular.woff2') format('woff2'); font-weight: 400; font-display: swap; }

:root {
  color-scheme: light;
  --ivoire: #FAF6EE;
  --sable: #F1EADC;
  --blanc: #FFFFFF;
  --encre: #1B2723;
  --encre-douce: #5E6964;
  --bordure: #E5DDCD;
  --emeraude: #11594A;
  --emeraude-nuit: #0B3F34;
  --emeraude-clair: #1B6E5A;
  --or: #A8873F;
  --or-clair: #CFB06A;
  --ivoire-sur-vert: #F3EEE2;
  --display: 'Reem Kufi', 'Readex Pro', system-ui, sans-serif;
  --texte: 'Readex Pro', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --arabe: 'Amiri', 'Traditional Arabic', serif;
  --gouttiere: clamp(16px, 4vw, 40px);
  --largeur: 1160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ivoire);
  color: var(--encre);
  font: 400 1.0625rem/1.65 var(--texte);
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--emeraude); text-underline-offset: 3px; }
a:focus-visible, summary:focus-visible { outline: 3px solid var(--or); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3 { margin: 0; font-weight: 500; }
h2, h1 { font-family: var(--display); word-spacing: 0.14em; line-height: 1.12; }
h2 { font-size: clamp(1.9rem, 3.6vw, 2.75rem); }
h3 { font-size: 1.25rem; line-height: 1.3; font-weight: 600; }
p { margin: 0; }
.defs { position: absolute; }
/* Avant l'ouverture des inscriptions (classe sur <html>, retirée au déploiement) : une version ou l'autre. */
.avant-ouverture .si-ouvert, html:not(.avant-ouverture) .si-ferme { display: none !important; }
/* Simple annonce, pas un bouton : sans cadre. */
.nav-annonce { border-color: transparent; padding-right: 0; opacity: .85; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; z-index: 10; background: var(--blanc); padding: 10px 16px; border-radius: 12px; }
.skip:focus { top: 16px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 0 26px; border-radius: 16px;
  font: 600 1rem/1 var(--texte); text-decoration: none;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn-gold { background: var(--ivoire); color: var(--emeraude-nuit); }
.btn-gold:hover { background: var(--blanc); }
.btn-line { color: var(--ivoire); border: 1px solid rgba(243, 238, 226, .45); }
.btn-line:hover { border-color: var(--ivoire); }

/* ---------- Arc de mihrab : cadre des captures ---------- */
.arch {
  position: relative; margin: 0;
  width: min(340px, 78vw);
  padding: 15% 14px 14px;
  border-radius: 999px 999px 34px 34px;
  background: var(--sable);
  border: 1px solid rgba(168, 135, 63, .45);
}
.arch img { border-radius: 22px; border: 1px solid var(--bordure); }
/* Étoile au sommet de l'arc, dans le flux : la capture commence sous la courbe. */
.arch-star {
  display: block; width: 30px; height: 30px; margin: 0 auto 8%;
  fill: none; stroke: var(--or); stroke-width: 1.3;
}

/* ---------- En-tête ---------- */
.hero {
  position: relative; overflow: hidden; color: var(--ivoire-sur-vert);
  background: linear-gradient(160deg, var(--emeraude-nuit) 0%, var(--emeraude) 58%, var(--emeraude-clair) 100%);
  padding: 0 var(--gouttiere) clamp(56px, 8vw, 104px);
}
.hero-motif { position: absolute; inset: 0; width: 100%; height: 100%; color: var(--or-clair); opacity: .08; pointer-events: none; }
.nav {
  position: relative; max-width: var(--largeur); margin: 0 auto;
  display: flex; align-items: center; gap: 28px; padding: 22px 0;
}
.brand { font: 500 1.6rem/1 var(--display); color: inherit; text-decoration: none; letter-spacing: .01em; }
.nav ul { display: flex; gap: 26px; list-style: none; margin: 0 0 0 auto; padding: 0; }
.nav ul a, .nav-cta { color: inherit; text-decoration: none; font-size: .95rem; }
.nav ul a:hover, .nav-cta:hover { text-decoration: underline; }
.nav-cta { padding: 9px 16px; border: 1px solid rgba(243, 238, 226, .4); border-radius: 12px; }

.hero-body {
  position: relative; max-width: var(--largeur); margin: clamp(24px, 5vw, 64px) auto 0;
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 6vw, 88px); align-items: center;
}
.bismillah { font: 400 1.7rem/1.4 var(--arabe); color: var(--or-clair); margin-bottom: 18px; text-align: left; }
.hero h1 { font-size: clamp(2.5rem, 5.4vw, 4.4rem); color: var(--blanc); max-width: 15ch; }
.lead { margin-top: 26px; font-size: 1.15rem; max-width: 56ch; color: rgba(243, 238, 226, .9); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 34px; }
.hero-note { margin-top: 18px; font-size: .92rem; color: rgba(243, 238, 226, .72); }
.arch-hero { justify-self: center; background: rgba(250, 246, 238, .07); border-color: rgba(207, 176, 106, .5); }
.arch-hero .arch-star { stroke: var(--or-clair); }
.arch-hero img { border-color: rgba(243, 238, 226, .2); }

/* Seul mouvement automatique : l'arc de l'en-tête s'élève au chargement. */
@media (prefers-reduced-motion: no-preference) {
  .arch-hero { animation: elevation 1.1s cubic-bezier(.2, .7, .2, 1) both .15s; }
  @keyframes elevation { from { opacity: 0; transform: translateY(36px); } to { opacity: 1; transform: none; } }
}

/* ---------- Sections ---------- */
/* Colonne commune : la marge latérale absorbe ce qui dépasse la largeur du contenu. */
main > section {
  padding-block: clamp(64px, 9vw, 120px);
  padding-inline: max(var(--gouttiere), (100% - var(--largeur)) / 2);
}
.section-head { margin-bottom: clamp(40px, 6vw, 72px); }
.section-head p { margin-top: 16px; max-width: 62ch; color: var(--encre-douce); font-size: 1.1rem; }

/* Le mot */
.mot { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 6vw, 96px); align-items: center; }
.mot-arabe { font: 400 clamp(6rem, 17vw, 13rem)/1.1 var(--arabe); color: var(--or); text-align: center; }
.mot-texte { max-width: 62ch; }
.mot-texte p { margin-top: 18px; color: var(--encre-douce); }
.mot-texte p:first-of-type { color: var(--encre); font-size: 1.15rem; }

/* Le parcours */
.chemin { background: var(--blanc); border-top: 1px solid var(--bordure); border-bottom: 1px solid var(--bordure); }
.etapes { list-style: none; padding: 0; display: grid; gap: clamp(72px, 10vw, 136px); }
.etape { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.etape:nth-child(even) .etape-texte { order: 2; }
.etape-texte { max-width: 52ch; }
.etape-num { display: block; font: 500 3.4rem/1 var(--display); color: var(--or); margin-bottom: 14px; }
.etape h3 { font: 500 clamp(1.6rem, 2.6vw, 2.1rem)/1.2 var(--display); word-spacing: .12em; }
.etape-texte p { margin-top: 16px; }
.etape-texte .detail { color: var(--encre-douce); font-size: 1rem; padding-left: 18px; border-left: 2px solid var(--or-clair); }
.etape-ecrans { position: relative; justify-self: center; padding-right: 0; }
.etape:has(.ecran-second) .etape-ecrans { padding-right: clamp(60px, 9vw, 120px); padding-bottom: 40px; }
.ecran-second {
  position: absolute; right: 0; bottom: 0; margin: 0; width: 48%;
  padding: 8px; background: var(--blanc); border: 1px solid var(--bordure); border-radius: 26px;
}
.ecran-second img { border-radius: 19px; }

/* Les rôles */
.roles-grille { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border: 1px solid var(--bordure); border-radius: 28px; background: var(--blanc); }
.role { padding: clamp(28px, 3.5vw, 44px); }
.role + .role { border-left: 1px solid var(--bordure); }
.role h3 { font: 500 2rem/1.1 var(--display); }
.role-resume { margin-top: 10px; color: var(--encre-douce); min-height: 3.3em; }
.role ul { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 12px; font-size: .98rem; }
.role li { position: relative; padding-left: 20px; }
.role li::before { content: ''; position: absolute; left: 0; top: .72em; width: 9px; height: 1.5px; background: var(--or); }
.role-wali { background: var(--emeraude-nuit); color: var(--ivoire-sur-vert); margin: -14px 0; border-radius: 28px; box-shadow: 0 0 0 1px var(--emeraude-nuit); }
.role-wali + .role { border-left: 0; }
.role-wali .role-resume { color: rgba(243, 238, 226, .78); }
.role-wali li::before { background: var(--or-clair); }
.substitution {
  margin-top: clamp(40px, 6vw, 64px); display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: center;
  background: var(--sable); border-radius: 28px; padding: clamp(24px, 4vw, 40px);
}
.substitution-ecran { margin: 0; }
.substitution-ecran img { border-radius: 18px; border: 1px solid var(--bordure); }
.substitution h3 { font: 500 1.6rem/1.2 var(--display); word-spacing: .12em; }
.substitution p { margin-top: 12px; max-width: 64ch; }

/* Garanties */
.garanties { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(40px, 7vw, 104px); align-items: start; }
.garanties dl { margin: 36px 0 0; display: grid; gap: 26px; }
.garanties dt { font-weight: 600; color: var(--emeraude); font-size: 1.1rem; }
.garanties dd { margin: 6px 0 0; color: var(--encre-douce); max-width: 60ch; }
.garanties em { font-style: normal; font-weight: 600; color: var(--encre); }
.arch-garanties { justify-self: center; position: sticky; top: 32px; }

/* Tarifs */
.tarifs { background: var(--sable); }
.tarifs-corps { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.tarifs-table { width: 100%; border-collapse: collapse; background: var(--blanc); border-radius: 24px; overflow: hidden; border: 1px solid var(--bordure); border-style: hidden; box-shadow: 0 0 0 1px var(--bordure); }
.tarifs-table th, .tarifs-table td { padding: 18px 22px; text-align: left; vertical-align: baseline; }
.tarifs-table thead th { font-size: .85rem; font-weight: 500; color: var(--encre-douce); border-bottom: 1px solid var(--bordure); }
.tarifs-table tbody tr + tr > * { border-top: 1px solid var(--bordure); }
.tarifs-table tbody th { font-weight: 600; white-space: nowrap; }
.tarifs-table td { color: var(--encre-douce); }
.tarifs-table .prix { font: 500 1.5rem/1 var(--display); color: var(--emeraude); white-space: nowrap; text-align: right; }
.prix span { font: 400 .85rem var(--texte); color: var(--encre-douce); margin-left: 2px; }
.tarifs-regles { margin: 0; padding: 0; list-style: none; display: grid; gap: 16px; }
.tarifs-regles li { padding-left: 20px; position: relative; }
.tarifs-regles li::before { content: ''; position: absolute; left: 0; top: .72em; width: 9px; height: 1.5px; background: var(--or); }

/* Questions */
.faq > * { max-width: 780px; }
.etapes { margin: 0; }
.faq h2 { margin-bottom: 32px; }
.faq details { border-top: 1px solid var(--bordure); }
.faq details:last-of-type { border-bottom: 1px solid var(--bordure); }
.faq summary { list-style: none; cursor: pointer; padding: 22px 44px 22px 0; position: relative; font-weight: 500; font-size: 1.08rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: ''; position: absolute; right: 8px; top: 50%; width: 12px; height: 12px; border-right: 1.5px solid var(--emeraude); border-bottom: 1.5px solid var(--emeraude); transform: translateY(-75%) rotate(45deg); transition: transform .2s; }
.faq details[open] summary::after { transform: translateY(-25%) rotate(-135deg); }
.faq details p { padding: 0 0 24px; color: var(--encre-douce); max-width: 66ch; }

/* Appel final */
.appel { text-align: center; background: var(--emeraude-nuit); color: var(--ivoire-sur-vert); }
.appel > * { margin-left: auto; margin-right: auto; }
.appel .btn { display: inline-flex; }
.appel-star { display: block; width: 40px; height: 40px; fill: none; stroke: var(--or-clair); stroke-width: 1.2; margin-bottom: 22px; }
.appel h2 { color: var(--blanc); }
.appel p { margin-top: 16px; max-width: 48ch; color: rgba(243, 238, 226, .82); }
.appel .btn { margin-top: 30px; }

/* Pied de page */
.pied { padding: 48px var(--gouttiere) 40px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 48px; max-width: calc(var(--largeur) + 2 * var(--gouttiere)); margin: 0 auto; font-size: .95rem; }
.pied .brand { color: var(--emeraude-nuit); }
.pied-marque p + p { margin-top: 8px; color: var(--encre-douce); }
.pied-liens { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pied-note { grid-column: 1 / -1; color: var(--encre-douce); font-size: .85rem; border-top: 1px solid var(--bordure); padding-top: 20px; }

/* ---------- Écrans étroits ---------- */
@media (max-width: 960px) {
  .nav ul { display: none; }
  .nav-cta { margin-left: auto; }
  .hero-body, .mot, .etape, .garanties, .tarifs-corps { grid-template-columns: minmax(0, 1fr); }
  .etape:nth-child(even) .etape-texte { order: 0; }
  .roles-grille { grid-template-columns: minmax(0, 1fr); }
  .role + .role { border-left: 0; border-top: 1px solid var(--bordure); }
  .role-wali { margin: 0 -1px; }
  .role-wali + .role { border-top: 0; }
  .role-resume { min-height: 0; }
  .arch-garanties { position: static; }
  .mot-arabe { text-align: left; }
}
@media (max-width: 600px) {
  body { font-size: 1rem; }
  .hero h1 { font-size: 2.35rem; }
  .hero-actions .btn { flex: 1 1 100%; }
  /* Arc et capture secondaire tiennent ensemble dans la largeur de l'écran. */
  .etape:has(.ecran-second) .etape-ecrans { padding-right: 22vw; padding-bottom: 32px; }
  .etape:has(.ecran-second) .arch { width: 66vw; }
  .ecran-second { width: 50%; padding: 6px; border-radius: 20px; }
  .ecran-second img { border-radius: 15px; }
  .substitution { grid-template-columns: minmax(0, 1fr); }
  .substitution-ecran { max-width: 200px; }
  /* Tableau en lignes empilées : offre et prix, puis à quoi elle sert. */
  .tarifs-table thead { display: none; }
  .tarifs-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .tarifs-table tbody th { padding: 16px 0 4px 16px; }
  .tarifs-table .prix { padding: 16px 16px 4px 8px; }
  .tarifs-table td:not(.prix) { grid-column: 1 / -1; order: 3; padding: 0 16px 16px; font-size: .95rem; }
  .tarifs-table tbody tr + tr > * { border-top: 0; }
  .tarifs-table tbody tr + tr { border-top: 1px solid var(--bordure); }
  .pied { grid-template-columns: minmax(0, 1fr); }
}
