/* Data-driven publications and events */
.publications-intro { max-width: 920px; margin-top: 14px; }
.publications-archive-section { padding-top: 72px; }
.publications-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr)); gap: 24px; }
.publication-record { position: relative; display: flex; flex-direction: column; min-height: 285px; padding: 28px; background: #fff; border: 1px solid var(--line); border-top: 4px solid var(--green); border-radius: 10px; box-shadow: var(--shadow-sm); transition: transform .2s ease, box-shadow .2s ease; }
.publication-record:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.publication-journal { display: inline-flex; align-self: flex-start; padding: 6px 10px; color: var(--green); background: var(--mist); border-radius: 999px; font-size: .78rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.publication-year { margin: 12px 0 0; color: var(--ink-muted); font-size: .85rem; }
.publication-record h3 { margin: 14px 0 10px; }
.publication-record p { color: var(--ink-muted); line-height: 1.7; }
.publication-record .archive-link { margin-top: auto; padding-top: 20px; font-weight: 700; color: var(--green); }
.events-grid { display: grid; gap: 28px; margin-bottom: 64px; }
.event-record { display: grid; grid-template-columns: minmax(260px, .85fr) 1.15fr; overflow: hidden; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); }
.event-record:nth-child(even) { grid-template-columns: 1.15fr minmax(260px, .85fr); }
.event-record:nth-child(even) img { order: 2; }
.event-record img { width: 100%; height: 100%; min-height: 280px; object-fit: cover; }
.event-record-body { padding: 34px; align-self: center; }
.event-meta { display: inline-block; margin-bottom: 12px; color: var(--green); font-size: .82rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.event-record h2 { margin-bottom: 12px; }
.event-record p { color: var(--ink-muted); line-height: 1.7; }
.event-record .archive-link { display: inline-block; margin-top: 18px; color: var(--green); font-weight: 700; }
@media (max-width: 1050px) { .publication-record { min-height: 0; } }
@media (max-width: 768px) {
  .event-record, .event-record:nth-child(even) { display: block; }
  .event-record:nth-child(even) img { order: initial; }
  .event-record img { height: 220px; min-height: 0; }
  .event-record-body { padding: 24px; }
}

/* Red accents: Leadership, Research, Publications views (green stays dominant) */
#page-leadership .section-head h2, #page-research .section-head h2, #page-publications .section-head h2 { position: relative; padding-bottom: 12px; }
#page-leadership .section-head h2::after, #page-research .section-head h2::after, #page-publications .section-head h2::after { content: ""; position: absolute; left: 0; bottom: 0; width: 44px; height: 3px; background: var(--red); border-radius: 2px; }
#page-leadership .team-card, #page-publications .publication-record, #page-research .publication-record { border-top: 3px solid var(--red); }
#page-publications .publication-journal, #page-research .publication-journal { color: var(--red); }
#page-publications .publication-record:hover h3, #page-research .publication-record:hover h3 { text-decoration: underline; text-decoration-color: var(--red); text-underline-offset: 4px; }
#page-publications .publication-record .archive-link:hover, #page-research .publication-record .archive-link:hover { color: var(--red); }

/* Train Africa page */
.train-intro { max-width: 880px; }
.train-intro p { margin: 0 0 18px; font-size: 1.3rem; line-height: 1.75; color: var(--ink-muted); }
.train-intro h3 { margin: 36px 0 14px; font-size: 1.5rem; }
.train-list { margin: 0; padding-left: 1.4em; font-size: 1.3rem; line-height: 1.7; color: var(--ink-muted); }
.train-list li { margin-bottom: 8px; padding-left: 4px; }
.train-list li::marker { color: var(--red); font-weight: 700; }

/* Fellow flip cards: photo front with graduated overlay, details on the back */
.fellows-grid { display: grid; grid-template-columns: 1fr; gap: 24px; }
@media (min-width: 640px) { .fellows-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .fellows-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1280px) { .fellows-grid { grid-template-columns: repeat(4, 1fr); } }
.fellow-card { aspect-ratio: 4 / 5; perspective: 1200px; border-radius: var(--radius-lg); outline: none; cursor: pointer; }
.fellow-card:focus-visible { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--green); }
.fellow-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .65s var(--ease); }
@media (hover: hover) { .fellow-card:hover .fellow-inner { transform: rotateY(180deg); } }
.fellow-card:focus-within .fellow-inner, .fellow-card.is-flipped .fellow-inner { transform: rotateY(180deg); }
.fellow-face { position: absolute; inset: 0; border-radius: var(--radius-lg); backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; box-shadow: var(--shadow-md); }
.fellow-front { display: flex; flex-direction: column; justify-content: flex-end; padding: 20px 22px; background-size: cover; background-position: center 20%; background-color: var(--deep); color: #fff; }
.fellow-front.no-photo { background-image: linear-gradient(150deg, var(--green), var(--deep)); }
.fellow-front::before { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(11, 63, 29, .92) 0%, rgba(11, 63, 29, .6) 22%, rgba(11, 63, 29, 0) 50%); }
.fellow-front > * { position: relative; }
.fellow-initials { position: absolute; top: 28%; left: 0; right: 0; text-align: center; font-family: var(--head); font-size: 64px; font-weight: 700; color: rgba(255, 255, 255, .22); }
.fellow-name { margin: 0; font-family: var(--head); font-size: clamp(1.15rem, 1.45vw, 1.35rem); line-height: 1.15; color: #fff; overflow-wrap: anywhere; }
.fellow-country { margin: 6px 0 0; font-size: .8rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .85); }
.fellows-note { margin: 10px 0 0; font-size: .95rem; color: var(--ink-muted); }
.cue-tap { display: none; }
@media (hover: none) { .cue-hover { display: none; } .cue-tap { display: inline; } }
.fellow-back { transform: rotateY(180deg); display: flex; flex-direction: column; justify-content: center; gap: 10px; padding: 24px; background: #fff; border-top: 4px solid var(--red); overflow-y: auto; }
.fellow-tag { font-size: .7rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--red); }
.fellow-role { margin: 0; font-family: var(--head); font-size: 1.15rem; font-weight: 700; line-height: 1.25; color: var(--deep); }
.fellow-details { margin: 0; padding: 0; list-style: none; font-size: .95rem; line-height: 1.4; color: var(--ink-muted); }
.fellow-details li { padding: 6px 0; border-top: 1px solid var(--line); }
.fellow-linkedin { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin-top: 4px; padding: 0 14px 0 10px; border: 1px solid var(--line); border-radius: 999px; font-size: .85rem; font-weight: 700; color: var(--green); text-decoration: none; transition: background .2s, color .2s; }
.fellow-linkedin:hover, .fellow-linkedin:focus-visible { background: var(--green); color: #fff; }
@media (max-width: 400px) { .fellow-card { aspect-ratio: 1 / 1.1; } }
@media (prefers-reduced-motion: reduce) {
  .fellow-inner { transition: none; }
  .fellow-face { transition: none; }
  .fellow-card .fellow-inner { transform: none !important; }
  .fellow-back { transform: none; opacity: 0; visibility: hidden; }
  .fellow-card:hover .fellow-back, .fellow-card:focus-within .fellow-back, .fellow-card.is-flipped .fellow-back { opacity: 1; visibility: visible; z-index: 2; }
}
.fellow-country { display: flex; align-items: center; gap: 8px; }
.fellow-flag { width: 20px; height: 14px; object-fit: cover; border-radius: 2px; box-shadow: 0 0 0 1px rgba(255, 255, 255, .35); }


/* Event records: subtle image zoom on hover */
.event-record img { transition: transform .6s var(--ease); }
.event-record:hover img { transform: scale(1.03); }

/* Featured news story: large image beside headline, above the news grid */
.feature-story { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); margin-bottom: 24px; overflow: hidden; background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--red); border-radius: 12px; box-shadow: var(--shadow-sm); }
.feature-story img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; transition: transform .6s var(--ease); }
.feature-story:hover img { transform: scale(1.03); }
.feature-story-body { align-self: center; padding: 36px 40px; }
.feature-story-body h3 { margin: 0 0 12px; font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.15; }
.feature-story-body p { color: var(--ink-muted); line-height: 1.7; }
.feature-story-body .archive-link { display: inline-block; margin-top: 16px; font-weight: 700; color: var(--green); }
.feature-story-body .archive-link:hover { color: var(--red); }
@media (max-width: 760px) {
  .feature-story { grid-template-columns: 1fr; }
  .feature-story img { min-height: 0; height: 260px; }
  .feature-story-body { padding: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .event-record img, .feature-story img { transition: none; }
  .event-record:hover img, .feature-story:hover img { transform: none; }
}

/* Editorial hero: a large photo with a content card layered over its lower edge.
   Set --hero-img (and optionally --hero-pos) on the .page-head; without an image the brand gradient shows.
   Card sits left by default; add editorial-hero--center to centre it. */
.page-head.editorial-hero { position: relative; display: block; padding: var(--hero-h, clamp(160px, 18vw, 260px)) 0 0; background: none; border-bottom: 0; }
.page-head.editorial-hero::before { content: ""; position: absolute; inset: 0 0 auto; height: calc(var(--hero-h, clamp(160px, 18vw, 260px)) + var(--hero-overlap, 270px)); background: linear-gradient(0deg, rgba(8, 30, 15, .28) 0%, rgba(8, 30, 15, 0) 45%), var(--hero-img, linear-gradient(135deg, var(--green) 0%, var(--deep) 100%)) var(--hero-pos, center) / cover no-repeat var(--deep); }
.page-head.editorial-hero .wrap { position: relative; display: flex; justify-content: flex-start; }
.page-head.editorial-hero--center .wrap { justify-content: center; }
.page-head.editorial-hero:not([style*="--hero-img"]) { padding-top: clamp(140px, 16vw, 220px); }
.eyebrow { display: inline-block; margin-bottom: 10px; font-size: .78rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--red); }
.editorial-card { width: min(100%, 720px); padding: 40px 48px 38px; background: rgba(255, 255, 255, .74); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); border-top: 4px solid var(--red); border-radius: var(--radius-md); box-shadow: 0 18px 44px rgba(11, 63, 29, .16); animation: editorial-rise .7s var(--ease) both; }
.editorial-hero--center .editorial-card { width: min(100%, 980px); }
.editorial-card h1 { margin: 0; color: var(--deep); }
.editorial-card p.intro { margin-top: 14px; color: var(--ink); }
.editorial-card .eyebrow { padding-left: 34px; position: relative; }
.editorial-card .eyebrow::before { content: ""; position: absolute; left: 0; top: 50%; width: 24px; height: 2px; background: var(--red); }
@keyframes editorial-rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@media (max-width: 760px) {
  .page-head.editorial-hero { padding-top: 150px; }
  .page-head.editorial-hero { --hero-overlap: 170px; }
  .editorial-card { padding: 26px 22px 24px; }
}
@media (prefers-reduced-motion: reduce) { .editorial-card { animation: none; } }

