/* =========================================================================
   niefrar.org — CSS overrides (a coller dans Apparence > Personnaliser > CSS additionnel)
   Date : 2026-04-24
   Couvre priorites 2, 4, 10 du rapport d'audit
   ========================================================================= */

/* ---- 1) Remplacer la banniere dunes par le PNG typographique Aref Ruqaa ----
   La "banniere dunes" est en fait l'ancien <img src=".../logo-deff.png"> (1010x149)
   qui combine texte arabe + photo des dunes. On remplace son rendu via content:url
   (contourne le style inline du theme qui force #theme-header { background: initial !important }). */

/* On casse le logo hors du .container de 1010px pour qu'il prenne toute la largeur du header */
#theme-header .header-content {
  width: 100% !important;
  max-width: none !important;
  padding: 0 !important;
}
#theme-header .logo {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}
#theme-header .logo h1 {
  margin: 0 !important;
  padding: 0 !important;
  line-height: 0 !important;
}
#theme-header .logo a {
  display: block !important;
  width: 100% !important;
  line-height: 0 !important;
}

/* L'<img> devient un bandeau large : 100% largeur, hauteur genereuse, cover pour remplir */
.logo img[src*="logo-deff"],
#theme-header .logo img,
.theme-header .logo img {
  content: url('https://niefrar.org/wp-content/uploads/2026/04/niefrar_banner_3200x320.png') !important;
  width: 100% !important;
  max-width: none !important;
  height: 180px !important;
  object-fit: cover !important;
  object-position: center center !important;
  display: block !important;
  margin: 0 !important;
}

/* Masquer le texte <strong> qui apparait en doublon par-dessus le bandeau */
.logo h1 strong,
.logo strong,
#logo strong,
.site-branding strong { display: none !important; }

/* Couleur de fond vert fonce pour les bandes entourant la banniere */
#theme-header, .top-nav {
  background-color: #0c3b24 !important;
}

/* Header tagline si presente */
#site-description, .site-description { display: none !important; }

/* ---- 2) Post-meta : passer #999 a #555 (contraste 2.85 -> ~7.5) ---- */
.post-meta, .post-meta span, .post-meta a,
.entry-meta, .entry-meta a,
.post-info, .post-info a,
.tie-cat-lists .tie-date,
.tie-date,
.date-views,
.post-cats, .post-cats a {
  color: #555 !important;
}
.post-meta .tie-icon, .entry-meta .tie-icon {
  color: #777 !important;
}

/* ---- 3) Skip-link accessibilite (cible le <a> injecte par le snippet PHP) ---- */
.skip-link {
  position: absolute;
  top: -100px;
  right: 10px;
  background: #0c3b24;
  color: #fff;
  padding: 10px 18px;
  z-index: 99999;
  text-decoration: none;
  border-radius: 0 0 6px 6px;
  font-weight: 600;
}
.skip-link:focus {
  top: 0;
  outline: 3px solid #d4a656;
}

/* ---- 4) Masquer les widgets morts (revolvermaps, youtube widget racine) ---- */
/* Le widget Revolvermaps n'a plus de domaine. On cache la widget-area si
   son contenu fait echouer 2 requetes DNS. Adaptation sur le nom de widget. */
.widget_text iframe[src*="revolvermaps"],
.widget_text script[src*="revolvermaps"] { display: none !important; }

/* iframes YouTube pointant sur la racine (URL cassee) */
iframe[src="https://www.youtube.com/"],
iframe[src="https://www.youtube.com"],
iframe[src^="https://www.youtube.com/?"] {
  display: none !important;
}

/* ---- 5) Empecher les debordements d'images cassees (wordpress/... et autres) ---- */
img[src*="://wordpress/"] { display: none !important; }
img[src=""] { display: none !important; }

/* ---- 6) Ameliorer l'espacement listing articles (home est enorme, relachons un peu) ---- */
.post-listing .post {
  margin-bottom: 18px;
}
.post-listing .post .post-title {
  line-height: 1.4;
}

/* ---- 7) Bouton "Lire la suite" plus visible ---- */
.more-link, a.more-link, .read-more {
  background: #0c3b24 !important;
  color: #fff !important;
  padding: 6px 14px !important;
  border-radius: 4px;
  display: inline-block;
  margin-top: 8px;
  text-decoration: none;
}
.more-link:hover { background: #124a2e !important; }

/* ---- 8) Footer : renforcer la separation visuelle ---- */
#theme-footer, .footer-widget-area {
  border-top: 2px solid #d4a656;
}

/* ---- 9) Responsive : sur tablette/mobile, on passe en `contain` pour ne rien couper ---- */
@media (max-width: 1024px) {
  .logo img[src*="logo-deff"],
  #theme-header .logo img,
  .theme-header .logo img {
    height: 140px !important;
    object-fit: contain !important;
    background-color: #0c3b24 !important;
  }
}
@media (max-width: 600px) {
  .logo img[src*="logo-deff"],
  #theme-header .logo img,
  .theme-header .logo img {
    height: 110px !important;
  }
}

