/* ===========================================
   Cartographie de la 'Aqida — Institut Miftah
   Palette bleu Miftah (#1F3A5F / #2F5FA3 / blanc)
   Présentation des cartes inspirée de coran.institutmiftah.com
   =========================================== */

@import url('https://fonts.googleapis.com/css2?family=Amiri:wght@400;700&family=Noto+Naskh+Arabic:wght@400;500;600;700&family=Cormorant+Garamond:ital,wght@0,400;0,500;0,600;0,700;1,400&family=DM+Sans:wght@400;500;600;700&display=swap');

/* --- Variables --- */
:root {
  --bg: #ffffff;
  --cream: #f6f8fc;
  --card: #ffffff;
  --card-hover: #fbfcfe;
  --border: #dde4ee;
  --text: #1F3A5F;
  --dim: #6b7280;

  /* Palette Miftah — bleu */
  --navy: #1F3A5F;          /* bleu principal */
  --accent: #2F5FA3;        /* bleu secondaire */
  --accent-dark: #1F3A5F;
  --accent-light: #4a8bc7;
  --accent-soft: #e7f0fa;

  /* Or institutionnel (filets, badges, accents arabes) */
  --gold: #c8984a;
  --gold-dim: #a87a32;

  /* Couleurs thématiques (compatibilité chapitres existants) */
  --green: #2d7d4b;
  --blue: #2F5FA3;
  --red: #c25b6e;
  --orange: #d4783b;
  --purple: #7b5ea7;
  --teal: #0eb290;

  /* Couleurs propres aux 4 portes de la cartographie */
  --door-fond: #6b8caf;     /* Fondations — bleu doux */
  --door-tawh: #1F3A5F;     /* Tawhid — bleu profond */
  --door-foi:  #2d7d4b;     /* Foi — vert */
  --door-prot: #c25b6e;     /* Protection — rouge sobre */
}

/* --- Reset --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* --- Base --- */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }

/* =====================
   SITE HEADER
   ===================== */
.site-header {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px 24px 0;
  text-align: center;
}

.logo-link {
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo {
  height: 100px; /* 👈 ajuste ici */
  width: auto;
  display: block;
  transition: transform .2s ease, opacity .2s ease;
}

.logo:hover {
  transform: translateY(-2px);
  opacity: 0.9;
}

/* =====================
   HERO
   ===================== */
.hero {
  text-align: center;
  padding: 16px 24px 28px;
}
.hero-bismillah {
  font-family: 'Noto Naskh Arabic', 'Amiri', serif;
  font-size: 1.8rem;
  color: var(--accent);
  direction: rtl;
  margin-bottom: 10px;
  opacity: 0;
  animation: fadeDown .8s .1s ease forwards;
}
.hero h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
  opacity: 0;
  animation: fadeDown .8s .2s ease forwards;
}
.hero h1 span { color: var(--accent); }
.hero-sub {
  font-size: .98rem;
  color: var(--dim);
  margin-top: 12px;
  max-width: 580px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.7;
  opacity: 0;
  animation: fadeDown .8s .3s ease forwards;
}
.hero-sub em { color: var(--navy); font-style: italic; }

.hero-cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 22px;
  opacity: 0;
  animation: fadeDown .8s .35s ease forwards;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  padding: 12px 26px;
  border-radius: 8px;
  font-weight: 600;
  font-size: .95rem;
  transition: background .2s, transform .15s;
  box-shadow: 0 3px 10px rgba(30, 95, 167, 0.18);
}
.btn-primary:hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}
.btn-secondary {
  background: #fff;
  color: var(--accent);
  padding: 12px 24px;
  border-radius: 8px;
  font-weight: 600;
  font-size: .95rem;
  border: 1px solid var(--accent-light);
  transition: all .2s;
}
.btn-secondary:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.stats-bar {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 28px;
  opacity: 0;
  animation: fadeDown .8s .4s ease forwards;
}
.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.stat-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.stat-label {
  font-size: .76rem;
  color: var(--dim);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: .5px;
}

/* Gold line */
.gold-line {
  width: 80px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  margin: 24px auto;
}

/* =====================
   HADITH INTRO
   ===================== */
.hadith-card-intro {
  max-width: 820px;
  margin: 30px auto;
  padding: 0 20px;
}
.hadith-card-intro-inner {
  background: var(--cream);
  border: 1px solid var(--border);
  border-right: 4px solid var(--accent);
  border-radius: 10px;
  padding: 26px 30px;
}
.hadith-card-intro-inner .ar-text {
  font-family: 'Noto Naskh Arabic', 'Amiri', serif;
  font-size: 1.15rem;
  line-height: 2;
  direction: rtl;
  color: var(--navy);
  text-align: right;
  margin-bottom: 14px;
}
.hadith-card-intro-inner .fr-text {
  font-size: .95rem;
  line-height: 1.75;
  color: var(--text);
  font-style: italic;
  padding: 14px 0;
  border-top: 1px solid var(--border);
}
.hadith-card-intro-inner .source {
  font-size: .8rem;
  color: var(--dim);
  margin-top: 10px;
  text-align: right;
}

/* =====================
   SECTION TITLES
   ===================== */
.section-title {
  text-align: center;
  max-width: 820px;
  margin: 36px auto 24px;
  padding: 0 20px;
}
.level-badge {
  display: inline-block;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: .75rem;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 20px;
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: .6px;
}
.level-badge-locked {
  background: rgba(15, 36, 68, 0.06);
  color: var(--navy);
}
.lock-mini { font-size: .7rem; }
.section-title h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
  line-height: 1.2;
}
.section-title p {
  font-size: .92rem;
  color: var(--dim);
  line-height: 1.65;
  max-width: 640px;
  margin: 0 auto;
}

/* =====================
   NIVEAU 1 — CARTE PRINCIPALE
   ===================== */
.carto-section {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

.cartography {
  position: relative;
  padding: 30px 0 20px;
}

/* Nœud central */
.carto-center {
  display: flex;
  justify-content: center;
  margin-bottom: 50px;
  position: relative;
}
.carto-center::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 28px;
  background: linear-gradient(180deg, var(--accent), transparent);
}
.carto-center-inner {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  padding: 22px 36px;
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 8px 28px rgba(30, 95, 167, 0.28);
  min-width: 260px;
}
.carto-center-inner .ar-tag {
  display: block;
  font-family: 'Noto Naskh Arabic', 'Amiri', serif;
  font-size: 1.5rem;
  margin-bottom: 6px;
  opacity: .92;
}
.carto-center-inner strong {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 700;
  display: block;
  letter-spacing: .3px;
}
.carto-center-inner small {
  display: block;
  font-size: .78rem;
  margin-top: 4px;
  opacity: .8;
  letter-spacing: .5px;
}

