/*
Theme Name: Mosquée Aïcha
Theme URI: https://www.mosqueeaicha.com
Author: Mosquée Aïcha
Description: Thème bloc sur mesure de la Mosquée Aïcha de Vaulx-en-Velin. Tout le contenu est éditable dans l'éditeur de blocs : le design vit dans ce thème, pas dans les pages.
Version: 1.0.21
Requires at least: 6.6
Requires PHP: 8.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: mosquee-aicha
Tags: block-theme, full-site-editing, one-column
*/

/* =========================================================
   JETONS
   ========================================================= */

:root {
  --accent: #272262;            /* l'indigo du logo */
  --ivoire: #FAF0E2;
  --blanc: #FDFDFD;
  --encre: #2D2D2E;
  --pierre: #6C6960;
  --filet: rgba(39, 34, 98, .18);

  --logo-orange: #F48839;
  --degrade: linear-gradient(100deg, #614A9B 0%, #7C2D8E 30%, #D82A7F 64%, #F48839 100%);

  /* l'arche en accolade, reprise des cartes de la référence sombre */
  --arche: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 130' preserveAspectRatio='none'%3E%3Cpath d='M0 130 L0 44 Q0 40 3.5 39 C0.5 27 9 15 31 9.5 C41 7 46.5 4.5 50 0 C53.5 4.5 59 7 69 9.5 C91 15 99.5 27 96.5 39 Q100 40 100 44 L100 130 Z' /%3E%3C/svg%3E");
  --arche-contour: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 130' preserveAspectRatio='none'%3E%3Cpath d='M0 130 L0 44 Q0 40 3.5 39 C0.5 27 9 15 31 9.5 C41 7 46.5 4.5 50 0 C53.5 4.5 59 7 69 9.5 C91 15 99.5 27 96.5 39 Q100 40 100 44 L100 130 Z' fill='none' stroke='white' stroke-opacity='.75' stroke-width='1' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
  --fleche: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 64'%3E%3Cpath d='M12 1v61M2 51l10 11 10-11' fill='none' stroke='%23000' stroke-width='1.3'/%3E%3C/svg%3E");

  --f-titre: 'Kalnia', 'Didot', 'Times New Roman', serif;
  --f-texte: 'Plus Jakarta Sans', system-ui, sans-serif;
  --f-arabe: 'Amiri', 'Times New Roman', serif;

  --marge: clamp(20px, 7vw, 120px);
  --entete: 92px;
  --respiration: clamp(72px, 11vh, 130px);
}

/* =========================================================
   BASE ET NEUTRALISATIONS GUTENBERG
   ========================================================= */

*, *::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: 500 16.5px/1.75 var(--f-texte);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }   /* height: auto, sinon l'attribut height des blocs image l'emporte */
a { color: inherit; }
figure, figure.wp-block-image { margin: 0; }
h1, h2, h3, p { margin: 0; }
ul.wp-block-list, ul.wp-block-social-links { list-style: none; margin: 0; padding: 0; }
.wp-block-quote { margin: 0; padding: 0; border: 0; }
.wp-block-quote cite { font-style: normal; }
/* espacement automatique : coupé dans theme.json (blockGap 0), filet de sécurité à spécificité nulle */
:where(.wp-block-group) > :where(*), :where(.wp-block-buttons) { margin-block: 0; }

.wp-site-blocks > * + * { margin-block-start: 0; }
main.wp-block-group, .entry-content, .wp-block-post-content { margin: 0; }

/* ---------- échelle typographique : h1 / h2 / h3 / paragraphe ---------- */

.etiquette {
  font: 600 12px/1.5 var(--f-texte);
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--pierre);
}
.titre-section {                               /* h2 */
  margin-top: 18px;
  text-wrap: balance;
  font: 700 clamp(36px, 4.2vw, 66px)/1.04 var(--f-titre);
  color: var(--accent);
}
.sous-titre {                                  /* h3 */
  margin: 22px 0 14px;
  font: 600 clamp(21px, 1.7vw, 26px)/1.25 var(--f-titre);
  color: var(--accent);
}

/* ---------- boutons : la classe atterrit sur le conteneur, le style va sur le lien ---------- */
.wp-block-button.bouton { display: inline-block; background: none; border: 0; padding: 0; }
.wp-block-button.bouton .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px 11px;
  background: var(--degrade);
  background-size: 160% 100%;
  color: #fff;
  font: 600 14.5px/1.2 var(--f-texte);
  text-decoration: none;
  white-space: nowrap;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  box-shadow: 0 12px 26px -14px rgba(216, 42, 127, .75);
  transition: background-position .5s ease, transform .3s, box-shadow .3s;
}
.wp-block-button.bouton .wp-block-button__link:hover { background-position: 100% 0; transform: translateY(-1px); box-shadow: 0 16px 30px -14px rgba(244, 136, 57, .8); }
.wp-block-button.bouton-ligne .wp-block-button__link { background: transparent; color: var(--accent); box-shadow: inset 0 0 0 1px rgba(39, 34, 98, .35); }
.wp-block-button.bouton-ligne .wp-block-button__link:hover { background: var(--degrade); color: #fff; box-shadow: none; }

.lien a {
  display: inline-block;
  padding-bottom: 6px;
  font: 600 12.5px/1.4 var(--f-texte);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--accent);
  text-decoration: none;
  background: var(--degrade) left bottom / 100% 1.5px no-repeat;
}

