/* =============================================================================
   Thoumoun : « Le Hizb en huit » (registre : PROJETS\OUTILS-DESIGN.md § 2)
   -----------------------------------------------------------------------------
   La page est un hizb découpé en huit thoumoun : chaque section s'ouvre sur un anneau
   de huit secteurs dont n sont pleins, en marge, comme les repères d'un mushaf.
   Papier ivoire, encre brun-noir, vert mushaf, un pastel par thoumoun.
   INTERDITS (refus déjà actés par Rémi) : fond sombre, nav en pilule, cadratin dans le texte
   visible, carte orpheline, marquee, pin au scroll, trois cartes égales alignées, bouton noir carré.
   Polices du site, auto-hébergées : aucune police téléchargée pour cette page.
   ========================================================================== */

@font-face { font-family: 'Sora'; src: url('/assets/fonts/sora-variable.woff2') format('woff2'); font-weight: 400 800; font-display: swap; }
@font-face { font-family: 'PlexArabic'; src: url('/assets/fonts/ibm-plex-sans-arabic.woff2') format('woff2'); font-weight: 400; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'PlexArabic'; src: url('/assets/fonts/ibm-plex-sans-arabic-600.woff2') format('woff2'); font-weight: 600 800; font-display: swap;
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1, U+08E3-08FF, U+200C-200E, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'IBM Plex Mono'; src: url('/assets/fonts/ibm-plex-mono-500.woff2') format('woff2'); font-weight: 400 600; font-display: swap; }