/* Branches */
.carto-branches {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  position: relative;
}

.carto-branch {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px 20px;
  position: relative;
  transition: transform .2s, box-shadow .2s, border-color .2s;
}
.carto-branch::before {
  content: "";
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 2px;
  height: 22px;
  background: var(--border);
}
.carto-branch:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 30px rgba(15, 36, 68, 0.08);
}

.carto-branch[data-color="blue"] { border-top: 4px solid var(--c-blue); }
.carto-branch[data-color="navy"] { border-top: 4px solid var(--c-navy); }
.carto-branch[data-color="gold"] { border-top: 4px solid var(--c-gold); }
.carto-branch[data-color="blue"]:hover { border-color: var(--c-blue); }
.carto-branch[data-color="navy"]:hover { border-color: var(--c-navy); }
.carto-branch[data-color="gold"]:hover { border-color: var(--c-gold); }

.branch-head {
  text-align: center;
  padding-bottom: 16px;
  margin-bottom: 14px;
  border-bottom: 1px dashed var(--border);
}
.branch-icon {
  display: inline-block;
  font-size: 1.4rem;
  margin-bottom: 6px;
  color: var(--accent);
}
.carto-branch[data-color="navy"] .branch-icon { color: var(--c-navy); }
.carto-branch[data-color="gold"] .branch-icon { color: var(--c-gold); }
.branch-head h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.2;
}
.branch-ar {
  font-family: 'Noto Naskh Arabic', 'Amiri', serif;
  font-size: 1.1rem;
  color: var(--accent-dark);
  display: block;
  margin: 4px 0;
  direction: rtl;
}
.carto-branch[data-color="navy"] .branch-ar { color: var(--c-navy); }
.carto-branch[data-color="gold"] .branch-ar { color: var(--c-gold); }
.branch-tag {
  font-size: .78rem;
  color: var(--dim);
  font-style: italic;
}

.branch-nodes {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.node {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background: var(--cream);
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: .92rem;
  color: var(--text);
  font-weight: 500;
  transition: all .15s;
  cursor: pointer;
}
.node:hover {
  background: var(--accent-soft);
  border-color: var(--accent-light);
  color: var(--accent-dark);
  transform: translateX(2px);
}
.node small {
  font-family: 'Noto Naskh Arabic', 'Amiri', serif;
  font-size: .85rem;
  color: var(--dim);
  font-weight: 400;
  margin-left: 6px;
  font-style: italic;
}
.node:hover small { color: var(--accent); }

@media (max-width: 860px) {
  .carto-branches { grid-template-columns: 1fr; gap: 16px; }
  .carto-branch::before { display: none; }
  .carto-center { margin-bottom: 24px; }
  .carto-center::after { display: none; }
}

/* =====================
   NIVEAU 2 — DÉVELOPPEMENT
   ===================== */
.develop-section {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 20px;
}

.topics { display: flex; flex-direction: column; gap: 36px; }

.topic-group { }
.topic-group-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--navy);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.topic-group-title .dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  display: inline-block;
}
.topic-group[data-color="blue"] .dot { background: var(--c-blue); }
.topic-group[data-color="navy"] .dot { background: var(--c-navy); }
.topic-group[data-color="gold"] .dot { background: var(--c-gold); }

.topic {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 12px;
  overflow: hidden;
  transition: box-shadow .2s, border-color .2s;
}
.topic:hover { border-color: var(--accent-light); box-shadow: 0 4px 16px rgba(15, 36, 68, 0.06); }

.topic-group[data-color="blue"] .topic { border-left: 3px solid var(--c-blue); }
.topic-group[data-color="navy"] .topic { border-left: 3px solid var(--c-navy); }
.topic-group[data-color="gold"] .topic { border-left: 3px solid var(--c-gold); }

.topic-head {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  cursor: pointer;
  user-select: none;
}
.topic-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  font-size: 1.05rem;
  flex-shrink: 0;
}
.topic-group[data-color="blue"] .topic-num { background: var(--c-blue); }
.topic-group[data-color="navy"] .topic-num { background: var(--c-navy); }
.topic-group[data-color="gold"] .topic-num { background: var(--c-gold); }

.topic-meta { flex: 1; min-width: 0; }
.topic-meta h4 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.18rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.3;
  margin-bottom: 2px;
}
.topic-meta .ar {
  font-family: 'Noto Naskh Arabic', 'Amiri', serif;
  font-size: .98rem;
  color: var(--accent-dark);
  direction: rtl;
  display: inline-block;
  margin-bottom: 4px;
}
.topic-tease {
  font-size: .87rem;
  color: var(--dim);
  line-height: 1.5;
  margin-top: 4px;
}
.topic-arrow {
  color: var(--accent);
  font-size: 1.1rem;
  transition: transform .3s;
  flex-shrink: 0;
}
.topic.open .topic-arrow { transform: rotate(180deg); }

.topic-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .45s ease;
}
.topic.open .topic-body { max-height: 4000px; }

/* Grille 4 cellules : définition · preuve · explication · exemple */
.grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  padding: 0 22px 18px;
  border-top: 1px solid var(--border);
  padding-top: 18px;
}
.cell {
  background: var(--cream);
  border-radius: 8px;
  padding: 14px 16px;
}
.cell h5 {
  font-size: .82rem;
  font-weight: 700;
  color: var(--accent-dark);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: .4px;
}
.cell p {
  font-size: .9rem;
  line-height: 1.65;
  color: var(--text);
}
.cell strong { color: var(--navy); }
.cell em { color: var(--accent-dark); font-style: italic; }
.cell .ayah {
  font-family: 'Noto Naskh Arabic', 'Amiri', serif;
  font-size: 1rem;
  line-height: 1.9;
  direction: rtl;
  text-align: right;
  padding: 10px 14px;
  border-right: 3px solid var(--accent);
  background: rgba(30, 95, 167, 0.06);
  border-radius: 6px;
  margin: 8px 0;
  color: var(--navy);
}

@media (max-width: 720px) {
  .grid-4 { grid-template-columns: 1fr; }
}