/* ---------- l'arche ---------- */
.arche {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  -webkit-mask: var(--arche) center / 100% 100% no-repeat;
          mask: var(--arche) center / 100% 100% no-repeat;
}
.arche img { width: 100%; height: 100%; object-fit: cover; }
.arche::after {
  content: '';
  position: absolute;
  inset: 9px;
  background: var(--arche-contour) center / 100% 100% no-repeat;
  pointer-events: none;
}
.arche.cadre-30 img { object-position: 30% 50%; }
.arche.cadre-62 img { object-position: 62% 50%; }

/* ---------- révélation au défilement (classe posée par app.js) ---------- */
.js .reveler { opacity: 0; transform: translateY(32px); transition: opacity 1.1s cubic-bezier(.2, .7, .2, 1), transform 1.1s cubic-bezier(.2, .7, .2, 1); }
.js .reveler.est-vu { opacity: 1; transform: none; }

/* =========================================================
   EN-TÊTE : logo d'origine, menu aligné et transparent
   ========================================================= */

.entete {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--entete);
  padding: 0 var(--marge);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  color: var(--accent);
  transition: height .4s, color .4s;
}
.admin-bar .entete { top: 32px; }
.entete--compacte { --entete: 74px; }
/* le verre dépoli, sur une couche à part :
   - un backdrop-filter posé sur l'en-tête lui-même enfermerait le menu mobile ouvert dans sa hauteur ;
   - son bord bas est fondu, pour que les images qui passent dessous n'y dessinent pas de trait net */