/* =============================================================================
   ---- PHASE B : Refonte editoriale ----
   ============================================================================= */

/* ---- 10) Home : "جديد الموقع" en LISTE de cards elegantes ----
   Layout vertical, chaque article = 1 card avec :
   - Photo a droite (RTL natif)
   - Titre + meta + extrait a gauche
   - Style raffine : ombre douce, bordure subtile, hover gradient */
.recent-blog .cat-box-content,
.post-listing.archive-box {
  display: flex !important;
  flex-direction: column !important;
  gap: 18px !important;
  padding: 20px !important;
  background: #fafafa !important;
}
/* Override Sahifa masonry-grid sur les pages archive (incompatible avec grid) */
.post-listing.archive-box.masonry-grid {
  position: static !important;
  height: auto !important;
}
.post-listing.archive-box.masonry-grid > .item-list {
  position: static !important;
  left: auto !important;
  top: auto !important;
}

.recent-blog .item-list,
.post-listing.archive-box .item-list,
body.search .post-listing .item-list,
body.author .post-listing .item-list {
  display: grid !important;
  grid-template-columns: 200px 1fr !important;
  grid-template-rows: auto 1fr auto !important;
  grid-template-areas:
    "thumb title"
    "thumb entry"
    "thumb meta" !important;
  gap: 0 !important;
  background: #fff !important;
  border: none !important;
  border-radius: 10px !important;
  padding: 0 !important;
  margin: 0 0 18px 0 !important;
  overflow: hidden !important;
  position: relative !important;
  min-height: 170px !important;
  box-shadow: 0 2px 8px rgba(12, 59, 36, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04) !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  border-right: 4px solid transparent !important;
  width: 100% !important;
}
.recent-blog .item-list:hover,
.post-listing.archive-box .item-list:hover,
body.search .post-listing .item-list:hover,
body.author .post-listing .item-list:hover {
  transform: translateY(-3px) !important;
  box-shadow: 0 12px 28px rgba(12, 59, 36, 0.18), 0 4px 8px rgba(0, 0, 0, 0.06) !important;
  border-right-color: #d4a656 !important;
}

/* Hide native inner clutter */
.recent-blog .item-list .overlay-icon,
.post-listing.archive-box .item-list .overlay-icon,
body.search .post-listing .item-list .overlay-icon,
body.author .post-listing .item-list .overlay-icon { display: none !important; }
.recent-blog .item-list .more-link,
.post-listing.archive-box .item-list .more-link,
body.search .post-listing .item-list .more-link,
body.author .post-listing .item-list .more-link { display: none !important; }
.recent-blog .item-list .tie-appear,
.post-listing.archive-box .item-list .tie-appear,
body.search .post-listing .item-list .tie-appear,
body.author .post-listing .item-list .tie-appear { background: #f3efe7 !important; }

/* PHOTO : grid-area thumb (RTL : col 1 declaree = visuellement a droite)
   Ratio 4:3 fixe + centree verticalement pour ne pas s'etirer en cas de
   card haute (long titre + extrait). */
.recent-blog .item-list .post-thumbnail,
.post-listing.archive-box .item-list .post-thumbnail,
body.search .post-listing .item-list .post-thumbnail,
body.author .post-listing .item-list .post-thumbnail {
  grid-area: thumb !important;
  align-self: center !important;
  justify-self: center !important;
  width: calc(100% - 24px) !important;
  height: auto !important;
  aspect-ratio: 4 / 3 !important;
  min-width: 0 !important;
  max-width: calc(100% - 24px) !important;
  max-height: calc(100% - 24px) !important;
  margin: 12px !important;
  padding: 0 !important;
  float: none !important;
  overflow: hidden !important;
  position: relative !important;
  background: #0c3b24 !important;
  border-radius: 6px !important;
}
.recent-blog .item-list .post-thumbnail::after,
.post-listing.archive-box .item-list .post-thumbnail::after,
body.search .post-listing .item-list .post-thumbnail::after,
body.author .post-listing .item-list .post-thumbnail::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 50%, rgba(12, 59, 36, 0.08) 100%);
  pointer-events: none;
  z-index: 1;
}
.recent-blog .item-list .post-thumbnail > a,
.post-listing.archive-box .item-list .post-thumbnail > a,
body.search .post-listing .item-list .post-thumbnail > a,
body.author .post-listing .item-list .post-thumbnail > a {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  position: relative;
}
.recent-blog .item-list .post-thumbnail img,
.recent-blog .item-list .post-thumbnail img.attachment-tie-small,
.recent-blog .item-list .post-thumbnail img.size-tie-small,
.recent-blog .item-list .post-thumbnail img.wp-post-image,
.post-listing.archive-box .item-list .post-thumbnail img,
.post-listing.archive-box .item-list .post-thumbnail img.attachment-tie-small,
.post-listing.archive-box .item-list .post-thumbnail img.size-tie-small,
.post-listing.archive-box .item-list .post-thumbnail img.wp-post-image,
body.search .post-listing .item-list .post-thumbnail img,
body.author .post-listing .item-list .post-thumbnail img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  min-height: 170px !important;
  object-fit: cover !important;
  object-position: center !important;
  display: block !important;
  transition: transform 0.5s ease !important;
}
.recent-blog .item-list:hover .post-thumbnail img,
.post-listing.archive-box .item-list:hover .post-thumbnail img,
body.search .post-listing .item-list:hover .post-thumbnail img,
body.author .post-listing .item-list:hover .post-thumbnail img {
  transform: scale(1.04) !important;
}