/* Niveau 3 verrouillé (dans chaque topic) */
.level-3 {
  margin: 0 22px 22px;
  background: linear-gradient(135deg, #f8fafd, #f0f5fc);
  border: 1px dashed var(--accent-light);
  border-radius: 10px;
  padding: 18px 20px;
  position: relative;
}
.lock-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.lock-row strong {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  color: var(--navy);
  font-weight: 600;
}
.lock-icon { font-size: 1.05rem; }
.lock-tag {
  font-size: .68rem;
  background: var(--accent);
  color: #fff;
  padding: 3px 10px;
  border-radius: 12px;
  font-weight: 600;
  letter-spacing: .4px;
  text-transform: uppercase;
}
.lock-list {
  list-style: none;
  padding: 0;
  margin: 0 0 12px;
}
.lock-list li {
  position: relative;
  padding: 6px 0 6px 20px;
  font-size: .88rem;
  color: var(--dim);
  line-height: 1.5;
}
.lock-list li::before {
  content: "›";
  position: absolute;
  left: 4px;
  color: var(--accent);
  font-weight: 700;
}
.lock-list a.preview-link {
  color: var(--accent);
  text-decoration: underline;
  font-weight: 500;
}
.lock-cta {
  display: inline-block;
  font-size: .85rem;
  font-weight: 600;
  color: var(--accent);
  padding: 6px 0;
  transition: color .2s;
}
.lock-cta:hover { color: var(--accent-dark); text-decoration: underline; }

/* =====================
   NIVEAU 3 — SECTION DÉDIÉE
   ===================== */
.level-3-section {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
}
.level-3-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 36px;
}
.l3-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 22px;
  transition: transform .2s, box-shadow .2s;
}
.l3-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(15, 36, 68, 0.08);
}
.l3-icon { font-size: 1.6rem; display: block; margin-bottom: 10px; }
.l3-card h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 8px;
}
.l3-card p {
  font-size: .9rem;
  line-height: 1.65;
  color: var(--dim);
}
.l3-card em { color: var(--accent-dark); font-style: italic; }

.cta-final {
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #fff;
  padding: 38px 28px;
  border-radius: 14px;
  text-align: center;
  margin: 30px auto 50px;
  box-shadow: 0 12px 40px rgba(30, 95, 167, 0.22);
}
.cta-final h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 8px;
}
.cta-final p {
  opacity: .9;
  margin-bottom: 18px;
  font-size: .95rem;
}
.btn-cta {
  display: inline-block;
  background: #fff;
  color: var(--accent-dark);
  padding: 13px 32px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 1rem;
  transition: transform .15s, box-shadow .2s;
}
.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,.18);
}

/* =====================
   SOURCES (textes de référence)
   ===================== */
.sources-section {
  max-width: 1100px;
  margin: 30px auto 10px;
  padding: 0 20px;
}
.sources-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.source-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 20px 16px;
  display: flex;
  flex-direction: column;
  position: relative;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  text-decoration: none;
  color: inherit;
  overflow: hidden;
}
.source-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
}
.source-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(15, 36, 68, 0.1);
  border-color: var(--accent-light);
  background: var(--card-hover);
}
.source-ar {
  font-family: 'Noto Naskh Arabic', 'Amiri', serif;
  font-size: 1.3rem;
  color: var(--accent-dark);
  direction: rtl;
  margin-bottom: 6px;
  line-height: 1.5;
  font-weight: 600;
}
.source-fr {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 4px;
  line-height: 1.3;
}
.source-author {
  font-size: .8rem;
  color: var(--accent);
  font-style: italic;
  margin-bottom: 10px;
}
.source-desc {
  font-size: .85rem;
  color: var(--text);
  line-height: 1.55;
  margin-bottom: 14px;
}
.source-link {
  margin-top: auto;
  font-size: .82rem;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.source-link::before {
  content: "↓";
  font-size: 1rem;
  font-weight: 700;
}
.source-card:hover .source-link { color: var(--accent-dark); }

.source-tag {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: .65rem;
  background: var(--accent-soft);
  color: var(--accent-dark);
  padding: 3px 9px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .4px;
}

/* =====================
   FOOTER
   ===================== */
.footer {
  text-align: center;
  padding: 40px 24px 30px;
  font-size: .85rem;
  color: var(--dim);
  border-top: 1px solid var(--border);
  margin-top: 40px;
}
.footer-ar {
  font-family: 'Noto Naskh Arabic', 'Amiri', serif;
  font-size: 1.2rem;
  color: var(--accent);
  direction: rtl;
  margin-bottom: 14px;
}
.footer a { color: var(--accent); }
.footer p { line-height: 1.7; }

/* =====================
   PROGRESS BAR + SCROLL TOP
   ===================== */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: var(--accent);
  z-index: 999;
  transition: width .2s ease;
}
.scroll-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .2s;
  box-shadow: 0 4px 12px rgba(15, 36, 68, 0.2);
  z-index: 998;
}
.scroll-top.visible { opacity: 1; pointer-events: auto; }
.scroll-top:hover { transform: translateY(-2px); background: var(--accent-dark); }

/* =====================
   SOMMAIRE FLOTTANT (TOC) — chapitres
   ===================== */
.chapter-toc {
  position: fixed;
  top: 110px;
  left: 18px;
  width: 220px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 14px 12px;
  font-size: .82rem;
  z-index: 90;
  box-shadow: 0 4px 20px rgba(31, 58, 95, 0.06);
}
.chapter-toc-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: .95rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: .04em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 8px;
}
.chapter-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  counter-reset: toc;
}
.chapter-toc-list li {
  counter-increment: toc;
  margin: 0;
}
.chapter-toc-list a {
  display: block;
  padding: 6px 8px 6px 26px;
  position: relative;
  color: var(--dim);
  text-decoration: none;
  border-radius: 6px;
  line-height: 1.35;
  font-size: .8rem;
  transition: all .15s ease;
}
.chapter-toc-list a::before {
  content: counter(toc);
  position: absolute;
  left: 6px;
  top: 6px;
  font-size: .68rem;
  font-weight: 700;
  color: var(--accent);
  opacity: .6;
}
.chapter-toc-list a:hover {
  color: var(--navy);
  background: var(--cream);
}
.chapter-toc-list a.active {
  color: var(--navy);
  background: var(--accent-soft);
  font-weight: 600;
}
.chapter-toc-list a.active::before { opacity: 1; }
@media (max-width: 1300px) {
  .chapter-toc { display: none; }
}

