/* Fallback: Ensure elements with data-aos are ALWAYS visible even if JS fails */
[data-aos] {
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !important;
}

/* Custom Modern UI Enhancements for ARE-NIGER */
:root {
  --aren-primary: #1b6e39;
  --aren-primary-hover: #14552b;
  --aren-accent: #f68f32;
  --aren-accent-hover: #e07b22;
  --aren-dark: #212529;
  --aren-light: #f8f9fa;
  --aren-border: #e9ecef;
  --aren-radius: 12px;
  --aren-shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --aren-shadow-md: 0 6px 20px rgba(0, 0, 0, 0.08);
  --aren-shadow-lg: 0 12px 30px rgba(0, 0, 0, 0.12);
}

/* ==========================================================================
   Header & Navigation (Desktop & Responsive Mobile)
   ========================================================================== */
#header {
  height: auto !important;
  min-height: 80px;
  box-shadow: var(--aren-shadow-sm);
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 1000;
  transition: all 0.3s ease;
}

#header .logo {
  display: flex !important;
  align-items: center !important;
  margin: 0 !important;
  padding: 0 !important;
}

#header .logo a {
  display: flex !important;
  align-items: center !important;
  gap: 12px;
  text-decoration: none;
}

#header .logo img {
  display: block !important;
  height: 65px !important;
  max-height: 65px !important;
  width: auto !important;
  padding: 0 !important;
  margin: 0 !important;
  object-fit: contain !important;
  transition: height 0.2s ease;
}

/* Desktop Navigation (>= 992px) */
@media (min-width: 992px) {
  .mobile-nav-toggle {
    display: none !important;
  }

  #navbar .menu-items {
    display: flex !important;
    align-items: center;
    gap: 4px;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  #navbar .menu-items li a {
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.92rem;
    padding: 10px 14px;
    color: #333333;
    transition: all 0.25s ease;
    text-decoration: none;
  }

  #navbar .menu-items li a:hover,
  #navbar .menu-items li a.active {
    background-color: var(--aren-primary);
    color: #ffffff !important;
  }
}

/* Mobile Navigation (< 992px) */
@media (max-width: 991.98px) {
  #header {
    min-height: 65px !important;
  }

  #header .logo img {
    height: 48px !important;
    max-height: 48px !important;
  }

  .mobile-nav-toggle {
    display: block !important;
    font-size: 32px !important;
    color: var(--aren-primary) !important;
    cursor: pointer;
    line-height: 1;
    padding: 4px;
    transition: color 0.2s ease;
    z-index: 10001;
  }

  /* Cache le menu desktop sur mobile par défaut */
  #navbar:not(.navbar-mobile) .menu-items {
    display: none !important;
  }

  /* Tiroir / Modale du menu mobile actif */
  #navbar.navbar-mobile {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background: rgba(14, 25, 18, 0.78) !important;
    backdrop-filter: blur(6px) !important;
    -webkit-backdrop-filter: blur(6px) !important;
    z-index: 99999 !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: flex-start !important;
    padding: 70px 20px 30px !important;
    overflow-y: auto !important;
  }

  #navbar.navbar-mobile .mobile-nav-toggle {
    position: fixed !important;
    top: 18px !important;
    right: 20px !important;
    font-size: 36px !important;
    color: #ffffff !important;
    z-index: 100000 !important;
  }

  #navbar.navbar-mobile .menu-items {
    display: flex !important;
    flex-direction: column !important;
    width: 100% !important;
    max-width: 440px !important;
    background: #ffffff !important;
    border-radius: 16px !important;
    padding: 22px 18px !important;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.4) !important;
    gap: 8px !important;
    margin: 0 auto !important;
    list-style: none !important;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
  }

  #navbar.navbar-mobile .menu-items li {
    width: 100% !important;
    list-style: none !important;
  }

  #navbar.navbar-mobile .menu-items li a {
    display: flex !important;
    align-items: center !important;
    width: 100% !important;
    padding: 12px 16px !important;
    font-size: 1.02rem !important;
    font-weight: 600 !important;
    color: #2d3748 !important;
    border-radius: 10px !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
  }

  #navbar.navbar-mobile .menu-items li a:hover {
    background-color: #e8f5e9 !important;
    color: var(--aren-primary) !important;
    transform: translateX(4px);
  }

  #navbar.navbar-mobile .menu-items li a.active {
    background-color: var(--aren-primary) !important;
    color: #ffffff !important;
  }
}

/* ==========================================================================
   Hero Slider Section (Parfaitement centré & Responsive)
   ========================================================================== */
#hero {
  position: relative !important;
  width: 100% !important;
  min-height: 520px !important;
  height: auto !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: hidden !important;
  border-bottom: 3px solid var(--aren-accent) !important;
  background-color: #151d18 !important;
}