/* ---- Placeholder pour articles sans thumbnail (silhouette tete/personne) ---- */
.niefrar-placeholder-wrap,
.post-thumbnail .niefrar-placeholder-img,
img.niefrar-placeholder-img {
  background: linear-gradient(135deg, #0c3b24 0%, #124a2e 100%) !important;
}
.niefrar-placeholder-wrap img,
img.niefrar-placeholder-img {
  object-fit: cover !important;
  object-position: center !important;
  width: 100% !important;
  height: 100% !important;
  background: linear-gradient(135deg, #0c3b24 0%, #124a2e 100%) !important;
}
/* Override le hover scale sur le placeholder (effet plus subtil) */
.recent-blog .item-list:hover .niefrar-placeholder-wrap img,
.recent-blog .item-list:hover img.niefrar-placeholder-img {
  transform: none !important;
}

/* CONTENU A GAUCHE (RTL : col 2 declaree = visuellement a gauche) */
.recent-blog .item-list .post-box-title,
.post-listing.archive-box .item-list .post-box-title,
body.search .post-listing .item-list .post-box-title,
body.author .post-listing .item-list .post-box-title {
  grid-area: title !important;
  font-size: 19px !important;
  line-height: 1.5 !important;
  font-weight: 700 !important;
  font-family: 'Aref Ruqaa', 'Amiri', serif !important;
  margin: 22px 24px 0 24px !important;
  padding: 0 !important;
}
.recent-blog .item-list .post-box-title a,
.post-listing.archive-box .item-list .post-box-title a,
body.search .post-listing .item-list .post-box-title a,
body.author .post-listing .item-list .post-box-title a {
  color: #0c3b24 !important;
  text-decoration: none !important;
  transition: color 0.2s !important;
}
.recent-blog .item-list:hover .post-box-title a,
.post-listing.archive-box .item-list:hover .post-box-title a,
body.search .post-listing .item-list:hover .post-box-title a,
body.author .post-listing .item-list:hover .post-box-title a {
  color: #d4a656 !important;
}

.recent-blog .item-list .post-meta,
.post-listing.archive-box .item-list .post-meta,
body.search .post-listing .item-list .post-meta,
body.author .post-listing .item-list .post-meta {
  grid-area: meta !important;
  font-size: 12px !important;
  color: #777 !important;
  margin: 10px 24px 18px 24px !important;
  padding: 10px 0 0 0 !important;
  border-top: 1px dashed #e8dfc9 !important;
  display: flex !important;
  flex-wrap: wrap !important;
  gap: 14px !important;
  align-items: center !important;
}
.recent-blog .item-list .post-meta span,
.post-listing.archive-box .item-list .post-meta span,
body.search .post-listing .item-list .post-meta span,
body.author .post-listing .item-list .post-meta span {
  display: inline-flex !important;
  align-items: center !important;
  gap: 4px !important;
}
.recent-blog .item-list .post-meta i,
.post-listing.archive-box .item-list .post-meta i,
body.search .post-listing .item-list .post-meta i,
body.author .post-listing .item-list .post-meta i {
  color: #d4a656 !important;
  margin-left: 3px !important;
}
.recent-blog .item-list .post-meta a,
.post-listing.archive-box .item-list .post-meta a,
body.search .post-listing .item-list .post-meta a,
body.author .post-listing .item-list .post-meta a {
  color: #0c3b24 !important;
  text-decoration: none !important;
  font-weight: 600 !important;
}
.recent-blog .item-list .post-meta a:hover,
.post-listing.archive-box .item-list .post-meta a:hover,
body.search .post-listing .item-list .post-meta a:hover,
body.author .post-listing .item-list .post-meta a:hover { color: #d4a656 !important; }
.recent-blog .item-list .post-meta .post-cats,
.post-listing.archive-box .item-list .post-meta .post-cats,
body.search .post-listing .item-list .post-meta .post-cats,
body.author .post-listing .item-list .post-meta .post-cats {
  background: rgba(212, 166, 86, 0.12) !important;
  border: none !important;
  padding: 3px 10px !important;
  border-radius: 12px !important;
}
.recent-blog .item-list .post-meta .post-cats a,
.post-listing.archive-box .item-list .post-meta .post-cats a,
body.search .post-listing .item-list .post-meta .post-cats a,
body.author .post-listing .item-list .post-meta .post-cats a {
  color: #0c3b24 !important;
  background: transparent !important;
}

.recent-blog .item-list .entry,
.recent-blog .item-list > p:not(.post-meta),
.post-listing.archive-box .item-list > p:not(.post-meta),
body.search .post-listing .item-list > p:not(.post-meta),
body.author .post-listing .item-list > p:not(.post-meta) {
  grid-area: entry !important;
  font-size: 14px !important;
  color: #555 !important;
  line-height: 1.75 !important;
  margin: 12px 24px 0 24px !important;
  padding: 0 !important;
  display: -webkit-box !important;
  -webkit-line-clamp: 3 !important;
  -webkit-box-orient: vertical !important;
  overflow: hidden !important;
  max-height: 73px !important;
  font-family: 'Amiri', 'Cairo', serif !important;
}

/* Premier item (le plus recent) : badge "Nouveau" + bordure doree permanente */
.recent-blog .item-list:nth-child(1) {
  background: linear-gradient(135deg, #fff 0%, #faf7f0 100%) !important;
  border-right: 4px solid #d4a656 !important;
}
.recent-blog .item-list:nth-child(1) .post-box-title {
  font-size: 22px !important;
}
.recent-blog .item-list:nth-child(1)::before {
  content: 'الأحدث' !important;
  position: absolute !important;
  top: 12px !important;
  left: 12px !important;
  background: #d4a656 !important;
  color: #0c3b24 !important;
  padding: 4px 12px !important;
  border-radius: 12px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  z-index: 3 !important;
  font-family: 'Cairo', sans-serif !important;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15) !important;
}

/* Items 7+ : masques (top 6 cards) */
.recent-blog .item-list:nth-child(n+7) {
  display: none !important;
}

/* Responsive : sur mobile, photo en haut, contenu en dessous */
@media (max-width: 768px) {
  .recent-blog .item-list {
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "thumb"
      "title"
      "entry"
      "meta" !important;
    grid-template-rows: auto auto auto auto !important;
    min-height: 0 !important;
  }
  .recent-blog .item-list .post-thumbnail {
    height: 200px !important;
  }
  .recent-blog .item-list .post-box-title {
    margin: 16px 18px 0 18px !important;
    font-size: 17px !important;
  }
  .recent-blog .item-list .post-meta { margin: 10px 18px 16px 18px !important; }
  .recent-blog .item-list .entry,
  .recent-blog .item-list > p:not(.post-meta) { margin: 10px 18px 0 18px !important; }
  .recent-blog .item-list:nth-child(1) .post-box-title { font-size: 19px !important; }
}

/* Titre du bloc : typographie plus chaleureuse */
.cat-box-title h2 {
  font-family: 'Aref Ruqaa', 'Amiri', serif !important;
  font-size: 26px !important;
  color: #0c3b24 !important;
}
.stripe-line {
  border-bottom: 1px solid #d4a656 !important;
  margin-top: 8px !important;
}

/* ---- 11) Sidebar : nettoyage des widgets morts/inutiles ----
   On masque : facebook (URL cassee), comments-avatar (lourd), youtube (redondant) */
#sidebar .widget_facebook-widget,
#sidebar .facebook-widget,
#sidebar .widget_facebook_widget,
aside .widget.facebook-widget,
#sidebar .comments-avatar,
#sidebar .widget.comments-avatar,
#sidebar .widget_comments-avatar-widget,
#sidebar .youtube-widget,
#sidebar .widget.youtube-widget,
#sidebar .news-pic,
#sidebar .widget.news-pic {
  display: none !important;
}

/* Widget tag_cloud : limiter visuellement */
#sidebar .widget_tag_cloud .tagcloud {
  max-height: 180px !important;
  overflow: hidden !important;
  position: relative !important;
}
#sidebar .widget_tag_cloud .tagcloud::after {
  content: '' !important;
  position: absolute !important;
  bottom: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: 40px !important;
  background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, #fff 100%) !important;
  pointer-events: none !important;
}
#sidebar .widget_tag_cloud a {
  font-size: 12px !important;
  margin: 2px !important;
  padding: 3px 8px !important;
  background: #f3efe7 !important;
  color: #0c3b24 !important;
  border-radius: 3px !important;
  text-decoration: none !important;
  display: inline-block !important;
}