.entete::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(250, 240, 226, .32);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
          backdrop-filter: blur(14px) saturate(1.2);
  -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 18px), transparent);
          mask-image: linear-gradient(180deg, #000 calc(100% - 18px), transparent);
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
}
.entete--compacte::before { opacity: 1; }
/* au-dessus du récit, pas de verre : la photo y glisse librement */
.entete--recit::before, .entete--clair::before { opacity: 0; }
/* sur les photos plein écran du récit, le menu passe en clair */
.entete--clair { color: #fff; }
.entete--clair .wp-block-site-logo img { filter: brightness(0) invert(1); }

.entete .wp-block-site-logo { flex: none; line-height: 0; }
.entete .wp-block-site-logo img { height: 58px; width: auto; transition: height .4s, filter .4s; }
.entete--compacte .wp-block-site-logo img { height: 48px; }

.entete-actions { display: flex; align-items: center; gap: clamp(20px, 2.6vw, 40px); }

.nav-liens .wp-block-navigation__container { gap: clamp(18px, 2.2vw, 34px); }
.nav-liens .wp-block-navigation-item__content {
  padding: 6px 0;
  font: 500 14px/1 var(--f-texte);
  color: inherit;
  text-decoration: none;
  background: var(--degrade) left bottom / 0 1.5px no-repeat;
  transition: background-size .35s;
}
.nav-liens .wp-block-navigation-item__content:hover,
.nav-liens .wp-block-navigation-item__content.est-actif { background-size: 100% 1.5px; }

/* menu plein écran (petits écrans) : le panneau de core/navigation, aux couleurs du site */
.nav-liens .wp-block-navigation__responsive-container-open,
.nav-liens .wp-block-navigation__responsive-container-close { color: inherit; }
.nav-liens .wp-block-navigation__responsive-container-open svg { width: 30px; height: 30px; }
.wp-block-navigation.nav-liens .wp-block-navigation__responsive-container.is-menu-open {
  background-color: var(--ivoire) !important;
  color: var(--accent) !important;
  padding: calc(var(--entete) + 4vh) var(--marge) 5vh;
}
.wp-block-navigation.nav-liens .is-menu-open .wp-block-navigation__container { gap: 0; align-items: stretch; width: 100%; }
.wp-block-navigation.nav-liens .is-menu-open .wp-block-navigation-item { width: 100%; }
.wp-block-navigation.nav-liens .is-menu-open .wp-block-navigation-item__content {
  display: block;
  width: 100%;
  padding: 1.6vh 0;
  font: 700 clamp(28px, 8vw, 52px)/1.1 var(--f-titre);
  border-bottom: 1px solid var(--filet);
  background: none;
}

/* =========================================================
   HERO
   ========================================================= */

.hero { position: relative; height: max(700px, 100svh); overflow: hidden; isolation: isolate; background: var(--ivoire); }

/* l'image s'arrête avant le titre : le bas du hero reste ivoire et le titre se lit nettement */
.hero-scene { position: absolute; inset: 0 0 auto 0; height: 84%; overflow: hidden; }
/* au doigt, les glissements verticaux font défiler la page, les autres promènent la loupe (app.js) */
.hero-scene { touch-action: pan-y pinch-zoom; -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.hero-batiment {
  width: 100%;
  height: 100%;
  -webkit-mask-image: linear-gradient(180deg, #000 66%, transparent 99%);
          mask-image: linear-gradient(180deg, #000 66%, transparent 99%);
  /* visible dès le premier affichage (sans attendre le script) : seul le zoom d'entrée est animé */
  animation: hero-entree 3.2s cubic-bezier(.2, .7, .1, 1) both;
}
@keyframes hero-entree { from { transform: scale(1.06); } }
.hero-batiment img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }

/* la loupe, couche décorative : elle suit la souris et agrandit ce qu'elle survole (app.js pose les variables) */
.hero-scene::after {
  --d: clamp(150px, 16vw, 250px);
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  width: var(--d);
  height: var(--d);
  border-radius: 50%;
  background-color: var(--ivoire);
  background-image: var(--loupe-image, none);
  background-repeat: no-repeat;
  background-size: var(--loupe-taille, cover);
  background-position: var(--loupe-position, center);
  /* pas d'anneau : la vue agrandie fait partie de l'image ; seule une ombre douce la détache de la façade */
  box-shadow: 0 22px 48px -18px rgba(20, 16, 50, .5);
  translate: var(--lx, 60vw) var(--ly, 30vh);
  scale: 0;
  opacity: 0;
  transition: scale .7s cubic-bezier(.2, .8, .2, 1.25), opacity .4s;
  pointer-events: none;
  will-change: translate, background-position;
}
.est-pret .hero-scene.loupe-prete::after { scale: 1; opacity: 1; transition-delay: .8s; }
.hero.zoom-actif { cursor: none; }
.hero.zoom-actif .hero-scene::after { transition-delay: 0s; }

.hero-texte { position: absolute; left: var(--marge); right: var(--marge); bottom: 8svh; }
.hero-titre {                                  /* h1 */
  display: inline-block;
  padding: .2em 0 .36em;
  margin: calc(16px - .2em) 0 -.36em;
  font: 700 clamp(44px, 5.6vw, 104px)/1 var(--f-titre);
  color: var(--accent);
}
/* le nom d'usage, souligné ; puis le nom complet « bint as-Siddiq », plus petit, sur la même ligne
   (en bloc en ligne : le soulignement ne le traverse pas, et il passe à la ligne d'un seul tenant) */
.hero-titre .hero-usage { text-decoration: underline 2px; text-underline-offset: .2em; text-decoration-skip-ink: auto; }
.hero-titre .hero-nom { display: inline-block; font-size: .46em; letter-spacing: .03em; }
.js .hero-titre { clip-path: inset(0 0 100% 0); transform: translateY(.3em); transition: clip-path 1.4s cubic-bezier(.7, 0, .2, 1) .35s, transform 1.4s cubic-bezier(.2, .7, .1, 1) .35s; }
.js .hero-texte .etiquette { opacity: 0; transition: opacity 1s .9s; }
.hero-texte .etiquette { letter-spacing: .4em; font-size: 13.5px; }
.js.est-pret .hero-titre { clip-path: inset(0 0 0 0); transform: none; }
.js.est-pret .hero-texte .etiquette { opacity: 1; }

/* la flèche : un lien texte, dessiné par un masque */
.fleche { position: absolute; right: var(--marge); bottom: calc(8svh + 6px); animation: respire 2.8s ease-in-out infinite; }
.fleche a {
  display: block;
  width: 24px;
  height: 64px;
  overflow: hidden;
  text-indent: 200%;
  white-space: nowrap;
  background: var(--accent);
  -webkit-mask: var(--fleche) center / contain no-repeat;
          mask: var(--fleche) center / contain no-repeat;
}
@keyframes respire { 50% { translate: 0 10px; } }
.hero.est-hors-champ .fleche { animation-play-state: paused; }

/* =========================================================
   RÉCIT — empilé par défaut (éditeur, sans JS), animé sinon
   ========================================================= */

.recit { position: relative; background: var(--ivoire); }
.recit-fonds, .recit-pied { display: none; }

.acte { position: relative; padding: var(--respiration) var(--marge); display: grid; gap: 26px; overflow: hidden; }
.acte + .acte { border-top: 1px solid var(--filet); }
.acte-chiffre {
  position: absolute;
  right: var(--marge);
  top: 7vh;
  font: 400 clamp(70px, 15vw, 230px)/1 var(--f-texte);
  letter-spacing: -.04em;
  color: var(--accent);
  opacity: .07;
  white-space: nowrap;
  pointer-events: none;
}
.acte-titre { font: 700 clamp(40px, 4.6vw, 76px)/1 var(--f-titre); color: var(--accent); }   /* h2 */
.acte-texte { max-width: 40ch; display: grid; gap: 12px; }
.acte-accroche { font: 600 clamp(21px, 1.7vw, 26px)/1.25 var(--f-titre); color: var(--accent); }
.acte-meta {
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid var(--filet);
  font: 600 12px/1.5 var(--f-texte);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent);
}
.acte-rail {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  margin: 0 calc(var(--marge) * -1);
  padding: 0 var(--marge) 8px;
  scrollbar-width: none;
}
.acte-rail::-webkit-scrollbar { display: none; }
.acte-rail > * { flex: 0 0 auto; scroll-snap-align: start; }
.acte-rail .arche { width: clamp(200px, 58vw, 270px); aspect-ratio: 3 / 4; }

/* --- version animée (classe posée par app.js) --- */
.recit--anime { height: 880vh; }   /* 800vh + les pauses de photo seule des actes 2 et 3 (2 × 40vh) */
/* entrée et sortie du récit : la scène émerge de l'ivoire et s'y fond */
.recit--anime::before,
.recit--anime::after { content: ''; position: absolute; left: 0; right: 0; z-index: 3; pointer-events: none; }
.recit--anime::before { top: 0; height: 70vh; background: linear-gradient(180deg, var(--ivoire) 0%, rgba(250, 240, 226, .92) 18%, rgba(250, 240, 226, .55) 45%, rgba(250, 240, 226, 0) 100%); }
.recit--anime::after { bottom: 0; height: 45vh; background: linear-gradient(0deg, var(--ivoire) 0%, rgba(250, 240, 226, .85) 30%, rgba(250, 240, 226, 0) 100%); }

.recit--anime .recit-scene {
  --intro: 0; --rail: 0; --sortie: 0; --ligne: 0;
  /* le titre de l'acte : sa place finale sous l'en-tête, et sa chute pendant les images seules */
  --titre-haut: 7vh; --titre-chute: 50vh;
  --ligne-arret: 8px;   /* la ligne s'arrête juste au-dessus des lettres (sous le haut de leur boîte) */
  position: sticky; top: 0; height: 100vh; overflow: hidden;
}
/* la ligne du temps : pendant les images seules, elle descend de l'en-tête jusqu'au titre de l'acte
   (app.js pose --ligne) ; quand elle l'atteint, l'acte commence et elle remonte avec lui en s'effaçant */
.recit--anime .recit-scene::after {
  content: '';
  position: absolute;
  z-index: 2;
  left: var(--marge);
  top: var(--entete);
  width: 2px;
  height: max(0px, calc((var(--titre-haut) + (1 - var(--intro)) * var(--titre-chute) + var(--ligne-arret)) * var(--ligne)));
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), #fff 35%);
  filter: drop-shadow(0 0 3px rgba(20, 16, 50, .45));   /* lisible aussi sur un mur blanc */
  opacity: calc(1 - var(--intro) * 1.4);
  pointer-events: none;
}
.recit--anime .recit-fonds { display: block; position: absolute; inset: 0; }
.recit--anime .recit-fond { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; transition: opacity .8s ease; }
.recit--anime .recit-fond img { width: 100%; height: 100%; object-fit: cover; }
.recit--anime .etat-1 .recit-fond.fond-1,
.recit--anime .etat-2 .recit-fond.fond-2,
.recit--anime .etat-3 .recit-fond.fond-3 {
  opacity: 1;
  transform: scale(calc(1.08 - var(--intro) * .08));
  filter: blur(calc(var(--intro) * 22px)) saturate(calc(1 - var(--intro) * .45));
}
/* voile ivoire et dégradé de lisibilité : couches décoratives, donc pseudo-éléments */
.recit--anime .recit-fonds::before { content: ''; position: absolute; inset: 0; z-index: 1; background: var(--ivoire); opacity: calc(var(--intro) * .9); }
.recit--anime .recit-fonds::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(20, 16, 50, .12) 0%, rgba(20, 16, 50, .05) 35%, rgba(20, 16, 50, .58) 100%);
  opacity: calc(1 - var(--intro));
}

