/* ========================================
   RESET & BASE
   ======================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Amiri', 'Book Antiqua', sans-serif;
    color: #333;
    line-height: 1.6;
    direction: rtl;
    text-align: right;
    background-color: #fafafa;
    
}

/* ========================================
   BARRE DE DATE
   ======================================== */
.top-date-bar {
    text-align: center;
    padding: 5px 10px;
    font-size: 0.82rem;
    color: #555;
    background: #f8f9fa;
    border-bottom: 1px solid #eee;
    font-family: 'Amiri', serif;
    direction: rtl;
}

/* ========================================
   CONTENEUR GLOBAL
   ======================================== */
.banner-home-link {
    display: block;
    text-decoration: none;
    outline: none;
    border-radius: inherit; /* Hérite des arrondis du conteneur si existants */
    transition: opacity 0.2s, transform 0.2s;
}

.banner-home-link:hover {
    opacity: 0.92;
}

.banner-home-link:focus-visible {
    outline: 3px solid #007bff;
    outline-offset: 2px;
}

/* Sécurité : garantit que les boutons voisins restent cliquables */
.banner-date-below {
    position: relative;
    z-index: 10; /* Reste au-dessus du lien si chevauchement visuel */
}

.site-container {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 16px;
    padding-right: 16px;
    background: #fff;
}
#tarikh {
    margin-right: auto;
    margin-left: auto;
    margin-bottom:0;
}
/* ========================================
   HEADER
   ======================================== */
.site-header {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid #eee;
    position: relative; /* ✅ NÉCESSAIRE pour ::after */
    /* overflow: hidden; */
}
/* ===== BACKGROUND IMAGE TRANSPARENT POUR HEADER ===== */
.site-headerr {
    position: relative; /* ✅ Nécessaire pour le pseudo-élément */
    overflow: hidden;   /* Empêche le débordement de l'image */
}

/* 1️⃣ Image de fond avec transparence 
.site-header::before {
    content: '';
    position: absolute;
    inset: 0; 
    background: url('../images/quran-memorise.jpg') center/cover no-repeat;
    opacity: 0.5; 
    z-index: -1;
    pointer-events: none; 
}*/

/* 2️⃣ Overlay léger pour garantir la lisibilité du texte */
.site-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(255,255,255,0.75) 0%, rgba(255,255,255,0.92) 100%);
    z-index: -1;
    pointer-events: none;
}


/* Sections du header */
.header-section-left,
.header-section-center,
.header-section-right {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 8px;
}

.header-section-center {
    justify-content: center;
       /* Background image */
/*     background: url('../images/logo_kitane.png') center no-repeat;
    background-size: contain;
    min-height: 80px; */

}

.header-section-right {
    justify-content: center;
}
.header-section-left {
    justify-content: center;

}

/* Logo */
.header-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.header-logo img {
    height: 50px;
    width: auto;
    display: inline-block;
}

/* ========================================
   RECHERCHE
   ======================================== */