#hero .carousel,
#hero .carousel-inner {
  position: relative !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 520px !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
}

#hero .carousel-item {
  position: relative !important;
  width: 100% !important;
  min-height: 520px !important;
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
}

#hero .carousel-item::before {
  content: "" !important;
  position: absolute !important;
  inset: 0 !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  height: 100% !important;
  background: linear-gradient(180deg, rgba(10, 20, 14, 0.62) 0%, rgba(10, 15, 12, 0.85) 100%) !important;
  z-index: 1 !important;
}

#hero .carousel-container {
  position: relative !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  width: 100% !important;
  min-height: 520px !important;
  z-index: 2 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 50px 20px !important;
  box-sizing: border-box !important;
}

#hero .carousel-content {
  position: relative !important;
  background: rgba(18, 26, 21, 0.84) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  border-top: 4px solid var(--aren-accent) !important;
  border-radius: var(--aren-radius) !important;
  padding: 32px 36px !important;
  color: #ffffff !important;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.45) !important;
  max-width: 820px !important;
  width: 100% !important;
  margin: 0 auto !important;
  text-align: center !important;
}

#hero .carousel-content h2 {
  font-size: 1.85rem !important;
  font-weight: 800 !important;
  color: #ffffff !important;
  line-height: 1.35 !important;
  margin-top: 8px !important;
  margin-bottom: 14px !important;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

#hero .carousel-content p {
  font-size: 1.05rem !important;
  line-height: 1.6 !important;
  color: #f1f3f5 !important;
  margin: 0 auto 20px !important;
  max-width: 720px !important;
}

.btn-get-started {
  background: var(--aren-accent);
  color: #ffffff !important;
  font-weight: 700;
  padding: 12px 30px;
  border-radius: 30px;
  display: inline-block;
  box-shadow: 0 4px 15px rgba(246, 143, 50, 0.4);
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn-get-started:hover {
  background: var(--aren-accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(246, 143, 50, 0.5);
}

/* Hero Controls & Indicators */
#hero .carousel-control-prev,
#hero .carousel-control-next {
  position: absolute !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  width: 44px !important;
  height: 44px !important;
  background: rgba(0, 0, 0, 0.45) !important;
  border: 1px solid rgba(255, 255, 255, 0.25) !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  opacity: 0.75 !important;
  transition: all 0.3s ease !important;
  z-index: 10 !important;
  padding: 0 !important;
}

#hero .carousel-control-prev {
  left: 16px !important;
}

#hero .carousel-control-next {
  right: 16px !important;
}

#hero .carousel-control-prev:hover,
#hero .carousel-control-next:hover {
  background: var(--aren-accent) !important;
  border-color: var(--aren-accent) !important;
  opacity: 1 !important;
}

#hero .carousel-control-prev-icon,
#hero .carousel-control-next-icon {
  background: none !important;
  font-size: 26px !important;
  color: #ffffff !important;
  line-height: 1 !important;
  width: auto !important;
  height: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
}

#hero .carousel-indicators {
  position: absolute !important;
  bottom: 12px !important;
  margin-bottom: 0 !important;
  z-index: 10 !important;
  display: flex !important;
  justify-content: center !important;
  padding: 0 !important;
  gap: 6px !important;
}

#hero .carousel-indicators li {
  width: 28px !important;
  height: 5px !important;
  border-radius: 4px !important;
  background-color: rgba(255, 255, 255, 0.45) !important;
  border: none !important;
  transition: all 0.3s ease !important;
  cursor: pointer !important;
  margin: 0 !important;
}

#hero .carousel-indicators li.active {
  width: 45px !important;
  background-color: var(--aren-accent) !important;
}

/* Hero Responsive Breakpoints */
@media (max-width: 768px) {
  #hero,
  #hero .carousel,
  #hero .carousel-inner,
  #hero .carousel-item,
  #hero .carousel-container {
    min-height: 440px !important;
    height: auto !important;
  }

  #hero .carousel-container {
    padding: 30px 14px !important;
  }

  #hero .carousel-content {
    padding: 20px 16px !important;
    border-radius: 12px !important;
    max-width: 100% !important;
  }

  #hero .carousel-content .badge {
    font-size: 0.72rem !important;
    padding: 4px 10px !important;
    margin-bottom: 8px !important;
  }

  #hero .carousel-content h2 {
    font-size: 1.22rem !important;
    line-height: 1.35 !important;
    margin-bottom: 10px !important;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  #hero .carousel-content p {
    font-size: 0.88rem !important;
    line-height: 1.45 !important;
    margin-bottom: 16px !important;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  .btn-get-started {
    font-size: 0.85rem !important;
    padding: 9px 20px !important;
  }

  #hero .carousel-control-prev,
  #hero .carousel-control-next {
    width: 36px !important;
    height: 36px !important;
    margin: 0 !important;
    background: rgba(0, 0, 0, 0.5) !important;
    opacity: 0.65 !important;
  }

  #hero .carousel-control-prev {
    left: 6px !important;
  }

  #hero .carousel-control-next {
    right: 6px !important;
  }

  #hero .carousel-control-prev-icon,
  #hero .carousel-control-next-icon {
    font-size: 20px !important;
  }
}