.recit--anime .acte { position: absolute; inset: 0; z-index: 2; padding: 0; display: block; border: 0; opacity: 0; visibility: hidden; transition: opacity .45s, visibility .45s; }
.recit--anime .etat-1 .acte-1,
.recit--anime .etat-2 .acte-2,
.recit--anime .etat-3 .acte-3 { opacity: calc(1 - var(--sortie)); visibility: visible; }

.recit--anime .acte-titre {
  position: absolute;
  left: var(--marge);
  top: calc(var(--entete) + var(--titre-haut));
  transform-origin: left top;
  transform: translateY(calc((1 - var(--intro)) * var(--titre-chute))) scale(calc(1 + (1 - var(--intro)) * .9));
  color: color-mix(in srgb, var(--accent) calc(var(--intro) * 100%), #fff);
  white-space: nowrap;
}
.recit--anime .acte-chiffre { top: auto; bottom: 9vh; font-size: clamp(90px, 11.5vw, 200px); opacity: calc(var(--intro) * .08); transform: translateX(calc((1 - var(--intro)) * 6vw)); }
.recit--anime .acte-texte {
  position: absolute;
  left: var(--marge);
  top: calc(var(--entete) + 21vh);
  width: min(38ch, 32vw);
  opacity: var(--intro);
  transform: translateY(calc((1 - var(--intro)) * 40px));
}
.recit--anime .acte-rail {
  position: absolute;
  left: 45vw;
  top: calc(var(--entete) + 14vh);
  margin: 0;
  padding: 0;
  overflow: visible;
  gap: 2vw;
  align-items: flex-start;
  filter: drop-shadow(0 30px 34px rgba(39, 34, 98, .2));
  transform: translateX(calc((1 - var(--rail)) * 62vw));
}
.recit--anime .acte-rail .arche { width: clamp(180px, 16.5vw, 280px); }
.recit--anime .acte-rail > :nth-child(2) { margin-top: 9vh; }
.recit--anime .acte-rail > :nth-child(3) { margin-top: 3vh; }

.recit--anime .recit-pied {
  display: flex;
  position: absolute;
  z-index: 2;
  left: var(--marge);
  right: var(--marge);
  bottom: 5vh;
  align-items: flex-end;
  justify-content: space-between;
  color: color-mix(in srgb, var(--accent) calc(var(--intro) * 100%), #fff);
}
.recit-compteur { display: flex; align-items: flex-end; gap: 6px; }
.recit-numeros { display: grid; height: 1em; overflow: hidden; font: 400 52px/1 var(--f-texte); letter-spacing: -.03em; }
.recit-numeros p { grid-area: 1 / 1; transform: translateY(110%); transition: transform .6s cubic-bezier(.7, 0, .2, 1); }
.etat-1 .recit-numeros .num-1, .etat-2 .recit-numeros .num-2, .etat-3 .recit-numeros .num-3 { transform: none; }
.recit-total { font: 500 14px/1.6 var(--f-texte); letter-spacing: .1em; opacity: .75; }
.recit-etapes { display: flex; gap: 32px; font: 600 12px/1 var(--f-texte); letter-spacing: .26em; text-transform: uppercase; }
.recit-etapes li { opacity: .5; padding-bottom: 8px; transition: opacity .4s; }
.etat-1 .recit-etapes li:nth-child(1),
.etat-2 .recit-etapes li:nth-child(2),
.etat-3 .recit-etapes li:nth-child(3) { opacity: 1; background: var(--degrade) left bottom / 100% 2px no-repeat; }

/* =========================================================
   LE PROJET
   ========================================================= */

.projet { background: linear-gradient(180deg, var(--ivoire) 0, var(--blanc) 180px); padding: var(--respiration) var(--marge); }
.projet-grille { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(40px, 6vw, 110px); align-items: center; }
.projet-grille > * { min-width: 0; }
.projet-texte > p:not([class]) { max-width: 46ch; }
.projet-meta { margin-top: 30px; }

.chiffres { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 34px; border-top: 1px solid var(--filet); }
.chiffre-bloc { padding: 22px 16px 20px 0; display: grid; gap: 6px; align-content: start; border-bottom: 1px solid var(--filet); }
.chiffre-bloc:nth-child(even) { padding-left: 22px; border-left: 1px solid var(--filet); }
.chiffre { font: 400 clamp(34px, 3vw, 48px)/1 var(--f-texte); letter-spacing: -.03em; color: var(--accent); white-space: nowrap; }
.chiffre-legende { font: 600 11.5px/1.5 var(--f-texte); letter-spacing: .18em; text-transform: uppercase; color: var(--pierre); }

.plan-onglets { display: flex; border-bottom: 1px solid var(--filet); margin-bottom: 3vh; }
.plan-onglet {
  margin-right: 34px;
  padding: 0 0 13px;
  font: 600 12.5px/1 var(--f-texte);
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--pierre);
  cursor: pointer;
}
.plan-onglet.est-actif { color: var(--accent); background: var(--degrade) left bottom / 100% 2px no-repeat; }
.js .plan-dessin:not(.est-actif) { display: none; }
.plan-dessin.est-actif { animation: apparait .7s ease both; }
@keyframes apparait { from { opacity: 0; transform: translateY(14px); } }
.plan-dessin img { width: 100%; }
.plan-dessin figcaption { margin-top: 20px; font: 600 12px/1.5 var(--f-texte); letter-spacing: .28em; text-transform: uppercase; color: var(--pierre); text-align: left; }
/* le plan se dévoile de gauche à droite quand il apparaît */
.js .plan.reveler .plan-dessin img { clip-path: inset(0 100% 0 0); transition: clip-path 2.2s cubic-bezier(.5, 0, .2, 1) .3s; }
.js .plan.reveler.est-vu .plan-dessin img { clip-path: inset(0 0 0 0); }

/* =========================================================
   LA COLLECTE
   ========================================================= */

.collecte { padding: var(--respiration) var(--marge); background: linear-gradient(180deg, var(--blanc) 0, var(--ivoire) 180px); }
.collecte-grille { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 110px); align-items: start; }
.collecte-gauche > p:not([class]) { max-width: 44ch; }