/* Train Africa banner: drawn in CSS (gradient, Africa outline, wordmark) so it stays sharp at any size */
.page-head.editorial-hero--banner { --band: clamp(130px, 14vw, 210px); --hero-h: var(--band); }
.page-head.editorial-hero--banner::before { background: radial-gradient(ellipse 70% 120% at 88% -10%, rgba(30, 140, 70, .55) 0%, rgba(16, 104, 47, 0) 60%), radial-gradient(ellipse 50% 90% at 0% 100%, rgba(0, 0, 0, .25) 0%, rgba(0, 0, 0, 0) 70%), linear-gradient(135deg, var(--deep) 0%, #0e5428 55%, var(--green) 100%); }
.page-head.editorial-hero--banner::after { content: ""; position: absolute; top: 0; left: clamp(8px, 4vw, 64px); width: clamp(160px, 22vw, 340px); height: calc(var(--band) + var(--hero-overlap, 270px)); background: url("assets/img/africa-map.png") left 30% / contain no-repeat; filter: brightness(0) invert(1); opacity: .08; pointer-events: none; }
.hero-wordmark { position: absolute; top: 0; left: 0; right: 0; z-index: 1; height: var(--band); display: flex; flex-direction: column; align-items: center; justify-content: center; font-family: var(--head); font-weight: 800; font-size: clamp(2.1rem, 5.4vw, 4.6rem); line-height: 1; letter-spacing: -.02em; text-transform: uppercase; color: #fff; pointer-events: none; }
.hero-wordmark::after { content: ""; width: clamp(56px, 7vw, 110px); height: 4px; margin-top: clamp(10px, 1.2vw, 16px); border-radius: 2px; background: var(--red); }
.page-head.editorial-hero--banner .wrap { z-index: 2; }
@media (max-width: 760px) { .page-head.editorial-hero--banner { --band: 150px; } }
.hero-logo { position: absolute; top: clamp(12px, 1.6vw, 24px); right: clamp(12px, 3vw, 48px); z-index: 1; width: clamp(64px, 7.5vw, 112px); height: auto; padding: 6px; background: #fff; border-radius: 10px; box-shadow: 0 6px 18px rgba(0, 0, 0, .18); }
/* The card's lower part sits on the white page: fade it to solid white with no hard edge or shadow */
.page-head.editorial-hero .editorial-card { background: linear-gradient(180deg, rgba(255, 255, 255, .74) 0%, rgba(255, 255, 255, .86) 55%, #fff 100%); box-shadow: 0 -20px 30px -12px rgba(11, 63, 29, .18); }

/* Home: "How AMedRA Supports Researchers" as a numbered grid */
.support-grid { counter-reset: support; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 640px) { .support-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .support-grid { grid-template-columns: repeat(3, 1fr); gap: 24px; } }
.support-item { counter-increment: support; position: relative; padding: 28px 26px 26px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-sm); transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), border-color var(--dur) var(--ease); }
.support-item::before { content: counter(support, decimal-leading-zero); display: block; margin-bottom: 14px; font-family: var(--head); font-size: 2.1rem; font-weight: 800; line-height: 1; color: var(--green); opacity: .9; }
.support-item::after { content: ""; position: absolute; left: 26px; top: 0; width: 44px; height: 3px; border-radius: 0 0 3px 3px; background: var(--red); transition: width var(--dur) var(--ease); }
.support-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(16, 104, 47, .35); }
.support-item:hover::after { width: calc(100% - 52px); }
.support-item h3 { margin: 0 0 8px; font-size: 1.15rem; line-height: 1.3; color: var(--deep); }
.support-item p { margin: 0; color: var(--ink-muted); line-height: 1.65; }
