/* =========================================================
   Africa Governance Institute, Resources / media library
   ========================================================= */
.rs-mast {
  padding: 60px 0 44px;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
}
.rs-mast .crumbs { margin-bottom: 26px; }
.rs-mast .eyebrow { margin-bottom: 18px; }
.rs-mast h1 { margin: 0; max-width: 16ch; }
.rs-mast .lead { margin: 20px 0 0; max-width: 620px; }

.rs-body { padding: 72px 0 104px; }
.rs-section { margin-top: 84px; }
.rs-section:first-child { margin-top: 0; }
.rs-sec-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  padding-bottom: 18px; margin-bottom: 34px;
  border-bottom: 1px solid var(--line-2);
}
.rs-sec-head h2 {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(28px, 3.4vw, 40px); line-height: 1.05; margin: 0; color: var(--ink);
}
.rs-sec-head .rs-kicker {
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--ink-3);
}

/* Placeholder surface: subtle brand stripes + monospace explainer */
.rs-ph {
  position: relative; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px; text-align: center;
  background-color: var(--cream-2);
  background-image: repeating-linear-gradient(135deg,
    rgba(94,107,39,0.07) 0, rgba(94,107,39,0.07) 2px,
    transparent 2px, transparent 11px);
  border: 1px solid var(--line-2);
  color: var(--ink-3);
  padding: 24px;
}
.rs-ph .rs-ph-tag {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--agi-red);
}
.rs-ph .rs-ph-note { font-size: 13.5px; line-height: 1.5; max-width: 26ch; }
.rs-ph .rs-play {
  width: 56px; height: 56px; border-radius: 999px;
  background: var(--agi-red); color: var(--cream);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}

/* Video grid */
.rs-vid-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px;
}
.rs-vid { display: flex; flex-direction: column; gap: 14px; }
.rs-vid .rs-ph { aspect-ratio: 16 / 9; border-radius: 12px; }
.rs-vid h3 {
  font-family: var(--serif); font-weight: 500; font-size: 22px; line-height: 1.2;
  margin: 0; color: var(--ink);
}
.rs-vid p { margin: 4px 0 0; font-size: 13px; color: var(--ink-3); }

/* Publications */
.rs-pub-list { display: grid; gap: 16px; }
.rs-pub {
  display: flex; align-items: center; gap: 22px;
  padding: 22px 26px; border: 1px solid var(--line);
  background: var(--paper); border-radius: 14px;
  transition: border-color .2s ease, transform .2s ease;
}
a.rs-pub:hover { border-color: var(--agi-red); transform: translateY(-2px); }
.rs-pub-ico {
  flex: 0 0 auto; width: 46px; height: 46px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: var(--cream-2); color: var(--agi-red);
}
.rs-pub-main { flex: 1; min-width: 0; }
.rs-pub-main h3 {
  font-family: var(--serif); font-weight: 600; font-size: 21px; line-height: 1.2;
  margin: 0; color: var(--ink);
}
.rs-pub-main p { margin: 4px 0 0; font-size: 13.5px; color: var(--ink-3); }
.rs-pub-cta {
  flex: 0 0 auto; font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--agi-red);
  display: inline-flex; align-items: center; gap: 7px;
}
.rs-pub.rs-pub-empty { border-style: dashed; background: transparent; }
.rs-pub.rs-pub-empty .rs-pub-ico { background: transparent; border: 1px dashed var(--line-2); color: var(--ink-3); }
.rs-pub.rs-pub-empty h3 { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); font-weight: 500; }

/* Photo essays */
.rs-photo-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 18px;
}
.rs-photo-grid .rs-ph { aspect-ratio: 4 / 5; border-radius: 12px; }

@media (max-width: 640px) {
  .rs-pub { flex-wrap: wrap; gap: 14px; }
  .rs-pub-cta { width: 100%; }
}


/* Featured media banner */
.rs-featured {
  position: relative; display: block; overflow: hidden;
  border-radius: 16px; aspect-ratio: 16 / 8; min-height: 340px;
  background: var(--agi-olive-deep); margin-bottom: 14px;
}
.rs-featured img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s ease; }
.rs-featured:hover img { transform: scale(1.03); }
.rs-featured::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(20,18,12,.88) 0%, rgba(20,18,12,.28) 52%, rgba(20,18,12,0) 100%); }
.rs-featured-body { position: absolute; left: 0; bottom: 0; z-index: 2;
  padding: clamp(24px, 4vw, 46px); color: var(--cream); max-width: 660px; }