.header-search {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.header-search input {
    width: 140px;
    padding: 6px 10px;
    font-size: 0.95rem;
    border: 1px solid #ccc;
    border-radius: 20px;
    text-align: right;
    direction: rtl;
    font-family: 'Amiri', sans-serif;
}

.search-toggle {
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: #222;
    padding: 6px;
}

.search-overlay {
    display: none; /* Caché par défaut */
    position: relative;
    margin: 8px auto 16px;
    max-width: 600px;
    width: 90%;
    text-align: center;
    z-index: 100;
}

.search-overlay.active {
    display: block;
    animation: fadeIn 0.2s ease;
}

.search-overlay input {
    width: 100%;
    padding: 10px 16px;
    font-size: 1rem;
    border: 2px solid #007bff;
    border-radius: 30px;
    text-align: right;
    direction: rtl;
    font-family: 'Amiri', sans-serif;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* ========================================
   MENU HAMBURGER
   ======================================== */
.hamburger-section:first-child a {
    font-weight: 600 !important;
    color: #007bff !important;
    /* font-size: 1.05rem; */
}

.hamburger-section:first-child h4 {
    background: linear-gradient(135deg, #28a745, #20c997) !important; /* Vert pour "Accueil" */
    box-shadow: 0 2px 6px rgba(40, 167, 69, 0.3) !important;
}
   .header-hamburger {
    flex: 0 0 auto;
    position: relative;
}

.hamburger-btn {
    background: #007bff;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.hamburger-dropdown {
    position: fixed;
    top: 0;
    right: 0;              /* ✅ Ancré à droite (début du flux RTL) */
    width: 320px;
    max-width: 85vw;       /* ✅ S'adapte aux petits écrans */
    height: 100vh;
    background: #fff;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.15);
    z-index: 1050;
    overflow-y: auto;
    padding: 24px 20px;
    direction: rtl;

    /* 🚀 État initial : hors écran à droite */
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.35s;
}

/* ✅ État actif : glisse vers la gauche jusqu'à sa place */
.hamburger-dropdown.show {
    transform: translateX(0);
    visibility: visible;
}
.menu-backdrop {
    position: fixed; inset: 0; background: rgba(0,0,0,0.4);
    z-index: 1040; opacity: 0; visibility: hidden;
    transition: opacity 0.3s ease;
}
.menu-backdrop.show { opacity: 1; visibility: visible; }
body.menu-open { overflow: hidden; }

.hamburger-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 12px 16px;
    border: 1px solid #e9ecef;
    margin-bottom: 12px;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
    box-sizing: border-box; /* ✅ Important */
}
.hamburger-section:last-child {
    margin-bottom: 0;
}

.hamburger-section h4 {
    margin: 0 0 10px 0;
    padding: 8px 12px;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: #fff;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    text-align: right;
    direction: rtl;
    box-shadow: 0 2px 6px rgba(0,123,255,0.25);
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%; /* ✅ Ajouté */
}

.hamburger-section a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 4px;
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s, padding-right 0.2s;
    direction: rtl;
    text-align: right;
    border-radius: 6px;
    width: 100%; /* ✅ Ajouté */
}
.hamburger-section a:hover{
        background: linear-gradient(50deg, #85a8ce, #d3d8dd);
        color:#20c997;
}
/* Séparateur entre sections */
.hamburger-section + .hamburger-section {
    position: relative;
    margin-top: 4px;
}

.hamburger-section + .hamburger-section::before {
    content: '';
    position: absolute;
    top: -6px;
    right: 16px;
    left: 16px;
    height: 1px;
    background: linear-gradient(90deg, transparent, #ddd, transparent);
}

/* ========================================
   ONGLES DE CATÉGORIES
   ======================================== */
.categories-bar {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 8px 0; 
    
}

.cat-item {
    white-space: nowrap;
    padding: 8px 16px;
    background: #f5f5f5;
    border-radius: 20px;
    text-decoration: none;
    /* color:#060633; */
    font-family: 'amiri', serif;
    font-size: 1.05rem;
    font-weight: 600;
    transition: background 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.cat-item:hover,
.cat-item.active {
    background: #007bff;
    color: white;
}

/* Desktop : une seule ligne scrollable */
@media (min-width: 768px) {
    .categories-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;

    }
    
    .categories-bar::-webkit-scrollbar {
        display: none;
    }
    
}

/* ========================================
   CONTENU PRINCIPAL
   ======================================== */
.articles-main {
    display: flex;
    flex-direction: column;
    /* gap: 24px; */
    padding: 8px 0;
}

/* ========================================
   ARTICLE HERO (PLEINE LARGEUR)
   ======================================== */
.featured-article {
    position: relative;
    display: block;
    width: 100%;
    height: 380px;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.12);
    transition: transform 0.2s ease;
}

.featured-article:hover {
    transform: translateY(-3px);
}

.featured-img,
.featured-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.featured-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 60px;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 60%, transparent 100%);
    text-align: right;
    direction: rtl;
}

.featured-overlay h2 {
    margin: 0;
    font-size: 1.4rem;
    line-height: 1.4;
    color: #fff;
    font-weight: 700;
}

/* ========================================
   GRILLE D'ARTICLES
   ======================================== */
.articles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    position: relative;
    margin-top: 28px;
    /* padding-top: 28px; */
}

.articles-grid::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80%;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, #dee2e6 50%, transparent 100%);
    opacity: 0.7;
}

/* ========================================
   CARTE ARTICLE
   ======================================== */
.article-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    text-decoration: none;
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    height: 100%;
}

.article-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.card-img-wrapper {
    position: relative;
    width: 100%;
    height: 180px;
    overflow: hidden;
    flex-shrink: 0;
}

.card-img-wrapper img,
.card-img-wrapper .placeholder-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.article-card:hover .card-img-wrapper img {
    transform: rotate(3deg) scale(1.08);
}

.placeholder-img {
    background: #eee;
    color: #888;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.3) 50%, transparent 100%);
    display: flex;
    align-items: flex-end;
    padding: 12px;
    opacity: 0;
    transition: opacity 0.3s ease;
    direction: rtl;
    pointer-events: none;
    text-align: right;

}
.featured-article:hover .card-overlay ,
.article-card:hover .card-overlay ,
.article-card:hover .card-overlay {
    opacity: 1;
    pointer-events: auto;
}