@media (max-width: 480px) {
  #hero,
  #hero .carousel,
  #hero .carousel-inner,
  #hero .carousel-item,
  #hero .carousel-container {
    min-height: 410px !important;
  }

  #hero .carousel-container {
    padding: 20px 10px !important;
  }

  #hero .carousel-content {
    padding: 16px 12px !important;
  }

  #hero .carousel-content h2 {
    font-size: 1.1rem !important;
    line-height: 1.3 !important;
    margin-bottom: 8px !important;
    -webkit-line-clamp: 3;
  }

  #hero .carousel-content p {
    font-size: 0.82rem !important;
    line-height: 1.4 !important;
    margin-bottom: 12px !important;
    -webkit-line-clamp: 2;
  }

  .btn-get-started {
    font-size: 0.8rem !important;
    padding: 8px 16px !important;
  }

  #hero .carousel-control-prev,
  #hero .carousel-control-next {
    width: 30px !important;
    height: 30px !important;
    opacity: 0.5 !important;
  }
}

/* ==========================================================================
   Modern Article Cards
   ========================================================================== */
.article-card {
  background: #ffffff;
  border: 1px solid var(--aren-border);
  border-radius: var(--aren-radius);
  overflow: hidden;
  box-shadow: var(--aren-shadow-sm);
  transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.article-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--aren-shadow-md);
  border-color: #d8e2dc;
}

.article-card-img-wrap {
  position: relative;
  width: 100%;
  height: 240px;
  overflow: hidden;
  background: #f1f3f5;
}

.article-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.article-card:hover .article-card-img-wrap img {
  transform: scale(1.05);
}

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

.article-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 600;
  background: #e8f5e9;
  color: var(--aren-primary);
  margin-bottom: 12px;
  width: fit-content;
}

.article-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 12px;
  color: var(--aren-dark);
}

.article-card-title a {
  color: inherit;
  transition: color 0.2s ease;
  text-decoration: none;
}

.article-card-title a:hover {
  color: var(--aren-primary);
}

.article-card-text {
  color: #6c757d;
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 20px;
  flex-grow: 1;
}

.article-card-footer {
  border-top: 1px solid var(--aren-border);
  padding-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #868e96;
}

.article-read-more {
  color: var(--aren-primary);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  transition: gap 0.2s ease;
}

.article-read-more:hover {
  color: var(--aren-primary-hover);
  gap: 8px;
}

/* ==========================================================================
   Event Callout Banner
   ========================================================================== */
.event-banner {
  background: linear-gradient(135deg, #1b6e39 0%, #0d4622 100%);
  color: #ffffff;
  border-radius: var(--aren-radius);
  padding: 35px 40px;
  box-shadow: var(--aren-shadow-md);
  margin: 40px 0;
  position: relative;
  overflow: hidden;
}

.event-banner::after {
  content: "";
  position: absolute;
  right: -50px;
  bottom: -50px;
  width: 200px;
  height: 200px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 50%;
}

.event-banner h3 {
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 12px;
  font-size: 1.6rem;
}

.event-banner-date {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.18);
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 14px;
}

.event-banner p {
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.92);
}

/* ==========================================================================
   Single Article Detail Presentation
   ========================================================================== */
.article-detail-header {
  margin-bottom: 25px;
}

.article-detail-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--aren-dark);
  line-height: 1.3;
}

.article-detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 15px;
  padding: 12px 0;
  border-bottom: 1px solid var(--aren-border);
  color: #6c757d;
  font-size: 0.9rem;
}

.article-featured-img {
  width: 100%;
  max-height: 520px;
  object-fit: cover;
  border-radius: var(--aren-radius);
  box-shadow: var(--aren-shadow-md);
  margin-bottom: 30px;
}

.article-content {
  font-size: 1.15rem;
  line-height: 1.8;
  color: #333333;
}

.article-content p {
  margin-bottom: 1.5rem;
  text-align: justify;
}

/* ==========================================================================
   Sidebar Widgets
   ========================================================================== */
.sidebar-box {
  background: #ffffff;
  border-radius: var(--aren-radius);
  border: 1px solid var(--aren-border);
  padding: 24px;
  margin-bottom: 30px;
  box-shadow: var(--aren-shadow-sm);
}

