/* ============================================
   Coran & Science — Feuille de style principale
   Design arabo-oriental élégant
   ============================================ */

/* ============================================
   1. Variables & Reset
   ============================================ */
:root {
    /* Palette principale — or & émeraude */
    --primary: #1a5276;
    --primary-dark: #0e2f44;
    --primary-light: #2980b9;
    --gold: #c9a227;
    --gold-light: #e8c96a;
    --gold-dark: #a8861d;
    --emerald: #1e8449;
    --emerald-dark: #145a32;

    /* Neutres */
    --bg: #faf7f0;
    --bg-alt: #f4efe3;
    --surface: #ffffff;
    --text: #2c3e50;
    --text-light: #6b7a8d;
    --text-muted: #95a5a6;
    --border: #e8e0d0;

    /* Typographie */
    --font-arabic: 'Amiri', serif;
    --font-display: 'Playfair Display', serif;
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Inter', sans-serif;

    /* Ombres & rayons */
    --shadow-sm: 0 2px 8px rgba(14, 47, 68, 0.08);
    --shadow-md: 0 6px 20px rgba(14, 47, 68, 0.12);
    --shadow-lg: 0 12px 40px rgba(14, 47, 68, 0.18);
    --radius: 12px;
    --radius-lg: 20px;
    --radius-sm: 8px;

    /* Surfaces & ombres */
    --card-bg: #ffffff;
    --shadow: 0 4px 16px rgba(14, 47, 68, 0.10);

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text);
    background-color: var(--bg);
    line-height: 1.7;
    overflow-x: hidden;
}

/* Langue arabe — typographie adaptée */
body.lang-ar {
    font-family: var(--font-arabic);
    line-height: 1.9;
}

body.lang-ar .brand-text,
body.lang-ar h1,
body.lang-ar h2,
body.lang-ar h3,
body.lang-ar h4 {
    font-family: var(--font-arabic);
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--gold-dark);
}

ul {
    list-style: none;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ============================================
   2. Motifs décoratifs arabesques
   ============================================ */

/* Motif supérieur */
.arabesque-top {
    height: 8px;
    background: linear-gradient(90deg,
        transparent,
        var(--gold) 20%,
        var(--primary) 50%,
        var(--gold) 80%,
        transparent);
    position: relative;
}

.arabesque-top::after {
    content: '';
    position: absolute;
    top: 8px;
    left: 0;
    right: 0;
    height: 2px;
    background: repeating-linear-gradient(90deg,
        var(--gold) 0 20px,
        transparent 20px 40px);
    opacity: 0.4;
}

/* Motif inférieur */
.arabesque-bottom {
    height: 8px;
    background: linear-gradient(90deg,
        transparent,
        var(--gold) 20%,
        var(--primary) 50%,
        var(--gold) 80%,
        transparent);
}

/* ============================================
   3. Barre de navigation
   ============================================ */
.navbar {
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
}

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

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.brand-icon {
    font-size: 2rem;
    line-height: 1;
}

.brand-text {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--primary-dark);
    letter-spacing: 0.5px;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-link {
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 500;
    color: var(--text);
    position: relative;
}

.nav-link:hover {
    color: var(--primary);
    background: rgba(26, 82, 118, 0.06);
}

.nav-link.active {
    color: var(--primary);
    background: rgba(26, 82, 118, 0.1);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 2px;
    background: var(--gold);
    border-radius: 2px;
}

/* ===== Sous-menu déroulant des catégories ===== */
.nav-item.has-dropdown {
    position: relative;
}

.dropdown-arrow {
    font-size: 0.7rem;
    margin-left: 6px;
    transition: transform 0.3s ease;
    vertical-align: middle;
}

.nav-item.has-dropdown:hover .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 260px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    padding: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
    z-index: 1001;
    list-style: none;
    margin: 0;
}

.nav-item.has-dropdown:hover .dropdown-menu,
.nav-item.has-dropdown:focus-within .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 30px;
    width: 12px;
    height: 12px;
    background: var(--surface);
    border-left: 1px solid var(--border);
    border-top: 1px solid var(--border);
    transform: rotate(45deg);
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-weight: 500;
    font-size: 0.92rem;
    transition: var(--transition);
}

.dropdown-link:hover {
    background: rgba(26, 82, 118, 0.08);
    color: var(--primary);
    transform: translateX(4px);
}

.dropdown-icon {
    font-size: 1.1rem;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-alt);
    border-radius: 8px;
    flex-shrink: 0;
}

.dropdown-label {
    flex: 1;
}

/* Style RTL pour le sous-menu */
html[dir="rtl"] .dropdown-menu {
    left: auto;
    right: 0;
}

html[dir="rtl"] .dropdown-menu::before {
    left: auto;
    right: 30px;
}

html[dir="rtl"] .dropdown-link:hover {
    transform: translateX(-4px);
}

html[dir="rtl"] .dropdown-arrow {
    margin-left: 0;
    margin-right: 6px;
}

/* Responsive : sous-menu en accordéon sur mobile */
@media (max-width: 768px) {
    /* Menu mobile */
    .nav-toggle {
        display: block;
    }
    
    .nav-menu {
        position: absolute;
        top: 72px;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        background: var(--surface);
        box-shadow: var(--shadow-lg);
        border-top: 1px solid var(--border);
        padding: 12px;
        gap: 4px;
        display: none;
        max-height: calc(100vh - 72px);
        overflow-y: auto;
    }
    
    .nav-menu.open {
        display: flex;
    }
    
    .nav-menu .nav-link {
        display: block;
        padding: 12px 16px;
        border-radius: 8px;
    }
    
    .nav-menu .nav-link.active::after {
        display: none;
    }
    
    /* Sous-menu en accordéon */
    .dropdown-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: none;
        border-left: 3px solid var(--gold);
        border-radius: 0;
        margin: 4px 0 4px 16px;
        padding: 4px 0;
        display: none;
        background: transparent;
    }
    
    .dropdown-menu::before {
        display: none;
    }
    
    .nav-item.has-dropdown.open .dropdown-menu {
        display: block;
    }
    
    .dropdown-link {
        padding: 8px 12px;
    }
    
    .dropdown-icon {
        width: 24px;
        height: 24px;
        font-size: 0.95rem;
    }
    
    /* RTL mobile */
    html[dir="rtl"] .dropdown-menu {
        border-left: none;
        border-right: 3px solid var(--gold);
        margin: 4px 16px 4px 0;
    }
    
    /* Sur mobile : la barre du header fixe est masquée,
       elle est déplacée en haut du menu mobile */
    .nav-actions .header-search {
        display: none;
    }
    
    .nav-search-mobile {
        display: block;
        padding: 4px 0 12px;
        border-bottom: 1px solid var(--border);
        margin-bottom: 8px;
    }
    
    .nav-search-mobile .header-search-group {
        min-width: 0;
        width: 100%;
        background: var(--bg-alt);
        border: 2px solid var(--border);
    }
    
    .nav-search-mobile .header-search-group:focus-within {
        border-color: var(--gold);
        box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
        background: var(--card-bg);
    }
    
    .nav-search-mobile .header-search-input {
        display: block;
    }
    
    .nav-search-mobile .header-search-btn {
        background: var(--primary);
        color: #fff;
    }
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Barre de recherche mobile : masquée sur desktop, affichée dans le menu mobile */
.nav-search-mobile {
    display: none;
}

/* Sélecteur de langue */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bg-alt);
    border-radius: 8px;
    padding: 4px;
}

.lang-btn {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    transition: var(--transition);
}

.lang-btn:hover {
    color: var(--primary);
}

.lang-btn.active {
    background: var(--primary);
    color: #fff;
    box-shadow: var(--shadow-sm);
}

/* Barre de recherche du header */
.header-search {
    display: flex;
    align-items: center;
}

/* Recherche desktop (dans .nav-actions) :
   par défaut réduite à un petit cercle ne montrant que l'icône,
   elle s'élargit au survol ou au clic (focus) pour révéler le champ. */