:root {
  --papier: #F7F1E3; --encre: #241A12; --douce: #5E5143; --trait: #DCCFB4;
  --vert: #1F6B52; --vert-fonce: #164E3C; --blanc: #FFFDF8;
  --p: #D7E6D5; --f: #5E8F63;
}
[data-n="1"] { --p: #D7E6D5; --f: #5E8F63; }
[data-n="2"] { --p: #F8E1B0; --f: #D9902B; }
[data-n="3"] { --p: #F2D3C8; --f: #C0674D; }
[data-n="4"] { --p: #D3DFEA; --f: #4F78A0; }
[data-n="5"] { --p: #CFEBDD; --f: #3C9A79; }
[data-n="6"] { --p: #F9D9BC; --f: #D77A35; }
[data-n="7"] { --p: #E0D9EA; --f: #7C68A6; }
[data-n="8"] { --p: #EADFC6; --f: #A58B52; }

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--papier); color: var(--encre); font-family: 'Sora', system-ui, sans-serif; font-size: 1rem; line-height: 1.6; }
[lang="ar"] body, [lang="ar"] { font-family: 'PlexArabic', 'Sora', system-ui, sans-serif; line-height: 1.85; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--vert); }
.saut { position: absolute; inset-inline-start: -999px; top: 0; background: var(--blanc); padding: .6rem 1rem; z-index: 9; }
.saut:focus { inset-inline-start: 1rem; }
:focus-visible { outline: 3px solid var(--f); outline-offset: 3px; border-radius: 4px; }

/* Anneau : huit secteurs, n pleins */
.anneau { width: 84px; height: 84px; flex: none; }
.anneau path { fill: var(--f); }
.anneau .vide { fill-opacity: .16; }
.anneau .plein { fill-opacity: 1; }
.js .thoumoun .anneau .plein { fill-opacity: .16; transition: fill-opacity .45s ease; }
.js .thoumoun.vu .anneau .plein { fill-opacity: 1; }
.js .thoumoun .anneau path:nth-child(1) { transition-delay: 0ms; }
.js .thoumoun .anneau path:nth-child(2) { transition-delay: 90ms; }
.js .thoumoun .anneau path:nth-child(3) { transition-delay: 180ms; }
.js .thoumoun .anneau path:nth-child(4) { transition-delay: 270ms; }
.js .thoumoun .anneau path:nth-child(5) { transition-delay: 360ms; }
.js .thoumoun .anneau path:nth-child(6) { transition-delay: 450ms; }
.js .thoumoun .anneau path:nth-child(7) { transition-delay: 540ms; }
.js .thoumoun .anneau path:nth-child(8) { transition-delay: 630ms; }
@media (prefers-reduced-motion: reduce) { .js .thoumoun .anneau .plein { transition: none; } }

/* Boutons : angles doux, vert mushaf (jamais de noir carré) */
.bouton { display: inline-block; background: var(--vert); color: #fff; font-weight: 700; font-size: .95rem; text-decoration: none;
  padding: .8rem 1.3rem; border-radius: 12px; border: 0; cursor: pointer; font-family: inherit; transition: background .2s; }
.bouton:hover { background: var(--vert-fonce); }
.lien { margin-inline-start: 1.1rem; font-weight: 600; }

/* En-tête */
.tete { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; max-width: 1240px; margin: 0 auto; padding: 1.1rem 1.5rem; }
.mot { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--encre); font-weight: 800; font-size: 1.35rem; letter-spacing: -.01em; }
.mot .anneau { width: 34px; height: 34px; --f: var(--vert); }
.tete-droite { display: flex; align-items: center; gap: 1.4rem; flex-wrap: wrap; }
.langues { display: inline-flex; gap: .9rem; font-size: .88rem; }
.langues a { color: var(--douce); text-decoration: none; padding-block: .2rem; }
.langues a[aria-current] { color: var(--encre); font-weight: 700; border-bottom: 2px solid var(--vert); }

/* Figures : capture réelle posée sur un aplat pastel décalé */
.fig { margin: 0; }
.fig a { display: block; background: var(--blanc); border: 1px solid var(--trait); border-radius: 14px; overflow: hidden; box-shadow: 10px 10px 0 var(--p); }
[dir="rtl"] .fig a { box-shadow: -10px 10px 0 var(--p); }
.fig figcaption { margin-top: 1.3rem; font-size: .86rem; color: var(--douce); }
.fig img { width: 100%; }

/* Héros */
.heros { max-width: 1240px; margin: 0 auto; padding: 3.2rem 1.5rem 2.5rem; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 3.2rem; align-items: center; }
.kicker { margin: 0 0 1rem; font-family: 'IBM Plex Mono', monospace; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--vert); }
[lang="ar"] .kicker { font-family: inherit; letter-spacing: 0; text-transform: none; font-size: .95rem; }
.heros h1 { margin: 0 0 1.2rem; font-size: clamp(2.1rem, 4.3vw, 3.5rem); line-height: 1.07; letter-spacing: -.025em; font-weight: 800; }
[lang="ar"] .heros h1 { letter-spacing: 0; line-height: 1.3; }
.chapo { font-size: 1.12rem; color: var(--douce); max-width: 34rem; margin: 0 0 1.8rem; }
.actions { margin: 0; display: flex; align-items: center; flex-wrap: wrap; gap: .8rem 0; }
.fig-heros { --p: #F8E1B0; }
.fig-heros img { border: 1px solid var(--trait); border-radius: 14px; box-shadow: 10px 10px 0 var(--p); }
[dir="rtl"] .fig-heros img { box-shadow: -10px 10px 0 var(--p); }
.fig-heros figcaption { margin-top: 1.3rem; }

/* Bento : quatre gestes, tailles inégales, deux rangées pleines */
.bento { max-width: 1240px; margin: 0 auto; padding: 1.5rem 1.5rem 3rem; display: grid; grid-template-columns: repeat(12, 1fr); gap: 1rem; }
.bento-cellule { background: var(--p); color: var(--encre); text-decoration: none; border-radius: 20px; padding: 1.5rem 1.7rem 1.7rem; min-height: 11rem;
  display: flex; flex-direction: column; gap: .5rem; transition: transform .2s ease; }
.bento-cellule:hover { transform: translateY(-3px); }
@media (prefers-reduced-motion: reduce) { .bento-cellule { transition: none; } .bento-cellule:hover { transform: none; } }
.bento-cellule .anneau { width: 46px; height: 46px; margin-bottom: .4rem; }
.bento-cellule h2 { margin: 0; font-size: 1.3rem; line-height: 1.2; }
.bento-cellule p { margin: 0; color: #3b2f24; max-width: 30rem; }
.b1 { grid-column: span 7; } .b2 { grid-column: span 5; } .b3 { grid-column: span 5; } .b4 { grid-column: span 7; }

/* Les huit thoumoun */
.thoumoun { max-width: 1240px; margin: 0 auto; padding: 4.2rem 1.5rem; display: grid; grid-template-columns: 120px minmax(0, 32rem) minmax(0, 1fr); gap: 2.2rem 3rem; align-items: start;
  border-top: 1px dashed var(--trait); scroll-margin-top: 1rem; }
.thoumoun[data-n="1"], .thoumoun[data-n="3"], .thoumoun[data-n="5"], .thoumoun[data-n="7"] {
  background: color-mix(in srgb, var(--p) 42%, transparent); box-shadow: 0 0 0 100vmax color-mix(in srgb, var(--p) 42%, transparent); clip-path: inset(0 -100vmax); }
.th-tete { display: flex; flex-direction: column; align-items: flex-start; gap: .6rem; }
.th-num { font-family: 'IBM Plex Mono', monospace; font-size: .85rem; color: var(--f); font-weight: 600; }
.th-corps { grid-column: 2; }
.thoumoun:not(.avec-figure) .th-corps { grid-column: 2 / -1; max-width: 46rem; }
.thoumoun .fig-telephone { grid-column: 3; grid-row: 1; }
.thoumoun .fig-large { grid-column: 2 / -1; grid-row: 2; max-width: 720px; margin-top: .6rem; }
.th-corps h2 { margin: 0 0 1rem; font-size: clamp(1.45rem, 2.4vw, 2rem); line-height: 1.18; letter-spacing: -.015em; }
[lang="ar"] .th-corps h2 { letter-spacing: 0; line-height: 1.4; }
.lecture { font-size: 1.04rem; margin: 0 0 1.4rem; }
.fig-telephone { max-width: 375px; }
.fig-telephone a { border-radius: 22px; }

/* Étapes : une pile verticale, jamais trois cartes alignées */
.etapes { list-style: none; margin: 0 0 1.6rem; padding: 0; display: grid; gap: 1.2rem; }
.etapes li { display: grid; grid-template-columns: 3.2rem 1fr; gap: 1rem; align-items: start; }
.etape-n { font-family: 'IBM Plex Mono', monospace; font-weight: 600; font-size: 2.1rem; line-height: 1; color: var(--f); }
.etapes h3 { margin: 0 0 .15rem; font-size: 1.05rem; }
.etapes p { margin: 0; color: var(--douce); }
.encadre { margin: 0; padding: 1.1rem 1.3rem; background: color-mix(in srgb, var(--p) 75%, var(--blanc)); border-radius: 14px; }

/* Listes à deux colonnes */
.liste { margin: 0; display: grid; }
.liste > div { display: grid; grid-template-columns: minmax(0, 11rem) minmax(0, 1fr); gap: .3rem 1.4rem; padding: .85rem 0; border-top: 1px solid color-mix(in srgb, var(--f) 35%, transparent); }
.liste dt { font-weight: 700; }
.liste dd { margin: 0; color: var(--douce); }
.liste-large > div { grid-template-columns: minmax(0, 13rem) minmax(0, 1fr); }

/* Demande */
.demande { background: color-mix(in srgb, #D7E6D5 60%, var(--papier)); border-top: 1px solid var(--trait); }
.demande-in { max-width: 1240px; margin: 0 auto; padding: 4.2rem 1.5rem; display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 3rem; align-items: start; }
.demande h2 { margin: 0 0 1rem; font-size: clamp(1.6rem, 2.8vw, 2.3rem); line-height: 1.15; }
.formulaire { background: var(--blanc); border: 1px solid var(--trait); border-radius: 18px; padding: 1.6rem; }
.form-grille { display: grid; grid-template-columns: 1fr 1fr; gap: .9rem 1.1rem; }
.champ { display: flex; flex-direction: column; gap: .3rem; }
.champ.large { grid-column: 1 / -1; }
.champ label { font-size: .84rem; font-weight: 600; }
.champ .aide, .aide { font-size: .78rem; color: var(--douce); }
.champ input, .champ select, .champ textarea { font: inherit; padding: .65rem .8rem; border: 1px solid #C9BB9F; border-radius: 10px; background: #fff; color: var(--encre); width: 100%; }
.champ textarea { min-height: 6rem; resize: vertical; }
.cases { display: flex; flex-wrap: wrap; gap: .5rem .9rem; }
.piege { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.erreur { border: 1px solid #e3b7ac; background: #fbece8; color: #8a2d18; border-radius: 10px; padding: .7rem .9rem; font-size: .9rem; margin-bottom: 1rem; }

.pied { max-width: 1240px; margin: 0 auto; padding: 2rem 1.5rem 3rem; display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; font-size: .88rem; }
.pied a { color: var(--douce); }

@media (max-width: 1020px) {
  .heros, .demande-in { grid-template-columns: 1fr; gap: 2rem; }
  .thoumoun { grid-template-columns: 1fr; gap: 1.4rem; padding: 3rem 1.5rem; }
  .th-tete { flex-direction: row; align-items: center; gap: .8rem; }
  .th-tete .anneau { width: 56px; height: 56px; }
  .th-corps, .thoumoun:not(.avec-figure) .th-corps, .thoumoun .fig-telephone, .thoumoun .fig-large { grid-column: 1; grid-row: auto; }
}
@media (max-width: 680px) {
  .bento { grid-template-columns: 1fr; }
  .b1, .b2, .b3, .b4 { grid-column: auto; }
  .form-grille { grid-template-columns: 1fr; }
  .liste > div, .liste-large > div { grid-template-columns: 1fr; }
  .lien { margin-inline-start: 0; }
  .tete-droite { gap: .9rem; }
}
@media (max-width: 680px) { .tete .bouton { display: none; } }
