/* ============================================
   Hadith.fr - Feuille de styles
   ============================================ */

:root {
  --bg: #ffffff;
  --bg-elev: #ffffff;
  --bg-soft: #f0f7ff;
  --ink: #0a1929;
  --ink-soft: #3d556e;
  --ink-mute: #7a8fa3;
  --line: #dde9f5;
  --accent: #4a90d9;
  --accent-deep: #2e74c2;
  --accent-light: #87b8e8;
  --accent-soft: #e3f0fc;
  --shadow: 0 1px 2px rgba(10,25,41,0.04), 0 8px 24px rgba(10,25,41,0.06);
  --shadow-lg: 0 4px 12px rgba(10,25,41,0.06), 0 24px 60px rgba(10,25,41,0.10);
  --radius: 8px;
  --radius-lg: 14px;
}

[data-theme="dark"] {
  --bg: #050810;
  --bg-elev: #0c1320;
  --bg-soft: #111c30;
  --ink: #f0f4fa;
  --ink-soft: #b8c5d6;
  --ink-mute: #6a7a90;
  --line: #1a2740;
  --accent: #4a7eb8;
  --accent-deep: #5d92cc;
  --accent-light: #6da3d8;
  --accent-soft: #142540;
  --shadow: 0 1px 2px rgba(0,0,0,0.3), 0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.4), 0 24px 60px rgba(0,0,0,0.5);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background 0.4s ease, color 0.4s ease;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 15% 5%, rgba(74,144,217,0.08) 0%, transparent 50%),
    radial-gradient(circle at 85% 90%, rgba(74,144,217,0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

[data-theme="dark"] body::before {
  background-image:
    radial-gradient(circle at 15% 5%, rgba(74,126,184,0.12) 0%, transparent 50%),
    radial-gradient(circle at 85% 90%, rgba(74,126,184,0.08) 0%, transparent 50%);
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  position: relative;
  z-index: 1;
}

/* ============================================
   LOGO — Image avec palmier
   ============================================ */
.logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
}

.logo-img {
  height: 38px;
  width: auto;
  display: block;
  transition: opacity 0.3s ease;
}

/* Mode clair : afficher le logo noir, cacher le logo blanc */
.logo-light { display: block; }
.logo-dark { display: none; }

/* Mode sombre : inverser */
[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: block; }

@media (max-width: 600px) {
  .logo-img { height: 32px; }
}

/* ============================================
   NAVIGATION
   ============================================ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--line);
  transition: background 0.4s ease;
}

[data-theme="dark"] .nav { background: rgba(5,8,16,0.85); }

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
}

.nav-links > li {
  position: relative;
}

.nav-links a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.nav-links > li > a::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.3s ease;
  border-radius: 2px;
}

.nav-links > li > a:hover { color: var(--ink); }
.nav-links > li > a:hover::after { width: 100%; }

.caret { transition: transform 0.3s ease; }
.has-dropdown:hover .caret { transform: rotate(180deg); }

/* ============================================
   DROPDOWN MENU (Recueils)
   ============================================ */
.dropdown {
  position: absolute;
  top: calc(100% + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  min-width: 360px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow-lg);
  padding: 8px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
  z-index: 110;
}

.dropdown::before {
  content: '';
  position: absolute;
  top: -16px;
  left: 0;
  right: 0;
  height: 16px;
}

.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.dropdown a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  color: var(--ink);
  transition: background 0.15s ease;
}

.dropdown a:hover { background: var(--accent-soft); }
.dropdown a::after { display: none; }

.dropdown .dd-num {
  font-family: 'Fraunces', serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--accent);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--accent-soft);
  border-radius: 8px;
  flex-shrink: 0;
}

.dropdown a > span:last-child {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dropdown a strong {
  font-family: 'Fraunces', serif;
  font-size: 15px;
  font-weight: 500;
}

.dropdown a em {
  font-family: 'Amiri', serif;
  font-style: normal;
  font-size: 13px;
  color: var(--accent);
  direction: rtl;
  text-align: right;
}

/* ============================================
   ICONES & BOUTONS
   ============================================ */
.nav-actions { display: flex; gap: 10px; align-items: center; }

.icon-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  transition: all 0.2s;
}

.icon-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
}

.icon-btn svg { width: 18px; height: 18px; }

/* ============================================
   HERO
   ============================================ */
.hero {
  padding: 100px 0 80px;
  text-align: center;
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: 100px;
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 32px;
  font-weight: 600;
}