.nav-actions .header-search-group {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0;
    background: var(--bg-alt);
    border: 2px solid var(--border);
    border-radius: 50px;
    padding: 0;
    height: 42px;
    width: 42px;
    min-width: 42px;
    justify-content: center;
    cursor: pointer;
    transition: width 0.35s ease, min-width 0.35s ease, padding 0.35s ease,
                border-color 0.35s ease, box-shadow 0.35s ease, background 0.35s ease;
    overflow: hidden;
}

.nav-actions .header-search-group:hover,
.nav-actions .header-search-group:focus-within {
    width: 260px;
    min-width: 260px;
    padding: 0 6px 0 14px;
    gap: 8px;
    justify-content: flex-start;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
    background: var(--card-bg);
}

/* Icône : centrée dans le cercle quand réduit, en flux à gauche quand élargi */
.nav-actions .header-search-icon {
    color: var(--primary-dark);
    font-size: 1.1rem;
    font-weight: 900;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.nav-actions .header-search-group:hover .header-search-icon,
.nav-actions .header-search-group:focus-within .header-search-icon {
    color: var(--primary);
}

/* Champ de saisie : retiré du flux (flex: 0, width: 0) quand réduit pour que
   l'icône soit parfaitement centrée dans le cercle ; il ne prend de la place
   (flex: 1) que lorsque le groupe est élargi au survol/focus. */
.nav-actions .header-search-input {
    flex: 0 0 0;
    min-width: 0;
    width: 0;
    opacity: 0;
    border: none;
    background: transparent;
    font-size: 0.9rem;
    color: var(--text);
    outline: none;
    padding: 0;
    transition: opacity 0.25s ease 0.1s;
}

.nav-actions .header-search-group:hover .header-search-input,
.nav-actions .header-search-group:focus-within .header-search-input {
    flex: 1 1 auto;
    width: auto;
    opacity: 1;
}

.nav-actions .header-search-input::placeholder {
    color: var(--text-muted);
}

/* Bouton : retiré du flux (largeur 0) quand réduit pour ne pas pousser l'icône,
   réapparaît quand le groupe est élargi */
.nav-actions .header-search-btn {
    width: 0;
    height: 32px;
    flex: 0 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    font-size: 0.8rem;
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.25s ease 0.1s, transform 0.25s ease 0.1s, background 0.2s ease;
}

.nav-actions .header-search-group:hover .header-search-btn,
.nav-actions .header-search-group:focus-within .header-search-btn {
    width: 32px;
    flex: 0 0 32px;
    opacity: 1;
    transform: scale(1);
}

.nav-actions .header-search-btn:hover {
    background: var(--gold);
    transform: scale(1.05);
}

/* Bouton menu mobile */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
    padding: 8px;
}

/* Bouton menu mobile */
.nav-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--primary);
    cursor: pointer;
    padding: 8px;
}

/* ============================================
   4. Hero
   ============================================ */
.hero {
    position: relative;
    background: linear-gradient(135deg, #0a1628 0%, #0f2440 40%, #1a3a5c 70%, #0d1f38 100%);
    color: #fff;
    padding: 100px 0 80px;
    overflow: hidden;
}

/* Motif géométrique en arrière-plan */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(90, 130, 200, 0.10) 0, transparent 45%),
        radial-gradient(circle at 80% 70%, rgba(120, 150, 220, 0.08) 0, transparent 45%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(30deg, transparent 48%, rgba(255,255,255,0.04) 50%, transparent 52%),
        linear-gradient(-30deg, transparent 48%, rgba(255,255,255,0.04) 50%, transparent 52%);
    background-size: 60px 60px;
    opacity: 0.5;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(201, 162, 39, 0.4);
    border-radius: 50px;
    padding: 8px 20px;
    font-size: 0.9rem;
    margin-bottom: 24px;
    backdrop-filter: blur(4px);
}

.hero-badge-icon {
    font-size: 1.1rem;
}

.hero-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 20px;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 36px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 56px;
}

/* Statistiques */
.hero-stats {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    max-width: 1000px;
    margin: 0 auto;
    padding-top: 40px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.stat-item {
    text-align: center;
}

.stat-number {
    display: block;
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--gold-light);
    margin-bottom: 4px;
}

.stat-label {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
}

/* ============================================
   Vue du cosmos et des constellations en toile de fond
   ============================================ */
.hero-cosmos {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

/* Couches d'étoiles scintillantes */
.cosmos-stars {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-repeat: repeat;
}

.cosmos-stars-1 {
    background-image:
        radial-gradient(1px 1px at 25px 35px, rgba(214,224,255,0.9) 50%, transparent 51%),
        radial-gradient(1px 1px at 75px 90px, rgba(214,224,255,0.8) 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 130px 45px, rgba(214,224,255,0.9) 50%, transparent 51%),
        radial-gradient(1px 1px at 180px 120px, rgba(214,224,255,0.8) 50%, transparent 51%),
        radial-gradient(1px 1px at 220px 30px, rgba(214,224,255,0.9) 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 280px 80px, rgba(214,224,255,0.8) 50%, transparent 51%),
        radial-gradient(1px 1px at 320px 140px, rgba(214,224,255,0.9) 50%, transparent 51%),
        radial-gradient(1px 1px at 370px 60px, rgba(214,224,255,0.8) 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 420px 110px, rgba(214,224,255,0.9) 50%, transparent 51%);
    background-size: 450px 180px;
    animation: stars-twinkle 6s ease-in-out infinite;
}

.cosmos-stars-2 {
    background-image:
        radial-gradient(1.5px 1.5px at 40px 60px, rgba(200,215,245,0.7) 50%, transparent 51%),
        radial-gradient(1px 1px at 100px 20px, rgba(200,215,245,0.6) 50%, transparent 51%),
        radial-gradient(2px 2px at 160px 100px, rgba(200,215,245,0.7) 50%, transparent 51%),
        radial-gradient(1px 1px at 210px 50px, rgba(200,215,245,0.6) 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 260px 130px, rgba(200,215,245,0.7) 50%, transparent 51%),
        radial-gradient(1px 1px at 320px 70px, rgba(200,215,245,0.6) 50%, transparent 51%),
        radial-gradient(2px 2px at 380px 30px, rgba(200,215,245,0.7) 50%, transparent 51%);
    background-size: 420px 160px;
    animation: stars-twinkle 7s ease-in-out infinite 1s;
}

.cosmos-stars-3 {
    background-image:
        radial-gradient(2px 2px at 30px 80px, rgba(173,216,255,0.55) 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 90px 40px, rgba(173,216,255,0.45) 50%, transparent 51%),
        radial-gradient(1px 1px at 150px 110px, rgba(173,216,255,0.55) 50%, transparent 51%),
        radial-gradient(2px 2px at 200px 20px, rgba(173,216,255,0.45) 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 260px 90px, rgba(173,216,255,0.55) 50%, transparent 51%),
        radial-gradient(1px 1px at 310px 140px, rgba(173,216,255,0.45) 50%, transparent 51%),
        radial-gradient(2px 2px at 370px 50px, rgba(173,216,255,0.55) 50%, transparent 51%);
    background-size: 400px 170px;
    animation: stars-twinkle 8s ease-in-out infinite 2s;
}

/* Scintillement des étoiles — amplitude douce et naturelle */
@keyframes stars-twinkle {
    0%, 100% { opacity: 0.72; }
    50% { opacity: 1; }
}

/* Constellations (SVG) */
.cosmos-constellation {
    position: absolute;
    top: 12%;
    right: 8%;
    width: 340px;
    height: auto;
    opacity: 0.4;
    animation: constellation-glow 8s ease-in-out infinite;
}

.cosmos-constellation-2 {
    top: 55%;
    right: 30%;
    width: 260px;
    opacity: 0.3;
    animation-delay: 2s;
}

.constellation-lines line {
    stroke: rgba(200, 215, 245, 0.28);
    stroke-width: 1;
    stroke-dasharray: 4 3;
}

.constellation-stars circle {
    fill: #d6e0ff;
    filter: drop-shadow(0 0 3px rgba(214, 224, 255, 0.6));
}

@keyframes constellation-glow {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 0.5; }
}

