/**
 * Archive de la catégorie NEWS (category-news.php) — design repris de
 * ecowas-all-news.html. Tout est SCOPÉ sous .eco-news pour ne pas entrer en
 * conflit avec Bootstrap / le thème. Chargée uniquement sur cette archive.
 * Aucun reset global.
 */

.eco-news {
  --green: #018949;
  --maroon: #8e1d36;
  --gold: #EDC006;
  --gold3: #E4CA00;
  --terra: #AD4F2E;
  --ink: #141414;
  --muted: #4a4a4a;
  --card: #0F4C67;
  font-family: 'Source Sans 3', system-ui, sans-serif;
  color: var(--ink);
}

.eco-news *,
.eco-news *::before,
.eco-news *::after {
  box-sizing: border-box;
}

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

/* Wrapper aligné sur le .container Bootstrap (mêmes largeurs + padding 12px) —
   comme .eco-inst-wrap : la page news est identique aux autres pages internes. */
.eco-news-wrap {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 12px;
}

@media (min-width: 576px)  { .eco-news-wrap { max-width: 540px; } }
@media (min-width: 768px)  { .eco-news-wrap { max-width: 720px; } }
@media (min-width: 992px)  { .eco-news-wrap { max-width: 960px; } }
@media (min-width: 1200px) { .eco-news-wrap { max-width: 1140px; } }
@media (min-width: 1400px) { .eco-news-wrap { max-width: 1400px; } }

/* ================= HERO (dernier article) ================= */
.eco-news .hero-frame {
  position: relative;
  border-radius: 22px;
  overflow: hidden;
  margin-top: 10px;
  min-height: 400px;
  display: flex;
  flex-direction: column;
  background: #0a1f0d;
}

.eco-news .hero-frame .bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.eco-news .hero-frame .bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  filter: brightness(.6) saturate(.9);
  transition: transform .6s ease;
}

.eco-news .hero-frame:hover .bg img {
  transform: scale(1.04);
}

.eco-news .hero-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to top, rgba(6, 25, 10, .78), rgba(6, 25, 10, .06) 60%);
}

.eco-news .hero-title {
  position: relative;
  z-index: 3;
  margin-top: auto;
  padding: 34px 42px;
}

.eco-news .hero-title .hero-tag {
  display: inline-block;
  margin-bottom: 14px;
  background: var(--gold3);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 6px 16px;
  border-radius: 40px;
}

.eco-news .hero-title h1 {
  color: #fff;
  font-size: 38px;
  font-weight: 800;
  line-height: 1.25;
  max-width: 680px;
  letter-spacing: -.01em;
}

.eco-news .hero-title h1 a {
  color: #fff;
  text-decoration: none;
}

/* ============ LAYOUT : grille news (gauche) + sidebar (droite) ============ */
.eco-news .news-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 40px;
  margin-top: 44px;
  align-items: start;
}

/* La grille des news vit maintenant dans la colonne de gauche. */
.eco-news .news-layout .allnews {
  margin-top: 0;
}

/* ---- Sidebar : mêmes cartes que les pages institution (promo-cards) ---- */
.eco-news .side-panel {
  background: #fff;
  border-radius: 26px;
  padding: 16px;
  box-shadow: 0 14px 40px rgba(30, 60, 110, .10);
  position: sticky;
  top: 18px;
  margin-bottom: 50px;
}

.eco-news .side-panel .card {
  border-radius: 20px;
  overflow: hidden;
  margin-bottom: 16px;
}

.eco-news .side-panel .card:last-child {
  margin-bottom: 0;
}

.eco-news .card.media {
  position: relative;
  background: linear-gradient(165deg, #159a4e, #0c6b2a);
  height: 520px;
  color: #fff;
}

.eco-news .card.media .media-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.eco-news .card.media .media-btn {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 22px;
  z-index: 2;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
  transition: transform .22s ease, box-shadow .22s ease, background .22s ease;
}

.eco-news .card.media .media-btn:hover,
.eco-news .card.media .media-btn:focus {
  color: #0c6b2a !important;
  background: #fff;
  transform: translate(-50%, -4px);
  box-shadow: 0 12px 26px rgba(0, 0, 0, .4);
}

.eco-news .btn-gold {
  display: inline-block;
  background: var(--gold);
  color: #0c6b2a;
  font-weight: 800;
  font-size: 16px;
  padding: 11px 24px;
  border-radius: 9px;
  text-decoration: none;
}

.eco-news .card.promo {
  position: relative;
  height: 300px;
  display: block;
}

.eco-news .card.promo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.eco-news .card.promo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .28);
}

.eco-news .card.promo .lbl {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 18px;
  z-index: 2;
  color: #fff;
  font-weight: 800;
  font-size: 19px;
  padding: 10px 22px;
  border-radius: 10px;
  white-space: nowrap;
  transition: transform .22s ease, box-shadow .22s ease;
}