.hero-eyebrow .dot {
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.hero h1 {
  font-family: 'Fraunces', serif;
  font-size: clamp(44px, 7vw, 84px);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin-bottom: 28px;
  max-width: 880px;
  margin-left: auto;
  margin-right: auto;
}

.hero h1 em {
  font-style: italic;
  color: var(--accent);
  font-weight: 300;
}

.hero-sub {
  font-size: 19px;
  color: var(--ink-soft);
  max-width: 600px;
  margin: 0 auto 48px;
  line-height: 1.6;
}

.search-box {
  max-width: 640px;
  margin: 0 auto;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 8px 8px 8px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow);
  transition: all 0.3s;
}

.search-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow-lg);
}

.search-box svg { color: var(--ink-mute); flex-shrink: 0; }

.search-box input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
  padding: 12px 0;
}

.search-box input::placeholder { color: var(--ink-mute); }

.search-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 12px 28px;
  border-radius: 100px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 14px;
}

.search-btn:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
}

/* ============================================
   STATS BAR
   ============================================ */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 64px;
  margin-top: 56px;
  flex-wrap: wrap;
}

.stat-num {
  font-family: 'Fraunces', serif;
  font-size: 36px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: -0.02em;
  display: block;
  line-height: 1;
}

.stat-label {
  font-size: 13px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 8px;
}

/* ============================================
   SECTIONS
   ============================================ */
.section { padding: 80px 0; }

.section-header {
  margin-bottom: 48px;
  text-align: center;
}

.section-subtitle {
  color: var(--accent);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 12px;
  font-weight: 600;
}

.section-title {
  font-family: 'Fraunces', serif;
  font-size: 44px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.section-title em {
  font-style: italic;
  color: var(--accent);
  font-weight: 300;
}

/* ============================================
   GRILLE DES RECUEILS (page d'accueil)
   ============================================ */
.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 20px;
}

.book-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: block;
}

.book-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

.book-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
  box-shadow: var(--shadow-lg);
}

.book-card:hover::before { transform: scaleX(1); }

.book-number {
  font-family: 'Fraunces', serif;
  font-size: 12px;
  color: var(--accent);
  letter-spacing: 0.12em;
  margin-bottom: 16px;
  font-weight: 500;
  text-transform: uppercase;
}

.book-name-ar {
  font-family: 'Amiri', serif;
  font-size: 24px;
  direction: rtl;
  text-align: right;
  color: var(--accent);
  margin-bottom: 10px;
  font-weight: 700;
}

.book-name-fr {
  font-family: 'Fraunces', serif;
  font-size: 21px;
  font-weight: 500;
  margin-bottom: 4px;
  letter-spacing: -0.01em;
}

.book-author {
  font-size: 13px;
  color: var(--ink-mute);
  margin-bottom: 24px;
  font-style: italic;
}

.book-stats {
  display: flex;
  gap: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-soft);
}

.book-stats strong {
  display: block;
  color: var(--ink);
  font-size: 18px;
  font-family: 'Fraunces', serif;
  font-weight: 500;
  margin-bottom: 2px;
}

/* ============================================
   PAGE RECUEIL — En-tête + présentation
   ============================================ */
.recueil-header {
  padding: 80px 0 40px;
}

.breadcrumb {
  font-size: 13px;
  color: var(--ink-mute);
  margin-bottom: 32px;
  text-align: center;
}

.breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}

.breadcrumb a:hover { text-decoration: underline; }

.breadcrumb .sep { margin: 0 8px; color: var(--ink-mute); }

.recueil-title-wrap {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 32px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.recueil-title-fr h1 {
  font-family: 'Fraunces', serif;
  font-size: clamp(36px, 5vw, 56px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 8px;
}

.recueil-title-fr .author {
  color: var(--ink-mute);
  font-style: italic;
  font-size: 15px;
}

.recueil-title-ar {
  font-family: 'Amiri', serif;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 700;
  color: var(--accent);
  direction: rtl;
  line-height: 1.4;
}

.recueil-presentation {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  font-size: 16px;
  line-height: 1.7;
  color: var(--ink-soft);
  margin-bottom: 48px;
  position: relative;
  text-align: justify;
  hyphens: auto;
}

.recueil-presentation::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent), transparent);
  border-radius: 14px 0 0 14px;
}

/* ============================================
   LISTE DES CHAPITRES (table des matières)
   ============================================ */
.chapters-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 16px;
  flex-wrap: wrap;
}