/* Widget titles : typographie coherente, couleur doree sur fond vert du theme
   ATTENTION : ne cibler QUE les TITRES de widget, pas les h3 internes aux items. */
#sidebar > .widget > .widget-title,
#sidebar > aside.widget > .widget-title,
aside.widget > .widget-title,
#sidebar .widget > h3.widget-title,
#sidebar .widget > h3:first-of-type:not(.tie_thumb *) {
  font-family: 'Aref Ruqaa', 'Amiri', serif !important;
  color: #d4a656 !important;
  border: none !important;
  padding: 10px 14px !important;
  background: #0c3b24 !important;
  margin: 0 0 10px 0 !important;
  font-size: 18px !important;
}
/* Border top pour accent */
#sidebar .widget > .widget-title,
#sidebar aside.widget > .widget-title {
  border-top: 2px solid #d4a656 !important;
}
/* Forcer les h3 INTERNES des items widget a ne PAS avoir le fond vert */
#sidebar .widget li h3,
#sidebar .widget .tie_thumb h3,
#sidebar .widget .item h3,
aside .widget li h3,
aside .widget .tie_thumb h3 {
  background: transparent !important;
  color: #1a1a1a !important;
  padding: 0 !important;
  margin: 0 !important;
  font-size: 13px !important;
  font-family: inherit !important;
  font-weight: 600 !important;
  line-height: 1.55 !important;
  border: none !important;
}