/* Nébuleuses diffuses */
.cosmos-nebula {
    position: absolute;
    border-radius: 50%;
    filter: blur(60px);
}

.cosmos-nebula-1 {
    top: 15%;
    left: 10%;
    width: 400px;
    height: 300px;
    background: radial-gradient(circle, rgba(90, 130, 200, 0.10) 0%, rgba(90, 130, 200, 0.04) 40%, transparent 70%);
    animation: nebula-drift 30s ease-in-out infinite;
}

.cosmos-nebula-2 {
    bottom: 10%;
    right: 5%;
    width: 500px;
    height: 350px;
    background: radial-gradient(circle, rgba(120, 140, 210, 0.10) 0%, rgba(120, 140, 210, 0.04) 40%, transparent 70%);
    animation: nebula-drift 35s ease-in-out infinite 5s;
}

@keyframes nebula-drift {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(20px, -15px) scale(1.05); }
}

/* Étoile filante */
.cosmos-shooting-star {
    position: absolute;
    top: 20%;
    left: 60%;
    width: 120px;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(214, 224, 255, 0.7));
    border-radius: 2px;
    transform: rotate(-35deg);
    opacity: 0;
    animation: shooting-star 30s ease-in-out infinite;
}

.cosmos-shooting-star::after {
    content: '';
    position: absolute;
    top: -2px;
    right: 0;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #d6e0ff;
    box-shadow: 0 0 6px rgba(214, 224, 255, 0.7);
}

@keyframes shooting-star {
    0%, 93% { opacity: 0; transform: translate(0, 0) rotate(-35deg); }
    95% { opacity: 1; }
    97% { opacity: 0; transform: translate(-300px, 200px) rotate(-35deg); }
    100% { opacity: 0; transform: translate(-300px, 200px) rotate(-35deg); }
}

/* Moteur canvas : étoiles vivantes, nébuleuses, météorites, galaxies */
.cosmos-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    display: block;
}

/* ============================================
   5. Boutons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
}

.btn-lg {
    padding: 16px 36px;
    font-size: 1.05rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #fff;
    box-shadow: 0 4px 15px rgba(201, 162, 39, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(201, 162, 39, 0.4);
    color: #fff;
}

.btn-outline {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.6);
    color: #fff;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #fff;
    color: #fff;
}

.btn-block {
    width: 100%;
    justify-content: center;
}

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

.section-alt {
    background: var(--bg-alt);
}

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 56px;
}

.section-eyebrow {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--gold-dark);
    margin-bottom: 12px;
}

.section-title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    color: var(--primary-dark);
    margin-bottom: 16px;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    border-radius: 3px;
}

.section-subtitle {
    color: var(--text-light);
    font-size: 1.05rem;
}

/* Texte raffiné de la timeline (intro + verset + conclusion) */
.timeline-refined {
    margin-top: 28px;
    text-align: left;
    max-width: 780px;
    margin-left: auto;
    margin-right: auto;
}

.timeline-refined .tl-refined-intro {
    color: var(--text);
    font-size: 1.02rem;
    line-height: 1.75;
    margin-bottom: 20px;
}

.timeline-refined .tl-refined-intro2 {
    color: var(--text);
    font-size: 1.02rem;
    line-height: 1.75;
    margin-bottom: 20px;
}

.timeline-refined .tl-refined-verse {
    position: relative;
    margin: 0 0 20px;
    padding: 20px 24px 20px 28px;
    background: linear-gradient(135deg, rgba(201, 162, 39, 0.08), rgba(201, 162, 39, 0.03));
    border-left: 4px solid var(--gold);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-family: var(--font-display);
    font-size: 1.12rem;
    font-style: italic;
    line-height: 1.8;
    color: var(--gold-dark);
}

.timeline-refined .tl-verse-label {
    display: block;
    font-family: var(--font-body);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-style: normal;
    color: var(--gold);
    margin-bottom: 8px;
}

.timeline-refined .tl-refined-conclusion {
    color: var(--primary);
    font-weight: 600;
    font-size: 1.02rem;
    line-height: 1.7;
}

/* RTL : la citation s'aligne à droite */
[dir="rtl"] .timeline-refined {
    text-align: right;
}

[dir="rtl"] .timeline-refined .tl-refined-verse {
    border-left: none;
    border-right: 4px solid var(--gold);
    border-radius: var(--radius-md) 0 0 var(--radius-md);
    padding: 20px 28px 20px 24px;
}

/* ============================================
   7. Grille de catégories
   ============================================ */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.category-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--cat-color, var(--primary));
    transition: var(--transition);
}

.category-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--cat-color, var(--primary));
}

.category-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: color-mix(in srgb, var(--cat-color, var(--primary)) 12%, transparent);
    border-radius: 16px;
}

.category-name {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: var(--primary-dark);
    margin-bottom: 10px;
}

.category-desc {
    color: var(--text-light);
    font-size: 0.95rem;
    flex-grow: 1;
    margin-bottom: 16px;
}

.category-link {
    color: var(--cat-color, var(--primary));
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.category-link i {
    transition: transform 0.3s;
}

.category-card:hover .category-link i {
    transform: translateX(4px);
}

/* ============================================
   8. Cartes d'articles
   ============================================ */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 28px;
}

.article-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
}

.article-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.article-card-header {
    padding: 24px;
    min-height: 120px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
}

.article-category {
    color: #fff;
    font-size: 0.85rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.15);
    padding: 6px 14px;
    border-radius: 50px;
    backdrop-filter: blur(4px);
}

