/**
 * Running Africa — content sections and video templates.
 *
 * Colours and type are read from the site's existing Elementor global tokens,
 * so these pages track the live palette instead of carrying their own copy of
 * it. The fallbacks after each var() are the values currently on the site, so
 * nothing breaks if Elementor's global stylesheet is not enqueued on a view.
 */

.ra-wrap {
	--ra-ink: var(--e-global-color-astglobalcolor2, #1e293b);
	--ra-muted: var(--e-global-color-393f45b, #656b77);
	--ra-accent: var(--e-global-color-accent, #b75520);
	--ra-rule: var(--e-global-color-0dc6f61, #c6cedd);
	--ra-font: var(--e-global-typography-primary-font-family, "Inter"), sans-serif;
}

.ra-section {
	--ra-ink: var(--e-global-color-astglobalcolor2, #1e293b);
	--ra-muted: var(--e-global-color-393f45b, #656b77);
	--ra-accent: var(--e-global-color-accent, #b75520);
	--ra-rule: var(--e-global-color-0dc6f61, #c6cedd);
	--ra-font: var(--e-global-typography-primary-font-family, "Inter"), sans-serif;
}

.ra-wrap {
	max-width: 1200px;
	margin: 0 auto;
	padding-block: 2.5rem;
	padding-inline: 20px;
	font-family: var(--ra-font);
	color: var(--ra-ink);
}

.ra-wrap--narrow { max-width: 820px; }

/* Inside the theme's own content container the width and side gutters are
   already set. Keeping ours as well would inset these pages ~40px narrower
   than every other page on the site, which reads as a mismatch. */
.site-main .ra-wrap,
.ast-container .ra-wrap,
.entry-content .ra-wrap {
	max-width: none;
	padding-inline: 0;
}

/* ---------- page heads ---------- */

.ra-page-head { margin-bottom: 2rem; }

.ra-page-title {
	font-family: var(--ra-font);
	font-size: clamp(1.9rem, 4vw, 2.75rem);
	line-height: 1.15;
	margin: 0 0 .5rem;
	color: var(--ra-ink);
}

.ra-page-intro { color: var(--ra-muted); max-width: 70ch; }

.ra-eyebrow {
	display: inline-block;
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--ra-accent);
	text-decoration: none;
	margin-bottom: .4rem;
}

.ra-eyebrow:hover,
.ra-eyebrow:focus-visible { text-decoration: underline; }

/* ---------- sections ---------- */

.ra-section {
	margin-block: 2.75rem;
	font-family: var(--ra-font);
	color: var(--ra-ink);
}

/* Themes and WordPress itself underline links inside post content. A section
   dropped into a page would then be underlined while the same cards on a real
   archive are not. Specificity here has to beat `.entry-content a`. */
.ra-section a,
.entry-content .ra-section a,
.ra-wrap a,
.entry-content .ra-wrap a {
	text-decoration: none;
}

.ra-section a:hover,
.entry-content .ra-section a:hover,
.ra-section a:focus-visible,
.entry-content .ra-section a:focus-visible {
	text-decoration: underline;
}

.ra-section__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	border-bottom: 2px solid var(--ra-accent);
	padding-bottom: .5rem;
	margin-bottom: 1.25rem;
}

.ra-section__title {
	margin: 0;
	font-size: clamp(1.15rem, 2.2vw, 1.5rem);
	line-height: 1.2;
	color: var(--ra-ink);
}

.ra-section__more {
	font-size: .85rem;
	font-weight: 600;
	color: var(--ra-accent);
	text-decoration: none;
	white-space: nowrap;
}

.ra-section__more:hover,
.ra-section__more:focus-visible { text-decoration: underline; }

.ra-section__desc {
	color: var(--ra-muted);
	margin: -.5rem 0 1.25rem;
	max-width: 70ch;
}

/* ---------- list sections (the client's CNN "DEVELOPING" reference) ---------- */

/* An accent bar beside the heading, rows of time + headline, rules between.
   Narrow enough to sit in a sidebar rail, but works full width too. */
.ra-section--list .ra-section__head {
	border-bottom: 0;
	padding-bottom: 0;
	margin-bottom: .75rem;
}

.ra-section--list .ra-section__title {
	display: flex;
	align-items: center;
	gap: .55rem;
	font-size: .9rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.ra-section--list .ra-section__title::before {
	content: "";
	width: 4px;
	height: 1.1em;
	background: var(--ra-accent);
	flex: none;
}

.ra-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ra-list__item { border-top: 1px solid var(--ra-rule); }

.ra-list__item:first-child { border-top: 0; }

.ra-list__link {
	display: grid;
	grid-template-columns: 5.5rem 1fr;
	gap: .25rem 1rem;
	align-items: start;
	padding-block: .8rem;
	color: var(--ra-ink);
}

.ra-list__time {
	font-size: .78rem;
	line-height: 1.5;
	color: var(--ra-muted);
	white-space: nowrap;
}

/* The newest item is the reason someone looks at a Developing rail. */
.ra-list__item:first-child .ra-list__time {
	color: var(--ra-accent);
	font-weight: 600;
}

.ra-list__title {
	font-size: .95rem;
	font-weight: 600;
	line-height: 1.4;
}

.ra-list__link:hover .ra-list__title,
.ra-list__link:focus-visible .ra-list__title { color: var(--ra-accent); }

@media (max-width: 560px) {
	.ra-list__link { grid-template-columns: 1fr; gap: .2rem; }
}

/* ---------- grid ---------- */

.ra-grid {
	display: grid;
	gap: 1.75rem 1.5rem;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.ra-grid--video {
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

/* Text-only articles read as a column of headlines, not a gappy picture grid. */
/* Row gap stays 0 so the rules between stacked headlines sit tight; the
   column gap must not, or adjacent columns of text run together. */
.ra-section--textonly .ra-grid {
	grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
	gap: 0 2.5rem;
}

.ra-section--textonly .ra-card {
	border-top: 1px solid var(--ra-rule);
	padding-block: 1.1rem;
}

/* ---------- cards ---------- */

.ra-card { min-width: 0; }

.ra-card__media {
	display: block;
	margin-bottom: .75rem;
	overflow: hidden;
	border-radius: 6px;
	aspect-ratio: 16 / 10;
}

.ra-card__media img {
	width: 100%;
	height: 100%;
	max-width: 100%;
	object-fit: cover;
	display: block;
}

.ra-card__title {
	margin: 0 0 .4rem;
	font-size: 1.0625rem;
	line-height: 1.3;
}

.ra-card--noimage .ra-card__title { font-size: 1.1875rem; }

.ra-card__title a {
	color: var(--ra-ink);
	text-decoration: none;
}

.ra-card__title a:hover,
.ra-card__title a:focus-visible { color: var(--ra-accent); }

.ra-card__excerpt {
	margin: 0 0 .5rem;
	font-size: .9rem;
	line-height: 1.55;
	color: var(--ra-muted);
}

.ra-card__date {
	font-size: .78rem;
	color: var(--ra-muted);
}

.ra-empty { color: var(--ra-muted); }

/* ---------- video facade ---------- */

.ra-video {
	position: relative;
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: 6px;
	overflow: hidden;
	margin-bottom: .75rem;
}

/* The facade is a <button>, so Astra gives it the site accent as a background
   plus its own generous padding — which read as a thick orange frame. Keeping
   the frame as a deliberate 4px edge: padding is what sets its width, and
   border-box keeps the thumbnail inside the box rather than overflowing it. */
.ra-video .ra-video__play,
.entry-content .ra-video .ra-video__play,
.ra-wrap .ra-video .ra-video__play {
	appearance: none;
	display: block;
	box-sizing: border-box;
	width: 100%;
	height: 100%;
	margin: 0;
	line-height: 0;
	cursor: pointer;
	padding: 4px !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: var(--e-global-color-accent, #b75520) !important;
	box-shadow: none !important;
}

.ra-video .ra-video__play:hover,
.ra-video .ra-video__play:focus,
.entry-content .ra-video .ra-video__play:hover,
.entry-content .ra-video .ra-video__play:focus {
	background: var(--e-global-color-accent, #b75520) !important;
	box-shadow: none !important;
}

.ra-video__thumb {
	width: 100%;
	height: 100%;
	max-width: 100%;
	object-fit: cover;
	display: block;
}

.ra-video__icon {
	position: absolute;
	inset: 50% auto auto 50%;
	transform: translate(-50%, -50%);
	width: 64px;
	height: 44px;
	border-radius: 10px;
	background: var(--e-global-color-accent, #b75520);
	opacity: .92;
	transition: opacity .15s ease, transform .15s ease;
}

.ra-video__icon::after {
	content: "";
	position: absolute;
	inset: 50% auto auto 50%;
	transform: translate(-42%, -50%);
	border-style: solid;
	border-width: 9px 0 9px 15px;
	border-color: transparent transparent transparent #fff;
}

.ra-video__play:hover .ra-video__icon,
.ra-video__play:focus-visible .ra-video__icon {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1.06);
}

.ra-video__play:focus-visible {
	outline: 3px solid var(--ra-accent);
	outline-offset: -3px;
}

.ra-video__frame {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.ra-prose { margin-block: 1.5rem; line-height: 1.65; }

@media (max-width: 480px) {
	.ra-grid,
	.ra-grid--video,
	.ra-section--textonly .ra-grid { grid-template-columns: 1fr; }
}