.etapes { display: grid; gap: 38px; margin-top: 42px; }
.etape { --pourcent: 0%; --remplissage: 0%; }
.etape.est-atteinte { --pourcent: 100%; }
.est-vu .etape { --remplissage: var(--pourcent); }
/* la ligne des chiffres porte la jauge en pseudo-élément : le client ne modifie que les montants */
.etape-chiffres { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .5em; margin: 10px 0 14px; padding-bottom: 16px; }
.etape-chiffres::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--degrade) 0 0 / var(--remplissage) 100% no-repeat, var(--filet);
  transition: background-size 2.2s cubic-bezier(.2, .7, .1, 1) .3s;
}
.etape-chiffres::before {
  content: '';
  position: absolute;
  bottom: -4.5px;
  left: calc(var(--remplissage) - 6px);
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--logo-orange);
  box-shadow: 0 0 0 4px rgba(244, 136, 57, .2);
  transition: left 2.2s cubic-bezier(.2, .7, .1, 1) .3s;
}
.etape-montant { font: 400 clamp(46px, 5vw, 80px)/1 var(--f-texte); letter-spacing: -.035em; color: var(--accent); white-space: nowrap; }
.etape-objectif { font: 500 clamp(16px, 1.7vw, 27px)/1 var(--f-texte); color: var(--pierre); white-space: nowrap; }
.etape-statut { margin-top: 12px; font: 600 12px/1.5 var(--f-texte); letter-spacing: .18em; text-transform: uppercase; color: var(--accent); }
.etape:not(.est-atteinte) .etape-statut { color: var(--pierre); }
/* le pourcentage est calculé par app.js depuis les deux montants, et affiché par un compteur CSS */
.etape.est-calcule .etape-statut { counter-reset: pourcent var(--entier); }
.etape.est-calcule .etape-statut::before { content: counter(pourcent) '\00a0% de l\2019objectif · '; color: var(--accent); }

.collecte-droite { padding-top: 6px; }
.moyens { margin-top: 18px; border-top: 1px solid var(--filet); }
.moyen { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--filet); }
.moyen-titre { font: 600 clamp(19px, 1.45vw, 22px)/1.2 var(--f-titre); color: var(--accent); margin-bottom: 3px; }
.moyen p { font-size: 15px; line-height: 1.6; }
.moyen .wp-block-button .wp-block-button__link { min-width: 140px; }
.iban { letter-spacing: .06em; }