.article-badge {
    background: var(--gold);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 50px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-card-body {
    padding: 24px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.article-surah {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 500;
}

.article-title {
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin-bottom: 10px;
    line-height: 1.4;
}

.article-title a {
    color: var(--primary-dark);
}

.article-title a:hover {
    color: var(--gold-dark);
}

.article-excerpt {
    color: var(--text-light);
    font-size: 0.95rem;
    flex-grow: 1;
    margin-bottom: 16px;
}

.article-read-more {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.article-read-more i {
    transition: transform 0.3s;
}

.article-read-more:hover i {
    transform: translateX(4px);
}

/* ============================================
   9. Section À propos (accueil)
   ============================================ */
.section-about {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
}

.section-about .section-title {
    color: #fff;
}

.section-about .section-eyebrow {
    color: var(--gold-light);
}

.section-about p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 16px;
}

.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-visual {
    display: flex;
    justify-content: center;
}

.mission-visual {
    position: relative;
    width: 400px;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Noyau central lumineux */
.mission-core {
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff, var(--gold-light) 40%, var(--gold));
    box-shadow: 0 0 25px rgba(201, 162, 39, 0.9), 0 0 60px rgba(201, 162, 39, 0.4);
    z-index: 3;
    animation: mission-pulse 3s ease-in-out infinite;
}

/* Orbites elliptiques en rotation */
.mission-orbit {
    position: absolute;
    border: 1.5px solid rgba(201, 162, 39, 0.4);
    border-radius: 50%;
    z-index: 1;
}

.mission-orbit-1 {
    width: 380px;
    height: 240px;
    animation: mission-spin 18s linear infinite;
}

.mission-orbit-2 {
    width: 320px;
    height: 200px;
    border-style: dashed;
    border-color: rgba(126, 200, 227, 0.4);
    animation: mission-spin-reverse 24s linear infinite;
}

.mission-orbit-3 {
    width: 260px;
    height: 160px;
    border-color: rgba(201, 162, 39, 0.3);
    animation: mission-spin 30s linear infinite;
}

.mission-orbit-4 {
    width: 200px;
    height: 120px;
    border-style: dotted;
    border-color: rgba(255, 255, 255, 0.35);
    animation: mission-spin-reverse 36s linear infinite;
}

/* Particules lumineuses sur les orbites */
.mission-atom {
    position: absolute;
    top: -7px;
    left: 50%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: radial-gradient(circle, #fff, var(--gold-light) 40%, var(--gold));
    box-shadow: 0 0 16px rgba(201, 162, 39, 0.9);
}

.mission-atom-2 {
    top: 50%;
    left: -7px;
    width: 11px;
    height: 11px;
    background: radial-gradient(circle, #fff, #7ec8e3 40%, var(--primary-light));
    box-shadow: 0 0 14px rgba(126, 200, 227, 0.9);
}

.mission-atom-3 {
    top: auto;
    bottom: -6px;
    left: 25%;
    width: 9px;
    height: 9px;
    background: radial-gradient(circle, #fff, var(--gold-light));
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.8);
}

.mission-atom-4 {
    top: -5px;
    left: 70%;
    width: 8px;
    height: 8px;
    background: radial-gradient(circle, #fff, #e8c96a);
    box-shadow: 0 0 10px rgba(232, 201, 106, 0.8);
}

/* Constellation d'étoiles fixes */
.mission-star {
    position: absolute;
    color: var(--gold-light);
    z-index: 2;
    animation: mission-twinkle 3s ease-in-out infinite;
    text-shadow: 0 0 10px rgba(201, 162, 39, 0.7);
}

.mission-star-1 { top: 10%; left: 50%; font-size: 1.1rem; animation-delay: 0s; }
.mission-star-2 { top: 30%; right: 10%; font-size: 0.9rem; animation-delay: 0.4s; }
.mission-star-3 { top: 65%; right: 5%; font-size: 1.2rem; animation-delay: 0.8s; }
.mission-star-4 { top: 87%; left: 30%; font-size: 1rem; animation-delay: 1.2s; }
.mission-star-5 { top: 82%; left: 5%; font-size: 0.8rem; animation-delay: 1.6s; }
.mission-star-6 { top: 55%; left: 2%; font-size: 1.1rem; animation-delay: 2s; }
.mission-star-7 { top: 25%; left: 8%; font-size: 0.9rem; animation-delay: 2.4s; }
.mission-star-8 { top: 45%; left: 50%; font-size: 0.7rem; animation-delay: 2.8s; }

/* Lignes de constellation */
.mission-lines {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.5;
}

.mission-lines line {
    stroke: rgba(201, 162, 39, 0.35);
    stroke-width: 1;
    stroke-dasharray: 4 4;
}

/* Animations */
@keyframes mission-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

@keyframes mission-spin-reverse {
    from { transform: rotate(360deg); }
    to { transform: rotate(0deg); }
}

@keyframes mission-twinkle {
    0%, 100% { opacity: 0.4; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.2); }
}

@keyframes mission-pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.25); }
}

/* ============================================
   10. Pages internes — Hero
   ============================================ */
.page-hero {
    color: #fff;
    padding: 80px 0 60px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(30deg, transparent 48%, rgba(255,255,255,0.04) 50%, transparent 52%),
        linear-gradient(-30deg, transparent 48%, rgba(255,255,255,0.04) 50%, transparent 52%);
    background-size: 60px 60px;
    opacity: 0.5;
}

.page-hero-small {
    padding: 60px 0 40px;
}

.page-hero-content {
    position: relative;
    z-index: 2;
}

.page-hero-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.page-hero-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 12px;
    position: relative;
    z-index: 2;
}

.page-hero-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 2;
}

/* Fond spatial (cosmos) pour les pages internes — cohérent avec l'accueil */
.page-hero-cosmos {
    background: linear-gradient(135deg, #0a1628 0%, #0f2440 40%, #1a3a5c 70%, #0d1f38 100%);
}

.page-hero-cosmos .page-hero-content,
.page-hero-cosmos .breadcrumb {
    position: relative;
    z-index: 2;
}

/* Fond spatial (cosmos) pour le hero d'article */
.article-hero-cosmos {
    background: linear-gradient(135deg, #0a1628 0%, #0f2440 40%, #1a3a5c 70%, #0d1f38 100%);
}

.article-hero-cosmos .breadcrumb,
.article-hero-cosmos .article-hero-title,
.article-hero-cosmos .article-hero-meta {
    position: relative;
    z-index: 2;
}

/* Fil d'Ariane */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    margin-top: 20px;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.breadcrumb a {
    color: rgba(255, 255, 255, 0.8);
}

.breadcrumb a:hover {
    color: var(--gold-light);
}

.breadcrumb-sep {
    color: rgba(255, 255, 255, 0.5);
}

.breadcrumb span:last-child {
    color: var(--gold-light);
}

/* ============================================
   11. Liste d'articles (catégorie & recherche)
   ============================================ */
.articles-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 900px;
    margin: 0 auto;
}

.article-row {
    display: flex;
    gap: 24px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.article-row:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.article-row-icon {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: #fff;
}

.article-row-content {
    flex-grow: 1;
}

.article-row-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    margin-bottom: 8px;
}

.article-row-title a {
    color: var(--primary-dark);
}

.article-row-title a:hover {
    color: var(--gold-dark);
}

.article-row-excerpt {
    color: var(--text-light);
    margin-bottom: 12px;
}

/* Autres catégories */
.other-categories {
    margin-top: 60px;
    text-align: center;
}

.other-categories-title {
    font-family: var(--font-display);
    color: var(--primary-dark);
    margin-bottom: 20px;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.chip {
    padding: 10px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50px;
    font-size: 0.9rem;
    color: var(--text);
    transition: var(--transition);
}

.chip:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

/* ============================================
   12. Page article
   ============================================ */
.article-hero {
    color: #fff;
    padding: 60px 0 50px;
    position: relative;
    overflow: hidden;
}

.article-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(30deg, transparent 48%, rgba(255,255,255,0.04) 50%, transparent 52%),
        linear-gradient(-30deg, transparent 48%, rgba(255,255,255,0.04) 50%, transparent 52%);
    background-size: 60px 60px;
    opacity: 0.5;
}

.article-hero .breadcrumb {
    justify-content: flex-start;
}

.article-hero-title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    margin: 16px 0;
    position: relative;
    z-index: 2;
}

.article-hero-meta {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
    position: relative;
    z-index: 2;
}

.meta-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
}

.meta-item i {
    color: var(--gold-light);
}

/* Badge ID d'article (ex : AST-01) */
.meta-article-id {
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: #1a1a2e !important;
    font-weight: 700;
    font-family: 'Courier New', monospace;
    letter-spacing: 0.5px;
    padding: 4px 12px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.meta-article-id i {
    color: #1a1a2e !important;
}

.article-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 48px;
    align-items: start;
}

.article-main {
    min-width: 0;
}

/* Boîte coranique */
.quran-box {
    background: linear-gradient(135deg, var(--emerald-dark), var(--emerald));
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 32px;
    color: #fff;
    border: 2px solid var(--gold);
    position: relative;
    overflow: hidden;
}

.quran-box::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(201, 162, 39, 0.4);
    border-radius: 12px;
    pointer-events: none;
}

.quran-box-header {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin-bottom: 24px;
    color: var(--gold-light);
}

.quran-verse {
    margin-bottom: 24px;
}

.quran-verse:last-child {
    margin-bottom: 0;
}

.quran-arabic {
    font-family: var(--font-arabic);
    font-size: 1.6rem;
    line-height: 2.2;
    text-align: right;
    margin-bottom: 8px;
    color: #fff;
}

.quran-reference {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.8);
    text-align: right;
}

.quran-translation {
    font-size: 1.05rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 8px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.08);
    border-left: 3px solid var(--gold);
    border-radius: 0 8px 8px 0;
}