.chapters-toolbar h2 {
  font-family: 'Fraunces', serif;
  font-size: 28px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.chapters-toolbar h2 .count {
  color: var(--ink-mute);
  font-size: 18px;
  font-weight: 400;
  font-style: italic;
}

.chapter-search {
  flex: 0 1 320px;
  min-width: 240px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 8px 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.chapter-search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  padding: 6px 0;
}

.chapter-search svg { color: var(--ink-mute); flex-shrink: 0; }

.chapters-list {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 80px;
}

.chapter-row {
  display: grid;
  grid-template-columns: 60px 1fr 1fr 140px;
  gap: 20px;
  padding: 18px 24px;
  align-items: center;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.chapter-row:last-child { border-bottom: none; }

.chapter-row:hover {
  background: var(--accent-soft);
}

.chapter-row .ch-num {
  font-family: 'Fraunces', serif;
  font-size: 16px;
  font-weight: 500;
  color: var(--accent);
}

.chapter-row .ch-fr {
  font-family: 'Fraunces', serif;
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
}

.chapter-row .ch-fr.empty {
  color: var(--ink-mute);
  font-style: italic;
  font-weight: 400;
}

.chapter-row .ch-ar {
  font-family: 'Amiri', serif;
  font-size: 18px;
  color: var(--accent);
  direction: rtl;
  text-align: right;
}

.chapter-row .ch-range {
  font-size: 13px;
  color: var(--ink-mute);
  text-align: right;
  white-space: nowrap;
}

.chapter-row .ch-range strong {
  color: var(--ink-soft);
  font-weight: 500;
}

@media (max-width: 720px) {
  .chapter-row {
    grid-template-columns: 40px 1fr;
    gap: 8px 16px;
  }
  .chapter-row .ch-ar {
    grid-column: 2;
    font-size: 16px;
  }
  .chapter-row .ch-range {
    grid-column: 2;
    text-align: left;
  }
}

/* ============================================
   PAGE LIVRE — En-tête + navigation
   ============================================ */
.livre-header {
  padding: 60px 0 24px;
}

.livre-title-block {
  text-align: center;
  margin: 32px 0 0;
}

.livre-recueil-name {
  font-size: 13px;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
  margin-bottom: 14px;
}

.livre-titles {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px 32px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  position: relative;
}

.livre-titles::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

.livre-titles h1 {
  font-family: 'Fraunces', serif;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-align: left;
  flex: 1 1 auto;
  min-width: 200px;
}

.livre-name-ar {
  font-family: 'Amiri', serif;
  font-size: clamp(22px, 3.2vw, 32px);
  color: var(--accent);
  direction: rtl;
  font-weight: 700;
  text-align: right;
  flex: 1 1 auto;
  min-width: 200px;
}

.livre-info {
  color: var(--ink-mute);
  font-size: 14px;
  font-style: italic;
}

/* === Navigation entre livres (flèches) === */
.livre-nav {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 14px;
  align-items: stretch;
  margin: 28px 0 8px;
}

.livre-nav-bottom {
  margin: 60px 0 40px;
}

.livre-nav-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--ink);
  transition: all 0.25s ease;
  min-height: 64px;
  font-family: inherit;
}

.livre-nav-btn:hover:not(.disabled) {
  border-color: var(--accent);
  background: var(--accent-soft);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(74,144,217,0.15);
}

.livre-nav-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.livre-nav-btn svg {
  flex-shrink: 0;
  color: var(--accent);
}

.livre-nav-prev { justify-self: stretch; }
.livre-nav-next {
  justify-self: stretch;
  text-align: right;
  flex-direction: row;
}
.livre-nav-next .livre-nav-label { align-items: flex-end; }

.livre-nav-up {
  flex-direction: column;
  gap: 4px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-soft);
}

.livre-nav-label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}

.livre-nav-direction {
  font-size: 11px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-weight: 600;
}

.livre-nav-title {
  font-family: 'Fraunces', serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}

.livre-nav-current {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 0 16px;
  min-width: 100px;
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}

.livre-nav-num {
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-weight: 500;
  color: var(--accent);
  line-height: 1;
}