.sidebar-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--aren-dark);
  margin-bottom: 20px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--aren-accent);
  position: relative;
}

.recent-post-item {
  display: flex;
  gap: 14px;
  padding-bottom: 15px;
  margin-bottom: 15px;
  border-bottom: 1px solid #f1f3f5;
  align-items: center;
}

.recent-post-thumb {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.recent-post-title {
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.35;
  color: #333;
}

/* ==========================================================================
   Comments Section
   ========================================================================== */
.comment-card {
  background: #ffffff;
  border: 1px solid var(--aren-border);
  border-radius: 10px;
  padding: 18px 20px;
  margin-bottom: 15px;
  box-shadow: var(--aren-shadow-sm);
}

.comment-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.comment-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--aren-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.95rem;
}

/* ==========================================================================
   Admin Dashboard Metrics & UI
   ========================================================================== */
.stat-card {
  background: #ffffff;
  border-radius: var(--aren-radius);
  padding: 25px;
  box-shadow: var(--aren-shadow-sm);
  border: 1px solid var(--aren-border);
  display: flex;
  align-items: center;
  gap: 20px;
  transition: transform 0.25s ease;
}

.stat-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--aren-shadow-md);
}

.stat-icon {
  width: 60px;
  height: 60px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

.stat-icon.primary { background: #e8f5e9; color: var(--aren-primary); }
.stat-icon.warning { background: #fff3e0; color: var(--aren-accent); }
.stat-icon.info { background: #e1f5fe; color: #0288d1; }

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1;
  color: var(--aren-dark);
}

.stat-label {
  font-size: 0.9rem;
  color: #6c757d;
  margin-top: 5px;
}

.admin-info-bar {
  background: linear-gradient(135deg, #1b6e39 0%, #2e7d32 100%);
  color: #ffffff;
  border-radius: var(--aren-radius);
  padding: 20px 25px;
  margin-bottom: 30px;
  display: flex;
  align-items: center;
  gap: 15px;
  box-shadow: var(--aren-shadow-sm);
}

/* Honeypot field (anti-spam) */
.hp-field {
  display: none !important;
}

/* Pagination Styling */
.pagination {
  margin-top: 30px;
  justify-content: center;
}

.page-item.active .page-link {
  background-color: var(--aren-primary) !important;
  border-color: var(--aren-primary) !important;
  color: #fff !important;
}

.page-link {
  color: var(--aren-primary);
  border-radius: 6px;
  margin: 0 3px;
  padding: 8px 14px;
}

.page-link:hover {
  color: var(--aren-primary-hover);
  background-color: #e8f5e9;
}

/* Back to top button styling */
.back-to-top {
  position: fixed;
  visibility: hidden;
  opacity: 0;
  right: 15px;
  bottom: 15px;
  z-index: 996;
  background: var(--aren-primary) !important;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  transition: all 0.4s;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.back-to-top:hover {
  background: var(--aren-accent) !important;
  color: #fff !important;
  transform: translateY(-3px);
}

.back-to-top.active {
  visibility: visible;
  opacity: 1;
}

/* ==========================================================================
   Global Mobile Adjustments (< 768px)
   ========================================================================== */
@media (max-width: 768px) {
  .event-banner {
    padding: 22px 18px !important;
    margin: 25px 0 !important;
  }

  .event-banner h3 {
    font-size: 1.25rem !important;
  }

  .event-banner p {
    font-size: 0.95rem !important;
  }

  .article-card-img-wrap {
    height: 190px !important;
  }

  .article-card-body {
    padding: 18px !important;
  }

  .article-card-title {
    font-size: 1.1rem !important;
  }

  .article-card-text {
    font-size: 0.9rem !important;
    margin-bottom: 15px !important;
  }

  .article-detail-title {
    font-size: 1.45rem !important;
  }

  .article-detail-meta {
    font-size: 0.82rem !important;
    gap: 10px !important;
  }

  .article-content {
    font-size: 1rem !important;
    line-height: 1.65 !important;
  }

  .article-featured-img {
    max-height: 280px !important;
    margin-bottom: 20px !important;
  }

  .sidebar-box {
    padding: 18px !important;
    margin-bottom: 20px !important;
  }

  .stat-card {
    padding: 16px !important;
    gap: 14px !important;
  }

  .stat-icon {
    width: 48px !important;
    height: 48px !important;
    font-size: 1.4rem !important;
  }

  .stat-value {
    font-size: 1.55rem !important;
  }

  .admin-info-bar {
    padding: 16px !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 10px !important;
  }

  #footer {
    padding: 24px 15px !important;
    font-size: 0.88rem !important;
  }
}