/* Boîte Hadith (Sunna) */
.hadith-box {
    background: linear-gradient(135deg, #1a3a2a, #245a3a);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin-bottom: 32px;
    color: #fff;
    border: 2px solid var(--gold);
    position: relative;
    overflow: hidden;
}

.hadith-box::before {
    content: '';
    position: absolute;
    inset: 8px;
    border: 1px solid rgba(201, 162, 39, 0.4);
    border-radius: 12px;
    pointer-events: none;
}

.hadith-box-header {
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin-bottom: 24px;
    color: var(--gold-light);
}

.hadith-item {
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.hadith-item:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.hadith-arabic {
    font-family: var(--font-arabic);
    font-size: 1.5rem;
    line-height: 2.1;
    text-align: right;
    margin-bottom: 10px;
    color: #fff;
}

.hadith-translation {
    font-size: 1.05rem;
    line-height: 1.8;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 10px;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.08);
    border-left: 3px solid var(--gold);
    border-radius: 0 8px 8px 0;
}

.hadith-reference {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.85);
    text-align: right;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

.hadith-narrator {
    color: var(--gold-light);
}

.hadith-source {
    color: rgba(255, 255, 255, 0.7);
}

.hadith-authenticity {
    background: var(--gold);
    color: var(--emerald-dark);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Contenu de l'article */
.article-content {
    font-size: 1.05rem;
    line-height: 1.9;
    color: var(--text);
}

.article-content h2,
.article-content h3 {
    font-family: var(--font-display);
    color: var(--primary-dark);
    margin: 32px 0 16px;
}

.article-content h2 {
    font-size: 1.6rem;
}

.article-content h3 {
    font-size: 1.3rem;
}

.article-content p {
    margin-bottom: 16px;
}

.article-content ul,
.article-content ol {
    margin: 16px 0;
    padding-left: 24px;
}

.article-content ul li,
.article-content ol li {
    margin-bottom: 8px;
}

.article-content blockquote {
    border-left: 4px solid var(--gold);
    padding: 16px 24px;
    background: var(--bg-alt);
    border-radius: 0 8px 8px 0;
    margin: 24px 0;
    font-style: italic;
    color: var(--text-light);
}

/* Découvertes scientifiques */
.findings-box {
    background: var(--bg-alt);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin: 32px 0;
    border: 1px solid var(--border);
}

.findings-title {
    font-family: var(--font-display);
    color: var(--emerald-dark);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.findings-title i {
    color: var(--emerald);
}

.findings-content {
    line-height: 1.8;
}

/* Explication scientifique */
.explanation-box {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.06), rgba(16, 185, 129, 0.02));
    border-radius: var(--radius-lg);
    padding: 32px;
    margin: 32px 0;
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-left: 4px solid var(--emerald);
}

.explanation-title {
    font-family: var(--font-display);
    color: var(--emerald-dark);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.explanation-title i {
    color: var(--emerald);
}

.explanation-content {
    line-height: 1.8;
    color: var(--text);
}

.explanation-content p {
    margin-bottom: 12px;
}

.explanation-content p:last-child {
    margin-bottom: 0;
}

/* Références */
.references-box {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 32px;
    margin: 32px 0;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.references-title {
    font-family: var(--font-display);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.references-title i {
    color: var(--gold-dark);
}

.references-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.reference-item {
    padding: 12px 16px;
    background: var(--bg);
    border-radius: 8px;
    border-left: 3px solid var(--gold);
    font-size: 0.95rem;
}

.reference-title {
    font-weight: 600;
    color: var(--text);
}

.reference-author {
    color: var(--text-light);
}

.reference-journal {
    color: var(--text-muted);
    font-style: italic;
}

/* Navigation article */
.article-nav {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

/* Barre latérale */
.article-sidebar {
    position: sticky;
    top: 90px;
}

.sidebar-widget {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.sidebar-title {
    font-family: var(--font-display);
    color: var(--primary-dark);
    font-size: 1.1rem;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--bg-alt);
}

.sidebar-articles {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-article {
    padding: 12px;
    border-radius: 8px;
    background: var(--bg);
    transition: var(--transition);
}

.sidebar-article:hover {
    background: var(--bg-alt);
}

.sidebar-article-title {
    display: block;
    font-weight: 600;
    color: var(--primary-dark);
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.sidebar-article-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Boutons de partage */
.share-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.share-btn {
    width: 42px;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: #fff;
    transition: var(--transition);
}

.share-btn:hover {
    transform: translateY(-3px);
    color: #fff;
}

.share-facebook { background: #1877f2; }
.share-twitter { background: #1da1f2; }
.share-whatsapp { background: #25d366; }
.share-telegram { background: #0088cc; }

/* ============================================
   13. Page recherche
   ============================================ */
.search-hero {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    padding: 60px 0;
    text-align: center;
}

.search-hero-title {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 24px;
}

/* ============================================
   14. Page À propos
   ============================================ */
.about-section {
    padding: 80px 0;
}

.about-section-alt {
    background: var(--bg-alt);
}

.about-content {
    max-width: 800px;
    margin: 0 auto;
    line-height: 1.9;
    color: var(--text);
}

.about-content h2 {
    font-family: var(--font-display);
    color: var(--primary-dark);
    margin: 32px 0 16px;
    font-size: 1.6rem;
}

.about-content p {
    margin-bottom: 16px;
}

.about-content ul {
    margin: 16px 0;
    padding-left: 24px;
}

.about-content ul li {
    margin-bottom: 8px;
}

/* Carte Bucaille */
.bucaille-card {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 32px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border);
    align-items: center;
}

.bucaille-photo {
    width: 200px;
    height: 240px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    color: var(--gold-light);
    overflow: hidden;
}

.bucaille-info h3 {
    font-family: var(--font-display);
    color: var(--primary-dark);
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.bucaille-role {
    color: var(--gold-dark);
    font-weight: 600;
    margin-bottom: 16px;
}

.bucaille-bio {
    color: var(--text-light);
    line-height: 1.8;
}

/* Valeurs */
.values-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

.value-card {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 32px 24px;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.value-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.value-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    color: #fff;
}

.value-title {
    font-family: var(--font-display);
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.value-desc {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* ============================================
   15. Page contact
   ============================================ */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.contact-card {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.contact-card-icon {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
}

.contact-card-title {
    font-family: var(--font-display);
    color: var(--primary-dark);
    margin-bottom: 4px;
}

.contact-card-text {
    color: var(--text-light);
    font-size: 0.95rem;
}

.contact-form {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 40px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

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

.form-label {
    display: block;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--bg);
    color: var(--text);
}

.form-control:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}

textarea.form-control {
    min-height: 140px;
    resize: vertical;
}

.form-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ============================================
   16. Footer
   ============================================ */
.site-footer {
    background: var(--primary-dark);
    color: rgba(255, 255, 255, 0.8);
    position: relative;
    overflow: hidden;
}

/* Filigrane décoratif en fond du footer */
.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='80' height='80' viewBox='0 0 80 80'%3E%3Cg fill='none' stroke='%23ffffff' stroke-width='0.8' opacity='0.04'%3E%3Cpath d='M40 10c-8 12-8 24 0 36 8-12 8-24 0-36z'/%3E%3Ccircle cx='40' cy='28' r='4'/%3E%3Cpath d='M0 40c10-6 20-6 30 0-10 6-20 6-30 0z'/%3E%3Cpath d='M80 40c-10-6-20-6-30 0 10 6 20 6 30 0z'/%3E%3Cpath d='M40 70c-6-8-6-16 0-24 6 8 6 16 0 24z'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: repeat;
    pointer-events: none;
    z-index: 0;
}

.site-footer > * {
    position: relative;
    z-index: 1;
}

.arabesque-bottom {
    height: 70px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='70' viewBox='0 0 160 70'%3E%3Cg fill='none' stroke='%23c9a227' stroke-width='1.2' opacity='0.55'%3E%3C!-- Arche centrale --%3E%3Cpath d='M80 5c-14 18-14 36 0 54 14-18 14-36 0-54z'/%3E%3Ccircle cx='80' cy='30' r='7'/%3E%3Ccircle cx='80' cy='30' r='3'/%3E%3C!-- Vagues latérales --%3E%3Cpath d='M0 40c12-8 24-8 36 0-12 8-24 8-36 0z'/%3E%3Cpath d='M160 40c-12-8-24-8-36 0 12 8 24 8 36 0z'/%3E%3Cpath d='M40 55c8-5 16-5 24 0-8 5-16 5-24 0z'/%3E%3Cpath d='M120 55c-8-5-16-5-24 0 8 5 16 5 24 0z'/%3E%3C!-- Petites étoiles --%3E%3Cpath d='M20 20l1.5 3 3 1.5-3 1.5-1.5 3-1.5-3-3-1.5 3-1.5z'/%3E%3Cpath d='M140 20l1.5 3 3 1.5-3 1.5-1.5 3-1.5-3-3-1.5 3-1.5z'/%3E%3Cpath d='M60 15l1 2 2 1-2 1-1 2-1-2-2-1 2-1z'/%3E%3Cpath d='M100 15l1 2 2 1-2 1-1 2-1-2-2-1 2-1z'/%3E%3C/g%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-position: center;
    opacity: 0.7;
}

/* Verset décoratif en haut du footer */
.footer-verse {
    padding: 28px 0;
    border-top: 1px solid rgba(201, 162, 39, 0.15);
    border-bottom: 1px solid rgba(201, 162, 39, 0.15);
    background: rgba(201, 162, 39, 0.04);
    text-align: center;
}

.footer-verse .container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
}

.footer-verse-text {
    font-family: var(--font-arabic);
    font-size: 1.5rem;
    color: var(--gold-light);
    line-height: 1.8;
    text-shadow: 0 0 20px rgba(201, 162, 39, 0.3);
}

.footer-verse-ornament {
    color: var(--gold);
    font-size: 1rem;
    animation: mission-twinkle 3s ease-in-out infinite;
}

.footer-verse-ornament:last-child {
    animation-delay: 1.5s;
}

.footer-main {
    padding: 60px 0 40px;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: 40px;
}

.footer-brand {
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: #fff;
    margin-bottom: 16px;
}

.footer-brand span {
    color: var(--gold);
}

.footer-about {
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 20px;
}

.footer-social {
    display: flex;
    gap: 12px;
}

.footer-social a {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: var(--transition);
}

.footer-social a:hover {
    background: var(--gold);
    transform: translateY(-3px);
}

.footer-title {
    font-family: var(--font-display);
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 20px;
    position: relative;
    padding-bottom: 12px;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: var(--gold);
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.95rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.footer-links a i {
    font-size: 0.7rem;
    color: var(--gold);
}

.footer-links a:hover {
    color: var(--gold-light);
    padding-left: 4px;
}

.footer-contact {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.footer-contact li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    font-size: 0.95rem;
}

.footer-contact i {
    color: var(--gold);
    margin-top: 4px;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
    text-align: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
}

/* ============================================
   17. Responsive
   ============================================ */
@media (max-width: 1024px) {
    .article-layout {
        grid-template-columns: 1fr;
    }

    .article-sidebar {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }

    .about-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .contact-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .section {
        padding: 60px 0;
    }

    .hero-title {
        font-size: 2.2rem;
    }

    .hero-subtitle {
        font-size: 1.05rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: stretch;
    }

    .hero-buttons .btn {
        justify-content: center;
    }

    /* Constellations responsive */
    .cosmos-constellation {
        width: 220px;
        right: 5%;
        top: 8%;
    }

    .cosmos-constellation-2 {
        width: 180px;
        right: 20%;
        top: 60%;
    }

    .cosmos-nebula-1 {
        width: 250px;
        height: 200px;
    }

    .cosmos-nebula-2 {
        width: 300px;
        height: 220px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .article-row {
        flex-direction: column;
    }

    .bucaille-card {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .bucaille-photo {
        margin: 0 auto;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .article-sidebar {
        grid-template-columns: 1fr;
    }
}

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

    .categories-grid,
    .articles-grid {
        grid-template-columns: 1fr;
    }

    .quran-arabic {
        font-size: 1.3rem;
    }
}

/* ============================================
   18. Animations & utilitaires
   ============================================ */
.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mt-5 { margin-top: 48px; }

.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }
.mb-5 { margin-bottom: 48px; }

/* Scrollbar personnalisée */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(var(--gold), var(--gold-dark));
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold-dark);
}

/* Sélection */
::selection {
    background: var(--gold);
    color: #fff;
}

/* ============================================
   PAGE À PROPOS
   ============================================ */
.about-page {
    max-width: 900px;
    margin: 0 auto;
}

.about-section {
    margin-bottom: 3rem;
    padding: 2rem;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}

.about-heading {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.about-heading i {
    color: var(--gold);
    font-size: 1.3rem;
}

.about-section p {
    color: var(--text);
    line-height: 1.8;
    margin-bottom: 0.75rem;
}

.about-categories {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.about-category {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.about-category:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.about-category-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.about-category h4 {
    font-family: var(--font-heading);
    color: var(--primary);
    margin-bottom: 0.25rem;
}

.about-category p {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0;
}

/* ============================================
   PAGE RECHERCHE
   ============================================ */
.search-results-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    color: var(--text-muted);
}

.search-results-header strong {
    color: var(--primary);
}

.empty-state {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    color: var(--border);
    margin-bottom: 1rem;
    display: block;
}

/* ============================================
   PAGE ERREUR
   ============================================ */
.error-page {
    text-align: center;
    padding: 5rem 1rem;
    max-width: 600px;
    margin: 0 auto;
}

.error-page h1 {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.error-page p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

/* ============================================
   BARRE LATÉRALE — PARTAGE
   ============================================ */
.sidebar-share {
    text-align: center;
}

/* ============================================
   PAGE CONTACT — Mise en page & formulaire
   ============================================ */
.contact-layout {
    display: grid;
    grid-template-columns: 0.9fr 1.1fr;
    gap: 40px;
    align-items: start;
}

.contact-info {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 36px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}

.contact-info-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    color: var(--primary-dark);
    margin-bottom: 16px;
}

.contact-info > p {
    color: var(--text-light);
    margin-bottom: 28px;
}

.contact-info-item {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid var(--bg-alt);
}

.contact-info-item:last-child {
    border-bottom: none;
}

.contact-info-item i {
    font-size: 1.3rem;
    color: var(--gold-dark);
    margin-top: 4px;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    border-radius: 10px;
    background: rgba(201, 162, 39, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-info-item strong {
    display: block;
    color: var(--primary-dark);
    margin-bottom: 4px;
}

.contact-info-item span {
    color: var(--text-light);
    font-size: 0.95rem;
}

.contact-form-wrap {
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 40px;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
}

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

.contact-form label {
    display: block;
    font-weight: 600;
    color: var(--primary-dark);
    margin-bottom: 8px;
    font-size: 0.95rem;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--bg);
    color: var(--text);
}

.form-input:focus {
    outline: none;
    border-color: var(--gold);
    box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.15);
}

textarea.form-input {
    min-height: 140px;
    resize: vertical;
}

.form-input.is-invalid {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.15);
}

/* Alertes */
.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    border-radius: 10px;
    padding: 16px 20px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.alert i {
    font-size: 1.3rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* ============================================
   RESPONSIVE — Contact
   ============================================ */
@media (max-width: 768px) {
    .contact-layout {
        grid-template-columns: 1fr;
    }

    .contact-form-wrap {
        padding: 28px;
    }
}

/* ============================================
   20. Ligne de temps horizontale (Timeline)
   Echelle logarithmique + epingles interactives
   ============================================ */
.section-timeline {
    background: linear-gradient(180deg, var(--bg-alt) 0%, var(--surface) 100%);
    position: relative;
    overflow: hidden;
}

/* Motif decoratif discret en fond */
.section-timeline::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 15% 20%, rgba(201, 162, 39, 0.06) 0, transparent 40%),
        radial-gradient(circle at 85% 80%, rgba(26, 82, 118, 0.06) 0, transparent 40%);
    pointer-events: none;
}

/* ---------- Conteneur principal ---------- */
.timeline-horizontal {
    position: relative;
    margin: 70px 10px 30px;
    padding: 0 45px 60px;      /* padding latéral : laisse la place aux épingles d'extrémité */
}

/* Piste interne : les épingles et le rail sont positionnés en % de CETTE zone
   (largeur = largeur du conteneur moins les 2×45px de padding). Ainsi le repère
   de naissance (0%) et le repère d'aujourd'hui (100%) restent dans le conteneur. */
.tl-track {
    position: relative;
    min-height: 620px;
}

/* La ligne de temps (le rail) */
.tl-track::before {
    content: '';
    position: absolute;
    top: 340px;                /* aligne sur le centre des epingles */
    left: 0;
    right: 0;
    height: 4px;
    border-radius: 4px;
    background: linear-gradient(90deg, #c9a227 0%, #1a5276 100%);
    opacity: 0.85;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset;
}

/* ---------- Epingles (marqueurs) ---------- */
.tl-pin {
    position: absolute;
    top: 340px;                /* centre de la ligne (rail à top:340px) */
    left: 0;
    transform: translateX(-50%) translateY(-50%) translateY(var(--pin-offset, 0px));
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    z-index: 2;
    transition: transform 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}

.tl-pin-dot {
    position: relative;
    width: var(--pin-size, 44px);
    height: var(--pin-size, 44px);
    border-radius: 50%;
    background: var(--surface);
    border: 3px solid var(--cat-color, #c9a227);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18), 0 0 0 4px rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(var(--pin-size, 44px) * 0.46);
    line-height: 1;
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.tl-pin-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
    background: rgba(255, 255, 255, 0.85);
    padding: 2px 8px;
    border-radius: 20px;
    white-space: nowrap;
    letter-spacing: 0.02em;
    transition: color 0.25s ease, background 0.25s ease;
}

/* Badge "Hot" collé au libellé d'une pastille majeure */
.tl-hot-badge {
    display: inline-block;
    margin-left: 5px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    padding: 1px 6px;
    border-radius: 10px;
    vertical-align: middle;
    box-shadow: 0 1px 4px rgba(231, 76, 60, 0.4);
}

[dir="rtl"] .tl-hot-badge {
    margin-left: 0;
    margin-right: 5px;
}

/* Badge "Bucaille" : encadré bleu marine pour les thèmes détaillés
   dans « La Bible, le Coran et la Science » (Maurice Bucaille, 1976) */
.tl-bucaille-badge {
    display: inline-block;
    margin-left: 5px;
    font-size: 9px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #fff;
    background: linear-gradient(135deg, #1a5276, #154360);
    padding: 1px 6px;
    border-radius: 10px;
    vertical-align: middle;
    box-shadow: 0 1px 4px rgba(26, 82, 118, 0.4);
}

[dir="rtl"] .tl-bucaille-badge {
    margin-left: 0;
    margin-right: 5px;
}

/* ---------- Pins "Bucaille" (thèmes détaillés par Maurice Bucaille) ---------- */
/* Encadré bleu marine autour de la pastille pour signaler le lien avec le livre */
.tl-pin.is-bucaille .tl-pin-dot {
    box-shadow: 0 0 0 3px rgba(26, 82, 118, 0.35), 0 6px 16px rgba(26, 82, 118, 0.4);
    border-color: #1a5276;
}

.tl-pin.is-bucaille .tl-pin-label {
    font-weight: 700;
    color: #154360;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(26, 82, 118, 0.35);
    padding: 3px 9px;
}

/* Si un pin est à la fois "Hot" et "Bucaille", le bleu marine reste visible
   en bordure mais on conserve l'anneau pulsant rouge du "Hot" */
.tl-pin.is-hot.is-bucaille .tl-pin-dot {
    border-color: #1a5276;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.35), 0 0 0 6px rgba(26, 82, 118, 0.25), 0 6px 16px rgba(26, 82, 118, 0.4);
}

/* ---------- Pins "Hot" (decouvertes scientifiques majeures) ---------- */
/* Pastille nettement agrandie, entourée d'un anneau de couleur vive qui pulse */
.tl-pin.is-hot .tl-pin-dot {
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.35), 0 6px 16px rgba(231, 76, 60, 0.45);
    transform: scale(1.35);
    border-color: #e74c3c;
}

.tl-pin.is-hot .tl-pin-label {
    font-weight: 800;
    color: #c0392b;
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(231, 76, 60, 0.3);
    padding: 3px 9px;
}

.tl-pin.is-hot .tl-pin-dot::after {
    content: '';
    position: absolute;
    inset: -7px;
    border-radius: 50%;
    border: 3px solid rgba(231, 76, 60, 0.6);
    animation: tl-hot-pulse 2s ease-in-out infinite;
}

@keyframes tl-hot-pulse {
    0%, 100% { transform: scale(1); opacity: 0.9; }
    50% { transform: scale(1.22); opacity: 0.35; }
}

/* Au survol, un pin "Hot" grossit encore plus pour attirer le clic */
.tl-pin.is-hot:hover .tl-pin-dot {
    transform: scale(1.5);
    box-shadow: 0 0 0 4px rgba(231, 76, 60, 0.45), 0 10px 26px rgba(231, 76, 60, 0.55);
}

/* Epingles speciales debut / fin */
.tl-pin-start .tl-pin-dot,
.tl-pin-end .tl-pin-dot {
    border-width: 3px;
}

.tl-pin-start .tl-pin-dot {
    border-color: #c9a227;
    background: linear-gradient(145deg, #fff8e1, #f5e6b8);
}

.tl-pin-end .tl-pin-dot {
    border-color: #1a5276;
    background: linear-gradient(145deg, #eaf2f8, #d4e6f1);
}

/* ---------- Repère prophétique : pastille dorée + libellé lisible (570 → 632) ---------- */
/* Pastille dorée avec icône 🕌 (taille standard, comme les autres épingles) */
.tl-pin-start .tl-pin-dot {
    border-color: #c9a227;
    background: linear-gradient(145deg, #fff8e1, #e8c96a);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18), 0 0 0 4px rgba(255, 255, 255, 0.5), 0 0 0 2px rgba(201, 162, 39, 0.35);
}

/* Libellé du repère prophétique : ancré à gauche du point pour ne pas
   déborder hors du conteneur (le point start est à l'extrême gauche).
   Le .tl-pin est décalé de translateX(-50%), donc left:0 = centre du point. */
.tl-pin-start .tl-pin-label {
    position: absolute;
    left: 0;
    top: calc(100% + 10px);
    background: linear-gradient(160deg, #fffdf5, #fdf6e3);
    border: 1px solid rgba(201, 162, 39, 0.45);
    color: #8a6d1a;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

/* Date de naissance mise en évidence dans le libellé du repère prophétique */
.tl-pin-start .tl-pin-year {
    display: inline-block;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 12px;
    background: linear-gradient(135deg, #c9a227, #a8841c);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.03em;
    vertical-align: middle;
    box-shadow: 0 2px 6px rgba(201, 162, 39, 0.4);
}

[dir="rtl"] .tl-pin-start .tl-pin-year {
    margin-left: 0;
    margin-right: 6px;
}

/* En arabe (RTL) : le point start reste physiquement à gauche (left:0%),
   le libellé s'étend donc vers la droite comme en LTR. Seul le texte
   s'aligne à droite pour la lecture arabe. */
[dir="rtl"] .tl-pin-start .tl-pin-label {
    text-align: right;
}

/* Libellé du repère prophétique réduit à la seule date (sans texte) :
   on retire le fond crème pour ne garder que le badge doré de l'année,
   plus grand et plus lisible. */
.tl-pin-start .tl-pin-label.tl-pin-start-label {
    background: transparent;
    border: none;
    box-shadow: none;
    padding: 0;
    top: calc(100% + 8px);
}

.tl-pin-start .tl-pin-start-label .tl-pin-year {
    margin-left: 0;
    padding: 3px 12px;
    font-size: 13px;
    border-radius: 14px;
    box-shadow: 0 3px 10px rgba(201, 162, 39, 0.45);
}

[dir="rtl"] .tl-pin-start .tl-pin-start-label .tl-pin-year {
    margin-right: 0;
}

/* ---------- Interaction au survol ---------- */
.tl-pin:hover {
    z-index: 5;
}

.tl-pin:hover .tl-pin-dot {
    transform: scale(1.22);
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.25), 0 0 0 6px rgba(255, 255, 255, 0.7);
}

.tl-pin:hover .tl-pin-label {
    color: var(--cat-color, #c9a227);
    background: #fff;
    font-weight: 700;
}

/* Focus clavier (accessibilite) */
.tl-pin:focus-visible {
    outline: 3px solid var(--cat-color, #c9a227);
    outline-offset: 4px;
    border-radius: 8px;
}

/* ---------- Carte d'information flottante ---------- */
.tl-card {
    position: absolute;
    top: 0;                    /* position verticale gérée par le JS */
    left: 0;
    width: 300px;
    max-width: 82vw;
    background: var(--surface, #fff);
    border-radius: 16px;
    padding: 18px 20px 16px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22), 0 4px 14px rgba(0, 0, 0, 0.12);
    border: 1px solid rgba(201, 162, 39, 0.25);
    border-top: 4px solid var(--cat-color, #c9a227);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.96);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
    z-index: 20;
    pointer-events: none;
}

.tl-card.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* Fleche pointant vers l'epingle (carte au-dessus de l'epingle) */
.tl-card-arrow {
    position: absolute;
    bottom: -8px;
    left: 50%;
    width: 16px;
    height: 16px;
    background: var(--surface, #fff);
    border-right: 1px solid rgba(201, 162, 39, 0.25);
    border-bottom: 1px solid rgba(201, 162, 39, 0.25);
    transform: translateX(-50%) rotate(45deg);
}

/* Carte placee EN DESSOUS de l'epingle : la fleche pointe vers le haut */
.tl-card.below {
    border-top: 1px solid rgba(201, 162, 39, 0.25);
    border-bottom: 4px solid var(--cat-color, #c9a227);
}
.tl-card.below .tl-card-arrow {
    top: -8px;
    bottom: auto;
    border-right: 1px solid rgba(201, 162, 39, 0.25);
    border-bottom: none;
    border-top: 1px solid rgba(201, 162, 39, 0.25);
    border-left: 1px solid rgba(201, 162, 39, 0.25);
    transform: translateX(-50%) rotate(45deg);
}

.tl-card-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.tl-card-year {
    font-family: 'Playfair Display', serif;
    font-weight: 700;
    font-size: 15px;
    color: var(--cat-color, #c9a227);
}

.tl-card-century {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted, #6b7280);
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 8px;
    border-radius: 20px;
}

.tl-card-cat {
    font-size: 11px;
    font-weight: 600;
    color: #fff;
    background: var(--cat-color, #c9a227);
    padding: 2px 9px;
    border-radius: 20px;
    white-space: nowrap;
}

.tl-card-title {
    font-family: 'Playfair Display', serif;
    font-size: 17px;
    line-height: 1.35;
    margin: 0 0 8px;
    color: var(--heading-color, #1f2937);
}

.tl-card-excerpt {
    font-size: 13px;
    line-height: 1.55;
    color: var(--text-muted, #6b7280);
    margin: 0 0 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tl-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--cat-color, #c9a227);
    text-decoration: none;
    transition: gap 0.2s ease;
}

.tl-card-link:hover {
    gap: 10px;
    text-decoration: underline;
}

/* Pont invisible entre l'epingle et la carte : permet a la souris de
   traverser le gap sans declencher la fermeture de la carte */
.tl-bridge {
    pointer-events: auto;
    background: transparent;
}

/* Carte sans lien (reperes debut/fin) : masquer le lien */
.tl-card.no-link .tl-card-link {
    display: none;
}

/* ---------- Indice / legende ---------- */
.timeline-hint {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted, #6b7280);
    margin: 10px 0 0;
    opacity: 0.85;
}

.timeline-hint i {
    margin-right: 6px;
    color: #c9a227;
}

/* ---------- Legende (echelle logarithmique) ---------- */
.timeline-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px 18px;
    margin: 16px auto 0;
    max-width: 900px;
    font-size: 12.5px;
    color: var(--text-muted, #6b7280);
    line-height: 1.5;
    background: rgba(255, 255, 255, 0.6);
    border: 1px solid rgba(201, 162, 39, 0.18);
    border-radius: 12px;
    padding: 10px 18px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.timeline-legend .lg-title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 800;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8a6d1a;
    padding-right: 14px;
    border-right: 1px solid rgba(201, 162, 39, 0.25);
}

.timeline-legend .lg-title i {
    color: #c9a227;
}

.timeline-legend .lg-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.timeline-legend .lg-scale {
    display: inline-flex;
    align-items: center;
    gap: 2px;
}

.timeline-legend .lg-scale .seg {
    width: 22px;
    height: 7px;
    border-radius: 2px;
}

.timeline-legend .lg-scale .seg.s1 { background: #d8c9a0; }
.timeline-legend .lg-scale .seg.s2 { background: #c9a227; }
.timeline-legend .lg-scale .seg.s3 { background: #8a6d1f; }

/* Echantillon du badge "Hot" dans la legende */
.timeline-legend .lg-hot-sample {
    display: inline-flex;
    align-items: center;
}

.timeline-legend .lg-hot-sample .tl-hot-badge {
    font-size: 10px;
    padding: 2px 8px;
}

/* Echantillon du badge "Bucaille" dans la legende */
.timeline-legend .lg-bucaille-sample {
    display: inline-flex;
    align-items: center;
}

.timeline-legend .lg-bucaille-sample .tl-bucaille-badge {
    font-size: 10px;
    padding: 2px 8px;
}

/* RTL : la barre de separation du titre passe a gauche */
html[dir="rtl"] .timeline-legend .lg-title {
    padding-right: 0;
    padding-left: 14px;
    border-right: none;
    border-left: 1px solid rgba(201, 162, 39, 0.25);
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
    .timeline-horizontal {
        margin: 60px 6px 20px;
        overflow-x: auto;
        overflow-y: visible;
        padding-bottom: 20px;
        -webkit-overflow-scrolling: touch;
    }

    .tl-pin-dot {
        width: var(--pin-size, 38px);
        height: var(--pin-size, 38px);
        font-size: calc(var(--pin-size, 38px) * 0.46);
    }

    .tl-pin-start .tl-pin-dot,
    .tl-pin-end .tl-pin-dot {
        font-size: calc(var(--pin-size, 44px) * 0.46);
    }

    .tl-card {
        width: 260px;
    }
}

/* ---------- Gestion RTL ---------- */
html[dir="rtl"] .tl-pin {
    transform: translateX(50%) translateY(-50%) translateY(var(--pin-offset, 0px));
}

html[dir="rtl"] .tl-card-arrow {
    border-right: none;
    border-left: 1px solid rgba(201, 162, 39, 0.25);
}

html[dir="rtl"] .timeline-hint i {
    margin-right: 0;
    margin-left: 6px;
}

/* ---------- Preference mouvement reduit ---------- */
@media (prefers-reduced-motion: reduce) {
    .tl-pin,
    .tl-pin-dot,
    .tl-card {
        transition: none !important;
    }
    .tl-pin.is-hot .tl-pin-dot::after {
        animation: none !important;
    }
}
