/* design-system.css */
/**
 * MOUSTAQIM.COM - DESIGN SYSTEM
 * Palette Kaaba : Or (#d4af37), Noir (#1a1a1a), Blanc (#ffffff)
 * Support Dark Mode
 *
 * Ce fichier NE modifie PAS les styles existants de site.css
 * Il fournit uniquement les variables CSS et des classes utilitaires prefixées
 */

/* ========================================
   VARIABLES CSS (disponibles partout)
   ======================================== */

:root {
    /* Couleurs Kaaba - Light Mode (fond blanc → or foncé) */
    --color-gold: #8B6508;
    --color-gold-light: #d4af37;
    --color-gold-dark: #6A4D06;
    --color-black: #1a1a1a;
    --color-black-light: #2a2a2a;
    --color-white: #ffffff;
    --color-cream: #faf9f6;

    /* Couleurs sémantiques - Light Mode */
    --color-background: #faf9f6;
    --color-surface: #ffffff;
    --color-text-primary: #1a1a1a;
    --color-text-secondary: #4a4a4a;
    --color-text-muted: #8a8a8a;
    --color-border: #d2d2d7;
    --color-shadow: rgba(0, 0, 0, 0.1);

    /* Couleurs de statut */
    --color-success: #b8941f;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    --color-info: #4b5563;

    /* Typographie - Inter pour le latin, Amiri pour l'arabe */
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-secondary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-arabic: 'Amiri', 'Traditional Arabic', serif;

    /* Tailles de police - WCAG 2.1 AAA Optimal */
    --text-xs: 12px;      /* Badges, labels (minimum absolu) */
    --text-sm: 14px;      /* Petit texte secondaire */
    --text-base: 16px;    /* Corps de texte */
    --text-md: 20px;      /* Texte arabe corps - minimum Amiri */
    --text-lg: 20px;      /* Sous-titres */
    --text-xl: 22px;      /* H4 */
    --text-2xl: 26px;     /* H3 */
    --text-3xl: 32px;     /* H2 */
    --text-4xl: 40px;     /* H1 */
    --text-5xl: 48px;     /* H1 Hero */

    /* Line-heights - WCAG 1.5 minimum pour corps */
    --line-height-tight: 1.3;    /* Titres */
    --line-height-normal: 1.6;   /* Corps de texte */
    --line-height-relaxed: 1.8;  /* Texte arabe */
    --line-height-loose: 2.0;    /* Grande lisibilité */

    /* Letter-spacing - WCAG 0.12em pour accessibilité */
    --tracking-tight: -0.01em;
    --tracking-normal: 0;
    --tracking-wide: 0.05em;
    --tracking-wider: 0.1em;

    /* Espacements */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    --space-16: 64px;

    /* Rayons de bordure - Style strict et professionnel */
    --radius-sm: 0;
    --radius-md: 2px;
    --radius-lg: 3px;
    --radius-xl: 4px;
    --radius-2xl: 6px;
    --radius-full: 9999px;

    /* Ombres */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
    --shadow-gold: 0 4px 20px rgba(212, 175, 55, 0.35);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);

    /* Layout */
    --header-height: 70px;
    --max-width: 1280px;
    --content-width: 800px;
}

/* ========================================
   DARK MODE VARIABLES
   ======================================== */

[data-theme="dark"] {
    --color-background: #121212;
    --color-surface: #1e1e1e;
    --color-text-primary: #f5f5f5;
    --color-text-secondary: #c0c0c0;
    --color-text-muted: #909090;
    --color-border: #333333;
    --color-shadow: rgba(0, 0, 0, 0.4);

    /* Or lumineux en dark mode (fond noir → or clair) */
    --color-gold: #E8B84B;
    --color-gold-light: #F5D98A;
    --color-gold-dark: #C9901A;
}

/* Dark mode - ajustements globaux */
[data-theme="dark"] body {
    background-color: var(--color-background);
    color: var(--color-text-primary);
}

[data-theme="dark"] #contenu,
[data-theme="dark"] .methode {
    background-color: var(--color-surface);
    border-color: var(--color-border);
}

[data-theme="dark"] h1 {
    background-color: var(--color-surface);
}

[data-theme="dark"] .date {
    background-color: var(--color-surface);
}

[data-theme="dark"] #footer {
    background-color: var(--color-black);
    color: var(--color-text-secondary);
}

/* ========================================
   CLASSES UTILITAIRES (prefixées mq-)
   ======================================== */

/* Conteneur */
.mq-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

/* Grilles */
.mq-grid {
    display: grid;
    gap: var(--space-6);
}

.mq-grid-2 { grid-template-columns: repeat(2, 1fr); }
.mq-grid-3 { grid-template-columns: repeat(3, 1fr); }
.mq-grid-4 { grid-template-columns: repeat(4, 1fr); }

/* Flexbox */
.mq-flex { display: flex; }
.mq-flex-center { display: flex; align-items: center; justify-content: center; }
.mq-flex-between { display: flex; align-items: center; justify-content: space-between; }
.mq-flex-col { flex-direction: column; }
.mq-gap-2 { gap: var(--space-2); }
.mq-gap-4 { gap: var(--space-4); }
.mq-gap-6 { gap: var(--space-6); }

/* ========================================
   COMPOSANTS MODERNES (prefixés mq-)
   ======================================== */

/* Boutons */
.mq-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-6);
    font-size: var(--text-base);
    font-weight: 600;
    font-family: var(--font-primary);
    text-decoration: none;
    border: none;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all var(--transition-fast);
}

/* Plus de fond doré + texte noir : bouton noir + texte blanc (demande Samir) */
.mq-btn-gold {
    background: var(--color-black);
    color: var(--color-white);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.mq-btn-gold:hover {
    transform: translateY(-2px);
    background: var(--color-black-light);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
    color: var(--color-white);
}

.mq-btn-dark {
    background-color: var(--color-black);
    color: var(--color-white);
}

.mq-btn-dark:hover {
    background-color: var(--color-black-light);
}

.mq-btn-outline {
    background: transparent;
    color: var(--color-gold);
    border: 2px solid var(--color-gold);
}

.mq-btn-outline:hover {
    background: var(--color-black);
    color: var(--color-white);
    border-color: var(--color-black);
}

/* Cartes */
.mq-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-xl);
    padding: var(--space-6);
    box-shadow: var(--shadow-md);
    transition: all var(--transition-fast);
}

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

.mq-card-gold {
    border-top: 4px solid var(--color-gold);
}

.mq-card-gold:hover {
    box-shadow: var(--shadow-gold);
}

/* Badges */
.mq-badge {
    display: inline-flex;
    align-items: center;
    padding: var(--space-1) var(--space-3);
    font-size: var(--text-xs);
    font-weight: 600;
    border-radius: var(--radius-full);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mq-badge-gold {
    background: rgba(212, 175, 55, 0.15);
    color: var(--color-gold);
}

.mq-badge-dark {
    background: var(--color-black);
    color: var(--color-white);
}

/* Inputs */
.mq-input {
    width: 100%;
    padding: var(--space-3) var(--space-4);
    font-size: var(--text-base);
    font-family: var(--font-primary);
    color: var(--color-text-primary);
    background: var(--color-surface);
    border: 2px solid var(--color-border);
    border-radius: var(--radius-lg);
    transition: all var(--transition-fast);
}

.mq-input:focus {
    outline: none;
    border-color: var(--color-gold);
    box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.15);
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes mq-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes mq-slideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.mq-fade-in { animation: mq-fadeIn var(--transition-normal) ease-in; }
.mq-slide-up { animation: mq-slideUp var(--transition-normal) ease-out; }
.mq-pulse { animation: mq-pulse 2s infinite; }

/* ========================================
   TYPOGRAPHIE ACCESSIBLE (WCAG 2.1 AAA)
   ======================================== */

/* Corps de texte - minimum 16px, line-height 1.6 */
body {
    font-size: var(--text-base);
    line-height: var(--line-height-normal);
    letter-spacing: var(--tracking-normal);
}

p {
    font-size: var(--text-base);
    line-height: var(--line-height-normal);
    margin-bottom: 1em;
}

/* Titres - Hiérarchie claire avec line-height adapté */
h1 {
    font-size: var(--text-4xl);
    line-height: var(--line-height-tight);
    letter-spacing: var(--tracking-tight);
    margin-bottom: 0.5em;
}

h2 {
    font-size: var(--text-3xl);
    line-height: var(--line-height-tight);
    letter-spacing: var(--tracking-tight);
    margin-bottom: 0.5em;
}

h3 {
    font-size: var(--text-2xl);
    line-height: var(--line-height-tight);
    margin-bottom: 0.5em;
}

h4 {
    font-size: var(--text-xl);
    line-height: var(--line-height-tight);
    margin-bottom: 0.5em;
}

h5 {
    font-size: var(--text-lg);
    line-height: var(--line-height-tight);
    margin-bottom: 0.5em;
}

h6 {
    font-size: var(--text-md);
    line-height: var(--line-height-tight);
    margin-bottom: 0.5em;
}

/* Texte arabe - Line-height plus grand pour lisibilité */
[lang="ar"] body,
[lang="ar"] p,
[dir="rtl"] body,
[dir="rtl"] p,
.arabic {
    font-family: var(--font-arabic);
    font-size: var(--text-md);
    line-height: var(--line-height-relaxed);
}

/* Headings et listes arabes - Police Amiri */
[lang="ar"] h1, [lang="ar"] h2, [lang="ar"] h3, [lang="ar"] h4, [lang="ar"] h5, [lang="ar"] h6,
[dir="rtl"] h1, [dir="rtl"] h2, [dir="rtl"] h3, [dir="rtl"] h4, [dir="rtl"] h5, [dir="rtl"] h6,
[lang="ar"] ul, [lang="ar"] ol, [lang="ar"] li,
[dir="rtl"] ul, [dir="rtl"] ol, [dir="rtl"] li {
    font-family: var(--font-arabic);
}

[lang="ar"] h1,
[dir="rtl"] h1 {
    font-size: var(--text-4xl);
    line-height: 1.4;
}

[lang="ar"] h2,
[dir="rtl"] h2 {
    font-size: var(--text-3xl);
    line-height: 1.4;
}

[lang="ar"] h3,
[dir="rtl"] h3 {
    font-size: var(--text-2xl);
    line-height: 1.4;
}

/* Listes - Espacement accessible */
ul, ol {
    font-size: var(--text-base);
    line-height: var(--line-height-normal);
    margin-bottom: 1em;
}

li {
    margin-bottom: 0.5em;
}

/* Liens - Taille minimale cliquable 44x44px (WCAG touch target) */
a {
    font-size: inherit;
    line-height: inherit;
}

/* Accessibilité - Focus visible */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 3px solid var(--color-gold);
    outline-offset: 2px;
}