/* le hadith : sobre, sous un trait aux couleurs du logo */
.hadith {
  margin: calc(var(--respiration) * .9) auto 0;
  max-width: 860px;
  padding: 44px 0 0;
  text-align: center;
  background: var(--degrade) center top / 120px 2px no-repeat;
}
.hadith-arabe { font: 400 clamp(28px, 3vw, 42px)/1.7 var(--f-arabe); color: var(--accent); }
.hadith .hadith-texte { margin: 14px 0 0; }
.hadith-texte p { text-wrap: balance; margin: 0 0 18px; font: 500 clamp(19px, 1.6vw, 23px)/1.5 var(--f-titre); color: var(--encre); }
/* « D'après… a dit : » : la chaîne de transmission, discrète au-dessus de la parole */
.hadith-texte .hadith-isnad { max-width: 62ch; margin: 0 auto 12px; font: 500 15px/1.6 var(--f-texte); color: var(--pierre); }
/* la source est une phrase : en bas de casse, plus lisible qu'en capitales espacées */
.hadith-texte cite { display: block; max-width: 60ch; margin: 0 auto; font: 500 13px/1.6 var(--f-texte); letter-spacing: .02em; font-style: normal; color: var(--pierre); text-wrap: balance; }

/* =========================================================
   ACTUALITÉS
   ========================================================= */

.actualites { background: linear-gradient(180deg, var(--ivoire) 0, var(--blanc) 180px); padding: var(--respiration) var(--marge); }
.actualites-tete { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.actualites-intro { max-width: 34ch; color: var(--pierre); }
.cartes { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(22px, 2.4vw, 42px); margin-top: 7vh; }
.carte { display: grid; gap: 12px; align-content: start; }
.carte .arche { aspect-ratio: 4 / 5; margin-bottom: 10px; }
.carte .arche img { object-position: 50% 6%; transition: transform 1.2s cubic-bezier(.2, .7, .1, 1); }
.carte:hover .arche img { transform: scale(1.05); }
.carte:nth-child(even) { margin-top: 6vh; }
.carte-titre { font: 600 clamp(19px, 1.45vw, 22px)/1.22 var(--f-titre); color: var(--accent); }      /* h3 */
.carte p:not(.etiquette):not(.lien) { font-size: 15px; line-height: 1.65; }
.carte [lang="ar"] { font-family: var(--f-arabe); }

/* =========================================================
   PRIER & CONTACT
   ========================================================= */

.prier { position: relative; padding: var(--respiration) var(--marge); overflow: hidden; isolation: isolate;
  background:
    linear-gradient(180deg, var(--blanc) 0, rgba(253, 253, 253, 0) 180px),
    radial-gradient(60% 80% at 90% 100%, rgba(244, 136, 57, .16), rgba(244, 136, 57, 0) 70%),
    radial-gradient(50% 70% at 10% 0%, rgba(124, 45, 142, .12), rgba(124, 45, 142, 0) 70%),
    var(--ivoire);
}
.prier-grille { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, .8fr) minmax(0, .7fr); gap: clamp(30px, 5vw, 90px); align-items: end; }
.prier-horaires { display: grid; gap: 16px; justify-items: start; }
.prier-horaires .titre-section { margin: 0 0 4px; }
.prier-horaires > p:not([class]) { max-width: 38ch; }
.prier-horaires .wp-block-buttons { margin-top: 10px; }
/* le module Mawaqit : une fenêtre sur le ciel de nuit (son contenu grandit avec sa largeur) */
.mawaqit {
  width: 100%;
  margin-top: 8px;
  border-radius: 18px;
  overflow: hidden;
  background: #0d1030;   /* le temps du chargement, pas de rectangle blanc */
  box-shadow: 0 30px 60px -32px rgba(39, 34, 98, .55), 0 0 0 1px rgba(39, 34, 98, .12);
}
.mawaqit iframe { display: block; width: 100%; aspect-ratio: 2 / 1; border: 0; }
/* sur téléphone, bord à bord : chaque pixel de largeur rend les horaires plus lisibles */
@media (max-width: 640px) {
  .mawaqit { width: auto; justify-self: stretch; margin-inline: calc(var(--marge) * -1); border-radius: 0; box-shadow: none; }
  .mawaqit iframe { aspect-ratio: 1.9 / 1; }
}
.prier-contact { padding-top: 22px; border-top: 1px solid var(--filet); }
.prier-adresse { margin-top: 12px; font: 500 clamp(19px, 1.5vw, 22px)/1.4 var(--f-texte); color: var(--accent); }
.prier-repere { margin-top: 6px; color: var(--pierre); font-size: 15px; }
.prier-tel { margin-top: 12px; }
.prier-tel a { font: 400 clamp(28px, 2.4vw, 38px)/1 var(--f-texte); letter-spacing: -.01em; color: var(--accent); text-decoration: none; }
.prier-suivre { margin-top: 26px; }