.livre-nav-of {
  font-size: 11px;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.livre-nav-total {
  font-size: 14px;
  color: var(--ink-soft);
  line-height: 1;
}

@media (max-width: 700px) {
  .livre-nav {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .livre-nav-current { display: none; }
  .livre-nav-bottom { grid-template-columns: 1fr 1fr; }
  .livre-nav-up { display: none; }
  .livre-nav-title { max-width: 140px; font-size: 13px; }
  .livre-nav-btn { padding: 12px 14px; }
}

/* === Toolbar de la page livre === */
.livre-toolbar {
  padding: 24px 0;
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: space-between;
}

/* === Sous-chapitres (babs) à l'intérieur d'un livre === */
.chapitre-block {
  margin: 28px 0 4px;
}

.chapitre-header-card {
  background: linear-gradient(135deg, var(--accent-soft), var(--bg-soft));
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius-lg);
  padding: 22px 28px;
  display: flex;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 12px;
}

.chapitre-num {
  font-family: 'Fraunces', serif;
  font-size: 20px;
  font-weight: 500;
  color: var(--accent);
  line-height: 1.2;
  flex-shrink: 0;
  padding-top: 2px;
}

.chapitre-titles {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chapitre-name-fr {
  font-family: 'Fraunces', serif;
  font-size: 17px;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.4;
}

.chapitre-name-ar {
  font-family: 'Amiri', serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  direction: rtl;
  line-height: 1.5;
}

.chapitre-intro {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 28px;
  margin-bottom: 16px;
}

.chapitre-intro-ar {
  font-family: 'Amiri', serif;
  font-size: 20px;
  line-height: 2;
  direction: rtl;
  text-align: right;
  color: var(--ink);
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px dashed var(--line);
}

.chapitre-intro-fr {
  font-family: 'Fraunces', serif;
  font-size: 16px;
  color: var(--ink-soft);
  line-height: 1.6;
  text-align: justify;
  hyphens: auto;
}

.chapitre-intro-fr em,
.chapitre-intro-fr .quoted {
  font-style: italic;
}

/* === Bloc référence en bas de chaque hadith === */
.hadith-references {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 6px;
}

.ref-row {
  display: grid;
  grid-template-columns: 160px 16px 1fr;
  gap: 4px;
  font-size: 13px;
  align-items: baseline;
}

.ref-label {
  color: var(--ink-mute);
  font-weight: 500;
  letter-spacing: 0.02em;
}

.ref-sep {
  color: var(--ink-mute);
}

.ref-value {
  color: var(--accent);
  font-weight: 500;
}

@media (max-width: 600px) {
  .ref-row {
    grid-template-columns: 130px 12px 1fr;
    font-size: 12px;
  }
  .chapitre-header-card { padding: 18px 20px; gap: 14px; }
  .chapitre-name-ar { font-size: 18px; }
  .chapitre-intro { padding: 18px 20px; }
  .chapitre-intro-ar { font-size: 17px; }
}

.filter-select {
  padding: 10px 16px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 100px;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}

.hadith-list { padding: 20px 0 80px; }

.hadith-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  margin-bottom: 20px;
}

.hadith-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.hadith-meta {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.hadith-source {
  font-size: 13px;
  color: var(--ink-soft);
}

.hadith-source strong { color: var(--ink); font-weight: 600; }

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background: var(--accent-soft);
  color: var(--accent);
  border-radius: 100px;
  font-size: 12px;
  font-weight: 600;
}

.auth-badge.hasan { background: rgba(212,168,81,0.15); color: #c89030; }
.auth-badge.daif { background: rgba(192,57,43,0.12); color: #c0392b; }
[data-theme="dark"] .auth-badge.hasan { background: rgba(212,168,81,0.18); color: #e0a050; }
[data-theme="dark"] .auth-badge.daif { background: rgba(224,112,112,0.15); color: #e07070; }

.hadith-arabic {
  font-family: 'Amiri', serif;
  font-size: 24px;
  line-height: 2.2;
  direction: rtl;
  text-align: right;
  margin-bottom: 24px;
  color: var(--ink);
}

.hadith-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
  margin: 24px 0;
}

.hadith-french {
  font-family: 'Fraunces', serif;
  font-size: 18px;
  line-height: 1.7;
  color: var(--ink);
  font-style: normal;
  text-align: justify;
  hyphens: auto;
}

/* L'italique est réservé aux mots entre guillemets (géré en JS) */
.hadith-french em,
.hadith-french .quoted {
  font-style: italic;
}

.hadith-french.empty {
  color: var(--ink-mute);
  font-style: italic;
  background: var(--bg-soft);
  padding: 14px 18px;
  border-radius: 8px;
  border-left: 3px solid var(--accent);
  font-size: 15px;
}

.hadith-arabic.empty-arabic {
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-style: italic;
  direction: ltr;
  text-align: center;
  color: var(--ink-mute);
  line-height: 1.6;
  padding: 16px;
  background: var(--bg-soft);
  border-radius: 8px;
  border: 1px dashed var(--line);
  margin-bottom: 24px;
}

.hadith-card-empty {
  opacity: 0.85;
}

.hadith-narrator {
  margin-top: 18px;
  font-size: 14px;
  color: var(--ink-mute);
}

.empty-state {
  text-align: center;
  padding: 80px 20px;
  color: var(--ink-mute);
}

.empty-state h3 {
  font-family: 'Fraunces', serif;
  font-size: 24px;
  margin-bottom: 12px;
  color: var(--ink-soft);
}

/* ============================================
   PAGE D'ACCUEIL — Section "Présentation"
   ============================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.about-text h2 {
  font-family: 'Fraunces', serif;
  font-size: 44px;
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: 24px;
}

.about-text h2 em { font-style: italic; color: var(--accent); }

.about-text p {
  color: var(--ink-soft);
  font-size: 16px;
  margin-bottom: 16px;
  line-height: 1.7;
  text-align: justify;
  hyphens: auto;
}

.about-visual {
  aspect-ratio: 4/5;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep) 100%);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  box-shadow: 0 24px 60px rgba(74,144,217,0.25);
}

.about-visual::before {
  content: '';
  position: absolute;
  inset: 24px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: 8px;
}

.about-visual span {
  font-family: 'Amiri', serif;
  font-size: clamp(48px, 9vw, 72px);
  color: rgba(255,255,255,0.95);
  z-index: 1;
  text-shadow: 0 4px 24px rgba(0,0,0,0.2);
  line-height: 1.4;
  text-align: center;
}

/* ============================================
   FORMULAIRE CONTACT
   ============================================ */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
}

.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 8px;
  font-weight: 500;
}

.form-group input,
.form-group textarea {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  transition: all 0.2s;
  resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.submit-btn {
  background: var(--accent);
  color: white;
  border: none;
  padding: 14px 32px;
  border-radius: 100px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 15px;
}

.submit-btn:hover {
  background: var(--accent-deep);
  transform: translateY(-1px);
}

/* ============================================
   FOOTER
   ============================================ */
footer {
  border-top: 1px solid var(--line);
  padding: 56px 0 32px;
  margin-top: 80px;
  background: var(--bg-soft);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 48px;
}

.footer-brand p {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.7;
  margin-top: 16px;
  max-width: 320px;
}

.footer-col h4 {
  font-family: 'Fraunces', serif;
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-col a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 14px;
  transition: color 0.2s;
}

.footer-col a:hover { color: var(--accent); }

.footer-bottom {
  padding-top: 32px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: 13px;
  color: var(--ink-mute);
  flex-wrap: wrap;
  gap: 16px;
}

.footer-duas {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-align: right;
  max-width: 60%;
}

.footer-bottom .arabic-quote {
  font-family: 'Amiri', serif;
  font-size: 16px;
  color: var(--accent);
  line-height: 1.6;
  direction: rtl;
}

@media (max-width: 700px) {
  .footer-duas { max-width: 100%; text-align: center; }
  .footer-bottom { justify-content: center; text-align: center; }
  .footer-bottom .arabic-quote { font-size: 15px; }
}

/* ============================================
   ANIMATIONS
   ============================================ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero > * { animation: fadeUp 0.8s ease backwards; }
.hero-eyebrow { animation-delay: 0.1s; }
.hero h1 { animation-delay: 0.2s; }
.hero-sub { animation-delay: 0.3s; }
.search-box { animation-delay: 0.4s; }
.stats-bar { animation-delay: 0.5s; }

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 860px) {
  .nav-links { display: none; }
  .container { padding: 0 20px; }
  .hadith-card { padding: 28px 22px; }
  .hadith-arabic { font-size: 21px; }
  .hadith-french { font-size: 17px; }
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .about-visual { max-width: 320px; margin: 0 auto; padding: 32px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .section { padding: 60px 0; }
  .section-title { font-size: 32px; }
  .stats-bar { gap: 32px; }
  .stat-num { font-size: 28px; }
  .recueil-presentation { padding: 24px 20px; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
  .search-box { padding: 6px 6px 6px 16px; }
  .search-btn span { display: none; }
  .search-btn { padding: 10px 14px; }
}


/* Symbole ﷺ : agrandir légèrement pour bonne lisibilité */
.hadith-arabic, .chapitre-intro-ar { font-feature-settings: 'liga'; }

/* Symbole ﷺ inline dans le français : un peu de respiration */
.hadith-french, .chapitre-intro-fr {
  word-spacing: 0.02em;
}