/* =====================
   COMPATIBILITÉ — pages chapitres
   (aqida-01-mindmap.html et autres)
   ===================== */
.search-bar { max-width: 500px; margin: 20px auto; padding: 0 20px; text-align: center; }
.search-bar input {
  width: 100%; padding: 12px 18px; border: 1px solid var(--border); border-radius: 8px;
  font-size: .95rem; font-family: 'DM Sans', sans-serif; color: var(--text); background: #fff;
  transition: border-color .2s, box-shadow .2s;
}
.search-bar input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(30,95,167,0.1); }
.search-count { margin-top: 8px; font-size: .82rem; color: var(--dim); font-style: italic; }

/* === RECHERCHE GLOBALE — résultats live === */
.search-wrap { position: relative; max-width: 680px; margin: 0 auto 14px; padding: 0 24px; }
.search-wrap .search-bar { margin: 0; padding: 0; max-width: 100%; }
.search-wrap .search-bar input {
  background: var(--card);
  border-radius: 999px;
  padding: 12px 22px;
  font-size: .9rem;
}
.search-results {
  position: absolute;
  left: 24px;
  right: 24px;
  top: calc(100% + 6px);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(31, 58, 95, 0.12);
  max-height: 60vh;
  overflow-y: auto;
  z-index: 100;
  padding: 8px;
}
.search-results .sr-empty {
  padding: 22px 18px;
  text-align: center;
  color: var(--dim);
  font-size: .86rem;
  font-style: italic;
}
.search-results .sr-item {
  display: block;
  width: 100%;
  text-align: left;
  font-family: inherit;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 14px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: all .12s ease;
}
.search-results .sr-item + .sr-item { margin-top: 2px; }
.search-results .sr-item:hover,
.search-results .sr-item:focus-visible {
  background: var(--cream);
  border-color: var(--border);
  outline: none;
}
.search-results .sr-kind {
  display: inline-block;
  font-size: .58rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.1px;
  padding: 2px 8px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  margin-right: 8px;
  vertical-align: middle;
}
.search-results .sr-kind.kind-chapter { background: rgba(200, 152, 74, 0.14); color: var(--gold-dim); }
.search-results .sr-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--navy);
  vertical-align: middle;
}
.search-results .sr-ar {
  font-family: 'Noto Naskh Arabic', serif;
  color: var(--accent);
  margin-left: 8px;
  font-size: .9rem;
  vertical-align: middle;
}
.search-results .sr-context {
  display: block;
  margin-top: 4px;
  font-size: .76rem;
  color: var(--dim);
  line-height: 1.45;
}
.search-results mark {
  background: rgba(200, 152, 74, 0.28);
  color: var(--navy);
  padding: 0 2px;
  border-radius: 3px;
}

.section-title .ar-section {
  font-family: 'Noto Naskh Arabic', 'Amiri', serif;
  font-size: 1.3rem;
  color: var(--accent);
  direction: rtl;
  margin-bottom: 10px;
}

.hadith-grid {
  max-width: 1100px;
  margin: 0 auto 20px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.hadith-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 16px 16px;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}