.card-overlay p {
    color: #fff;
    font-size: 0.82rem;
    line-height: 1.45;
    margin: 0;
    text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

/* ========================================
   INFOS ARTICLE (TITRE + CATÉGORIE)
   ======================================== */
.card-info {
    padding: 12px 14px;
    direction: rtl;
    text-align: right;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.card-info h3 {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #2c3e50;
    font-weight: 700;
    text-align: right;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Amiri_b', serif;
}
.card-info:hover {
    background: rgba(161, 149, 185, 0.5);
}

 /* ========================================
   BADGE CATÉGORIE
   ======================================== */
.card-cat {
    display: inline-block;
    
    /* Style */
    padding: 5px 16px !important;
    background: linear-gradient(135deg, #b5bbc4, #204377) !important;
    color: #ffffff !important;
    border-radius: 20px !important;
    font-size: 1.05rem !important;
    /* font-weight: 600 !important; */
    text-decoration: none !important;
    text-align: center !important;
    white-space: nowrap;
    font-family: 'ae_AlBattar', serif;
    transition: all 0.2s ease;
    box-shadow: 0 2px 6px rgba(13,110,253,0.3);
    border: none !important;
    line-height: 1.4 !important;
}



/* ========================================
   FOOTER
   ======================================== */
.site-footer {
    padding: 20px 0;
    background: #fafafa;
    border-top: 1px solid #eee;
}

.footer-container {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: center;
    align-items: stretch;
}

.footer-col {
    flex: 1 1 220px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.author-photo {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #ddd;
    display: block;
    margin: 0 auto;
}

.quran-verse {
    font-family: 'Amiri', serif;
    font-size: 1.15rem;
    line-height: 1.5;
    color: #007bff;
    margin: 0;
    padding: 0 12px;
}

.verse-ref {
    display: block;
    font-size: 1rem;
    color: #555;
    margin-top: 6px;
}

.author-name {
    font-family: 'Amiri', serif;
    font-size: 1.2rem;
    font-weight: bold;
    color: #007bff;
    padding: 8px 16px;
    background: white;
    border: 2px solid #007bff;
    border-radius: 12px;
    box-shadow: 0 3px 8px rgba(0,0,0,0.12);
    margin-bottom: 12px;
    display: inline-block;
}

/* ========================================
   RÉSEAUX SOCIAUX
   ======================================== */
.social-icons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: transparent;
    transition: all 0.2s ease;
    text-decoration: none;
}

.social-icons a[href^="mailto:"] svg {
    fill: #4da6ff !important;
    transition: fill 0.2s;
}

.social-icons a[href*="facebook.com"] svg {
    fill: #1877F2 !important;
}

.social-icons a[href*="youtube.com"] svg {
    fill: #FF0000 !important;
}

.social-icons a[href*="tiktok.com"] svg {
    fill: #000000 !important;
}

.social-icons a:hover {
    transform: translateY(-3px);
    background: rgba(255,255,255,0.25);
}

.social-icons a[href^="mailto:"]:hover svg { fill: #007bff !important; }
.social-icons a[href*="facebook.com"]:hover svg { fill: #145dbf !important; }
.social-icons a[href*="youtube.com"]:hover svg { fill: #cc0000 !important; }
.social-icons a[href*="tiktok.com"]:hover svg { fill: #696969 !important; }

.social-icons a[href*="facebook.com"]:hover { background: #1877F2; }
.social-icons a[href*="youtube.com"]:hover { background: #FF0000; }
.social-icons a[href*="tiktok.com"]:hover { background: #000; }
.social-icons a[href^="mailto:"]:hover { background: #4da6ff; }

.social-icons a:hover svg {
    fill: #ffffff !important;
}

/* ===== BARRE DE PARTAGE ARTICLE ===== */
.article-share-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 0;
    margin-bottom: 24px;
    border-bottom: 1px solid #e9ecef;
    direction: rtl;
}

.share-label {
    font-weight: 700;
    color: #495057;
    font-size: 0.95rem;
    white-space: nowrap;
    font-family: 'Amiri', serif;
}

.share-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    font-size: 0.85rem;
    font-family: 'Amiri', serif;
}

.share-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.share-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    opacity: 0.95;
}

.share-btn:active {
    transform: translateY(-1px);
}

/* Couleurs des réseaux */
.share-btn.fb { background: #1877F2; }
.share-btn.tw { background: #0F1419; }
.share-btn.wa { background: #25D366; }
.share-btn.tg { background: #0088CC; }
.share-btn.mail { background: #EA4335; }
.share-btn.copy { background: #6C757D; }
.share-btn.copy.copied { background: #28A745; }

/* ========================================
   PAGE DE RECHERCHE
   ======================================== */
.search-results {
    padding: 24px 0;
}

.search-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 16px;
    text-align: center;
    direction: rtl;
}

.search-title span {
    color: #007bff;
    background: #f0f7ff;
    padding: 2px 8px;
    border-radius: 4px;
}

.search-info,
.search-no-results,
.search-count {
    text-align: center;
    font-size: 1.1rem;
    color: #555;
    direction: rtl;
    background: #fff;
    border: 2px dashed red;
    padding: 10px;
    margin: 20px;
}

.search-no-results {
    background: #fff3cd;
    border-radius: 8px;
    margin-bottom: 16px;
}

.search-suggestion {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    font-size: 0.95rem;
    color: #666;
    line-height: 1.8;
}

.search-excerpt {
    font-size: 0.88rem;
    color: #666;
    line-height: 1.6;
    margin: 8px 0;
    padding: 8px;
    background: #f8f9fa;
    border-radius: 6px;
    direction: rtl;
    text-align: right;
    text-decoration: none;
}

.search-match-count {
    font-size: 0.8rem;
    color: #007bff;
    margin-top: 8px;
    font-weight: 500;
}

/* ===== FORMULAIRE DE RECHERCHE ===== */
.search-form {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    max-width: 320px;
    width: 100%;
    
    margin: 0 auto;           /* ✅ CENTRE LE FORMULAIRE SUR LA PAGE */
    justify-content: center;  /* ✅ CENTRE INPUT/BOUTON À L'INTÉRIEUR */
}

/* Bouton "ابحث" */
.search-submit {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: #ffffff;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-family: 'Amiri', serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0; /* ✅ Empêche le bouton de se compresser */
    box-shadow: 0 2px 6px rgba(0,123,255,0.25);
}

.search-submit:hover {
    background: linear-gradient(135deg, #0056b3, #004494);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,123,255,0.35);
}

/* Champ de saisie */
.search-form input {
    flex: 1; /* Prend tout l'espace restant à gauche */
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    font-family: 'Amiri', serif;
    font-size: 0.95rem;
    text-align: right;
    direction: rtl;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-form input:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.15);
}

/* ========================================
   SURLIGNAGE DES RÉSULTATS
   ======================================== */
.search-highlight {
    background: linear-gradient(135deg, #ffeb3b 0%, #ffc107 100%);
    color: #000;
    padding: 2px 4px;
    border-radius: 3px;
    font-weight: 700;
    box-shadow: 0 1px 3px rgba(255, 193, 7, 0.4);
}

/* Animation au chargement */
@keyframes highlightPulse {
    0% { background-color: #ffeb3b; }
    50% { background-color: #ffc107; }
    100% { background-color: #ffeb3b; }
}

.search-highlight {
    animation: highlightPulse 2s ease-in-out 3;
}
/* Conteneur principal */
/* ===== BANNER PRINCIPAL ===== */

.banner-layout {
    max-width: 1140px;       /* ✅ Alignez sur la largeur de votre contenu */
    margin: 0 auto;          /* ✅ Centre le bloc */
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    /* padding: 20px 16px 0;    Marge intérieure (haut, côtés, bas) */
    width: 100%;
    box-sizing: border-box;
}

/* ===== BANNER PRINCIPAL ===== */
.site-banner {
    flex: 1;                 /* ✅ Prend tout l'espace restant */
    min-width: 0;            /* ✅ Empêche le débordement flexbox */
     /*height: 200px;           ✅ Hauteur fixe pour uniformité */
    border-radius: 16px;
    position: relative; /* ✅ Obligatoire pour positionner les enfants */
    overflow: visible;  /* ✅ Permet aux boutons de dépasser légèrement si besoin */    max-width: 900px;
}

.site-banner .banner-image {
    width: 100%;
    height: 100%;
    object-fit: cover;       /* ✅ SUPPRIME LA TRONCATURE : recadre proprement */
    object-position: center; /* ✅ Centre l'image */
    display: block;
    line-height: 0;
    border-radius: 16px;
}
/* ===== BOUTONS FLOTTANTS ===== */
.site-banner .hamburger-btn,
.site-banner .search-toggle {
    position: absolute;
    top: 4px;
    z-index: 20; /* ✅ Au-dessus de l'image et de la date */
    border-radius: 12px;    width: 46px;
    height: 46px;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    color:blueviolet;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.35rem;
    cursor: pointer;
    padding: 0;
    transition: all 0.2s ease;
}

.site-banner .hamburger-btn:hover,
.site-banner .search-toggle:hover {
    background: #fff;
    transform: scale(1.08);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
    background: rgba(184, 176, 197, 0.95);

}

/* Positionnement RTL : Droite = Début, Gauche = Fin */
.site-banner .hamburger-btn { right: 4px; } /* ☰ Haut Droite */
.site-banner .search-toggle { left: 4px; }  /* 🔍 Haut Gauche */

/* ===== BARRE DATE (Nettoyée) ===== */
.banner-date-below {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 6px 0 10px;
    position: relative;
    z-index: 10;
    /* Supprimez tout gap/justify-content space-between ici */
}

/* ✅ Date centrée : style "onglet" turquoise */
.banner-date-below .date-hijri {
    background: #b2ebf2;            /* Turquoise clair */
    color: #004d40;                 /* Texte vert foncé */
    padding: 8px 24px;
    border-radius: 0 0 20px 20px;   /* Arrondi vers le bas */
    font-family: 'Amiri', serif;
    font-size: 0.9rem;
    font-weight: 700;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(0, 150, 136, 0.15);
    text-align: center;
}




.banner-side-img {
    width: 200px;
    height: 200px;           /* Même hauteur que le banner */
    object-fit: cover;
    border-radius: 10px;
    align-items: right;
}
/* ===== HEADER-TOP (après le banner) ===== */
.header-top {
    background: #fff;
    /* padding: 12px 20px; */
    border-bottom: 1px solid #e9ecef;
}

/* ===== TARICH-BAR (ligne 2) ===== */
.tarikh-bar {
    background: #f8f9fa;
    padding: 8px 16px;
    border-bottom: 1px solid #e9ecef;
    gap: 8px !important;
}



/* ========================================
   MOBILE
   ======================================== */
@media (max-width: 767px) {
    .header-top {
    /* min-height: 200px; */
    background-size: 100% auto; 

}
/* ===== MOBILE : Barre de catégories compacte (1 ligne) ===== */

.categories-bar {
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 8px;
        overflow-x: auto;
        white-space: nowrap;
        padding: 6px 12px;
        margin: 0;
        background: #fff;
        border-bottom: 1px solid #e9ecef;
        
        /* ✅ Hauteur maîtrisée */
        min-height: 38px;
        /* max-height: 58px; */
        
        /* Scroll tactile fluide */
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
    }
    .categories-bar::-webkit-scrollbar { display: none; } /* Chrome/Safari */

    .cat-item {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 6px 14px;
        background: #f1f5f9;
        border: 1px solid #cbd5e1;
        border-radius: 20px;
        text-decoration: none;
        color: #334155;
        font-size: 0.82rem;
        font-weight: 600;
        white-space: nowrap;
        transition: all 0.2s;
        flex-shrink: 0; /* ✅ Empêche l'écrasement */
        line-height: 1.2;
    }
    .cat-item.active, .cat-item:hover {
        background: #007bff;
        color: #fff;
        border-color: #007bff;
    }
/* ===== IMAGES LATÉRALES (200px) ===== */
.banner-side-img {
    display: none;           /* ✅ Caché sur mobile par défaut */
}
    .banner-layout {
        padding: 12px 8px 0;
        gap: 0;
    }
    
    .site-banner {
         /* height: 140px;      ✅ Hauteur réduite sur mobile */
    border-radius: 12px; /* Un peu moins rond sur mobile */

    }
.banner-date-below {
        padding: 4px 8px !important;       /* ✅ Padding minimal */
        gap: 6px !important;               /* ✅ Espace réduit entre éléments */
        margin-top: -6px;                  /* ✅ Ajustez ici : -3px (léger) → 0 (net) → 5px (espace) */
        box-sizing: border-box;            /* ✅ Empêche le padding d'élargir le conteneur */
        max-width: 100%;                   /* ✅ Bloque tout débordement horizontal */
        overflow-x: hidden;                /* ✅ Coupe proprement si dépassement résiduel */
    }

    .banner-date-below .date-hijri {
        padding: 3px 10px !important;      /* ✅ Padding très réduit */
        font-size: 0.75rem !important;     /* ✅ Texte compact */
        border-radius: 10px;               /* ✅ Coins adoucis pour petit espace */
        white-space: nowrap;               /* ✅ Empêche la date de passer à la ligne */
    }

    /* ✅ Boutons : taille fixe pour ne pas casser l'alignement */
    .banner-date-below .hamburger-btn,
    .banner-date-below .search-toggle {
        padding: 4px 6px !important;       /* ✅ Boutons compacts */
        font-size: 1.05rem !important;
        min-width: 32px;                   /* ✅ Taille minimale stable */
        flex-shrink: 0;                    /* ✅ Ne s'écrase jamais */
        width: 40px;                /* ✅ Largeur fixe = alignement prévisible */
        transform: translateY(0px);
        margin-right: 0px; /* Pousse le bouton (côté droit) vers le centre */
        margin-left: 0px;  /* Pousse le bouton (côté gauche) vers le centre */
        border-radius: 10px;
        width: 40px;
        height: 40px;
    }
     
 .tarikh-bar {
        flex-wrap: nowrap !important;       /* ✅ Interdit strictement le passage à la ligne */
        justify-content: space-around !important; /* Répartit : ☰ | Date | 🔍 */
        gap: 6px !important;
        padding: 6px 8px;
        width: 100%;
    }

    /* Boutons : taille fixe, ne rétrécissent jamais */
    .tarikh-bar .hamburger-btn,
    .tarikh-bar .search-toggle {
        flex-shrink: 0 !important;
        font-size: 1.15rem;
        padding: 4px 6px;
        margin: 0;
        line-height: 1;
    }

    /* Bloc Date : s'adapte et se compresse */
    .tarikh-bar #tarikh {
        flex: 1 !important;                 /* Prend l'espace restant */
        min-width: 0 !important;            /* ✅ Clé : autorise la compression flexbox */
        margin: 0 !important;               /* Annule mx-3 de Bootstrap */
        justify-content: center;
        overflow: hidden;
        white-space: nowrap;
    }

    /* Badges : texte ultra-compact */
    .tarikh-bar #tarikh .badge {
        font-size: 0.65rem !important;
        padding: 2px 4px !important;
        margin: 0 !important;
        vertical-align: middle;
    }

    /* Cache les labels verbeux sur mobile (gain de place) */
    .tarikh-bar #tarikh .d-none {
        display: none !important;
    }
    .tarikh-bar #tarikh h5 {
        font-size: 0.65rem !important;     /* Texte très compact sur mobile */
        padding: 2px 4px !important;
        margin: 0 !important;
        white-space: nowrap !important;    /* ✅ Empêche le texte de se couper */
        line-height: 1.2 !important;
    }
    .article-share-bar {
        /* flex-direction: column; */
        align-items: flex-start;
        gap: 10px;
    }
    .share-btn {
        width: 34px;
        height: 34px;
    }
    .share-btn svg {
        width: 16px;
        height: 16px;
    }
    .search-title {
        font-size: 1.2rem;
    }
    
    .search-excerpt {
        font-size: 0.82rem;
    }

    .site-header::after,
    .articles-grid::before {
        left: 5%;
        right: 5%;
        width: auto;
    }
    

    .site-header::before {
        background: none;
    }
    .header-search input {
        width: 80px;
        font-size: 0.9rem;
        padding: 5px 8px;
    }
    
    .featured-article {
        height: 260px;
        border-radius: 8px;
    }
    
    .featured-overlay {
        padding: 16px;
    }
    
    .featured-overlay h2 {
        font-size: 1.1rem;
    }
    
    .articles-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        margin-top: 20px;
        padding-top: 20px;
    }
    
    .card-img-wrapper {
        height: 150px;
    }
    
    .card-info {
        /* min-height: 90px; */
        padding: 10px 12px;
    }
    
    .card-info h3 {
        font-size: 0.9rem;
    }
    
    .card-overlay p {
        font-size: 0.78rem;
    }
    
    .card-cat {
        padding: 4px 12px !important;
        font-size: 0.72rem !important;
        margin-top: auto !important;
    }
    
    .footer-container {
        gap: 24px;
    }
    
    .footer-col {
        flex: 1 1 100%;
        min-height: auto;
        justify-content: flex-start;
        /* padding: 12px; */
    }
    
    .footer-col:not(:last-child) {
        position: relative;
        padding-bottom: 20px;
        /* margin-bottom: 20px; */
    }
    
    .footer-col:not(:last-child)::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 10%;
        right: 10%;
        height: 1px;
        background: linear-gradient(to right, transparent, #ccc, transparent);
    }
    
    .author-photo {
        width: 80px;
        height: 80px;
    }
    
    .quran-verse {
        font-size: 1.05rem;
    }
    
    .author-name {
        font-size: 1.1rem;
    }
    
    .social-icons a {
        width: 48px;
        height: 48px;
    }
    
    .social-icons a svg {
        width: 28px !important;
        height: 28px !important;
    }
    
    .cat-item {
        padding: 8px 10px;
    }
    
   .hamburger-dropdown {
        width: 100vw;
        border-radius: 0;
        box-shadow: none;
        overscroll-behavior: contain !important; /* Safari/Chrome moderne */
        -webkit-overflow-scrolling: touch;
    }
    
    .hamburger-section {
        padding: 10px 14px;
    }
    
    .hamburger-section h4 {
        font-size: 0.9rem;
        padding: 7px 10px;
    }
    
    .hamburger-section a {
        font-size: 0.85rem;
        padding: 7px 4px;
    }
    
    .top-date-bar {
        font-size: 0.75rem;
        padding: 4px 8px;
    }
    
.search-overlay {
      /* ✅ Positionnement absolu pour le mettre dans la ligne du header */
     position: absolute;
     top: 150px;
     left: calc(100% /2px);
     width: calc(100% - 32px);
     max-width: none;
     margin: 0 auto; /* ✅ Centre l'élément horizontalement */

    }
    
    .search-overlay input {
        padding: 10px;
        font-size: 0.95rem;
    }
    
    .header-section-right,
    .header-section-left {
        justify-content: center;
    }
    .header-section-center {
        min-height: 80px; /* Plus compact sur mobile */
    }
}

/* Desktop : icônes plus grandes */
@media (min-width: 768px) {
    .social-icons svg {
        width: 32px !important;
        height: 32px !important;
    }
    .search-overlay {
        /* ✅ Positionnement absolu pour le mettre dans la ligne du header */
        position: absolute;
        top: 20px;
        left: -280px; /* Ajustez selon la largeur de la loupe + marge */
        transform: translateY(-50%);
        
        /* ✅ Style inline */
        display: none !important; /* Caché par défaut */
        margin: 0;
        width: auto;
        max-width: 300px;
        text-align: right;
        padding: 0;
        z-index: 90; /* Derrière le header mais devant le contenu */
    }
    
    .search-overlay.active {
        display: flex !important; /* ✅ Affiché en flex quand actif */
        animation: slideInLeft 0.2s ease;
    }
    
    @keyframes slideInLeft {
        from { opacity: 0; transform: translate(20px, -50%); }
        to { opacity: 1; transform: translate(0, -50%); }
    }
    
    .search-form {
        justify-content: flex-end; /* Aligné à droite (côté loupe) */
        gap: 6px;
    }
    
    .search-overlay input {
        width: 180px;
        padding: 6px 10px;
        font-size: 0.9rem;
    }
    
    .search-submit {
        padding: 6px 14px;
        font-size: 0.9rem;
    }
}
/* ===== MODAL "عن الموقع" - VERSION RTL CORRECTED ===== */

.modal-overlay {
    display: none !important;
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0, 0, 0, 0.65);
    z-index: 99999 !important;
    align-items: center;
    justify-content: center;
    padding: 20px;
    direction: rtl; /* ✅ Force la direction RTL */
}

.modal-overlay.active {
    display: flex !important;
    animation: fadeIn 0.2s ease;
}

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

.modal-content {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 550px;
    /* max-height: 85vh; */
    overflow-y: auto;
    box-shadow: 0 25px 50px rgba(0,0,0,0.3);
    position: relative;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    
    /* ✅ Styles globaux pour le contenu arabe */
    direction: rtl;
    text-align: right;
}

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

/* Bouton fermer : en haut à gauche (fin de lecture RTL) */
.modal-close {
    position: absolute;
    top: 16px;
    left: 16px; /* ✅ Gauche pour le RTL */
    right: auto;
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.8rem;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}
.modal-close:hover { background: #fee2e2; color: #dc2626; transform: rotate(90deg); }

/* En-tête */
.modal-header { 
    padding: 24px 40px 16px 24px; /* ✅ Padding gauche plus grand pour éviter le bouton */
    border-bottom: 1px solid #e9ecef; 
}
.modal-header h3 { 
    margin: 0; 
    font-size: 1.3rem; 
    color: #0f172a; 
    font-family: 'Amiri', serif; 
    text-align: right; /* ✅ Alignement texte */
}

/* Corps du texte */
.modal-body { padding: 20px 28px; }
.about-section { margin-bottom: 20px; }
.about-section h4 { 
    margin: 0 0 10px; 
    font-size: 1.1rem; 
    color: #007bff; 
    font-weight: 700; 
    text-align: right;
}
.about-section p { 
    color: #475569; 
    line-height: 1.8; 
    font-size: 0.98rem; 
    text-align: justify; /* ✅ Justification pour un texte arabe propre */
}

/* Liste des objectifs (Puces à droite) */
.objectives-list { 
    list-style: none; 
    padding: 0; 
    margin: 0; 
}
.objectives-list li { 
    margin-bottom: 10px; 
    color: #475569; 
    line-height: 1.7; 
    font-size: 0.95rem; 
    position: relative;
    padding-right: 20px; /* ✅ Espace pour la puce à droite */
    padding-left: 0;
    list-style: none;

}
.objectives-list li::before { 
    content: '•'; 
    color: #007bff; 
    font-weight: bold; 
    position: absolute; 
    right: 0; /* ✅ Puce collée à droite */
    left: auto;

}

/* Pied de page (Boutons) */
.modal-footer {
    padding: 16px 28px 24px;
    border-top: 1px solid #e9ecef;
    display: flex;
    gap: 12px;
    justify-content: flex-end; /* ✅ Boutons alignés à gauche (fin de ligne RTL) */
    flex-wrap: wrap;
}
.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border-radius: 8px;
    font-family: 'Amiri', serif;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: transform 0.2s, box-shadow 0.2s;
}
.btn-primary { background: #007bff; color: #fff; }
.btn-primary:hover { background: #0056b3; transform: translateY(-2px); }
.btn-secondary { background: #e2e8f0; color: #334155; }
.btn-secondary:hover { background: #cbd5e1; }

/* 📱 Mobile */
@media (max-width: 480px) {
    .modal-content { max-width: 100%; border-radius: 12px; }
    .modal-header h3 { font-size: 1.1rem; }
    .modal-footer { flex-direction: column-reverse; }
    .btn-primary, .btn-secondary { width: 100%; text-align: center; }
}
/* Toggle contenu modal sans dupliquer les styles */
.modal-section { display: none; }
.modal-section.active { display: block; }
/* Force le bouton fermer au-dessus de tout */
/* Force le bouton fermer à être au-dessus et cliquable */
.modal-close {
    position: relative;
    z-index: 100 !important;
    pointer-events: auto !important; /* ✅ Garantit que le clic passe */
    cursor: pointer;
}
/* ===== PHOTO AUTEUR DANS MODAL ===== */
.author-photo-container {
    text-align: center;
    margin: 20px 0 25px;
    padding: 0;
}

.author-photo {
    width: 150px;
    height: 150px;
    border-radius: 50%; /* Cercle parfait */
    object-fit: cover; /* Recadre sans déformer */
    border: 4px solid #e2e8f0;
    box-shadow: 0 8px 20px rgba(0, 123, 255, 0.15);
    transition: all 0.3s ease;
    background: #fff;
}

.author-photo:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 12px 30px rgba(0, 123, 255, 0.25);
    border-color: #007bff;
}

/* 📱 Mobile : photo plus petite */
@media (max-width: 480px) {
    .author-photo {
        width: 120px;
        height: 120px;
    }
}
/* ===== CORRECTION DÉBORDEMENT MOBILE ===== */
html, body {
    overflow-x: hidden !important;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

/* ✅ Boîte cohérente partout (évite width:100% + padding > écran) */
*, *::before, *::after {
    box-sizing: border-box !important;
}

/* ✅ Sécurité pour tous les conteneurs principaux */
.site-banner,
.banner-date-below,
.search-overlay-float,
.nav-controls-wrapper,
.categories-bar {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* 📱 Mobile : force les éléments flottants à rester dans l'écran */
@media (max-width: 768px) {
    .search-overlay-float {
        width: calc(100% - 24px) !important;
        left: 12px !important;
        right: auto !important;
        max-width: 280px;
    }
    
    .banner-date-below {
        padding: 6px 12px !important;
        max-width: 100% !important;
    }

    .site-banner .hamburger-btn,
    .site-banner .search-toggle {
        max-width: 40px;
    }
    
}
/* Style spécifique pour le دفتر ذهبي */
#diftar-form .form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.15);
}

.message-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.2s ease;
}

.admin-reply {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    border-right-color: #10b981 !important;
}

/* Animation d'apparition des nouveaux messages */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}
.message-item {
    animation: fadeIn 0.3s ease;
}
/* ===== FORÇAGE RTL POUR LE FORMULAIRE DIFTAR ===== */
.diftar-wrapper,
.diftar-wrapper form,
.diftar-wrapper input,
.diftar-wrapper textarea,
.diftar-wrapper label,
.diftar-wrapper .form-control {
    direction: rtl !important;
    text-align: right !important;
}

/* Placeholder en RTL */
.diftar-wrapper input::placeholder,
.diftar-wrapper textarea::placeholder {
    text-align: right;
    color: #94a3b8;
}

/* Labels alignés à droite */
.diftar-wrapper .col-form-label {
    text-align: right !important;
    justify-content: flex-end;
}

/* Messages d'erreur alignés à droite */
.diftar-wrapper .invalid-feedback,
.diftar-wrapper .alert {
    text-align: right !important;
    direction: rtl !important;
}

/* Bouton : icône à droite du texte en RTL */
.diftar-wrapper button[type="submit"] {
    display: inline-flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 8px;
}