.rs-featured-tag { font-family: var(--mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--agi-yellow); }
.rs-featured h2 { font-family: var(--serif); font-weight: 500; font-size: clamp(28px, 4vw, 46px); line-height: 1.04; margin: 10px 0 8px; color: var(--cream); }
.rs-featured p { margin: 0 0 14px; font-size: 15px; line-height: 1.55; opacity: .86; max-width: 48ch; }
.rs-featured-cta { display: inline-flex; align-items: center; gap: 8px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--cream); }
.rs-featured:hover .rs-featured-cta { color: var(--agi-yellow); }

/* Photo gallery */
.rs-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(232px, 1fr)); grid-auto-rows: 196px; gap: 14px; }
.rs-shot { position: relative; display: block; overflow: hidden; border-radius: 12px; background: var(--agi-olive-deep); border: 0; padding: 0; margin: 0; width: 100%; height: 100%; cursor: zoom-in; font: inherit; }
.rs-shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.rs-shot:hover img { transform: scale(1.05); }
.rs-shot::after { content: ""; position: absolute; inset: 0; background: rgba(20,18,12,0); transition: background .3s ease; }
.rs-shot:hover::after { background: rgba(20,18,12,.12); }
.rs-shot.tall { grid-row: span 2; }
.rs-shot.wide { grid-column: span 2; }

.rs-soon-note { font-size: 15px; line-height: 1.6; color: var(--ink-3); max-width: 60ch; margin: 0; }

@media (max-width: 720px) {
  .rs-gallery { grid-auto-rows: 150px; }
  .rs-shot.wide { grid-column: span 1; }
}


/* Click-to-play video (vertical / Shorts). No YouTube request until the user plays. */
.rs-video { max-width: 320px; }
.rs-video-facade {
  position: relative; display: block; width: 100%; aspect-ratio: 9 / 16;
  border: 0; padding: 0; margin: 0; cursor: pointer; overflow: hidden;
  border-radius: 16px; background: #14110d; box-shadow: 0 18px 44px rgba(20,17,13,.28);
}
.rs-video-facade img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.rs-video-facade::after { content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(20,18,12,.74) 0%, rgba(20,18,12,.05) 48%, rgba(20,18,12,.28) 100%); }
.rs-video-play { position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%); z-index: 2;
  width: 66px; height: 66px; border-radius: 999px; background: rgba(178,47,40,.95); color: var(--cream);
  display: flex; align-items: center; justify-content: center; transition: transform .2s ease, background .2s ease; }
.rs-video-facade:hover .rs-video-play { transform: translate(-50%,-50%) scale(1.08); background: var(--agi-red); }
.rs-video-label { position: absolute; left: 0; bottom: 0; z-index: 2; width: 100%; box-sizing: border-box;
  padding: 16px 18px; color: var(--cream); font-size: 13.5px; line-height: 1.4; text-align: left; }
.rs-video-cap { margin: 12px 0 0; font-size: 12.5px; color: var(--ink-3); }
.rs-video-frame { position: relative; width: 100%; max-width: 320px; aspect-ratio: 9 / 16;
  border-radius: 16px; overflow: hidden; background: #14110d; box-shadow: 0 18px 44px rgba(20,17,13,.28); }
.rs-video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }


/* Lightbox viewer */
.lightbox { position: fixed; inset: 0; z-index: 1200; background: rgba(20,17,13,0.93);
  display: flex; align-items: center; justify-content: center; padding: 4vmin;
  opacity: 0; visibility: hidden; transition: opacity .22s ease; }
.lightbox.open { opacity: 1; visibility: visible; }
.lightbox img { max-width: 92vw; max-height: 90vh; width: auto; height: auto;
  border-radius: 6px; box-shadow: 0 30px 80px rgba(0,0,0,0.55); cursor: zoom-out; }
.lightbox .lb-close, .lightbox .lb-nav { position: absolute; border: 0; cursor: pointer;
  background: rgba(248,242,226,0.12); color: #f8f2e2; display: flex; align-items: center; justify-content: center; transition: background .2s; }
.lightbox .lb-close { top: 20px; right: 24px; width: 46px; height: 46px; border-radius: 50%; }
.lightbox .lb-nav { top: 50%; transform: translateY(-50%); width: 50px; height: 50px; border-radius: 50%; }
.lightbox .lb-prev { left: 24px; }
.lightbox .lb-next { right: 24px; }
.lightbox .lb-close:hover, .lightbox .lb-nav:hover { background: rgba(248,242,226,0.24); }
@media (max-width: 600px){ .lightbox .lb-prev{ left:10px; } .lightbox .lb-next{ right:10px; } }