.hadith-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(15, 36, 68, 0.1);
  border-color: var(--accent-light);
  background: var(--card-hover);
}
.card-stripe { position: absolute; top: 0; left: 0; right: 0; height: 4px; }
.ready-badge {
  position: absolute; top: 10px; right: 10px;
  font-size: .65rem; color: var(--accent); font-weight: 600;
  background: rgba(30, 95, 167, 0.08); padding: 3px 8px; border-radius: 10px;
}
.coming-badge {
  position: absolute; top: 10px; right: 10px;
  font-size: .65rem; color: var(--dim); font-weight: 600;
  background: rgba(107, 114, 128, 0.12); padding: 3px 8px; border-radius: 10px;
}
.hadith-card.coming-soon { opacity: 0.55; cursor: not-allowed; filter: grayscale(30%); }
.hadith-card.coming-soon:hover { transform: none; box-shadow: 0 2px 8px rgba(15, 36, 68, 0.05); border-color: var(--border); background: var(--card); }
.card-top { display: flex; align-items: flex-start; gap: 12px; margin-top: 6px; margin-bottom: 10px; }
.card-number { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.card-number .num { color: #fff; font-family: 'Cormorant Garamond', serif; font-weight: 700; font-size: 1.1rem; }
.card-meta { flex: 1; min-width: 0; }
.card-meta h3 { font-family: 'Cormorant Garamond', serif; font-size: 1.08rem; font-weight: 600; color: var(--navy); line-height: 1.3; margin-bottom: 2px; }
.card-meta .ar-name { font-family: 'Noto Naskh Arabic', 'Amiri', serif; font-size: .95rem; color: var(--accent-dark); direction: rtl; display: block; margin-bottom: 4px; }
.card-source { font-size: .7rem; color: var(--dim); font-style: italic; }
.card-desc { font-size: .82rem; color: var(--text); line-height: 1.5; margin-top: auto; }

.breadcrumb { max-width: 900px; margin: 16px auto; padding: 0 24px; font-size: .85rem; color: var(--dim); text-align: center; }
.breadcrumb a { color: var(--accent); transition: color .2s; }
.breadcrumb a:hover { color: var(--accent-dark); }
.breadcrumb span { margin: 0 6px; color: var(--dim); }

.header { text-align: center; padding: 20px 24px 30px; max-width: 900px; margin: 0 auto; }
.bismillah { font-family: 'Noto Naskh Arabic', 'Amiri', serif; font-size: 1.8rem; color: var(--accent); direction: rtl; margin-bottom: 14px; }
.header h1 { font-family: 'Cormorant Garamond', serif; font-size: 2.5rem; font-weight: 700; color: var(--navy); line-height: 1.2; }
.header h1 span { color: var(--accent); }
.header .ar-title { font-family: 'Noto Naskh Arabic', 'Amiri', serif; font-size: 1.6rem; color: var(--accent-dark); direction: rtl; margin: 10px 0; }
.header .sub { font-size: .95rem; color: var(--dim); margin-top: 10px; line-height: 1.6; }
.header .sub strong { color: var(--accent-dark); }

.intro { max-width: 820px; margin: 0 auto 30px; padding: 24px 28px; background: var(--cream); border-radius: 10px; border-right: 3px solid var(--accent); }
.intro p { font-size: .98rem; line-height: 1.75; color: var(--text); }

.print-btn-wrap { text-align: center; margin: 20px auto 30px; max-width: 600px; }
.print-btn { background: var(--accent); color: #fff; border: none; padding: 12px 30px; font-size: .95rem; font-family: 'DM Sans', sans-serif; font-weight: 600; border-radius: 6px; cursor: pointer; transition: background .2s; }
.print-btn:hover { background: var(--accent-dark); }
.print-note { font-size: .8rem; color: var(--dim); margin-top: 8px; font-style: italic; }

.hadith-main { max-width: 860px; margin: 0 auto 40px; padding: 0 20px; }
.hadith-main-card { background: #fff; border: 1px solid var(--border); border-right: 4px solid var(--accent); border-radius: 10px; padding: 32px 36px; box-shadow: 0 2px 8px rgba(15, 36, 68, 0.06); }
.hadith-main-card .ar-text { font-family: 'Noto Naskh Arabic', 'Amiri', serif; font-size: 1.4rem; line-height: 2.2; direction: rtl; color: var(--navy); text-align: right; margin-bottom: 20px; }
.hadith-main-card .fr-text { font-size: 1rem; line-height: 1.8; color: var(--text); font-style: italic; padding: 16px 0; border-top: 1px solid var(--border); }
.hadith-main-card .source { font-size: .85rem; color: var(--dim); margin-top: 14px; text-align: right; }
.hadith-main-card .source strong { color: var(--accent-dark); }

.biographie-glossaire { max-width: 860px; margin: 0 auto 30px; padding: 0 20px; display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
@media (max-width: 768px) { .biographie-glossaire { grid-template-columns: 1fr; } }
.biographie-card, .glossaire-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; box-shadow: 0 2px 8px rgba(15, 36, 68, 0.04); }
.biographie-header, .glossaire-header { padding: 14px 20px; color: #fff; display: flex; align-items: center; gap: 10px; }
.biographie-header h3, .glossaire-header h3 { font-family: 'Cormorant Garamond', serif; font-size: 1.15rem; font-weight: 600; margin: 0; }
.biographie-icon, .glossaire-icon { font-size: 1.2rem; }
.biographie-body { padding: 18px 22px; }
.biographie-body p { font-size: .92rem; line-height: 1.75; color: var(--text); }
.glossaire-body { padding: 14px 20px; }
.glossaire-list { margin: 0; padding: 0; }
.glossaire-entry { padding: 10px 0; border-bottom: 1px dashed var(--border); }
.glossaire-entry:last-child { border-bottom: none; padding-bottom: 0; }
.glossaire-entry:first-child { padding-top: 0; }
.glossaire-entry dt { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.mot-ar { font-family: 'Noto Naskh Arabic', 'Amiri', serif; font-size: 1.15rem; color: var(--accent-dark); direction: rtl; font-weight: 600; }
.mot-fr { font-family: 'DM Sans', sans-serif; font-size: .85rem; color: var(--dim); font-style: italic; }
.glossaire-entry dd { font-size: .88rem; line-height: 1.6; color: var(--text); margin-left: 0; padding-left: 0; }

.sections { max-width: 860px; margin: 0 auto; padding: 0 20px; }
.block { background: #fff; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 16px; overflow: hidden; transition: box-shadow .2s, border-color .2s; cursor: pointer; }
.block:hover { border-color: var(--accent-light); box-shadow: 0 3px 12px rgba(15, 36, 68, 0.08); }
.b-header { padding: 20px 24px; display: flex; align-items: center; gap: 16px; position: relative; }
.b-icon { width: 42px; height: 42px; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 1.1rem; flex-shrink: 0; }
.b-meta { flex: 1; }
.b-meta h3 { font-family: 'Cormorant Garamond', serif; font-size: 1.3rem; font-weight: 600; color: var(--navy); line-height: 1.3; margin-bottom: 4px; }
.bv { font-size: .8rem; color: var(--dim); margin-bottom: 6px; font-style: italic; }
.b-summary { font-size: .92rem; color: var(--text); line-height: 1.6; margin-top: 8px; }
.b-tags { margin-top: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.btag { font-size: .72rem; padding: 3px 10px; border-radius: 12px; font-weight: 500; }
.btag-theme { background: rgba(30, 95, 167, 0.1); color: var(--accent-dark); }
.btag-key { background: rgba(200, 152, 74, 0.15); color: #8a6625; }
.b-arrow { color: var(--accent); font-size: 1.2rem; transition: transform .3s; flex-shrink: 0; }
.block.open .b-arrow { transform: rotate(180deg); }
.b-detail { max-height: 0; overflow: hidden; transition: max-height .4s ease; }
.block.open .b-detail { max-height: 3000px; }
.detail-inner { padding: 0 24px 24px; border-top: 1px solid var(--border); padding-top: 24px; margin-top: 0; }
.d-section { margin-bottom: 24px; }
.d-section:last-child { margin-bottom: 0; }
.d-section h4 { font-family: 'Cormorant Garamond', serif; font-size: 1.1rem; font-weight: 600; margin-bottom: 12px; }
.d-section p { font-size: .94rem; line-height: 1.75; color: var(--text); margin-bottom: 12px; }
.ayah { font-family: 'Noto Naskh Arabic', 'Amiri', serif; font-size: 1.05rem; line-height: 2; direction: rtl; text-align: right; padding: 14px 18px; border-right: 3px solid var(--accent); background: rgba(30, 95, 167, 0.06); border-radius: 6px; margin: 12px 0; color: var(--navy); }
.rules-list { list-style: none; padding: 0; margin-top: 8px; }
.rules-list li { position: relative; padding: 10px 14px 10px 32px; margin-bottom: 8px; background: var(--cream); border-radius: 6px; font-size: .92rem; line-height: 1.6; }
.rules-list li::before { content: "◆"; position: absolute; left: 12px; top: 10px; color: var(--accent); font-size: .8rem; }
.link-box { background: rgba(30, 95, 167, 0.08); border-right: 3px solid var(--accent); padding: 12px 16px; margin-top: 14px; border-radius: 6px; font-size: .88rem; line-height: 1.6; }
.link-box strong { color: var(--accent-dark); }

.mnemonic { max-width: 860px; margin: 40px auto; padding: 0 20px; }
.mnemonic-card { background: var(--cream); border: 1px solid var(--border); border-radius: 10px; padding: 28px; }
.mnemonic-card h3 { font-family: 'Cormorant Garamond', serif; font-size: 1.4rem; font-weight: 600; color: var(--navy); text-align: center; margin-bottom: 20px; }
.m-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.m-item { background: #fff; padding: 16px; border-radius: 8px; border-left: 4px solid; text-align: center; }
.m-num { font-family: 'Cormorant Garamond', serif; font-size: 2rem; font-weight: 700; line-height: 1; margin-bottom: 6px; }
.m-label { font-size: .88rem; line-height: 1.4; color: var(--text); margin-bottom: 6px; font-weight: 500; }
.m-verses { font-size: .75rem; color: var(--dim); font-style: italic; }

.nav-hadith { max-width: 860px; margin: 40px auto; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.nav-hadith a { padding: 10px 18px; border: 1px solid var(--border); border-radius: 6px; font-size: .88rem; font-weight: 500; color: var(--text); transition: all .2s; }
.nav-hadith a:hover { border-color: var(--accent); color: var(--accent-dark); background: var(--cream); }
.nav-home { background: var(--accent); color: #fff !important; border-color: var(--accent) !important; }
.nav-home:hover { background: var(--accent-dark) !important; color: #fff !important; }

/* =====================
   IMPRESSION PDF
   ===================== */
@media print {
  body { background: #fff; }
  .site-header, .breadcrumb, .print-btn-wrap, .nav-hadith, .footer,
  .progress-bar, .scroll-top, .hero-cta, .level-3, .cta-final, .chapter-toc { display: none !important; }
  .topic-body { max-height: none !important; }
  .topic-arrow, .b-arrow { display: none; }
  .topic, .block { page-break-inside: avoid; }
  .b-detail { max-height: none !important; }
}

/* =====================
   RESPONSIVE
   ===================== */
@media (max-width: 640px) {
  .hero h1 { font-size: 2rem; }
  .hero-sub { font-size: .9rem; }
  .stats-bar { gap: 26px; }
  .stat-num { font-size: 1.6rem; }
  .section-title h2 { font-size: 1.6rem; }
  .topic-head { padding: 14px 16px; gap: 12px; }
  .topic-meta h4 { font-size: 1.05rem; }
  .grid-4 { padding: 0 14px 14px; padding-top: 14px; }
  .level-3 { margin: 0 14px 14px; padding: 14px 16px; }
  .cta-final { padding: 28px 20px; }
  .cta-final h3 { font-size: 1.3rem; }
  .header h1 { font-size: 1.9rem; }
  .header .ar-title { font-size: 1.3rem; }
  .hadith-main-card { padding: 22px 20px; }
  .hadith-main-card .ar-text { font-size: 1.2rem; }
  .b-header { padding: 16px 18px; gap: 12px; }
  .b-icon { width: 36px; height: 36px; font-size: 1rem; }
  .b-meta h3 { font-size: 1.1rem; }
  .detail-inner { padding: 20px 18px; }
  .mnemonic-card { padding: 20px; }
}

/* =====================================================
   STYLES "TABLE DES MATIÈRES" — alignés sur fiqh.institutmiftah.com
   Pour la grille des 4 portes / 39 chapitres en home.
   ===================================================== */

/* Bandeau de référence (sous le hero) */
.reference-banner {
  max-width: 900px;
  margin: 4px auto 18px;
  padding: 14px 22px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 10px;
  font-size: .9rem;
  line-height: 1.65;
  color: var(--text);
}
.reference-banner strong { color: var(--navy); }
.reference-banner em { font-style: italic; color: var(--accent-dark); }
.reference-banner a {
  color: var(--accent);
  font-weight: 600;
  border-bottom: 1px solid var(--accent-soft);
  padding-bottom: 1px;
  transition: color .15s;
}
.reference-banner a:hover { color: var(--accent-dark); }

/* Légende des statuts */
.legend {
  max-width: 900px;
  margin: 6px auto 18px;
  padding: 0 20px;
  display: flex;
  justify-content: center;
  gap: 14px 22px;
  flex-wrap: wrap;
  font-size: .78rem;
  color: var(--dim);
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.legend-sep {
  color: var(--border);
  margin: 0 4px;
}
.legend-dot.fondation       { background: var(--door-fond); }
.legend-dot.approfondissement { background: var(--door-foi); }
.legend-dot.protection      { background: var(--door-prot); }
.legend-dot.dispo           { background: var(--accent); }
.legend-dot.venir           { background: #cbcfd6; border: 1px solid #b3b8c1; }

/* Liste des "kitab" — ici les 4 portes */
.kitab-list {
  max-width: 1100px;
  margin: 0 auto 50px;
  padding: 0 20px;
}

details.kitab {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--kitab-color, var(--accent));
  border-radius: 12px;
  margin-bottom: 14px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(31, 58, 95, 0.04);
  transition: box-shadow .2s, border-color .2s;
}
details.kitab[open] {
  box-shadow: 0 6px 22px rgba(31, 58, 95, 0.10);
}
.kitab-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 18px 22px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.kitab-head::-webkit-details-marker { display: none; }
.kitab-head::marker { display: none; content: ""; }

.kitab-letter {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--kitab-color, var(--accent));
  color: #fff;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.kitab-titles { min-width: 0; }
.kitab-titles h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
  line-height: 1.25;
  margin: 0 0 2px;
}
.kitab-ar {
  font-family: 'Noto Naskh Arabic', 'Amiri', serif;
  font-size: 1.2rem;
  color: var(--kitab-color, var(--accent-dark));
  direction: rtl;
  margin-bottom: 6px;
}
.kitab-desc {
  font-size: .88rem;
  color: var(--dim);
  line-height: 1.55;
  margin: 0;
}
.kitab-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
  text-align: right;
  min-width: 130px;
}
.kitab-count {
  font-size: .8rem;
  color: var(--dim);
}
.kitab-count strong {
  color: var(--navy);
  font-size: 1rem;
  font-family: 'Cormorant Garamond', serif;
}
.kitab-progress {
  font-size: .72rem;
  color: var(--kitab-color, var(--accent));
  font-weight: 600;
  background: rgba(0,0,0,0.04);
  padding: 3px 8px;
  border-radius: 10px;
}
.kitab-toggle {
  font-size: .8rem;
  color: var(--kitab-color, var(--accent));
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.kitab-arrow {
  display: inline-block;
  transition: transform .25s ease;
}
details.kitab[open] .kitab-arrow { transform: rotate(180deg); }
details.kitab[open] .kitab-toggle::before { content: "Fermer"; }
details.kitab[open] .kitab-toggle .k-text { display: none; }

.kitab-body {
  padding: 4px 22px 22px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  border-top: 1px dashed var(--border);
}

/* Cartes de chapitre */
.fiche-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
  transition: transform .18s ease, border-color .18s, box-shadow .18s;
  cursor: default;
  text-decoration: none;
  color: inherit;
}
.fiche-card.available {
  cursor: pointer;
  border-color: #d8d2c2;
}
.fiche-card.available:hover {
  transform: translateY(-2px);
  border-color: var(--accent-light);
  box-shadow: 0 8px 22px rgba(31, 58, 95, 0.08);
}
.fiche-card.coming {
  background: #fafafa;
  opacity: .78;
}
.fiche-num {
  position: absolute;
  top: 12px;
  right: 14px;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  font-size: .85rem;
  color: var(--dim);
  letter-spacing: .5px;
}
.fiche-card h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.3;
  padding-right: 50px;
  margin: 0;
}
.fiche-card h3 em {
  font-style: italic;
  color: var(--accent-dark);
  font-weight: 600;
}
.fiche-ar {
  font-family: 'Noto Naskh Arabic', 'Amiri', serif;
  font-size: 1rem;
  color: var(--accent-dark);
  direction: rtl;
}
.fiche-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 2px;
}
.tag-level, .tag-status {
  font-size: .68rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  letter-spacing: .3px;
}
.tag-level.fondation         { background: rgba(107,140,175,.18); color: #34547a; }
.tag-level.approfondissement { background: rgba(45,125,75,.14);  color: #1e5d35; }
.tag-level.protection        { background: rgba(194,91,110,.14); color: #9b3a4d; }
.tag-status.dispo            { background: rgba(47,95,163,.12);  color: var(--accent-dark); }
.tag-status.venir            { background: rgba(107,114,128,.12); color: #4a5260; }

.fiche-skill {
  font-size: .82rem;
  line-height: 1.5;
  color: var(--text);
  margin-top: 4px;
  font-style: italic;
}
.fiche-cta {
  align-self: flex-start;
  margin-top: 4px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--accent);
}
.fiche-card.available:hover .fiche-cta { color: var(--accent-dark); }

@media (max-width: 720px) {
  .kitab-head {
    grid-template-columns: auto 1fr;
    gap: 12px;
  }
  .kitab-meta {
    grid-column: 1 / -1;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    flex-wrap: wrap;
    text-align: left;
    min-width: 0;
    margin-top: 4px;
    padding-left: 56px;
  }
  .kitab-titles h2 { font-size: 1.25rem; }
  .kitab-ar { font-size: 1.05rem; }
  .kitab-body {
    padding: 4px 14px 16px;
    grid-template-columns: 1fr;
  }
}

/* Bloc de bascule pédagogique (Uṣūl vs Furūʿ) — calé sur le bloc fiqh */
.bascule-aqida {
  max-width: 920px;
  margin: 48px auto 24px;
  padding: 28px;
  background: linear-gradient(180deg, #fdf6e3 0%, #f5ebd6 100%);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  color: #3d3d3d;
}
.bascule-aqida .bascule-eyebrow {
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: #8b6f47;
  font-weight: 700;
  margin-bottom: 6px;
}
.bascule-aqida h2 {
  margin: 0 0 8px;
  font-size: 1.4rem;
  color: #2d2d2d;
  font-family: 'Cormorant Garamond', serif;
}
.bascule-aqida h2 em { font-style: italic; }
.bascule-aqida > p.lede {
  margin: 0 0 18px;
  font-size: .95rem;
  color: #555;
}
.bascule-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin: 0 0 20px;
}
.bascule-col {
  background: #fff;
  padding: 18px;
  border-radius: 6px;
}
.bascule-col.usul    { border-top: 3px solid var(--door-tawh); }
.bascule-col.furu    { border-top: 3px solid #8b6f47; }
.bascule-col h3 {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-family: 'Cormorant Garamond', serif;
}
.bascule-col.usul h3 { color: var(--door-tawh); }
.bascule-col.furu h3 { color: #8b6f47; }
.bascule-col .small {
  margin: 0 0 8px;
  font-size: .85rem;
  color: #777;
}
.bascule-col .rule {
  margin: 0 0 8px;
  font-size: .95rem;
}
.bascule-col ul {
  margin: 0;
  padding-left: 18px;
  font-size: .92rem;
  list-style: disc;
}
.bascule-col ul li { margin-bottom: 3px; }
.bascule-aqida .retain {
  background: #2d2d2d;
  color: #fdf6e3;
  padding: 18px;
  border-radius: 6px;
}
.bascule-aqida .retain h3 {
  margin: 0 0 8px;
  font-size: 1rem;
  color: #fdf6e3;
  font-family: 'Cormorant Garamond', serif;
}
.bascule-aqida .retain ol {
  margin: 0;
  padding-left: 20px;
  font-size: .93rem;
  line-height: 1.6;
}
.bascule-aqida .metho-link-out {
  margin: 14px 0 0;
  font-size: .85rem;
  text-align: right;
}
.bascule-aqida .metho-link-out a {
  color: #8b6f47;
  font-weight: 600;
  text-decoration: none;
}

/* Appel final vers l'inscription */
.cta-inscription {
  max-width: 820px;
  margin: 24px auto 28px;
  padding: 24px 30px;
  background: var(--navy);
  color: #fdf6e3;
  border-radius: 12px;
  text-align: center;
}
.cta-inscription h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0 0 6px;
  color: #fdf6e3;
}
.cta-inscription p {
  margin: 0 0 14px;
  font-size: .95rem;
  line-height: 1.65;
  color: #d8e0ec;
}
.cta-inscription a {
  display: inline-block;
  background: var(--gold);
  color: #2d2d2d;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform .18s, background .18s;
}
.cta-inscription a:hover {
  transform: translateY(-1px);
  background: #d6a655;
}

/* Teaser méthodologie en bas de home */
.methodologie-teaser {
  max-width: 820px;
  margin: 28px auto 30px;
  padding: 28px 32px;
  background: var(--cream);
  border: 1px solid var(--border);
  border-left: 4px solid var(--navy);
  border-radius: 12px;
}
.methodologie-teaser h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.35rem;
  color: var(--navy);
  margin-bottom: 8px;
}
.methodologie-teaser p {
  font-size: .92rem;
  line-height: 1.7;
  color: var(--text);
  margin-bottom: 10px;
}
.methodologie-teaser .methodo-link {
  display: inline-block;
  margin-top: 6px;
  padding: 8px 16px;
  background: var(--navy);
  color: #fff;
  border-radius: 6px;
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  transition: background .2s;
}
.methodologie-teaser .methodo-link:hover {
  background: #142845;
}

/* Petite recherche en haut (variante simple) */
.search-bar-toc {
  max-width: 720px;
  margin: 4px auto 14px;
  padding: 0 20px;
}
.search-bar-toc input {
  width: 100%;
  padding: 12px 16px;
  font-size: .95rem;
  font-family: inherit;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.search-bar-toc input:focus {
  outline: none;
  border-color: var(--accent-light);
  box-shadow: 0 0 0 3px rgba(47,95,163,0.10);
}
.search-count {
  text-align: center;
  font-size: .78rem;
  color: var(--dim);
  margin-top: 6px;
  font-style: italic;
}

/* =====================================================
   COMPOSANTS PÉDAGOGIQUES FICHE-CHAPITRE
   (calés sur fiqh.institutmiftah.com — utilisés par
    template-fiche.html et toute nouvelle fiche d'aqida)
   ===================================================== */

/* Objectif de la fiche — encadré ouvrant */
.objectif {
  max-width: 820px;
  margin: 0 auto 26px;
  padding: 18px 24px;
  background: linear-gradient(135deg, rgba(47,95,163,.05), rgba(31,58,95,.04));
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 10px;
}
.objectif h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.05rem;
  color: var(--accent-dark);
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.objectif p {
  font-size: .95rem;
  line-height: 1.65;
  color: var(--text);
  margin: 0;
}

/* Titres d'étape de la fiche */
.fiche-step-title {
  max-width: 860px;
  margin: 36px auto 14px;
  padding: 0 20px;
  text-align: center;
}
.fiche-step-title .step-tag {
  display: inline-block;
  background: var(--gold);
  color: #fff;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: .72rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 700;
  margin-bottom: 8px;
}
.fiche-step-title h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 6px;
}
.fiche-step-title .intro {
  font-size: .92rem;
  color: var(--dim);
  font-style: italic;
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.55;
}

/* Méthode pratique — cinq étapes */
.method {
  max-width: 860px;
  margin: 18px auto 30px;
  padding: 0 20px;
}
.method-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 28px 22px;
  box-shadow: 0 2px 10px rgba(31,58,95,.05);
}
.method-card > h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 700;
  text-align: center;
  color: var(--navy);
  margin: 0 0 4px;
}
.method-sub {
  text-align: center;
  font-size: .9rem;
  color: var(--dim);
  font-style: italic;
  margin: 0 0 18px;
}
.method-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: methstep;
}
.method-step {
  position: relative;
  padding: 14px 16px 14px 56px;
  margin-bottom: 12px;
  background: var(--cream);
  border-radius: 10px;
  counter-increment: methstep;
}
.method-step::before {
  content: counter(methstep);
  position: absolute;
  left: 14px;
  top: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}
.method-step h4 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 6px;
}
.method-step ul {
  margin: 0;
  padding-left: 18px;
  font-size: .92rem;
  color: var(--text);
  line-height: 1.55;
}
.method-step ul li { margin-bottom: 3px; }
.case-answer {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: 6px;
  padding: 10px 14px;
  margin: 8px 0 0;
  font-size: .9rem;
  line-height: 1.55;
}

/* Règles à retenir */
.rules-section {
  max-width: 860px;
  margin: 0 auto 30px;
  padding: 0 20px;
}
.rules-card {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: 12px;
  padding: 22px 26px;
}
.rules-card h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  color: var(--navy);
  margin: 0 0 10px;
}
.rules-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.rules-list li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 8px;
  font-size: .95rem;
  line-height: 1.6;
}
.rules-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--accent);
  font-weight: 700;
}
.rules-list li strong { color: var(--navy); }

/* Erreurs fréquentes */
.errors {
  max-width: 860px;
  margin: 0 auto 30px;
  padding: 0 20px;
}
.errors-card {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--red);
  border-radius: 12px;
  padding: 22px 26px;
}
.errors-card h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  color: var(--red);
  margin: 0 0 10px;
}
.errors-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.errors-list li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 8px;
  font-size: .95rem;
  line-height: 1.6;
}
.errors-list li::before {
  content: '⚠';
  position: absolute;
  left: 0;
  top: 0;
  color: var(--red);
}

/* Mini quiz */
.quiz {
  max-width: 860px;
  margin: 0 auto 30px;
  padding: 0 20px;
}
.quiz-card {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 12px;
  padding: 22px 26px;
}
.quiz-card h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.3rem;
  color: var(--navy);
  margin: 0 0 12px;
}
.quiz-q {
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
}
.quiz-q:last-child { border-bottom: none; }
.quiz-q .q {
  font-size: .95rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 6px;
}
.quiz-q details { margin-top: 4px; }
.quiz-q details summary {
  cursor: pointer;
  font-size: .85rem;
  color: var(--accent);
  font-weight: 600;
  list-style: none;
}
.quiz-q details summary::-webkit-details-marker { display: none; }
.quiz-q details summary::before { content: '▾ '; }
.quiz-q details[open] summary::before { content: '▴ '; }
.quiz-q .a {
  margin-top: 8px;
  font-size: .9rem;
  line-height: 1.55;
  color: var(--text);
  background: var(--cream);
  border-radius: 6px;
  padding: 10px 14px;
}

/* Cas pratique */
.case-study {
  max-width: 860px;
  margin: 0 auto 36px;
  padding: 0 20px;
}
.case-study-card {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: 12px;
  padding: 24px 28px;
}
.case-study-card .case-tag {
  display: inline-block;
  background: var(--gold);
  color: #fff;
  font-size: .72rem;
  letter-spacing: 1.2px;
  font-weight: 700;
  text-transform: uppercase;
  padding: 3px 11px;
  border-radius: 999px;
  margin-bottom: 8px;
}
.case-study-card h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 8px;
}
.case-study-card .scenario {
  font-size: .95rem;
  font-style: italic;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.6;
}
.case-study-card .reponse {
  font-size: .92rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--cream);
  border-radius: 6px;
  padding: 12px 16px;
}