/* Skip to content - Accessibilité clavier */
.skip-to-content {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.skip-to-content:focus {
    position: fixed;
    top: 10px;
    left: 10px;
    width: auto;
    height: auto;
    padding: var(--space-4) var(--space-6);
    background: var(--color-black);
    color: var(--color-white);
    font-size: var(--text-base);
    z-index: 9999;
}

/* ========================================
   RESPONSIVE
   ======================================== */

@media (max-width: 768px) {
    :root {
        --header-height: 60px;
        /* Tailles responsive - toujours accessibles */
        --text-4xl: 28px;     /* H1 mobile */
        --text-3xl: 24px;     /* H2 mobile */
        --text-2xl: 20px;     /* H3 mobile */
        --text-xl: 18px;      /* H4 mobile */
        --text-5xl: 32px;     /* H1 Hero mobile */
    }

    .mq-grid-2,
    .mq-grid-3,
    .mq-grid-4 {
        grid-template-columns: 1fr;
    }

    .mq-container {
        padding: 0 var(--space-4);
    }

    .mq-hide-mobile {
        display: none !important;
    }

    /* Typographie mobile - maintient 16px minimum */
    h1 { font-size: var(--text-4xl); }
    h2 { font-size: var(--text-3xl); }
    h3 { font-size: var(--text-2xl); }
    h4 { font-size: var(--text-xl); }

    /* Arabe mobile */
    [lang="ar"] h1,
    [dir="rtl"] h1 {
        font-size: var(--text-4xl);
    }

    [lang="ar"] h2,
    [dir="rtl"] h2 {
        font-size: var(--text-3xl);
    }

    [lang="ar"] h3,
    [dir="rtl"] h3 {
        font-size: var(--text-2xl);
    }
}

@media (min-width: 769px) {
    .mq-hide-desktop {
        display: none !important;
    }
}

/* ========================================
   RTL SUPPORT (Right-to-Left Languages)
   Arabic, Urdu, Persian, Hebrew
   ======================================== */

/* Base RTL - Text alignment */
[dir="rtl"] {
    text-align: right;
}

[dir="rtl"] body {
    direction: rtl;
}

/* RTL - Typography */
[dir="rtl"] .arabic,
[dir="rtl"] [lang="ar"],
[dir="rtl"] [lang="ur"],
[dir="rtl"] [lang="fa"] {
    font-family: var(--font-arabic);
    line-height: 1.8;
}

/* RTL - Flexbox reversal */
[dir="rtl"] .mq-flex,
[dir="rtl"] .mq-flex-between,
[dir="rtl"] .flex,
[dir="rtl"] .share-buttons,
[dir="rtl"] .legend,
[dir="rtl"] .navigation,
[dir="rtl"] .breadcrumb,
[dir="rtl"] .white-days-list {
    flex-direction: row-reverse;
}

[dir="rtl"] .mq-flex-col {
    flex-direction: column; /* Keep vertical */
}

/* RTL - Margins & Paddings swap */
[dir="rtl"] .mq-btn {
    flex-direction: row-reverse;
}

[dir="rtl"] .legend-color {
    margin-right: 0;
    margin-left: 12px;
}

[dir="rtl"] .month-num {
    margin-right: 0;
    margin-left: 10px;
}

/* RTL - Borders swap (left border -> right border) */
[dir="rtl"] .months-list li {
    border-left: none;
    border-right: 3px solid var(--color-gold);
}

[dir="rtl"] .months-list li.sacred {
    border-left: none;
    border-right-width: 5px;
}

[dir="rtl"] .fasting-day {
    border-left: none !important;
    border-right: 3px solid #b8941f !important;
}

[dir="rtl"] .mq-card-gold {
    border-top: 4px solid var(--color-gold);
}

/* RTL - Lists */
[dir="rtl"] ul,
[dir="rtl"] ol {
    padding-left: 0;
    padding-right: 20px;
}

[dir="rtl"] .prenom-toc-list {
    padding-right: 25px;
}

/* RTL - Breadcrumb */
[dir="rtl"] .breadcrumb {
    flex-direction: row-reverse;
}

[dir="rtl"] .breadcrumb-separator {
    transform: scaleX(-1); /* Flip arrow */
}

/* RTL - Navigation arrows */
[dir="rtl"] .nav-link[data-month] {
    /* Swap prev/next visual direction */
}

[dir="rtl"] .navigation a:first-of-type::before {
    content: '▶'; /* Right arrow for "previous" */
}

[dir="rtl"] .navigation a:last-of-type::after {
    content: '◀'; /* Left arrow for "next" */
}

/* RTL - Gradients (swap direction) */
[dir="rtl"] .next-event-widget::before {
    background: linear-gradient(270deg, var(--color-gold) 0%, transparent 100%);
}

/* RTL - Form inputs */
[dir="rtl"] .mq-input,
[dir="rtl"] input,
[dir="rtl"] textarea,
[dir="rtl"] select {
    text-align: right;
}

[dir="rtl"] input[type="search"] {
    padding-right: var(--space-4);
    padding-left: var(--space-10);
}

/* RTL - Tables */
[dir="rtl"] table {
    direction: rtl;
}

[dir="rtl"] th,
[dir="rtl"] td {
    text-align: right;
}

[dir="rtl"] .calendar-container th,
[dir="rtl"] .calendar-container td {
    text-align: center; /* Calendar stays centered */
}

/* RTL - Cards with side accent */
[dir="rtl"] .prenom-section {
    border-left: none;
    border-right: 4px solid var(--color-gold);
    padding-left: 0;
    padding-right: var(--space-6);
}

/* RTL - Floating elements */
[dir="rtl"] .float-left {
    float: right;
}

[dir="rtl"] .float-right {
    float: left;
}

/* RTL - Icons with text */
[dir="rtl"] .icon-text {
    flex-direction: row-reverse;
}

[dir="rtl"] .icon-text svg,
[dir="rtl"] .icon-text img {
    margin-left: var(--space-2);
    margin-right: 0;
}

/* RTL - Share buttons */
[dir="rtl"] .share-widget {
    flex-direction: row-reverse;
}

[dir="rtl"] .share-label {
    margin-left: var(--space-4);
    margin-right: 0;
}

/* RTL - Print section */
[dir="rtl"] .print-section {
    flex-direction: row-reverse;
}

/* RTL - White days widget */
[dir="rtl"] .white-days-widget h4 {
    text-align: center;
}

/* RTL - Next event widget */
[dir="rtl"] .next-event-widget {
    text-align: center; /* Keep centered */
}

/* RTL - Prenom page specific */
[dir="rtl"] .prenom-hero {
    text-align: center;
}

[dir="rtl"] .prenom-meta {
    flex-direction: row-reverse;
    justify-content: center;
}

[dir="rtl"] .prenom-toc {
    text-align: right;
}

[dir="rtl"] .badge {
    margin-left: var(--space-2);
    margin-right: 0;
}

/* RTL - Grid (no change needed, auto-adapts) */

/* RTL - Specific fixes for prayer times */
[dir="rtl"] .prayer-times-table th:first-child,
[dir="rtl"] .prayer-times-table td:first-child {
    text-align: right;
}

[dir="rtl"] .method-selector {
    flex-direction: row-reverse;
}

[dir="rtl"] .method-selector label {
    margin-left: var(--space-4);
    margin-right: 0;
}

/* RTL - Ramadan table */
[dir="rtl"] .ramadan-table {
    direction: rtl;
}

/* RTL - Footer */
[dir="rtl"] #footer,
[dir="rtl"] footer {
    text-align: right;
}

[dir="rtl"] .footer-links {
    flex-direction: row-reverse;
}

/* RTL - Menu / Navigation */
[dir="rtl"] nav ul {
    flex-direction: row-reverse;
}

[dir="rtl"] .dropdown-menu {
    left: auto;
    right: 0;
}

/* RTL - Responsive adjustments */
@media (max-width: 768px) {
    [dir="rtl"] .mq-flex,
    [dir="rtl"] .share-buttons {
        flex-direction: column;
    }

    [dir="rtl"] .navigation {
        flex-direction: column;
    }

    [dir="rtl"] .share-widget {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* site.css */
body{font-family:'Inter',-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;font-size:16px;background-color:var(--color-background, #faf9f6);line-height:1.5;padding:0;margin:0;display:grid;}

/* marges horizontales des p/H supprimees (regle 20/09 : le rythme horizontal vient du padding de #contenu) */

/* ===========================================================
   H1 - STYLE UNIQUE & UNIFORME sur 100% du site (carte champagne centrée)
   Ne JAMAIS surcharger h1 par page : un seul rendu partout.
   Marquage recommandé : <header class="sahabi-header"><h1>…</h1></header>
   (le wrapper est optionnel, le style vit sur h1 lui-même)
   =========================================================== */
h1 {
    font-family: var(--font-primary, Georgia);
    font-size: 2em;
    font-weight: 700;
    color: var(--color-black, #1a1a1a);
    display: block;
    text-align: center;
    margin: 0 0 30px;
    padding: 0.25em;
    background: linear-gradient(135deg, #fffdf5 0%, #fef9e7 100%);
    border: 1px solid #e8d99a;
    border-radius: 12px;
    line-height: 1.4;
}

h2 {
    font-family: var(--font-primary, Georgia);
    font-size: 16pt;
    font-weight: 600;
    color: var(--color-black, #1a1a1a);
    display: block;
    width: fit-content;
    max-width: 100%;
    margin: 2rem 0 1rem;
    padding: 0 0 8px;
    border-bottom: 2px solid var(--color-gold, #d4af37);
}

h3 {
    font-family: var(--font-primary, Georgia);
    font-size: 14pt;
    font-weight: 600;
    color: var(--color-black, #1a1a1a);
    display: block;
    margin: 0;
    padding-bottom: 5px;
}

h4 {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-black, #1a1a1a);
    display: block;
    margin: 15px 0 0;
}

/* ===========================================================
   CARDS - habillage UNIQUE sur tout le site (fond, bordure, rayon, hover).
   Le layout (display/flex/padding/gap) reste géré par chaque carte ;
   seul le "skin" est mutualisé ici pour un rendu identique partout.
   =========================================================== */
.card,
.prenom-card, .module-card, .link-card, .pillar-card, .terme-card,
.term-card, .category-card, .sahabi-card, .fitr-card, .related-card,
.tool-card, .result-card, .definition-card, .city-card, .dates-card,
.nisab-card, .prenom-link-card, .verset-card, .quran-verse-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.card:hover,
.prenom-card:hover, .module-card:hover, .link-card:hover, .pillar-card:hover, .terme-card:hover,
.term-card:hover, .category-card:hover, .sahabi-card:hover, .fitr-card:hover, .related-card:hover,
.tool-card:hover, .result-card:hover, .definition-card:hover, .city-card:hover, .dates-card:hover,
.nisab-card:hover, .prenom-link-card:hover, .verset-card:hover, .quran-verse-card:hover {
    border-color: #d4af37;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* Dark mode titres */
[data-theme="dark"] h1,
[data-theme="dark"] h2,
[data-theme="dark"] h4 {
    color: var(--color-text-primary, #f5f5f5);
    background: var(--color-surface, #1e1e1e);
}
[data-theme="dark"] h3 {
    color: var(--color-gold, #D4A520);
}

/* Mise à jour - petite mention discrète (toutes langues, y compris AR) */
.last-update,
[dir="rtl"] #contenu .last-update-wrapper .last-update,
[dir="rtl"] #contenu .last-update {
    font-size: 1rem !important;
    line-height: 1.4 !important;
    color: #6b6b6b;
    text-align: end;
    margin: 0;
}

[data-theme="dark"] .last-update {
    color: #999;
}

/* Wrapper date + temps de lecture (rendu central : inc/base/last-update.php) */
.last-update-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin: 1.5rem 0;
    padding: 0 1rem;
}
.reading-time-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    padding: 0;
    border-radius: 0;
    color: #888;
    font-size: 1rem;
    font-weight: normal;
    white-space: nowrap;
}
[data-theme="dark"] .reading-time-badge {
    color: #999;
}

/* ===========================================================
   CARD HADITH - style UNIQUE sur tout le site (citations + source)
   Marquage : <blockquote class="hadith">…texte… <span class="hadith-src">رواه …</span></blockquote>
   =========================================================== */
.hadith {
    margin: 16px 0;
    padding: 16px 20px;
    background: #faf9f6;
    border: 1px solid #ececec;
    border-inline-start: 4px solid var(--color-gold, #d4af37);
    border-radius: 8px;
    line-height: 1.9;
    font-style: italic;
    color: #333;
}
[dir="rtl"] .hadith {
    font-family: 'Amiri', 'Traditional Arabic', serif;
    font-style: normal;
    font-size: 1.375rem;
    line-height: 2;
}
.hadith .hadith-src {
    display: block;
    margin-top: 8px;
    font-size: 0.85rem;
    color: #8b7320;
    font-style: normal;
}
/* Formule arabe + phonétique à l'intérieur d'un hadith (page FR/EN) */
.hadith .hadith-ar {
    display: block;
    font-family: 'Scheherazade New', 'Amiri Quran', 'Amiri', serif;
    font-size: 1.375rem;
    line-height: 2;
    direction: rtl;
    text-align: right;
    font-style: normal;
    margin-bottom: 8px;
}
.hadith .hadith-ph {
    display: block;
    font-style: normal;
    margin-bottom: 8px;
}
[data-theme="dark"] .hadith { background: #1e1e1e; border-color: #333; color: #ddd; }

/* Citation de verset coran (traduction FR/EN) dans les fiches — distinct du composant hadith */
.quran-quote { margin: 16px 0; padding: 16px 20px; background: #fffdf6; border: 1px solid #e8d99a; border-inline-start: 3px solid #d4af37; border-radius: 8px; }
.quran-quote .quran-ref { display: block; margin-top: 8px; color: #8b7320; font-weight: 600; font-size: .9rem; }
[data-theme="dark"] .quran-quote { background: #1e1e1e; border-color: #333; }
[data-theme="dark"] .quran-quote .quran-ref { color: #e8d99a; }
/* Ligne arabe uthmani dans quran-quote (fiches glossaire) : RTL + typo Coran, mark or sur le terme.
   Règle [dir="rtl"] en (0,3,0) pour battre l'exception revert de ar-typography.css ([class*="quran-"]). */
.quran-quote .quran-aya { display: block; font-family: 'Scheherazade New', 'Amiri Quran', 'Amiri', serif; font-size: 1.5rem; line-height: 2.2; }
[dir="rtl"] .quran-quote .quran-aya { font-size: 1.5rem; line-height: 2.2; }
.quran-quote .quran-aya mark { background: rgba(212,175,55,0.28); color: inherit; padding: 0 2px; border-radius: 3px; }
.quran-quote .quran-bracket { color: #d4af37; font-size: 1.3em; font-weight: bold; padding: 0 0.2em; }
.quran-quote .aya-tr { display: block; margin-top: 8px; font-style: italic; color: var(--color-text-muted, #777); font-size: 0.95rem; line-height: 1.8; }
[data-theme="dark"] .quran-quote .aya-tr { color: #aaa; }

/* Paragraphes internes des citations aerees (regle 05/09/2026) : un bloc
   quran-quote / hadith long est coupe en plusieurs <p> par le splitter ;
   espacement serre a l'interieur de la boite. */
/* Grille de navigation (pages piliers + sous-pages fiqh) — transverse */
#contenu .fq-pages { display:grid; grid-template-columns:repeat(auto-fill,minmax(240px,1fr)); gap:12px; margin:14px 0 26px; }
#contenu .fq-pages a { display:block; padding:14px 16px; border:1px solid #e8d99a; border-radius:12px; background:linear-gradient(135deg,#fffdf5,#fef9e7); text-decoration:none; color:#1a1a1a; }
#contenu .fq-pages a:hover { border-color:gold; }

/* Chapo d'introduction des recits qisas (SEO/GEO) */
.qisas-intro { margin: 12px 0 18px; padding: 10px 16px; background: #fffdf6; border-inline-start: 3px solid #d4af37; border-radius: 6px; font-size: 1.02em; color: #4a3f28; }
[data-theme="dark"] .qisas-intro { background: #1e1e1e; color: #ddd; }

.quran-quote p, .hadith p { margin: 0 0 .75em; }
.quran-quote p:last-of-type, .hadith p:last-of-type { margin-bottom: 0; }

/* ===========================================================
   CARD VERSET CORAN - composant UNIQUE sur tout le site
   Markup :
   <div class="verset-card">
     <div class="verset-header">
       <div style="display:flex;gap:.5rem;flex-wrap:wrap;align-items:center">
         <span class="reference">…سورة … : N</span>
         <span class="surah-type makki|madani">…</span>
       </div>
       <div style="display:flex;gap:.5rem"><button class="copy-btn">…</button><button class="listen-btn">…</button></div>
     </div>
     <div class="verset-text"><span class="quran-bracket">﴿</span>…<mark class="term-highlight">…</mark>…<span class="quran-bracket">﴾</span></div>
   </div>
   =========================================================== */
.verset-card { padding: 1.5rem; margin-bottom: 1rem; transition: all 0.2s; }
.verset-card .verset-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; gap: 0.5rem; }
.verset-card .reference { display: inline-flex; align-items: center; gap: 0.5rem; background: #fff; color: #1a1a1a; border: 1px solid #e5e5e5; padding: 0.4rem 1rem; border-radius: 20px; font-size: 1rem; }
.verset-card .surah-type { display: inline-flex; align-items: center; gap: 0.3rem; padding: 0.3rem 0.7rem; border-radius: 15px; font-size: 0.85rem; font-weight: 500; }
.verset-card .surah-type.makki { background: #fcf6e4; color: #1a1a1a; border: 1px solid #e8d99a; }
.verset-card .surah-type.madani { background: #fffdf5; color: #1a1a1a; border: 1px solid #e8d99a; }
.verset-card .copy-btn, .quran-quote .copy-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; padding: 0.4rem 0.8rem; border: 1px solid #ddd; border-radius: 8px; background: #fff; color: #666; cursor: pointer; transition: all 0.2s; font-size: 0.85rem; font-family: inherit; }
.verset-card .copy-btn:hover, .quran-quote .copy-btn:hover { background: #fffdf5; color: #1a1a1a; border-color: #1a1a1a; }
.verset-card .copy-btn.copied, .quran-quote .copy-btn.copied { background: #1a1a1a; color: #fff; border-color: #1a1a1a; }
.verset-card .listen-btn, .quran-quote .listen-btn { display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; padding: 0.4rem 0.8rem; border: 1px solid #d4af37; border-radius: 8px; background: #fffdf5; color: #1a1a1a; cursor: pointer; transition: all 0.2s; font-size: 0.85rem; font-family: inherit; }
.verset-card .listen-btn:hover, .verset-card .listen-btn.playing,
.quran-quote .listen-btn:hover, .quran-quote .listen-btn.playing { background: #1a1a1a; color: #d4af37; border-color: #1a1a1a; }
.verset-card .verset-text { font-family: 'Scheherazade New', 'Amiri Quran', 'Amiri', serif; font-size: 1.5rem; line-height: 2.2; color: #1a1a1a; padding: 1rem; background: #fffdf5; border-radius: 8px; direction: rtl; text-align: right; }
.verset-card .quran-bracket { color: #d4af37; font-size: 1.3em; font-weight: bold; padding: 0 0.2em; }
.verset-card .term-highlight { background: linear-gradient(120deg, #fcf6e4 0%, #e8d99a 100%); padding: 0.1em 0.3em; border-radius: 4px; color: #1a1a1a; font-weight: 700; }
.verset-card .copy-btn:focus-visible, .verset-card .listen-btn:focus-visible,
.quran-quote .copy-btn:focus-visible, .quran-quote .listen-btn:focus-visible { outline: 2px solid #b8941f; outline-offset: 3px; }
.hidden-verset { display: none; }
[data-theme="dark"] .verset-card .verset-text { background: #333; color: #eee; }
[data-theme="dark"] .verset-card .copy-btn { background: #333; border-color: #555; color: #ccc; }
[data-theme="dark"] .quran-quote .copy-btn { background: #333; border-color: #555; color: #ccc; }
[data-theme="dark"] .quran-quote .listen-btn { background: #1e1e1e; }

/* Rangée d'actions verset dans quran-quote (glossaire) : copier + écouter,
   états pilotés par classes (.copied / .playing) via inc/js/verset-actions.js. */
.quran-quote .aya-actions { display: flex; gap: 0.5rem; margin-top: 10px; flex-wrap: wrap; }
.quran-quote .lbl-alt { display: none; }
.quran-quote .copy-btn.copied .lbl { display: none; }
.quran-quote .copy-btn.copied .lbl-alt { display: inline; align-items: center; gap: 0.4rem; }
.quran-quote .ic-pause { display: none; }
.quran-quote .listen-btn.playing .ic-play { display: none; }
.quran-quote .listen-btn.playing .ic-pause { display: inline-flex; }
.quran-quote .copy-btn svg, .quran-quote .listen-btn svg { flex-shrink: 0; }
@media (max-width: 768px) {
    .verset-card .verset-text { font-size: 1.3rem; padding: 0.75rem; }
}
@media (max-width: 600px) {
    .verset-card { padding: 1rem; }
    .verset-card .verset-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }
    .verset-card .reference { font-size: 0.9rem; padding: 0.3rem 0.75rem; }
    .verset-card .verset-text { font-size: 1.2rem; line-height: 2; padding: 0.75rem; }
}
@media (max-width: 400px) {
    .verset-card .verset-text { font-size: 1.1rem; }
}
@media print {
    .verset-card { break-inside: avoid; }
    .verset-card .term-highlight { background: #ff0 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

ol, p, ul {
  line-height: 189%;
}

ul, ol {
  padding-right: 15px;
}

.methode {
width: 75%;
background-color: white;
border: 1px solid #d2d2d7;
border-radius: 10px;
padding: 15px;
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
margin:auto;
margin-bottom:15px;
}

/* Carte de contenu "à propos" (définition, intro module).
   Utilisée par glossaire/asbab/asma/amthal/buldan/fatawa/ghreeb/hadith...
   Pattern identique à .methode mais pleine largeur + DA or/crème. */
.dico-card {
background: linear-gradient(135deg, #fffdf5, #fef9e7);
border: 1px solid #e8d99a;
border-radius: 12px;
padding: 22px 26px;
margin: 18px 0;
box-shadow: 0 1px 4px rgba(212, 175, 55, 0.10);
}
.dico-card-h {
margin-top: 0;
}

/* Titres de section dans les pages hadith (matn, isnad, sharh, sahaba...).
   Aère la page : les H2 ne collent pas au bloc précédent. */
.had-section-h {
margin-top: 32px;
}

/* Toggle tashkil (diacritiques arabes) - transverse, utilisé sur hadith, sira, kitab.
   Par défaut : texte SANS tashkil. Cocher = afficher AVEC tashkil. */
.tashkil-toggle { display:flex; align-items:center; gap:8px; margin-left:auto; }
.tashkil-toggle > label:first-child { font-size:.85rem; color:#888; cursor:pointer; }
.toggle-switch { position:relative; width:36px; height:20px; display:inline-block; }
.toggle-switch input { opacity:0; width:0; height:0; }
.toggle-slider { position:absolute; inset:0; background:#ddd; border-radius:20px; cursor:pointer; transition:.2s; }
.toggle-slider:before { content:''; position:absolute; width:14px; height:14px; right:3px; top:3px; background:#fff; border-radius:50%; transition:.2s; }
.toggle-switch input:checked + .toggle-slider { background:#d4af37; }
.toggle-switch input:checked + .toggle-slider:before { transform:translateX(-16px); }


/* ========================================
   SIDEBAR (#droite) - Theme Kaaba
   ======================================== */

#droite {
    vertical-align: top;
    width: 320px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-left: auto;
}

/* ========================================
   COMPOSANT PAGE-HEADER - Universel
   Règle : le H1 contient UNIQUEMENT titre + sous-titre.
   Stats, boutons, recherche → blocs séparés en dessous.

   Variante A (défaut) : page simple / article / fiche individuelle
     → H1 global avec barre gauche dorée (déjà dans h1{})
     → Pas de wrapper supplémentaire

   Variante B : page index / collection
     → <div class="page-header--index"> contenant :
          <h1>...</h1>
          <p class="page-subtitle">...</p> (optionnel)
   ======================================== */

/* Wrapper passthrough : le style carte vit sur h1 (uniforme partout) */
.page-header--index {
    margin-bottom: 24px;
    text-align: center;
}

/* Pas d'override de h1 ici : on garde le rendu global uniforme */

.page-header--index .page-subtitle {
    margin: 10px 0 0;
    font-size: 1.05rem;
    color: #666;
    line-height: 1.5;
}

[data-theme="dark"] .page-header--index .page-subtitle {
    color: #999;
}

/* Titre de section sidebar */
.sidebar-title {
    background: linear-gradient(135deg, #fffdf5 0%, #fef9e7 100%);
    color: var(--color-gold, #d4af37);
    font-family: var(--font-primary, Georgia);
    font-size: 14px;
    font-weight: 600;
    padding: 12px 16px;
    margin: 0;
    border-left: 3px solid var(--color-gold, #d4af37);
    border-bottom: 1px solid #e8d99a;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Widget date Hijri - Theme clair elegant */
.date {
    background: linear-gradient(135deg, #ffffff 0%, #faf9f6 100%);
    text-align: center;
    padding: 20px 16px;
    font-size: 12pt;
    border: 1px solid rgba(212, 175, 55, 0.4);
    color: var(--color-black, #1a1a1a);
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

/* Phrase islamique au dessus de la date */
.date-dhikr {
    display: block;
    font-family: 'Amiri', 'Traditional Arabic', serif;
    font-size: 16px;
    color: #8b7320;
    margin-bottom: 10px;
    line-height: 1.4;
}

.date::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.5), transparent);
}

/* Dark mode sidebar */
[data-theme="dark"] #droite .date {
    background: linear-gradient(135deg, #1e1e1e 0%, #252525 100%);
    color: #f5f5f5;
}

[data-theme="dark"] .date-dhikr {
    color: var(--color-gold, #d4af37);
}

[data-theme="dark"] .sidebar-title {
    background: linear-gradient(135deg, #0a0a0a 0%, #151515 100%);
}

/* ========================================
   RTL Support - Sidebar à gauche
   ======================================== */
[dir="rtl"] #contenu {
    float: right;
    margin-right: 0;
    margin-left: 50px;
}

[dir="rtl"] #droite {
    float: left;
}

[dir="rtl"] .sidebar-title {
    border-left: none;
    border-right: 3px solid var(--color-gold, #d4af37);
}

@media all and (max-width: 768px) {
    [dir="rtl"] #contenu {
        float: none;
        margin-left: 0;
    }
    [dir="rtl"] #droite {
        float: none;
    }
}

/* Widget Dhikr rotatif - Theme clair */
.dhikr-widget {
    background: linear-gradient(135deg, #ffffff 0%, #faf9f6 100%);
    border: 1px solid rgba(212, 175, 55, 0.4);
    padding: 16px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.dhikr-ar {
    color: #8b7320;
    font-family: 'Amiri', 'Traditional Arabic', serif;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.4;
}

.dhikr-fr {
    color: rgba(0, 0, 0, 0.5);
    font-size: 11px;
    font-style: italic;
}

[data-theme="dark"] .dhikr-widget {
    background: linear-gradient(135deg, #1e1e1e 0%, #252525 100%);
}

[data-theme="dark"] .dhikr-ar {
    color: var(--color-gold, #d4af37);
}

[data-theme="dark"] .dhikr-fr {
    color: rgba(255, 255, 255, 0.6);
}

/* Liens du contenu (pas header/footer) */
#contenu a:hover {text-decoration: none;color:#d4af37;}
.ariane {text-decoration: none}
#contenu a:not([class]):link, #contenu a:not([class]):visited {color: black; }
.intro{color: black;}
[data-theme="dark"] .intro{color: rgba(255, 255, 255, 0.85);}

/* Bullets dorées pour le contenu */
#contenu ul li::marker {
    color: #d4af37;
}

/* Sommaire dark mode */
[data-theme="dark"] #contenu a:link,
[data-theme="dark"] #contenu a:visited {
    color: #e8d99a;
}
[data-theme="dark"] #contenu a:hover {
    color: #d4af37;
}

/* ========================================
   LIENS-BOUTONS SUR FOND SOMBRE
   Toujours doré clair, même en :visited.
   Cible toute classe en -btn, btn-, ou _btn,
   plus les classes connues de blocs sombres.
   ======================================== */
a[class*="-btn"]:link,
a[class*="-btn"]:visited,
a[class^="btn-"]:link,
a[class^="btn-"]:visited,
a.btn:link,
a.btn:visited,
.qp-progress-box a:link,
.qp-progress-box a:visited,
.qp-mini a:link,
.qp-mini a:visited,
.qp-panel a:link,
.qp-panel a:visited,
.dark-bg a:link,
.dark-bg a:visited,
.daily-mobile a:link,
.daily-mobile a:visited,
.prayer-card a:link,
.prayer-card a:visited {
    color: var(--color-gold-light, #e8c968);
}
a[class*="-btn"]:hover,
a[class^="btn-"]:hover,
a.btn:hover,
.qp-progress-box a:hover,
.qp-mini a:hover,
.qp-panel a:hover,
.dark-bg a:hover,
.daily-mobile a:hover,
.prayer-card a:hover {
    color: var(--color-gold-light-strong, #f4dc8f);
}

img {width:100%;margin-left:auto;margin-right:auto;}

.mawaqit {border-width: 1px; border-style: outset; border-collapse: collapse; border-color: gray; margin: 0 auto; text-align:center; width:100%;}
.mawaqit td {border-width: 1px; border-spacing: 1px; padding: 10px; border-style: outset; border-color: 1px solid black;}

.separation{width:100%; display:block; height:3px; background: linear-gradient(90deg, var(--color-gold, #d4af37) 0%, transparent 100%); margin:0px}


#global{margin-left:auto;margin-right:auto; padding-top:75px; display:flex; flex-wrap:wrap; gap:0 50px;}
/* Micro-clearfix conservé pour les pages qui n'utilisent pas le flex */
#global::after{content:""; display:table; clear:both;}

#contenu{vertical-align:top; width:600px; background-color:#fff; display:flex; flex-direction:column; padding:24px 16px 24px; }

/* Logo */
#logo {
    max-height: 50px;
    width: auto;
}


label
    {
        font-size:12pt;
        color: black;
    }


@media all and (max-width:768px)
{
    /* Reset box-sizing pour éviter les débordements */
    *, *::before, *::after {
        box-sizing: border-box;
    }

    body {
        font-size: 14pt;
        overflow-x: clip;
    }

    #global {
        padding-top: 65px;
        padding-left: 0;
        padding-right: 0;
        width: 100%;
        max-width: 100vw;
        overflow-x: clip;
    }

    #contenu {
        vertical-align: top;
        width: 100%;
        background-color: #fff;
        display: block;
        margin-right: 0;
        border: none;
        padding: 24px 16px;
        box-sizing: border-box;
    }

    /* Titres mobile */
    h1 {
        font-size: 16pt;
        padding: 0.25em;
    }

    h2 {
        font-size: 15pt;
        padding: 10px 10px;
    }

    h3 {
        font-size: 12pt;
        padding-top: 15px;
        padding-bottom: 0;
        padding-left: 15px;
        padding-right: 15px;
        margin-top: 0;
        margin-bottom: 5px;
    }

    p {
        font-size: 16px;
    }

    ul, ol {
        padding-left: 25px;
        padding-right: 10px;
        font-size: 16px;
    }

    .methode {
        width: 95%;
        padding: 10px;
        margin-bottom: 10px;
    }

    .date {
        border-radius: 0px;
    }

    /* Sidebar mobile */
    #droite {
        width: 100%;
        float: none;
        margin-top: 15px;
    }

    img {
        width: 100%;
        height: auto;
        margin-left: auto;
        margin-right: auto;
    }

    /* Tableaux horaires - scroll horizontal sur mobile */
    .horaires-wrapper {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 10px;
    }

    .horaires {
        min-width: 600px;
        margin: 0;
    }

    .horaires td, .horaires th {
        padding: 10px 8px;
        white-space: nowrap;
    }

    .horaires .em {
        width: auto;
        min-width: 50px;
    }

    .horaires .top-row td {
        padding: 12px 8px;
    }

    .horaires .arabic {
        font-size: 11pt;
    }

    /* Table vendredi centrée et compacte - pas de scroll */
    .vendredi-table {
        width: auto !important;
        min-width: auto !important;
        max-width: 320px;
        margin-left: auto !important;
        margin-right: auto !important;
        display: table !important;
    }

    .vendredi-table td.em {
        min-width: auto;
        width: auto;
        padding: 10px 15px;
        white-space: normal;
    }

    /* Toutes les cellules même taille */
    .horaires td {
        font-size: 12pt;
    }

    /* Tahajjud widget lisible */
    .tahajjud-widget {
        font-size: 14px;
    }

    /* Suffixe minutes plus discret */
    .minsuffixe {
        display: none;
    }

    /* Tableau prière du jour - Next prayer */
    #today {
        margin-top: 10px;
    }

    #today td {
        padding: 10px 5px;
        font-size: 11pt;
    }

    #today span[style*="font-size:15pt"] {
        font-size: 16px !important;
    }

    /* Widget Tahajjud mobile */
    .tahajjud-widget {
        margin: 10px;
        padding: 12px;
    }

    /* Widget météo mobile */
    .weather-widget {
        margin: 10px;
    }

    /* Section Ramadan CTA mobile */
    .ramadan-cta {
        margin: 10px;
        padding: 15px;
    }

    /* City info block mobile */
    .city-info-block {
        margin: 10px;
    }

    .city-info-grid {
        grid-template-columns: 1fr;
    }

    /* Nearby cities mobile */
    .nearby-cities {
        margin: 0 10px;
    }

    .nearby-list {
        columns: 1;
    }

    /* Sélecteur méthode mobile */
    select {
        width: 100%;
        max-width: 100%;
        font-size: 11pt;
        padding: 8px;
    }

    /* Print section mobile */
    .print-calendar-controls {
        flex-direction: column;
        gap: 10px;
    }

    .print-month-select {
        width: 100%;
    }

    .print-btn {
        width: 100%;
    }
}

/* ========================================
   BLOC HORAIRES MOBILE - Theme Kaaba
   ======================================== */
.daily-mobile {
  display: none; /* Caché par défaut sur desktop */
  margin: 15px 10px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  background: #fff;
  border: 1px solid rgba(212, 175, 55, 0.3);
}

/* Grille 2x3 pour les 6 prières */
.daily-mobile {
  display: none;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: rgba(212, 175, 55, 0.15);
}

/* Carte de prière */
.prayer-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px 15px;
  text-align: center;
  background: #fff;
  transition: all 0.3s ease;
  min-height: 100px;
}

/* Coins arrondis */
.prayer-card:first-child {
  border-top-left-radius: 15px;
}
.prayer-card:nth-child(2) {
  border-top-right-radius: 15px;
}
.prayer-card:nth-child(5) {
  border-bottom-left-radius: 15px;
}
.prayer-card:nth-child(6) {
  border-bottom-right-radius: 15px;
}

/* Icône de prière */
.prayer-icon {
  font-size: 24px;
  margin-bottom: 6px;
  filter: grayscale(20%);
}

/* Nom de la prière */
.prayer-name {
  font-size: 11pt;
  font-weight: 500;
  color: #666;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 8px;
}

/* Heure de prière */
.prayer-time {
  font-size: 22pt;
  font-weight: 700;
  color: #d4af37;
  font-family: var(--font-primary, Georgia, serif);
  letter-spacing: 1px;
}

/* Prière active (en cours) */
.prayer-card.active {
  background: rgba(212, 175, 55, 0.12);
  position: relative;
}

.prayer-card.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, transparent, #d4af37, transparent);
}

.prayer-card.active .prayer-icon {
  filter: none;
  transform: scale(1.1);
}

.prayer-card.active .prayer-name {
  color: #d4af37;
}

.prayer-card.active .prayer-time {
  color: #1a1a1a;
  text-shadow: none;
  animation: pulseGold 2s ease-in-out infinite;
}

@keyframes pulseGold {
  0%, 100% { text-shadow: 0 0 10px rgba(212, 175, 55, 0.4); }
  50% { text-shadow: 0 0 20px rgba(212, 175, 55, 0.8); }
}

/* Dark mode */
[data-theme="dark"] .daily-mobile {
  background: linear-gradient(135deg, #0a0a0a 0%, #151515 100%);
}

[data-theme="dark"] .prayer-card {
  background: linear-gradient(180deg, #0f0f0f 0%, #1a1a1a 100%);
}

/* ========================================
   CLASSES HORAIRES GÉNÉRALES
   ======================================== */
.dayadhan {
  font-weight: bold;
  color: #d4af37;
}

.daydigit {
  color: #555;
}

/* Cache la table mobile sur PC */
@media screen and (min-width: 769px) {
  .daily-mobile {
    display: none !important;
  }
}

/* Affiche la table mobile et cache la table PC sur mobile */
@media screen and (max-width: 768px) {
  .daily {
    display: none !important;
  }

  .daily-mobile {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
  }
}





/* Général */
#logo {
  width: auto;
  height: 56px;
}


/* Liens d'article inline UNIQUEMENT (sans classe). Les composants à classe
   (link-card, share-btn, prenom-card, cards…) gardent leur propre couleur - jamais de bleu. */
#contenu a:not([class]), #contenu a:not([class]):hover {
  color: #8a6d1f;
}

#titres {
  text-decoration: underline;
}


#bismillah, #end {
  text-align: center;
}

.coran, #end, #titres {
  font-weight: 700;
}

#break, .ayaNum, .verNum {
  white-space: nowrap;
}

/* Typographie spécifique */
#quran, #tajwid {
  font-family: quran;
}



#titres {
}

#discret, .arrow, #contenu a:visited {
  text-decoration: none;
}

#colonnes {
  width: 320px;
}

#bismillah {
  margin-bottom: -15px;
  margin-top: 3px;
}

.coran {
  color: teal;
}

#stamp {
  float: right;
  margin-right: 100px;
}

/* Tableaux et style des jours */
.daytable {
  text-align: center;
  width: 4em;
  color: #1a1a1a;
}

.daydigit {
  text-align: center;
  width: 4em;
}

.suffixe {
  color: gray;
}

.timeinday {
}

.arabic {
  font-weight: normal;
}

.em {
  width: 4.5em;
}

.minsuffixe {
}

.none {
  display: none;
}

.encours {
  background-color: ivory;
  font-weight: bold;
}

.dayadhan {
  text-align: center;
  width: 4em;
  background-color: ivory;
}

.dayadhantab {
  text-align: center;
  width: 4em;
  background-color: ivory;
  color: black;
}

/* Tableaux spécifiques */
.horaires {
  border-collapse: collapse;
  border-color: #ddd;
  margin: 0 auto;
  text-align: center;
  width: 100%;
  margin-top: 15px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  border-radius: 8px;
  overflow: hidden;
}

.horaires td {
  border: 1px solid #e5e5e5;
  padding: 12px 8px;
  vertical-align: middle;
  line-height: 1.4;
}

.horaires .top-row td {
  padding: 14px 8px;
  font-weight: 600;
}

.horaires .arabic {
  display: block;
  font-size: 11pt;
  margin-bottom: 2px;
  color: #8b7320;
}

/* Tableaux spécifiques */
.daily {
  border-collapse: collapse;
  border-color: gray;
  margin: 0 auto;
  text-align: center;
  width: 100%;
    margin-top:15px;
}

.daily td {
  border-width: 1px;
  border-style: outset;
  border-spacing: 1px;
  padding: 10px;
  border-color: 1px solid #000;
}

.top-row{color:#1a1a1a;background:linear-gradient(135deg, #fffdf5 0%, #fef9e7 100%);border-bottom:1px solid #e8d99a;}
.top-vendredi{color:black;background-color:lightyellow;}

.djoumoua td {
  border-collapse: collapse;
  border-color: gray;
  margin: 0 auto;
  text-align: center;
  width: 50%;
}

.select-djoumoua {
  border-width: 1px;
  border-style: outset;
  border-spacing: 1px;
  padding: 10px;
  border-color: 1px solid #000;
  background-color:lightyellow;
}

.select-today{
	background:ivory;
	border: 2px dashed;
	font-weight: bold;
}

/* ========================================
   EXTRA SMALL SCREENS (320px)
   ======================================== */
@media screen and (max-width: 380px) {
    body {
        font-size: 16px;
    }

    h1 {
        font-size: 14pt;
        padding: 0.25em;
    }

    h2 {
        font-size: 16px;
        padding: 8px;
    }

    h3 {
        font-size: 12pt;
        padding-top: 15px;
        padding-bottom: 0;
        padding-left: 15px;
        padding-right: 15px;
        margin-top: 0;
        margin-bottom: 5px;
    }

    p, ul, ol {
        font-size: 12pt;
    }

    ul, ol {
        margin-left: 8px;
        margin-right: 8px;
    }

    /* Tableaux horaires - même taille, scroll horizontal */
    .horaires-wrapper {
        margin: 5px;
    }

    /* Tableau daily-mobile plus compact */
    .daily-mobile td {
        padding: 10px 8px;
        font-size: 16px;
    }

    /* Widget météo compact */
    .weather-widget {
        margin: 5px;
        padding: 10px;
    }

    .weather-main {
        flex-direction: column;
    }

    /* City info compact */
    .city-info-item {
        padding: 8px;
    }

    /* Ramadan CTA compact */
    .ramadan-cta {
        margin: 5px;
        padding: 10px;
    }

    .ramadan-cta h3 {
        font-size: 16px;
    }

    /* Sélecteur méthode */
    select {
        font-size: 12pt;
        padding: 6px;
    }

    /* Next prayer box */
    #today td {
        padding: 8px 4px;
        font-size: 12pt;
    }

    #today span[style*="font-size:15pt"] {
        font-size: 14pt !important;
    }
}

/* ===== AR TYPOGRAPHY (fusionné depuis ar-typography.css - un seul CSS partout) ===== */
/**
 * AR Typography - règle d'or moustaqim.com :
 * Amiri partout + 22px (1.375rem) sur p/ul/ol/li/sommaire sur toutes les pages AR.
 * Exception : texte du Coran (classes .quran-*, .verse, .ayah, .surah, .qari) garde sa typo.
 */

/* === Police Amiri sur TOUT le contenu AR (règle générale, pas d'énumération) ===
   #contenu et #droite + tous leurs descendants. Toute classe (présente ou future)
   est donc en Amiri automatiquement, sans avoir à l'ajouter ici. */
[dir="rtl"] body,
[dir="rtl"] #contenu,
[dir="rtl"] #contenu *,
[dir="rtl"] #droite,
[dir="rtl"] #droite * {
    font-family: 'Amiri', 'Traditional Arabic', serif;
}
/* Exception : texte coranique garde sa typo dédiée (spécificité plus haute) */
[dir="rtl"] #contenu [class*="quran"],
[dir="rtl"] #contenu [class*="coran"],
[dir="rtl"] #contenu .ayah,
[dir="rtl"] #contenu .hero-verse {
    font-family: 'Scheherazade New', 'Amiri Quran', 'Amiri', serif;
}

/* === H1 AR : 2em suffisant === */
[dir="rtl"] h1 {
    font-size: 2em;
    line-height: 1.4;
}

/* === H2/H3/H4 AR : tailles correctes (force par-dessus les styles inline hérités) === */
[dir="rtl"] #contenu h2 { font-size: 1.7em !important; line-height: 1.4; width: fit-content; }
[dir="rtl"] #contenu h3,
[dir="rtl"] #contenu h4 { font-size: 1.35em !important; line-height: 1.5; }
/* sommaire AR en 22px */
[dir="rtl"] #contenu .sommaire a,
[dir="rtl"] #contenu .sommaire li,
[dir="rtl"] #contenu .sommaire .sommaire-title { font-size: 1.375rem; }

/* === Taille 22px + line-height 2 sur TOUT le contenu AR (p/ul/ol où qu'ils soient
       dans #contenu : div, section, article…). Exclusions : breadcrumb (1er p) et last-update. === */
[dir="rtl"] #contenu p:not(.last-update),
[dir="rtl"] #contenu ul,
[dir="rtl"] #contenu ol,
[dir="rtl"] #droite,
[dir="rtl"] #droite *,
[dir="rtl"] .bio-text,
[dir="rtl"] .bio-extra,
[dir="rtl"] .intro,
[dir="rtl"] .list-intro {
    font-size: 1.375rem;
    line-height: 2;
}
/* Breadcrumb (1er paragraphe) reste discret - sauf si c'est une intro */
[dir="rtl"] #contenu > p:first-of-type:not(.list-intro):not(.intro) {
    font-size: 1rem;
    line-height: 1.5;
}

/* Listes en AR : la flèche/puce native suffit, pas de padding lateral */
[dir="rtl"] #contenu li,
[dir="rtl"] .bio-text li,
[dir="rtl"] .bio-extra li {
    margin: 0;
    line-height: 2;
}
[dir="rtl"] #contenu ul,
[dir="rtl"] #contenu ol,
[dir="rtl"] .bio-text ul,
[dir="rtl"] .bio-text ol,
[dir="rtl"] .bio-extra ul,
[dir="rtl"] .bio-extra ol {
    margin: 8px 0;
    padding: 0;
    line-height: 2;
}

/* Sommaire AR : Amiri 22px, line-height 2 cohérent partout */
[dir="rtl"] .sommaire,
[dir="rtl"] .sommaire p,
[dir="rtl"] .sommaire ul,
[dir="rtl"] .sommaire li,
[dir="rtl"] .sommaire a,
[dir="rtl"] .sommaire b {
    font-size: 1.375rem !important;
    line-height: 2 !important;
    font-family: 'Amiri', 'Traditional Arabic', serif !important;
}


/* FAQ AR : Amiri 22px sur questions et réponses */
[dir="rtl"] .faq-question h3,
[dir="rtl"] .faq-question-text,
[dir="rtl"] .faq-answer-inner,
[dir="rtl"] .faq-answer-inner p {
    font-family: 'Amiri', 'Traditional Arabic', serif !important;
    font-size: 1.375rem !important;
    line-height: 2 !important;
}

/* H3 (sous-sections) : taille discrète */
[dir="rtl"] h3 {
    font-size: 1.5rem;
    line-height: 1.6;
}

/* === Exceptions - texte du Coran garde sa propre typographie === */
[dir="rtl"] .quran-verse,
[dir="rtl"] .quran-ayah,
[dir="rtl"] .quran-surah,
[dir="rtl"] .verse-arabic,
[dir="rtl"] .ayah,
[dir="rtl"] .surah-title,
[dir="rtl"] .qari-name,
[dir="rtl"] [class*="quran-"],
[dir="rtl"] [class*="surah-"],
[dir="rtl"] [class*="verse-"] {
    /* Préserve la typographie spécifique du Coran (Amiri Quran ou autre) */
    font-size: revert;
    line-height: revert;
}

/* Inputs / boutons interface : pas en Amiri (clarté UI) */
[dir="rtl"] input,
[dir="rtl"] button,
[dir="rtl"] select,
[dir="rtl"] textarea,
[dir="rtl"] .nav-link,
[dir="rtl"] .lang-flag,
[dir="rtl"] .stat-number {
    font-family: inherit;
}

/* ===== Mot-à-mot Coran (lecteur) ===== */
body.wbw-on .wbw-w {
    cursor: pointer;
    border-radius: 4px;
    padding: 0 .08em;
    transition: background .15s;
}
body.wbw-on .wbw-w:hover {
    background: rgba(212, 175, 55, .18);
}
.wbw-w.wbw-active {
    background: #1a1a1a;
    color: #fff;
}
.wbw-bar {
    position: fixed;
    left: 50%;
    transform: translateX(-50%);
    bottom: 1rem;
    z-index: 60;
    display: flex;
    align-items: center;
    gap: .9rem;
    background: #1a1a1a;
    color: #fffdf5;
    border: 1px solid #d4af37;
    border-radius: 12px;
    padding: .6rem 1rem;
    max-width: min(92vw, 560px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
}
.wbw-bar-word {
    font-family: 'Amiri', serif;
    font-size: 1.6rem;
    line-height: 1.4;
    color: #e8d99a;
    white-space: nowrap;
}
.wbw-bar-info {
    display: flex;
    flex-direction: column;
    font-size: .92rem;
    min-width: 0;
}
.wbw-bar-tr {
    color: #d4af37;
    font-style: italic;
}
.wbw-bar-verse {
    font-size: .8rem;
    opacity: .75;
    white-space: nowrap;
}
.wbw-bar-close {
    background: none;
    border: none;
    color: #fffdf5;
    opacity: .7;
    cursor: pointer;
    font-size: 1rem;
    padding: .2rem .4rem;
}
.wbw-bar-close:hover {
    opacity: 1;
}
@media (max-width: 640px) {
    .wbw-bar {
        bottom: .5rem;
        padding: .5rem .7rem;
        gap: .6rem;
    }
    .wbw-bar-word {
        font-size: 1.3rem;
    }
}

/* ===== Tafsir FR al-Mukhtasar (lecteur + fiches) ===== */
.tafsir-src {
    font-size: .92rem;
    color: #7a5c00;
    margin: 4px 0 14px;
}
.tafsir-content .tafsir-verse-ar {
    font-family: 'Amiri', serif;
    font-size: 1.25rem;
    line-height: 2;
    direction: rtl;
    text-align: right;
    color: #1a1a1a;
    background: #fff;
    border-right: 4px solid #d4af37;
    border-radius: 8px;
    padding: 10px 16px;
    margin: 0 0 12px;
}

/* ===== Tafsir FR al-Mukhtasar : fiches + hub ===== */
.tf-src {
    font-size: .92rem;
    color: #7a5c00;
    margin: 6px 0 18px;
}
.tf-v {
    border: 1px solid #e8d99a;
    border-radius: 12px;
    background: #fffdf5;
    padding: 16px 20px;
    margin: 14px 0;
}
.tf-v h3 {
    margin: 0 0 10px;
}
.tf-ar {
    font-family: 'Amiri', serif;
    font-size: 1.35rem;
    line-height: 2.1;
    direction: rtl;
    text-align: right;
    color: #1a1a1a;
    background: #fff;
    border-radius: 8px;
    border-right: 4px solid #d4af37;
    padding: 10px 16px;
    margin: 0 0 12px;
}
.tf-txt {
    line-height: 1.85;
    color: #1a1a1a;
    margin: 0 0 8px;
}
.tf-list {
    margin: 0 0 8px 22px;
}
.tf-list li {
    line-height: 1.8;
}
.tf-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 28px 0 8px;
}
.tf-nav a {
    padding: 12px 18px;
    border: 1px solid #e8d99a;
    border-radius: 12px;
    background: #fffdf5;
    text-decoration: none;
    color: #1a1a1a;
    flex: 1;
    max-width: 48%;
}
.tf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
    margin: 16px 0;
}
.tf-grid a {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    padding: 10px 14px;
    border: 1px solid #e8d99a;
    border-radius: 10px;
    background: #fffdf5;
    text-decoration: none;
    color: #1a1a1a;
}
.tf-grid a:hover {
    background: #fcf6e4;
}
.tf-grid .tf-num {
    color: #b8941f;
    font-weight: 600;
}
.tf-grid .tf-ar-name {
    font-family: 'Amiri', serif;
    color: #7a5c00;
}
@media (max-width: 640px) {
    .tf-nav {
        flex-direction: column;
    }
    .tf-nav a {
        max-width: 100%;
    }
}

/* ===== Coran mot à mot : fiches sourate ===== */
.wbw-verse {
    margin: 18px 0;
}
.wbw-verse h3 {
    margin: 0 0 8px;
}
.wbw-verse-ar {
    font-family: 'Amiri', serif;
    font-size: 1.6rem;
    line-height: 2.1;
    direction: rtl;
    text-align: right;
    color: #1a1a1a;
    margin: 8px 0 4px;
}
.wbw-verse-fr {
    color: #4a4a4a;
    line-height: 1.8;
    margin: 0 0 12px;
}
.wbw-words {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    direction: rtl; /* le flux de cartes suit le sens de lecture arabe */
    border-top: 1px solid #f0e9d2; /* mini séparation verset <-> mots */
    padding-top: 14px;
    margin-top: 2px;
}
.wbw-word {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    background: #fff;
    border: 1px solid #e8d99a;
    border-radius: 10px;
    padding: 8px 12px;
    min-width: 90px;
    direction: ltr; /* contenu de carte (translit, gloss) en latin */
}
.wbw-word-ar {
    font-family: 'Amiri', serif;
    font-size: 1.45rem;
    line-height: 1.7;
    color: #1a1a1a;
}
.wbw-word-tr {
    font-style: italic;
    color: #b8941f;
    font-size: .85rem;
}
.wbw-word-gl {
    color: #4a4a4a;
    font-size: .88rem;
    text-align: center;
}

/* ===== Fiche mot (index inverse) ===== */
.wm-occ {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin: 0 0 10px;
    line-height: 1.8;
}
.wm-occ-ref {
    white-space: nowrap;
    font-weight: 600;
}
.wm-occ-ref a {
    color: #b8941f;
    text-decoration: none;
}
.wm-occ-ref a:hover {
    text-decoration: underline;
}
.wm-occ-ctx {
    font-family: 'Amiri', serif;
    font-size: 1.25rem;
    color: #1a1a1a;
    flex: 1;
    min-width: 0;
}
.wm-occ-link {
    white-space: nowrap;
    font-size: .85rem;
}
.wm-occ-link a {
    color: #7a5c00;
    text-decoration: none;
    border: 1px solid #e8d99a;
    border-radius: 8px;
    padding: 2px 10px;
}
@media (max-width: 640px) {
    .wm-occ {
        flex-wrap: wrap;
    }
}

.tf-verse-fr {
    color: #4a4a4a;
    line-height: 1.8;
    margin: 0 0 12px;
    font-style: italic;
}

/* ===== Play audio mot à mot ===== */
.wbw-verse-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}
.wbw-play {
    align-self: center;
    width: 26px;
    height: 26px;
    border: 1px solid #e8d99a;
    border-radius: 50%;
    background: #fff;
    color: #b8941f;
    font-size: .62rem;
    cursor: pointer;
    line-height: 1;
    padding: 0;
    flex: none;
    order: 3;
}
.wbw-play:hover {
    background: #1a1a1a;
    color: #fffdf5;
    border-color: #1a1a1a;
}
.wbw-play.wbw-playing {
    background: #d4af37;
    border-color: #d4af37;
    color: #1a1a1a;
}
.wbw-play-verse {
    border: 1px solid #e8d99a;
    border-radius: 10px;
    background: #fffdf5;
    color: #7a5c00;
    font-size: .8rem;
    padding: 6px 12px;
    cursor: pointer;
    white-space: nowrap;
}
.wbw-play-verse:hover {
    background: #1a1a1a;
    color: #fffdf5;
    border-color: #1a1a1a;
}
.wbw-play-verse.wbw-playing {
    background: #d4af37;
    border-color: #d4af37;
    color: #1a1a1a;
}
.wbw-bar-play {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid #d4af37;
    background: none;
    color: #e8d99a;
    font-size: .8rem;
    cursor: pointer;
    flex: none;
}
.wbw-bar-play:hover {
    background: #d4af37;
    color: #1a1a1a;
}
@media (max-width: 640px) {
    .wbw-play-txt { display: none; }
}

/* ===== Karaoké mot par mot (lecteur) ===== */
.wbw-w.w-spoken {
    background: rgba(212, 175, 55, .38);
    border-radius: 4px;
    box-shadow: 0 0 0 2px rgba(212, 175, 55, .38);
}
.dark .wbw-w.w-spoken {
    background: rgba(212, 175, 55, .55);
    box-shadow: 0 0 0 2px rgba(212, 175, 55, .55);
}

/* ===== Clavier arabe (/clavier-arabe/) ===== */
.kba-tool {
    background: var(--bg-card, #fffdf5);
    border: 1px solid #d4af37;
    border-radius: 12px;
    padding: 18px;
    margin: 22px 0 30px;
}
.kba-label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: .95rem;
}
#kba-output {
    box-sizing: border-box;
    width: 100%;
    height: 4.3em; /* 2 lignes par defaut, redimensionnable */
    min-height: 4.3em;
    padding: 8px 14px;
    border: 1px solid #d4af37;
    border-radius: 8px;
    background: #ffffff;
    color: #1a1a1a;
    font-family: 'Amiri', serif;
    font-size: 1.45rem;
    line-height: 1.9;
    resize: vertical;
    overflow: hidden;
}
#kba-output:focus {
    outline: 2px solid #d4af37;
    outline-offset: 1px;
}
.dark #kba-output {
    background: #232323;
    color: #f5f0dd;
    border-color: #b8941f;
}
.kba-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}
.kba-btn {
    background: #1a1a1a;
    color: #ffffff;
    border: 1px solid #1a1a1a;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: .92rem;
    font-weight: 600;
    cursor: pointer;
}
.kba-btn:hover {
    background: #d4af37;
    border-color: #d4af37;
    color: #1a1a1a;
}
.kba-btn-ghost {
    background: transparent;
    color: inherit;
    border-color: #b8941f;
}
.kba-btn-ghost:hover {
    background: #1a1a1a;
    color: #ffffff;
    border-color: #1a1a1a;
}
.dark .kba-btn-ghost { color: #e8d99a; border-color: #b8941f; }
.dark .kba-btn-ghost:hover { background: #d4af37; color: #1a1a1a; border-color: #d4af37; }
.kba-count {
    font-size: .85rem;
    opacity: .75;
    margin-inline-start: 12px;
}
.kba-hint {
    font-size: .88rem;
    margin: 14px 0 2px;
}
.kba-demos,
.kba-recents {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.kba-demos {
    margin: 12px 0 14px;
}
.kba-recents {
    margin: 10px 0 0;
}
.kba-hintkey {
    position: absolute;
    bottom: 2px;
    right: 4px;
    font-family: 'Inter', sans-serif;
    font-size: .6rem;
    line-height: 1;
    opacity: .6;
}
.kba-share {
    display: inline-flex;
    gap: 8px;
    margin-inline-start: auto;
}
.kba-demo {
    background: transparent;
    border: 1px solid #d4af37;
    border-radius: 999px;
    color: inherit;
    padding: 4px 12px;
    font-size: .85rem;
    cursor: pointer;
}
.kba-demo:hover {
    background: #d4af37;
    color: #1a1a1a;
}
.kba-kbd {
    display: flex;
    flex-direction: column;
    gap: 7px;
    direction: rtl;
}
.kba-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}
.kba-key {
    position: relative;
    min-width: 40px;
    height: 44px;
    padding: 0 8px;
    background: #ffffff;
    border: 1px solid #e0d6b0;
    border-bottom-color: #cbb96a;
    border-radius: 7px;
    color: #1a1a1a;
    font-family: 'Amiri', serif;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    flex: 1 1 0;
    max-width: 74px;
}
.kba-key:hover {
    background: #1a1a1a;
    color: #ffffff;
    border-color: #1a1a1a;
}
.kba-key:active {
    transform: translateY(1px);
}
.dark .kba-key {
    background: #2b2b2b;
    color: #f5f0dd;
    border-color: #4a4234;
}
.dark .kba-key:hover {
    background: #d4af37;
    color: #1a1a1a;
    border-color: #d4af37;
}
.kba-row-harakat {
    padding-top: 6px;
    border-top: 1px dashed #d4af37;
}
.kba-key-harakat {
    font-size: 1.05rem;
    min-width: 40px;
    height: 40px;
}
.kba-row-actions {
    padding-top: 6px;
}
.kba-key-space {
    flex: 6 1 200px;
    max-width: none;
    font-family: inherit;
    font-size: .9rem;
    letter-spacing: .06em;
}
.kba-key-act {
    font-size: 1rem;
    min-width: 44px;
}
.kba-table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0 22px;
    font-size: .95rem;
}
.kba-table th,
.kba-table td {
    border: 1px solid #e3d9b8;
    padding: 7px 10px;
}
.kba-table th {
    background: #f7f1da;
    font-weight: 600;
}
.dark .kba-table th { background: #2b2b2b; }
.dark .kba-table th,
.dark .kba-table td { border-color: #4a4234; }
.kba-table .kba-ar {
    font-family: 'Amiri', serif;
    font-size: 1.25rem;
    direction: rtl;
}
@media (max-width: 640px) {
    .kba-tool { padding: 12px; }
    #kba-output { font-size: 1.4rem; }
    .kba-key { min-width: 32px; height: 40px; font-size: 1.1rem; }
    .kba-count { margin-inline-start: 0; width: 100%; }
}
.kba-preview-line {
    margin: 8px 0 0;
    font-size: .9rem;
    opacity: .9;
}
.kba-preview-line[hidden] {
    display: none;
}
.kba-preview-label {
    font-weight: 600;
    margin-inline-end: 6px;
}
#kba-preview {
    font-family: 'Amiri', serif;
    font-size: 1.35rem;
    color: #b8941f;
}
.dark #kba-preview { color: #e8d99a; }
.kba-suggest {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}
.kba-suggest:empty {
    display: none;
}
.kba-sug {
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
    background: #fffdf6;
    border: 1px solid #d4af37;
    border-radius: 8px;
    padding: 4px 10px;
    cursor: pointer;
    color: inherit;
}
.kba-sug:hover {
    background: #1a1a1a;
    border-color: #1a1a1a;
}
.kba-sug:hover .kba-sug-la { color: #e8d99a; }
.dark .kba-sug { background: #2b2b2b; }
.kba-sug-ar {
    font-family: 'Amiri', serif;
    font-size: 1.2rem;
    direction: rtl;
}
.kba-sug-la {
    font-size: .78rem;
    opacity: .7;
}

/* navigation.css */
/**
 * NAVIGATION MODERNE - Moustaqim.com
 * Header avec couleurs Kaaba (Or/Noir/Blanc)
 * Utilise les variables CSS de design-system.css
 *
 * Classes uniques: site-header, nav-*, theme-toggle-*, mobile-menu-*
 */

/* ========================================
   HEADER & NAVIGATION
   ======================================== */

.site-header {
    --color-gold: #E8B84B;
    --color-gold-light: #F5D98A;
    --color-gold-dark: #C9901A;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: linear-gradient(135deg, var(--color-black) 0%, var(--color-black-light) 100%);
    box-shadow: none;
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    transition: all var(--transition-normal);
}

.site-header.scrolled {
    background: rgba(26, 26, 26, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 2px 30px rgba(0, 0, 0, 0.5);
}

.nav-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-6);
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ========================================
   LOGO TEXTE
   ======================================== */

.site-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity var(--transition-fast);
}

.site-logo:hover {
    opacity: 0.9;
}

.site-logo-text {
    font-family: var(--font-primary);
    font-size: 26px;
    font-weight: 700;
    color: var(--color-gold);
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
    padding-bottom: 4px;
}

.site-logo-text::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--color-gold) 0%, transparent 100%);
}

/* ========================================
   NAVIGATION LINKS
   ======================================== */

.nav-menu {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    list-style: none;
    margin: 0;
    padding: 0;
    line-height: normal;
}
/* En RTL, flex suit naturellement la direction du texte.
   Le 1er item DOM s'affiche à droite (début de lecture arabe). */
[dir="rtl"] .nav-menu {
    direction: rtl;
}

.nav-menu li {
    list-style: none;
    margin: 0;
    padding: 0;
    line-height: normal;
}

.nav-link {
    display: flex;
    align-items: center;
    padding: var(--space-2) var(--space-4);
    color: var(--color-white);
    text-decoration: none;
    font-size: var(--text-base);
    font-weight: 500;
    font-family: var(--font-secondary);
    border-radius: 0;
    transition: all var(--transition-fast);
    position: relative;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 0;
    height: 2px;
    background: var(--color-gold);
    transform: translateX(-50%);
    transition: width var(--transition-fast);
}

.nav-link:hover {
    color: var(--color-gold);
    background: rgba(212, 175, 55, 0.1);
}

.nav-link:hover::after {
    width: 80%;
}

.nav-link.active {
    color: var(--color-gold);
    background: rgba(212, 175, 55, 0.15);
}

/* ========================================
   DARK MODE TOGGLE
   ======================================== */

.theme-toggle {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin-left: var(--space-4);
}

/* Facon tahbir : bouton icone compact, lune (jour) / soleil (nuit) */
.theme-toggle-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 8px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease;
}

.theme-toggle-btn:hover {
    color: var(--color-gold);
    border-color: var(--color-gold);
}

.theme-toggle-btn .theme-icon-moon,
.theme-toggle-btn .theme-icon-sun {
    display: none;
}

.theme-toggle-btn .theme-icon-moon {
    display: block;
}

[data-theme="dark"] .theme-toggle-btn .theme-icon-moon {
    display: none;
}

[data-theme="dark"] .theme-toggle-btn .theme-icon-sun {
    display: block;
}

/* ========================================
   MOBILE MENU TOGGLE
   ======================================== */

.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: var(--space-2);
    z-index: 1001;
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background: var(--color-gold);
    border-radius: 0;
    transition: all var(--transition-fast);
    transform-origin: center;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(6px, -6px);
}

/* ========================================
   RESPONSIVE NAVIGATION
   ======================================== */

@media (max-width: 968px) {
    .mobile-menu-toggle {
        display: flex;
    }

    .nav-menu {
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        background: linear-gradient(180deg, var(--color-black) 0%, var(--color-black-light) 100%);
        max-height: 0;
        overflow: hidden;
        transition: max-height var(--transition-normal);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    }

    .nav-menu.active {
        max-height: 500px;
    }

    .nav-link {
        padding: var(--space-4) var(--space-6);
        border-bottom: 1px solid rgba(212, 175, 55, 0.1);
        border-radius: 0;
    }

    .nav-link::after {
        display: none;
    }

    .theme-toggle {
        margin-left: 0;
        padding: var(--space-4) var(--space-6);
        justify-content: center;
        border-top: 2px solid rgba(212, 175, 55, 0.2);
    }
}

/* ========================================
   SMALL SCREENS
   ======================================== */

@media (max-width: 480px) {
    .nav-container {
        padding: 0 var(--space-4);
    }

    .site-logo-text {
        font-size: 20px;
        letter-spacing: 0.5px;
    }
}

/* ========================================
   LANGUAGE SELECTOR DROPDOWN
   ======================================== */

.lang-selector {
    position: relative;
}

.lang-dropdown {
    position: relative;
}

.lang-current {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: transparent;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 6px;
    color: var(--color-white);
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.lang-current:hover {
    border-color: var(--color-gold);
    background: rgba(212, 175, 55, 0.1);
}

.lang-flag {
    font-size: 16px;
}

.lang-code {
    font-weight: 600;
    font-size: 12px;
}

.lang-list {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    padding: 8px 0;
    background: var(--color-black);
    border: 1px solid rgba(212, 175, 55, 0.2);
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    list-style: none;
    min-width: 180px;
    max-height: 400px;
    overflow-y: auto;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
}

.lang-dropdown:hover .lang-list,
.lang-dropdown:focus-within .lang-list {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-list li {
    margin: 0;
    padding: 0;
}

.lang-list li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--color-white);
    text-decoration: none;
    transition: background 0.2s;
}

.lang-list li a:hover {
    background: rgba(212, 175, 55, 0.1);
}

.lang-list li.active a {
    background: rgba(212, 175, 55, 0.15);
    color: var(--color-gold);
}

.lang-name {
    font-size: 14px;
}

/* Scrollbar styling for language list */
.lang-list::-webkit-scrollbar {
    width: 6px;
}

.lang-list::-webkit-scrollbar-track {
    background: transparent;
}

.lang-list::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.3);
    border-radius: 3px;
}

.lang-list::-webkit-scrollbar-thumb:hover {
    background: rgba(212, 175, 55, 0.5);
}

/* ========================================
   TEXT SIZE CONTROL
   ======================================== */

.text-size-control {
    position: relative;
    display: flex;
    align-items: center;
    margin-left: var(--space-4);
}

.text-size-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: transparent;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 8px;
    cursor: pointer;
    transition: all var(--transition-fast);
    color: var(--color-white);
}

.text-size-btn:hover {
    border-color: var(--color-gold);
    background: rgba(212, 175, 55, 0.1);
}

.text-size-btn svg {
    width: 20px;
    height: 20px;
}

.text-size-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--color-black);
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 20px;
    min-width: 250px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s;
    z-index: 1000;
}

.text-size-control:hover .text-size-panel,
.text-size-control:focus-within .text-size-panel {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.text-size-panel label {
    display: block;
    color: var(--color-white);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 12px;
}

.text-size-panel input[type="range"] {
    width: 100%;
    height: 6px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    outline: none;
    -webkit-appearance: none;
    margin-bottom: 10px;
}

.text-size-panel input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--color-gold);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.text-size-panel input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    background: var(--color-gold);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

.text-size-value {
    display: block;
    text-align: center;
    color: var(--color-gold);
    font-size: 16px;
    font-weight: 700;
}

/* ========================================
   RTL SUPPORT (Arabic, Hebrew, etc.)
   ======================================== */

/* RTL: Toggle and Select on left, Menu near Logo on right */
[dir="rtl"] .theme-toggle {
    order: -2;
}

[dir="rtl"] .lang-selector {
    order: -1;
    margin-left: auto;
}

[dir="rtl"] .site-logo-text::after {
    background: linear-gradient(270deg, var(--color-gold) 0%, transparent 100%);
}

[dir="rtl"] .lang-list {
    right: auto;
    left: 0;
}

@media (max-width: 968px) {
    [dir="rtl"] .theme-toggle {
        order: 0;
    }
    [dir="rtl"] .lang-selector {
        order: 0;
        margin-left: 0;
    }
}

/* footer.css */
/**
 * FOOTER MODERNE - Moustaqim.com
 * Design cohérent avec le header (thème Kaaba)
 * Classes uniques: site-footer, footer-*
 */

/* ========================================
   FOOTER PRINCIPAL
   ======================================== */

.site-footer {
    --color-gold: #E8B84B;
    --color-gold-light: #F5D98A;
    --color-gold-dark: #C9901A;
    background: linear-gradient(135deg, var(--color-black) 0%, var(--color-black-light) 100%);
    color: var(--color-white);
    padding: var(--space-12) 0 var(--space-6);
    margin-top: 0;
}

.footer-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-6);
}

/* ========================================
   FOOTER GRID
   ======================================== */

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--space-8);
    margin-bottom: var(--space-8);
}

/* Section Brand */
.footer-brand {
    display: flex;
    flex-direction: column;
    gap: var(--space-4);
}

.footer-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
}

.footer-logo-text {
    font-family: var(--font-primary);
    font-size: 24px;
    font-weight: 700;
    color: var(--color-gold);
    letter-spacing: 1px;
    text-transform: uppercase;
    position: relative;
    padding-bottom: 4px;
}

.footer-logo-text::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--color-gold) 0%, transparent 100%);
}

.footer-description {
    color: rgba(255, 255, 255, 0.65);
    font-size: var(--text-sm);
    line-height: 1.6;
    max-width: 300px;
}

/* Sections de liens */
.footer-section h4,
.footer-section-title {
    color: var(--color-gold);
    font-size: var(--text-md);
    font-weight: 600;
    margin-bottom: var(--space-4);
    padding-bottom: var(--space-2);
    border-bottom: 2px solid rgba(212, 175, 55, 0.3);
}

/* Liens légaux (footer-bottom) : même style clair que les autres liens du footer */
.footer-legal a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    transition: color var(--transition-fast);
}
.footer-legal a:hover { color: var(--color-gold); }

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    line-height: normal;
}

.footer-links li {
    list-style: none;
    margin: 0;
    padding: 0;
    line-height: normal;
}

.footer-links li a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    font-size: var(--text-sm);
    transition: all var(--transition-fast);
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.footer-links li a:hover {
    color: var(--color-gold);
    transform: translateX(4px);
}

/* ========================================
   FOOTER BOTTOM
   ======================================== */

.footer-bottom {
    border-top: 1px solid rgba(212, 175, 55, 0.2);
    padding-top: var(--space-6);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--space-4);
}

.footer-copyright {
    color: rgba(255, 255, 255, 0.6);
    font-size: var(--text-sm);
}

.footer-copyright a {
    color: var(--color-gold);
    text-decoration: none;
}

.footer-copyright a:hover {
    text-decoration: underline;
}

/* Scroll to Top */
.footer-scroll-top {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    color: var(--color-gold);
    background: rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: var(--space-2) var(--space-4);
    border-radius: 0;
    font-size: var(--text-sm);
    font-family: var(--font-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.footer-scroll-top:hover {
    background: var(--color-gold);
    color: var(--color-black);
    transform: translateY(-2px);
}

.footer-scroll-top svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* ========================================
   RESPONSIVE FOOTER
   ======================================== */

@media (max-width: 968px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-6);
    }

    .footer-brand {
        grid-column: 1 / -1;
        text-align: center;
        align-items: center;
    }

    .footer-description {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .site-footer {
        padding: var(--space-8) 0 var(--space-4);
    }

    .footer-container {
        padding: 0 var(--space-4);
    }

    .footer-grid {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .footer-section h4 {
        text-align: center;
    }

    .footer-links {
        align-items: center;
    }

    .footer-links li a:hover {
        transform: none;
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }
}

/* ========================================
   DARK MODE ADJUSTMENTS
   ======================================== */

[data-theme="dark"] .site-footer {
    background: linear-gradient(135deg, #0a0a0a 0%, #151515 100%);
}

[data-theme="dark"] .footer-links li a {
    color: #b0b0b0;
}

/* sommaire.css */
/* Sommaire - fond clair coranique (var --coran-light) uniforme sur tout le site */
.sommaire {
    background: var(--coran-light, #f5f9f7);
    border: 1px solid #e5e5e5;
    border-left: 4px solid #d4af37;
    border-radius: 6px;
    padding: 20px;
    padding-inline-start: 30px;
    margin: 15px 0 20px 0;
}

.sommaire p,
.sommaire-title {
    margin: 0 0 12px 0;
    font-size: 1em;
    font-weight: bold;
}
.sommaire p b { text-decoration: underline; }
.sommaire-title { text-decoration: underline; }

/* Liste : puces indentées (le !important bat la règle AR globale #contenu ul{padding:0}) */
.sommaire ul,
[dir="rtl"] .sommaire ul {
    margin: 0 !important;
    padding-inline-start: 1.6em !important;
    list-style: disc;
}
.sommaire li {
    margin: 8px 0;
    font-size: 1em;
    line-height: 1.6;
}
.sommaire li::marker { color: #d4af37; }

/* Sous-liste (sections d'un contenu long, ex. commentaires de hadith) */
.sommaire ul.sommaire-sub {
    margin: 4px 0 10px !important;
    padding-inline-start: 1.4em !important;
    list-style: circle;
}
.sommaire ul.sommaire-sub li { margin: 3px 0; font-size: .95em; }
.sommaire ul.sommaire-sub2 {
    margin: 2px 0 6px !important;
    padding-inline-start: 1.2em !important;
    list-style: disc;
}
.sommaire ul.sommaire-sub2 li { margin: 2px 0; font-size: .92em; }
.sommaire ul.sommaire-sub2 a { color: #6d5a1a; }

.sommaire a {
    color: #8a6d1f;
    text-decoration: none;
    font-size: 1em;
}
.sommaire a:hover { text-decoration: underline; }

/* RTL : barre dorée côté début (droite) */
[dir="rtl"] .sommaire {
    border-left: 1px solid #e5e5e5;
    border-right: 4px solid #d4af37;
    text-align: right;
}

/* Dark mode */
[data-theme="dark"] .sommaire { background: #1e1e1e; border-color: #333; border-left-color: #d4af37; }
[data-theme="dark"] .sommaire a { color: #e8d99a; }

/* breadcrumb.css */
/**
 * Breadcrumb - Style unifié (FR + AR + EN)
 * Couvre :
 *   - <p> avec <a class="ariane"> (généré par inc/base/ariane.php)
 *   - <nav class="breadcrumb"> (pages custom comme sahabi.php)
 * Règle : taille discrète, fond champagne, identique sur toutes les pages.
 */

/* Wrapper commun - gris très discret, largeur du contenu uniquement
   (exclut .list-intro/.intro : sur les pages où le fil d'Ariane est un <nav>,
    le 1er <p> est l'intro, pas un breadcrumb) */
#contenu > p:first-of-type:not(.list-intro):not(.intro),
.breadcrumb,
nav.breadcrumb {
    font-size: 0.85rem;
    margin: 0 0 18px 0;
    padding: 6px 12px;
    background: #f5f5f5;
    border: none;
    border-radius: 6px;
    color: #888;
    line-height: 1.5;
    display: inline-block;
}

/* Liens - jamais bleu, toujours gris discret */
.ariane,
.ariane:visited,
.ariane:link,
.breadcrumb a,
.breadcrumb a:visited,
.breadcrumb a:link,
nav.breadcrumb a,
nav.breadcrumb a:visited,
nav.breadcrumb a:link,
#contenu > p:first-of-type a,
#contenu > p:first-of-type a:visited,
#contenu > p:first-of-type a:link {
    color: #888 !important;
    text-decoration: none !important;
    transition: color 0.2s ease;
    font-weight: 400;
}

.ariane:hover,
.ariane:active,
.breadcrumb a:hover,
.breadcrumb a:active,
nav.breadcrumb a:hover,
nav.breadcrumb a:active,
#contenu > p:first-of-type a:hover,
#contenu > p:first-of-type a:active {
    color: #555 !important;
    text-decoration: underline !important;
}

/* Séparateurs (plus discrets et petits) */
.ariane + span,
nav.breadcrumb > a + span,
#contenu > p:first-of-type > span:not([style*="font-weight"]) {
    color: #ccc;
    padding: 0 4px;
    font-size: 0.8em;
    user-select: none;
}

/* Dernier élément (page courante) */
#contenu > p:first-of-type > span[style*="font-weight"],
.breadcrumb > span:last-child,
nav.breadcrumb > span:last-child {
    color: #555;
    font-weight: 500;
}

/* === AR : Amiri, taille discrète (PAS 22px - breadcrumb doit rester subtil) === */
[dir="rtl"] #contenu > p:first-of-type:not(.list-intro):not(.intro),
[dir="rtl"] .breadcrumb,
[dir="rtl"] nav.breadcrumb {
    font-family: 'Amiri', 'Traditional Arabic', serif;
    font-size: 1rem;
    direction: rtl;
    text-align: right;
}

/* Mobile */
@media (max-width: 600px) {
    #contenu > p:first-of-type:not(.list-intro):not(.intro),
    .breadcrumb,
    nav.breadcrumb {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
    [dir="rtl"] #contenu > p:first-of-type:not(.list-intro):not(.intro),
    [dir="rtl"] .breadcrumb,
    [dir="rtl"] nav.breadcrumb {
        font-size: 0.95rem;
    }
}

/* Dark mode (Kaaba theme) */
[data-theme="dark"] #contenu > p:first-of-type:not(.list-intro):not(.intro),
[data-theme="dark"] .breadcrumb,
[data-theme="dark"] nav.breadcrumb {
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    border: none;
    color: #d4af37;
}

[data-theme="dark"] .ariane,
[data-theme="dark"] .breadcrumb a,
[data-theme="dark"] nav.breadcrumb a {
    color: #d4af37;
}

[data-theme="dark"] .ariane:hover,
[data-theme="dark"] .breadcrumb a:hover,
[data-theme="dark"] nav.breadcrumb a:hover {
    color: #fff;
}

[data-theme="dark"] #contenu > p:first-of-type > span[style*="font-weight"],
[data-theme="dark"] .breadcrumb > span:last-child,
[data-theme="dark"] nav.breadcrumb > span:last-child {
    color: #fff;
}

/* faq.css */
/* ========================================
   FAQ Component - Moustaqim
   Style accordeon elegant et reutilisable
   ======================================== */

.faq-section {
    margin: 25px 15px;
    padding: 0;
}

.faq-section h2 {
    margin-bottom: 20px;
}

/* Container des items FAQ */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Item FAQ individuel */
.faq-item {
    background: #fff;
    border: 1px solid var(--color-border, #e5e5e5);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.faq-item:hover {
    border-color: var(--color-gold, #d4af37);
}

/* Question (header cliquable) */
.faq-question {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    cursor: pointer;
    background: #fff;
    transition: background 0.2s ease;
    gap: 15px;
}

.faq-question:hover {
    background: rgba(212, 175, 55, 0.03);
}

.faq-question h3,
.faq-question-text {
    font-family: var(--font-primary, Georgia);
    font-size: 16px;
    font-weight: 700;
    color: var(--color-black, #1a1a1a);
    margin: 0;
    padding: 0;
    flex: 1;
    line-height: 1.4;
    border: none;
}

/* Icone fleche */
.faq-icon {
    color: var(--color-gold, #d4af37);
    font-size: 0.8em;
    line-height: 1;
    transition: transform 0.3s ease;
}

.faq-icon::before {
    content: '▼';
}

/* Reponse */
.faq-answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    background: #fff;
}

.faq-answer-inner {
    padding: 0 20px;
    color: #444;
    font-size: 16px;
    line-height: 1.8;
}

.faq-answer-inner p {
    margin: 0 0 15px 0;
    padding: 0;
}

.faq-answer-inner p:last-child {
    margin-bottom: 0;
}

/* Etat ouvert */
.faq-item.open .faq-question {
    background: rgba(212, 175, 55, 0.04);
    border-bottom: 1px solid #f0ece0;
}

.faq-item.open .faq-icon {
    transform: rotate(180deg);
}

.faq-item.open .faq-answer {
    max-height: 500px;
}

.faq-item.open .faq-answer-inner {
    padding: 20px;
}

/* Style sans JS - toujours visible */
.faq-item.static .faq-answer {
    max-height: none;
}

.faq-item.static .faq-answer-inner {
    padding: 20px;
    border-top: 1px solid #f0ece0;
}

.faq-item.static .faq-icon {
    display: none;
}

.faq-item.static .faq-question {
    cursor: default;
}

/* ========================================
   Dark Mode
   ======================================== */
[data-theme="dark"] .faq-item {
    background: #1e1e1e;
    border-color: #333;
}

[data-theme="dark"] .faq-item:hover {
    border-color: var(--color-gold, #d4af37);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.2);
}

[data-theme="dark"] .faq-question {
    background: linear-gradient(to right, #1a1a1a, #1e1e1e);
}

[data-theme="dark"] .faq-question:hover {
    background: linear-gradient(to right, #252525, #1e1e1e);
}

[data-theme="dark"] .faq-question h3,
[data-theme="dark"] .faq-question-text {
    color: #f5f5f5;
}

[data-theme="dark"] .faq-answer {
    background: #1e1e1e;
}

[data-theme="dark"] .faq-answer-inner {
    color: #ccc;
}

[data-theme="dark"] .faq-item.open .faq-question {
    background: linear-gradient(to right, #252518, #1e1e1e);
    border-bottom-color: #333;
}

[data-theme="dark"] .faq-item.static .faq-answer-inner {
    border-top-color: #333;
}

/* ========================================
   RTL Support
   ======================================== */
[dir="rtl"] .faq-question {
    background: linear-gradient(to left, #faf9f6, #fff);
}

[dir="rtl"] .faq-question:hover {
    background: linear-gradient(to left, #f5f3ed, #faf9f6);
}

[dir="rtl"] .faq-item.open .faq-question {
    background: linear-gradient(to left, #fffef5, #fff);
}

[dir="rtl"] .faq-answer-inner {
    text-align: right;
}

/* En RTL : le + à droite (côté début de lecture), texte aligné à droite */
[dir="rtl"] .faq-icon {
    order: -1;
}
[dir="rtl"] .faq-question-text,
[dir="rtl"] .faq-question h3 {
    text-align: right;
}

/* ========================================
   Mobile Responsive
   ======================================== */
@media all and (max-width: 768px) {
    .faq-section {
        margin: 15px 10px;
    }

    .faq-list {
        gap: 10px;
    }

    .faq-question {
        padding: 15px;
    }

    .faq-question h3,
    .faq-question-text {
        font-size: 16px;
    }

    .faq-icon {
        width: 22px;
        height: 22px;
        min-width: 22px;
        font-size: 12px;
    }

    .faq-answer-inner {
        font-size: 16px;
        padding: 15px;
    }

    .faq-item.open .faq-answer-inner {
        padding: 15px;
    }
}

@media all and (max-width: 380px) {
    .faq-question {
        padding: 12px;
    }

    .faq-question h3,
    .faq-question-text {
        font-size: 16px;
    }

    .faq-answer-inner {
        font-size: 16px;
        padding: 12px;
    }
}

/* ========================================
   Schema.org FAQ Microdata support
   ======================================== */
.faq-schema {
    /* Container pour le markup schema.org */
}

/* ========================================
   Variante compacte
   ======================================== */
.faq-list.compact .faq-item {
    border-radius: 8px;
}

.faq-list.compact .faq-question {
    padding: 14px 16px;
}

.faq-list.compact .faq-question h3,
.faq-list.compact .faq-question-text {
    font-size: 16px;
}

.faq-list.compact .faq-answer-inner {
    font-size: 16px;
    padding: 16px;
}

/* ========================================
   Variante avec numeros
   ======================================== */
.faq-list.numbered {
    counter-reset: faq-counter;
}

.faq-list.numbered .faq-item {
    counter-increment: faq-counter;
}

.faq-list.numbered .faq-question::before {
    content: counter(faq-counter);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    min-width: 28px;
    background: var(--color-gold, #d4af37);
    color: #fff;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    margin-right: 12px;
}

[dir="rtl"] .faq-list.numbered .faq-question::before {
    margin-right: 0;
    margin-left: 12px;
}

