/**
 * Page d'une INSTITUTION (single-institutions.php) — design repris de
 * ecowas-institutions.html. Tout est SCOPÉ sous .eco-inst pour ne pas entrer en
 * conflit avec Bootstrap/le thème (classes génériques .card/.media/.article…).
 * Chargée uniquement sur les pages d'institution. Aucun reset global.
 */

.eco-inst {
  --gold: #EDC006;
  --gold3: #E4CA00;
  --maroon: #8e1d36;
  --ink: #141414;
  --muted: #4a4a4a;
  --pagew: 1355px;
  font-family: 'Source Sans 3', system-ui, sans-serif;
  color: var(--ink);
}

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

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

.eco-inst-wrap {
  width: 100%;
  max-width: var(--pagew);
  margin: 0 auto;
  padding: 0 24px;
}

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

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

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

.eco-inst .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-inst .hero-title {
  position: relative;
  z-index: 3;
  margin-top: auto;
  padding: 34px 42px;
}

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

/* ================= CONTENU + SIDEBAR ================= */
.eco-inst .layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 44px;
  margin-top: 44px;
  align-items: start;
}

.eco-inst .a-img {
  border-radius: 18px;
  overflow: hidden;
  margin: 8px 0 24px;
}

.eco-inst .article h1,
.eco-inst .article h2 {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.3;
  margin: 8px 0 20px;
  letter-spacing: -.01em;
}

.eco-inst .article h3 {
  font-size: 22px;
  font-weight: 700;
  margin: 6px 0 14px;
}

.eco-inst .article p {
  font-size: 18px;
  line-height: 1.75;
  color: #2a2a2a;
  margin-bottom: 22px;
}

.eco-inst .article img {
  border-radius: 14px;
  margin: 6px 0 22px;
}

.eco-inst .article ul,
.eco-inst .article ol {
  font-size: 18px;
  line-height: 1.75;
  color: #2a2a2a;
  margin: 0 0 22px 22px;
}

.eco-inst .article a {
  color: #018949;
  text-decoration: underline;
}

/* Sidebar : panneau blanc arrondi + cartes promo */
.eco-inst .side-panel {
  background: #fff;
  border-radius: 26px;
  padding: 16px;
  box-shadow: 0 14px 40px rgba(30, 60, 110, .10);
  position: sticky;
  top: 18px;
}

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

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

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

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

.eco-inst .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;
}

/* Le thème force les liens en jaune au survol (a:hover !important) : on rétablit
   la couleur du bouton + une petite animation de levée. */
.eco-inst .card.media .media-btn:hover,
.eco-inst .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-inst .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-inst .card.promo {
  position: relative;
  height: 300px;
  display: block;
}

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

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

.eco-inst .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-inst .card.promo:hover .lbl {
  transform: translate(-50%, -4px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
}

.eco-inst .lbl.proc {
  background: var(--maroon);
}

.eco-inst .lbl.recr {
  background: #1f5fa8;
}

/* ================= GRILLE DES INSTITUTIONS (en bas) ================= */
.eco-inst .insts {
  background: rgba(228, 202, 0, .3);
  padding: clamp(40px, 5vw, 56px) 0 clamp(40px, 6vw, 64px);
  margin-top: 64px;
  display: flex;
  justify-content: center;
}

.eco-inst .insts .head {
  display: flex;
  align-items: flex-start;
  gap: 30px;
  margin-bottom: 42px;
}

.eco-inst .insts .insts-pill {
  flex: 0 0 auto;
  margin-top: 6px;
  display: inline-block;
  border: 1.5px solid #26352B;
  border-radius: 40px;
  padding: 8px 18px;
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.eco-inst .insts .head-main {
  flex: 1;
  min-width: 0;
}

.eco-inst .insts .head-main h2 {
  font-size: 45px;
  font-weight: 800;
  line-height: 1.04;
  letter-spacing: -.025em;
  color: #26352b;
  margin-bottom: 14px;
}

.eco-inst .insts .head-main p {
  font-size: 18px;
  color: #000;
  max-width: 740px;
  line-height: 1.55;
}

.eco-inst .insts .read-more {
  flex: 0 0 auto;
  margin-top: 8px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  background: var(--gold3);
  color: var(--ink);
  border: none;
  border-radius: 40px;
  padding: 15px 26px;
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s, transform .2s;
  font-family: inherit;
}

.eco-inst .insts .read-more:hover {
  background: var(--maroon);
  transform: translateY(-1px);
  color: #fff;
}

.eco-inst .insts .read-more svg {
  width: 17px;
  height: 17px;
}

/* Carrousel : une seule ligne, défilement horizontal (flèches en bas). */
.eco-inst .insts .track {
  display: flex;
  gap: 28px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  padding: 6px 2px 10px;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.eco-inst .insts .track::-webkit-scrollbar {
  display: none;
}

.eco-inst .insts .icard {
  flex: 0 0 calc((100% - 3 * 28px) / 4);   /* 4 cartes visibles */
  scroll-snap-align: start;
  background: #008244;
  border-radius: 20px;
  padding: 16px 16px 26px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
  display: flex;
  flex-direction: column;
  text-decoration: none;
  transition: transform .25s;
}

/* Flèches de défilement */
.eco-inst .insts-controls {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 34px;
}

.eco-inst .insts-arrow {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: #008244;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s, opacity .2s, transform .2s;
}

.eco-inst .insts-arrow:hover:not(:disabled) {
  background: var(--maroon);
  transform: translateY(-1px);
}

.eco-inst .insts-arrow:disabled {
  opacity: .35;
  cursor: default;
}

.eco-inst .insts-arrow svg {
  width: 22px;
  height: 22px;
}

.eco-inst .insts .icard:hover {
  transform: translateY(-4px);
}

.eco-inst .insts .icard .ithumb {
  border-radius: 13px;              /* même radius que la maquette */
  overflow: hidden;
  aspect-ratio: 1.55;
  flex: 0 0 auto;
  background: linear-gradient(150deg, #2a3b46, #16331f);
}

.eco-inst .insts .icard .ithumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.eco-inst .insts .icard h3 {
  color: #fff;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
  margin: 18px 6px 0;
}

/* ================= RESPONSIVE ================= */
@media (max-width: 980px) {
  .eco-inst .layout {
    grid-template-columns: 1fr;
  }

  .eco-inst .side-panel {
    position: static;
  }

  .eco-inst .insts .icard {
    flex-basis: calc((100% - 28px) / 2);   /* 2 cartes visibles */
  }

  .eco-inst .insts .head {
    flex-direction: column;
    gap: 18px;
  }

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

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

@media (max-width: 560px) {
  .eco-inst .insts .icard {
    flex-basis: 85%;                        /* 1 carte visible (+ aperçu suivante) */
  }
}