/* ---- 12) Widget custom "أعلام انيفرار" (injecte via PHP) ---- */
.niefrar-authors-widget { margin-bottom: 25px; }
.niefrar-authors-widget .authors-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 10px;
}
/* Si nombre impair d'auteurs, centrer le dernier seul */
.niefrar-authors-widget .author-card:last-child:nth-child(odd) {
  grid-column: 1 / -1;
  max-width: calc(50% - 5px);
  margin: 0 auto;
}
.niefrar-authors-widget .author-card {
  background: #faf7f0;
  border: 1px solid #e8dfc9;
  border-radius: 6px;
  padding: 10px;
  text-align: center;
  transition: all 0.2s;
}
.niefrar-authors-widget .author-card:hover {
  background: #0c3b24;
  border-color: #d4a656;
}
.niefrar-authors-widget .author-card:hover .author-name,
.niefrar-authors-widget .author-card:hover .author-count { color: #fff; }
.niefrar-authors-widget .author-avatar {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: #0c3b24;
  color: #d4a656;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Aref Ruqaa', serif;
  font-size: 22px;
  font-weight: 700;
  margin: 0 auto 8px;
  border: 3px solid #d4a656;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(12, 59, 36, 0.2);
  transition: transform 0.25s;
}
.niefrar-authors-widget .author-avatar-photo {
  background-size: cover !important;
  background-position: center top !important;
  background-repeat: no-repeat !important;
}
.niefrar-authors-widget .author-card:hover .author-avatar {
  transform: scale(1.08);
  border-color: #fff;
}
.niefrar-authors-widget .author-name {
  font-size: 12px;
  font-weight: 600;
  color: #0c3b24;
  line-height: 1.3;
  text-decoration: none;
  display: block;
}
.niefrar-authors-widget .author-count {
  font-size: 11px;
  color: #888;
  margin-top: 3px;
}

/* ---- 13) Card "Espace memorial" en haut du contenu (CTA) ---- */
.niefrar-memorial-card {
  background: linear-gradient(135deg, #0c3b24 0%, #124a2e 100%);
  color: #fff;
  padding: 20px 24px;
  border-radius: 8px;
  margin-bottom: 25px;
  display: flex;
  align-items: center;
  gap: 18px;
  border: 1px solid #d4a656;
  box-shadow: 0 4px 12px rgba(12, 59, 36, 0.15);
}
.niefrar-memorial-card .memorial-icon {
  font-size: 42px;
  color: #d4a656;
  flex-shrink: 0;
}
.niefrar-memorial-card .memorial-text { flex: 1; }
.niefrar-memorial-card h3 {
  color: #fff;
  font-family: 'Aref Ruqaa', serif;
  font-size: 22px;
  margin: 0 0 4px;
}
.niefrar-memorial-card p {
  color: #e8dfc9;
  font-size: 13px;
  margin: 0;
  line-height: 1.5;
}
.niefrar-memorial-card .memorial-btn {
  background: #d4a656;
  color: #0c3b24;
  padding: 8px 18px;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
  font-size: 13px;
  transition: background 0.2s;
}
.niefrar-memorial-card .memorial-btn:hover {
  background: #fff;
}

/* ---- 14) Page memoriale (/?memorial=1) ---- */
.niefrar-memorial-page { padding: 20px 0; }
.niefrar-memorial-page .memorial-hero {
  text-align: center;
  padding: 30px 20px;
  background: #faf7f0;
  border-bottom: 3px solid #d4a656;
  margin-bottom: 30px;
}
.niefrar-memorial-page .memorial-hero h1 {
  font-family: 'Aref Ruqaa', serif;
  font-size: 42px;
  color: #0c3b24;
  margin: 0 0 8px;
}
.niefrar-memorial-page .memorial-hero p {
  color: #555;
  font-size: 15px;
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.7;
}
.niefrar-memorial-page .memorial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  padding: 0 15px;
}
.niefrar-memorial-page .memorial-card {
  background: #fff;
  border: 1px solid #e5e5e5;
  border-right: 4px solid #d4a656;
  padding: 14px 16px;
  border-radius: 4px;
  transition: all 0.2s;
  text-decoration: none;
  color: #333;
  display: block;
}
.niefrar-memorial-page .memorial-card:hover {
  background: #0c3b24;
  color: #fff;
  border-right-color: #fff;
}
.niefrar-memorial-page .memorial-card:hover h3,
.niefrar-memorial-page .memorial-card:hover .memorial-count { color: #fff; }
.niefrar-memorial-page .memorial-card h3 {
  font-size: 15px;
  margin: 0 0 6px;
  line-height: 1.5;
  color: #0c3b24;
  font-family: 'Amiri', serif;
  font-weight: 700;
}
.niefrar-memorial-page .memorial-count {
  font-size: 12px;
  color: #888;
}

/* ---- 15) Cat-boxes : hierarchie visuelle + espacement ---- */
.cat-box {
  margin-bottom: 30px !important;
  border-radius: 6px;
  overflow: hidden;
}
.cat-box .cat-box-title {
  background: #faf7f0;
  padding: 10px 16px !important;
  border-bottom: 2px solid #d4a656 !important;
}

/* ---- 16) Menu principal : typographie + dropdowns elegants ---- */
#main-nav .main-menu > ul > li > a,
#main-nav .menu > li > a {
  font-family: 'Cairo', 'Amiri', sans-serif !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  padding: 14px 16px !important;
  transition: background-color 0.2s, color 0.2s !important;
}
#main-nav .main-menu > ul > li > a:hover,
#main-nav .menu > li > a:hover,
#main-nav .menu > li.current-menu-item > a,
#main-nav .menu > li:hover > a {
  background: rgba(212, 166, 86, 0.18) !important;
  color: #d4a656 !important;
}
/* Indicateur de dropdown : fleche bas doree */
#main-nav .menu > li.menu-item-has-children > a::after {
  content: ' \f0d7' !important;
  font-family: FontAwesome !important;
  font-size: 11px !important;
  margin-right: 6px !important;
  color: #d4a656 !important;
  opacity: 0.85 !important;
}
/* Sous-menus : carte elegante */
#main-nav .menu .sub-menu,
#main-nav .menu .menu-sub-content {
  background: #0c3b24 !important;
  border: 1px solid #d4a656 !important;
  border-top: 3px solid #d4a656 !important;
  border-radius: 0 0 8px 8px !important;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25) !important;
  padding: 8px 0 !important;
  min-width: 240px !important;
  max-width: 360px !important;
  z-index: 999 !important;
}
#main-nav .menu .sub-menu li,
#main-nav .menu .menu-sub-content li {
  border: none !important;
  background: transparent !important;
}
#main-nav .menu .sub-menu li a,
#main-nav .menu .menu-sub-content li a {
  font-family: 'Cairo', 'Amiri', sans-serif !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  padding: 9px 18px !important;
  color: #f3efe7 !important;
  border-bottom: 1px dashed rgba(212, 166, 86, 0.18) !important;
  white-space: normal !important;
  line-height: 1.5 !important;
  transition: all 0.2s !important;
}
#main-nav .menu .sub-menu li:last-child a,
#main-nav .menu .menu-sub-content li:last-child a {
  border-bottom: none !important;
}
#main-nav .menu .sub-menu li a:hover,
#main-nav .menu .menu-sub-content li a:hover {
  background: rgba(212, 166, 86, 0.18) !important;
  color: #d4a656 !important;
  padding-right: 24px !important;
}