.eco-news .card.promo:hover .lbl {
  transform: translate(-50%, -4px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
}

.eco-news .lbl.proc { background: var(--maroon); }
.eco-news .lbl.recr { background: #1f5fa8; }

/* ================= ALL NEWS ================= */
.eco-news .allnews {
  margin-top: 54px;
  margin-bottom: 40px;
}

.eco-news .sec-title {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--ink);
  margin-bottom: 34px;
}

.eco-news .sec-title::before {
  content: "";
  width: 16px;
  height: 16px;
  background: var(--gold3);
  border-radius: 3px;
  flex: 0 0 auto;
}

.eco-news .news-grid {
  display: flex;
  flex-direction: column;
  gap: 30px;
}

.eco-news .nrow {
  display: grid;
  gap: 30px;
}

.eco-news .nrow.r3 { grid-template-columns: repeat(3, 1fr); }
.eco-news .nrow.r2 { grid-template-columns: 1fr 1.9fr; }

/* Carte standard — même constitution que l'accueil (.nws .news) :
   fond vert, image arrondie insérée dans le padding, catégorie + titre + date,
   bouton rond blanc à flèche diagonale. */
.eco-news .ncard {
  position: relative;
  background: var(--card);
  border-radius: 22px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  transition: transform .25s;
}

.eco-news .ncard:hover { transform: translateY(-4px); }

/* Lien étirée : toute la carte est cliquable (le titre reste en texte blanc,
   ce qui évite le a:hover jaune global du thème). */
.eco-news .ncard .ncard-link {
  position: absolute;
  inset: 0;
  z-index: 4;
}

/* Image insérée + arrondie (comme .nws-thumb) */
.eco-news .ncard .nthumb {
  height: 210px;
  border-radius: 16px;
  overflow: hidden;
  flex: 0 0 auto;
  background: linear-gradient(150deg, #9aa7ad, #566b5a);
}

.eco-news .ncard .nthumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}

.eco-news .ncard:hover .nthumb img { transform: scale(1.05); }

.eco-news .ncard .nbody {
  padding: 18px 10px 66px;
  color: #fff;
}

/* Label catégorie (comme .nws .news .cat) */
.eco-news .ncard .ncat {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #fff;
  opacity: .85;
  margin-bottom: 14px;
}

.eco-news .ncard .ntitle {
  font-size: 18.5px;
  font-weight: 800;
  line-height: 1.28;
  text-transform: uppercase;
  letter-spacing: .01em;
  color: #fff;
  margin-bottom: 16px;
  /* Titre tronqué à 2 lignes max (comme la page d'accueil). */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.eco-news .ncard .ndate {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
}

/* Bouton rond blanc à flèche diagonale (comme .nws .news .go). Décoratif :
   le lien étiré couvre déjà toute la carte. */
.eco-news .ncard .ngo {
  position: absolute;
  right: 24px;
  bottom: 24px;
  z-index: 5;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0f3d21;
  pointer-events: none;
  box-shadow: 0 8px 20px -10px rgba(15, 61, 33, .5);
  transition: background .2s, color .2s, transform .2s;
}

.eco-news .ncard:hover .ngo {
  background: var(--gold3);
  color: #fff;
  transform: translateY(-2px);
}

.eco-news .ncard .ngo svg { width: 21px; height: 21px; }

/* Carte vedette : image à gauche, corps à droite — même style (vert + insertion). */
.eco-news .ncard.featured {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 16px;
  height: 360px;            /* hauteur fixe : la photo est recadrée (cover), pas étirée */
}

.eco-news .ncard.featured .nthumb {
  height: 100%;
}

.eco-news .ncard.featured .nbody {
  padding: 26px 24px 78px 14px;
  display: flex;
  flex-direction: column;
}

.eco-news .ncard.featured .ncat { margin-bottom: 24px; }

.eco-news .ncard.featured .ntitle {
  font-size: 27px;
  line-height: 1.28;
  max-width: 460px;
}

/* Bouton Load more */
.eco-news .loadmore-wrap {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

.eco-news .loadmore {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--gold3);
  color: var(--ink);
  border: none;
  border-radius: 40px;
  padding: 16px 34px;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, transform .2s, color .2s;
  font-family: inherit;
}

.eco-news .loadmore:hover {
  background: var(--maroon);
  color: #fff !important;
  transform: translateY(-1px);
}

.eco-news .loadmore:disabled {
  opacity: .6;
  cursor: default;
}

.eco-news .loadmore svg {
  width: 18px;
  height: 18px;
  transition: transform .2s;
}

/* Spinner circulaire (remplace la flèche pendant le chargement). */
.eco-news .loadmore .lm-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2.5px solid rgba(20, 20, 20, .28);
  border-top-color: #141414;
  animation: eco-news-spin .7s linear infinite;
}

.eco-news .loadmore.is-loading .lm-arrow {
  display: none;
}

.eco-news .loadmore.is-loading .lm-spinner {
  display: inline-block;
}

@keyframes eco-news-spin {
  to { transform: rotate(360deg); }
}

/* ================= RESPONSIVE ================= */
@media (max-width: 980px) {
  .eco-news .news-layout { grid-template-columns: 1fr; gap: 30px; }
  .eco-news .side-panel { position: static; }

  .eco-news .nrow.r3 { grid-template-columns: repeat(2, 1fr); }
  .eco-news .nrow.r2 { grid-template-columns: 1fr; }

  .eco-news .ncard.featured {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .eco-news .ncard.featured .nthumb { height: 260px; }

  .eco-news .ncard.featured .nbody { padding: 30px 30px 78px; }

  .eco-news .ncard.featured .ntitle { font-size: 22px; }

  .eco-news .hero-title h1 { font-size: 26px; }

  .eco-news .hero-frame { min-height: 300px; }

  .eco-news .sec-title { font-size: 30px; }
}

@media (max-width: 620px) {
  .eco-news .nrow.r3 { grid-template-columns: 1fr; }
}