/* réseaux sociaux (core/social-links, style « logos seuls ») */
.wp-block-social-links.reseaux { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 12px; padding: 0; }
.wp-block-social-links.reseaux .wp-social-link { margin: 0; padding: 0; color: var(--accent); background: none; }
.wp-block-social-links.reseaux .wp-block-social-link-anchor { display: inline-flex; align-items: center; gap: 9px; padding: 0; color: inherit; text-decoration: none; }
.wp-block-social-links.reseaux .wp-block-social-link-anchor svg { width: 20px; height: 20px; transition: transform .3s; }
.wp-block-social-links.reseaux .wp-block-social-link-label { font: 600 14px/1 var(--f-texte); }
.wp-block-social-links.reseaux .wp-social-link:hover { transform: none; color: #D82A7F; }
.wp-block-social-links.reseaux .wp-social-link:hover svg { transform: translateY(-2px); }

/* =========================================================
   PIED DE PAGE
   ========================================================= */

.pied { display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap; padding: 34px var(--marge); border-top: 1px solid var(--filet); background: var(--ivoire); }
.pied .wp-block-site-logo img { height: 52px; width: auto; }
.pied-nav .wp-block-navigation__container { gap: 28px; }
.pied-nav .wp-block-navigation-item__content { font: 500 14px var(--f-texte); text-decoration: none; color: var(--encre); }
.pied-nav .wp-block-navigation-item__content:hover { color: var(--accent); }
.pied .reseaux { margin-top: 0; gap: 16px; }
.pied-bas { font-size: 11px; }

/* =========================================================
   ADAPTATIF
   ========================================================= */

@media (max-width: 1180px) {
  .nav-liens .wp-block-navigation__container { gap: 18px; }
  .nav-liens .wp-block-navigation-item__content { font-size: 13px; }
  .cartes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  :root { --entete: 76px; }
  /* le menu replié dès 900 px (core/navigation ne bascule d'elle-même qu'à 600 px) */
  .nav-liens .wp-block-navigation__responsive-container-open { display: flex !important; }
  .nav-liens .wp-block-navigation__responsive-container:not(.is-menu-open) { display: none !important; }
  .projet-grille, .collecte-grille, .prier-grille { grid-template-columns: 1fr; }
  .moyen { grid-template-columns: 1fr; gap: 10px; }
  /* comme sur la maquette : « Faire un don » puis le bouton menu, tout à droite */
  .entete-actions .wp-block-buttons { order: -1; }
}

@media (max-width: 640px) {
  .entete .wp-block-site-logo img { height: 46px; }
  .entete .wp-block-button.bouton .wp-block-button__link { padding: 10px 16px 9px; font-size: 13.5px; }
  /* le titre passe sur deux lignes : assez d'interligne pour que le soulignement de « MOSQUÉE »
     ne touche pas le tréma de « AÏCHA » */
  .hero-titre { font-size: clamp(44px, 14.5vw, 76px); line-height: 1.3; }
  .hero-titre .hero-nom { display: block; margin: .1em 0 0; font-size: .42em; line-height: 1.2; }
  .cartes { grid-template-columns: 1fr; }
  .carte:nth-child(even) { margin-top: 0; }
  .actualites-tete { display: block; }
  .actualites-intro { margin-top: 14px; }
  .chiffre-legende, .pied-bas { font-size: 12px; }
  .etape-montant { font-size: clamp(38px, 11.5vw, 56px); }
  /* le plan garde une taille lisible : on le fait glisser du doigt */
  .plan-dessin { overflow-x: auto; margin: 0 calc(var(--marge) * -1); padding: 0 var(--marge); scrollbar-width: none; }
  .plan-dessin::-webkit-scrollbar { display: none; }
  .plan-dessin img { width: 620px; max-width: none; }
  .plan-dessin figcaption::after { content: ' · faites glisser le plan →'; color: var(--accent); }
}

/* cibles tactiles d'au moins 44 px */
@media (pointer: coarse), (max-width: 900px) {
  .nav-liens .wp-block-navigation__responsive-container-open { width: 44px; height: 44px; align-items: center; justify-content: center; margin-right: -7px; }
  .entete .wp-block-button.bouton .wp-block-button__link { min-height: 42px; }
  .fleche a { padding: 12px; margin: -12px; box-sizing: content-box; }
  .plan-onglet { padding-top: 14px; }
  .prier-tel a { display: inline-block; padding: 6px 0; }
  .lien a { padding-top: 12px; padding-bottom: 10px; }
  .wp-block-social-links.reseaux .wp-block-social-link-anchor { min-height: 44px; }
  .pied .wp-block-social-links.reseaux .wp-block-social-link-anchor { width: 44px; justify-content: center; }
  .pied-nav .wp-block-navigation-item__content { display: inline-block; padding: 13px 0; }
}

/* mobile — hero : le bâtiment entier juste sous l'en-tête, le titre en bas de l'écran visible
   (il invite à faire défiler) ; sur un petit écran, le titre suit l'image sans jamais la chevaucher */
@media (max-width: 640px) {
  .hero {
    --scene: calc(var(--entete) + 80vw);
    --bas: max(44px, 7svh);
    height: auto;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: calc(var(--scene) + 6px) var(--marge) var(--bas);
  }
  .hero-texte { position: relative; left: auto; right: auto; bottom: auto; }
  .hero-texte .etiquette { margin-bottom: 10px; }
  .fleche { top: auto; bottom: var(--bas); }
  .hero-scene {
    height: var(--scene);
    background:
      linear-gradient(180deg, rgba(110, 102, 172, .5) 0%, rgba(110, 102, 172, 0) calc(100% - 72vw)),
      linear-gradient(90deg, #9990B4 0%, #B5A4C0 50%, #D8B8C4 100%) top / 100% calc(100% - 50vw) no-repeat,
      var(--ivoire);
  }
  .hero-batiment {
    position: absolute;
    left: 50%;
    bottom: 0;
    width: 136vw;
    max-width: none;
    height: auto;
    aspect-ratio: 2000 / 1116;
    margin-left: -68vw;
    -webkit-mask-image: linear-gradient(180deg, transparent 0%, #000 14%, #000 68%, transparent 98%);
            mask-image: linear-gradient(180deg, transparent 0%, #000 14%, #000 68%, transparent 98%);
  }
  .hero-scene::after { --d: 34vw; }
}

/* mobile — récit animé */
@media (max-width: 900px) {
  .recit--anime { height: 840svh; }
  .recit--anime .recit-scene { height: 100svh; --titre-haut: 2svh; --titre-chute: 58svh; --ligne-arret: -3px; }
  .recit--anime .etat-1 .recit-fond.fond-1,
  .recit--anime .etat-2 .recit-fond.fond-2,
  .recit--anime .etat-3 .recit-fond.fond-3 { filter: none; }
  .recit--anime .recit-fonds::before { opacity: calc(var(--intro) * .94); }
  .recit--anime .acte-titre {
    font-size: clamp(30px, 8.6vw, 46px);
    transform: translateY(calc((1 - var(--intro)) * var(--titre-chute))) scale(calc(1 + (1 - var(--intro)) * .3));
  }
  .recit--anime .acte-texte { top: calc(var(--entete) + 2svh + clamp(48px, 13vw, 66px)); left: var(--marge); right: var(--marge); width: auto; gap: 8px; }
  .recit--anime .acte-texte p:not([class]) { font-size: 15px; line-height: 1.6; }
  .recit--anime .acte-accroche { font-size: 21px; }
  .recit--anime .acte-meta { margin-top: 2px; padding-top: 10px; font-size: 11.5px; }
  .recit--anime .acte-rail { top: auto; bottom: calc(4svh + 54px); left: var(--marge); gap: 3vw; transform: translateX(calc((1 - var(--rail)) * 105vw)); }
  .recit--anime .acte-rail .arche { width: 31vw; }
  .recit--anime .acte-rail > :nth-child(2) { margin-top: 3svh; }
  .recit--anime .acte-rail > :nth-child(3) { margin-top: 1svh; }
  .recit--anime .acte-chiffre { display: none; }
  .recit--anime .recit-pied { bottom: 3svh; }
  .recit--anime .recit-numeros { font-size: 38px; }
  .recit--anime .recit-etapes { gap: 14px; font-size: 10.5px; letter-spacing: .16em; }
}
@media (max-width: 900px) and (max-height: 700px) {
  .recit--anime .acte-texte p:not([class]) { font-size: 14px; line-height: 1.5; }
  .recit--anime .acte-meta { display: none; }
  .recit--anime .acte-rail .arche { width: 26vw; }
}

:where(a, button, [tabindex]):focus-visible { outline: 2px solid #D82A7F; outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveler { opacity: 1; transform: none; }
}

/* pages ordinaires (hors accueil) : l'en-tête est fixe, on lui réserve la place */
.page-standard { padding: calc(var(--entete) + 8vh) var(--marge) var(--respiration); max-width: 1100px; margin-inline: auto; display: grid; gap: 22px; }
/* le texte des pages ordinaires (mentions légales…) : une colonne lisible */
.page-standard .wp-block-post-content { max-width: 70ch; }
.page-standard .wp-block-post-content > * + * { margin-top: 14px; }
.page-standard .wp-block-post-content h2 { margin-top: 46px; font: 700 clamp(22px, 2vw, 28px)/1.2 var(--f-titre); color: var(--accent); }
.page-standard .wp-block-post-content h2 + * { margin-top: 12px; }
.page-standard .wp-block-post-content ul { margin-bottom: 0; padding-left: 1.2em; display: grid; gap: 6px; }
.page-standard .wp-block-post-content a { color: var(--accent); text-underline-offset: .2em; }
.page-standard .page-intro { font-size: 18px; color: var(--encre); }
.page-standard .page-maj { margin-top: 46px; font-size: 13px; color: var(--pierre); }
.pied-bas a { color: inherit; text-decoration: none; }
.pied-bas a:hover, .pied-bas a:focus-visible { color: var(--accent); text-decoration: underline; text-underline-offset: .3em; }

/* WordPress annule la marge basse du dernier enfant d'un groupe (:root :where(.is-layout-flow) > :last-child) :
   le titre du hero en a besoin pour garder sa place, d'où une spécificité plus forte */
.hero .hero-texte .hero-titre { margin-bottom: -.36em; }

/* « إن شاء الله » à côté de « DEMAIN » : suit le titre dans l'animation */
.acte-titre [lang="ar"] { font: 400 .5em/1 var(--f-arabe); letter-spacing: 0; margin-inline-start: .35em; vertical-align: .18em; white-space: nowrap; }
/* l'arabe des cartes en Amiri, sans agrandir la hauteur de ligne */
.carte [lang="ar"] { line-height: 1; }
/* dou'a en arabe après un nom (حفظه الله, رحمه الله) : Amiri, à la taille optique du texte latin,
   jamais coupée en fin de ligne, sans l'espacement des étiquettes (il casserait les liaisons) */
.douaa { font: 400 1.15em/1 var(--f-arabe); letter-spacing: 0; text-transform: none; white-space: nowrap; }
/* le paragraphe qui porte le lien « Lire… » épouse la hauteur du lien (sinon sa ligne de base ajoute 6 px) */
p.lien { display: flex; }

/* figure.wp-block-image { margin: 0 } est plus spécifique qu'une simple classe :
   les décalages des figures du hero mobile et du plan défilable doivent être qualifiés */
@media (max-width: 640px) {
  .hero-scene .hero-batiment { margin-left: -68vw; }
  .plan .plan-dessin { margin: 0 calc(var(--marge) * -1); }
}