/* Menu plus compact - une seule ligne pour les 7 items */
#main-nav .main-menu {
  padding: 0 !important;
}
#main-nav .menu {
  display: flex !important;
  flex-wrap: nowrap !important;
  justify-content: flex-end !important;
  gap: 0 !important;
}
#main-nav .menu > li {
  flex: 0 0 auto !important;
}

/* Icone home dans le 1er item du menu */
#main-nav .menu > li:first-child a i.fa-home {
  font-size: 16px !important;
  color: #d4a656 !important;
}

/* Mobile : garder le hamburger natif Sahifa */
@media (max-width: 768px) {
  #main-nav .menu {
    flex-direction: column !important;
  }
}

/* ---- 17) Galerie video en bas de home (mkt fidéo Niefrar) ---- */
.niefrar-video-gallery {
  margin: 35px 0 !important;
  background: linear-gradient(180deg, #0c3b24 0%, #124a2e 100%);
  padding: 25px !important;
  border-radius: 8px;
  border: 1px solid #d4a656;
}
.niefrar-video-gallery .video-gallery-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  position: relative;
}
.niefrar-video-gallery .video-gallery-header h2 {
  font-family: 'Aref Ruqaa', serif !important;
  color: #d4a656 !important;
  font-size: 26px !important;
  margin: 0 !important;
  padding: 0 !important;
  flex-shrink: 0;
}
.niefrar-video-gallery .video-gallery-header .stripe-line {
  flex: 1;
  height: 1px;
  background: #d4a656;
  opacity: 0.4;
  border: none !important;
}
.niefrar-video-gallery .view-all {
  color: #d4a656;
  text-decoration: none;
  font-size: 13px;
  white-space: nowrap;
  transition: color 0.2s;
}
.niefrar-video-gallery .view-all:hover {
  color: #fff;
}
.niefrar-video-gallery .video-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.niefrar-video-gallery .video-card {
  position: relative;
  aspect-ratio: 16 / 9;
  background-size: cover;
  background-position: center;
  background-color: #0c3b24;
  border-radius: 6px;
  overflow: hidden;
  display: block;
  text-decoration: none;
  transition: transform 0.2s;
  border: 2px solid transparent;
}
.niefrar-video-gallery .video-card:hover {
  transform: scale(1.02);
  border-color: #d4a656;
}
.niefrar-video-gallery .video-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.85) 100%);
}
.niefrar-video-gallery .video-play {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(212, 166, 86, 0.92);
  color: #0c3b24;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  transition: all 0.2s;
  z-index: 2;
}
.niefrar-video-gallery .video-card:hover .video-play {
  background: #fff;
  transform: translate(-50%, -50%) scale(1.1);
}
.niefrar-video-gallery .video-title {
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  padding: 10px 12px;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  z-index: 2;
  max-height: 60px;
  overflow: hidden;
  text-align: right;
}
@media (max-width: 768px) {
  .niefrar-video-gallery .video-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 480px) {
  .niefrar-video-gallery .video-gallery-grid {
    grid-template-columns: 1fr;
  }
}

/* =============================================================================
   ---- PHASE B.2 : Ameliorations visuelles post-audit utilisateur ----
   ============================================================================= */

/* ---- 18) Widget "مؤلفات وفتاوي" sidebar : titres VERT-SUR-VERT corriges ----
   Le widget categort-posts utilise des couvertures livre vertes + titres verts
   (color #1a5c38 par defaut du theme) => invisible. On force titre sombre. */
#sidebar .widget.categort-posts h3,
#sidebar .widget.categort-posts h3 a,
#sidebar .widget.categort-posts .tie_thumb h3 a,
aside .widget.categort-posts h3 a,
.widget.categort-posts li a,
.widget.categort-posts .tie_thumb h3,
.widget.categort-posts .tie_thumb h3 a {
  color: #1a1a1a !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
  text-shadow: none !important;
  font-weight: 600 !important;
}
#sidebar .widget.categort-posts h3 a:hover,
.widget.categort-posts .tie_thumb h3 a:hover {
  color: #0c3b24 !important;
  text-decoration: underline !important;
}
/* Amelioration du layout des items */
.widget.categort-posts .tie_thumb {
  background: #faf7f0 !important;
  border: 1px solid #e8dfc9 !important;
  border-radius: 4px !important;
  padding: 10px !important;
  margin-bottom: 10px !important;
  overflow: hidden !important;
  list-style: none !important;
}
.widget.categort-posts .tie_thumb .post-thumbnail {
  float: left !important;
  margin-left: 10px !important;
  margin-right: 0 !important;
  width: 50px !important;
  height: 50px !important;
  overflow: hidden !important;
  border-radius: 3px !important;
}
.widget.categort-posts .tie_thumb .post-thumbnail img {
  width: 50px !important;
  height: 50px !important;
  object-fit: cover !important;
  max-width: none !important;
}
.widget.categort-posts .tie_thumb .tie-date {
  font-size: 11px !important;
  color: #777 !important;
  display: block !important;
  margin-top: 4px !important;
}

/* ---- 19) Widget "فيديوهات" sidebar (iframe unique) : redondant avec la
   galerie bas de home, on le masque pour alleger */
#sidebar .widget.youtube-widget,
#sidebar .video-widget,
#sidebar .widget_video-widget {
  display: none !important;
}

/* ---- 20) Scroll-box "مؤلفات وفتاوي" home : images livre avec masques noirs ----
   Le scroll affiche des livres avec fond noir autour des couvertures. */
.cat-box.scroll-box .item .post-thumbnail,
.cat-box.tie-cat-4 .post-thumbnail,
.cat-box.tie-cat-11 .post-thumbnail {
  background: #faf7f0 !important;
  aspect-ratio: 4 / 3 !important;
  overflow: hidden !important;
}
.cat-box.scroll-box .item .post-thumbnail img,
.cat-box.tie-cat-4 .post-thumbnail img,
.cat-box.tie-cat-11 .post-thumbnail img {
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: cover !important;
  object-position: center !important;
}
.cat-box.scroll-box .item {
  background: #fff !important;
  border: 1px solid #e5e5e5 !important;
  border-radius: 6px !important;
  overflow: hidden !important;
}
.cat-box.scroll-box .item .post-box-title,
.cat-box.scroll-box .item h3 {
  padding: 10px 12px !important;
  color: #1a1a1a !important;
  font-size: 13px !important;
  background: #fff !important;
}
.cat-box.scroll-box .item .post-meta {
  padding: 0 12px 10px !important;
  font-size: 11px !important;
  color: #666 !important;
}

/* ---- 21) Ensure que la home-icon (maison vert) du menu reste visible et propre ---- */
#main-nav .menu-item-home a,
#main-nav .menu-item-home .home-icon {
  background: #124a2e !important;
}

/* ---- 22) Grille cat-boxes de listing (non recent-blog) : titres bien visibles ---- */
.cat-box .item-list .post-box-title,
.cat-box .item-list h2 {
  color: #1a1a1a !important;
}
.cat-box .item-list .post-box-title a {
  color: #1a1a1a !important;
}
.cat-box .item-list .post-box-title a:hover {
  color: #0c3b24 !important;
}

/* ---- 23) Amelioration globale de contraste pour les titres cat-box ---- */
.cat-box-title h2 {
  color: #0c3b24 !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) !important;
}

/* ---- 24) Memorial card : harmonisation alignement ---- */
.niefrar-memorial-card h3 {
  margin-bottom: 6px !important;
}

/* ---- 25) Sidebar widgets : spacing coherent ---- */
#sidebar .widget {
  margin-bottom: 22px !important;
  background: #fff !important;
  border-radius: 6px !important;
  overflow: hidden !important;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04) !important;
}

/* ---- 26) Footer : harmonisation typographie ---- */
#theme-footer .widget-title,
.footer-widget-area .widget-title {
  color: #d4a656 !important;
  font-family: 'Aref Ruqaa', serif !important;
  font-size: 18px !important;
}

/* ---- 27) Badges categorie sur thumbnails : contraste renforce ----
   Le theme applique rgba(255,255,255,0.1) pour les badges sur post-thumb.
   Blanc sur fond presque transparent = illisible. On force un fond vert dore. */
.post-cats,
.cat-labels,
.post-cats a,
.tie-cat-badge,
.post-thumbnail .post-cats-link {
  background: rgba(12, 59, 36, 0.92) !important;
  color: #fff !important;
  padding: 3px 8px !important;
  border-radius: 3px !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  border: 1px solid #d4a656 !important;
  text-decoration: none !important;
}
.post-cats a:hover,
.cat-labels a:hover {
  background: #d4a656 !important;
  color: #0c3b24 !important;
}

/* Post-meta badges (post-cats i + a) */
.post-meta .post-cats,
.post-meta .post-cats a {
  background: transparent !important;
  border: none !important;
  color: #555 !important;
  padding: 0 !important;
  font-weight: normal !important;
}
.post-meta .post-cats a:hover {
  color: #0c3b24 !important;
  background: transparent !important;
}

/* ---- 28) Image cassee du widget "yacob" : fallback si src=="" ou wordpress ---- */
img[src*="wordpress/wp-content"],
img[src="http:/wordpress/wp-content/uploads/2017/06/yacob.jpg"] {
  content: url('https://niefrar.org/wp-content/uploads/2017/06/yacob.jpg') !important;
  max-width: 100% !important;
  height: auto !important;
  border-radius: 4px !important;
}

/* ---- 29) Anti-redondance home : masquer sections doublons ----
   - Sahifa scroll-box "الفيديوهات" (cat 11) : redondant avec notre galerie video en bas
   - Sections "single article" (cat-box-content sans cat-box ancestor) : articles complets
     intercales en home, redondants avec leurs categories */
.content > section.cat-box.scroll-box.tie-cat-11,
.content > section.tie-cat-11.scroll-box {
  display: none !important;
}
/* Single articles (cat-box-content non encapsulé dans une vraie cat-box section) */
.content > div.cat-box-content {
  display: none !important;
}
