/* ==========================================================================
   ARC Africa Map widget
   --------------------------------------------------------------------------
   Country fill colours match the original embed (#4CAF50 / #FF9800 hover) and
   are deliberately preserved — do not introduce a density palette here.
   ========================================================================== */

.arc-am {
	--arc-am-panel: #0f3d2e;
	--arc-am-accent: #1f7a44;
	--arc-am-counter-bg: #ffffff;
	--arc-am-counter-text: #0f3d2e;
	--arc-am-country-fill: #4CAF50;
	--arc-am-country-hover: #FF9800;
	--arc-am-border: #e7ece8;
	--arc-am-ink: #18211c;
	--arc-am-muted: #6b7c72;
	font-family: inherit;
	color: var(--arc-am-ink);
}

/* ── Summary cards ─────────────────────────────────────────── */
.arc-am-cards {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 14px;
	margin-bottom: 18px;
}
.arc-am-card {
	background: #fff;
	border: 1px solid var(--arc-am-border);
	border-radius: 10px;
	padding: 16px 18px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.arc-am-card-label {
	font-size: 10px;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--arc-am-muted);
	font-weight: 600;
}
.arc-am-card-value {
	font-size: 30px;
	font-weight: 700;
	line-height: 1.05;
	color: var(--arc-am-panel);
}
.arc-am-card-sub {
	font-size: 12px;
	color: var(--arc-am-muted);
}
.arc-am-card--feature {
	background: #4CAF50;
	border-color: #4CAF50;
}
.arc-am-card--feature .arc-am-card-label { color: rgba(255,255,255,.66); }
.arc-am-card--feature .arc-am-card-value { color: #fff; font-size: 22px; }
.arc-am-card--feature .arc-am-card-sub   { color: rgba(255,255,255,.8); }

/* ── Layout: map left, panel right ─────────────────────────── */
/* Both columns share one row, so grid stretches them to equal height.
   The map (sized by the SVG aspect ratio) drives that height; the panel
   matches it and scrolls its list internally. */
.arc-am-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.9fr) minmax(280px, 1fr);
	gap: 20px;
	align-items: stretch;
}
.arc-am-mapcol,
.arc-am-panelcol {
	display: flex;
	min-height: 0;
}

/* ── Map card ──────────────────────────────────────────────── */
.arc-am-mapcard {
	background: #fff;
	border: 1px solid var(--arc-am-border);
	border-radius: 12px;
	padding: 18px 20px 14px;
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
}
.arc-am-map { flex: 1 1 auto; display: flex; align-items: center; }
.arc-am-map svg { margin: auto; }
.arc-am-maphead {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	border-bottom: 1px solid var(--arc-am-border);
	padding-bottom: 10px;
	margin-bottom: 6px;
}
.arc-am-maptitle {
	margin: 0;
	font-size: 17px;
	font-weight: 600;
	color: var(--arc-am-ink);
}
.arc-am-mapcount {
	font-size: 12px;
	color: var(--arc-am-muted);
}
.arc-am-maphint {
	text-align: center;
	font-style: italic;
	font-size: 12px;
	color: var(--arc-am-muted);
	margin: 4px 0 8px;
}

/* ── The SVG itself ────────────────────────────────────────── */
.arc-am-map svg {
	width: 100%;
	height: auto;
	display: block;
	overflow: visible;
}
/* Preserve the original map colours. */
.arc-am-map path.country-svg-path,
.arc-am-map svg a > path,
.arc-am-map svg path[id] {
	fill: var(--arc-am-country-fill);
	stroke: #ffffff;
	stroke-width: 0.8;
	transition: fill .25s ease;
}
.arc-am-map a { cursor: pointer; }
/* Only interactive (data-bearing) countries respond to hover. */
.arc-am-map path.arc-am-interactive:hover {
	fill: var(--arc-am-country-hover);
	cursor: pointer;
}
/* Selected: highlight in the hover colour.
   path[id] qualifier keeps specificity above the base fill rule. */
.arc-am-map path[id].arc-am-selected {
	fill: var(--arc-am-country-hover);
}
/* Suppress the browser's default focus box (renders as a black rectangle
   around the path's bounding box); show focus via the hover colour instead. */
.arc-am-map a:focus,
.arc-am-map path:focus { outline: none; }
.arc-am-map path.arc-am-interactive:focus-visible {
	outline: none;
	fill: var(--arc-am-country-hover);
}

/* Counter badges (overlay — not a country colour) */
.arc-am-counter circle,
.arc-am-counter rect {
	fill: var(--arc-am-counter-bg);
	stroke: var(--arc-am-panel);
	stroke-width: 0.4;
	filter: drop-shadow(0 0.5px 1px rgba(0,0,0,.25));
}
.arc-am-counter text {
	fill: var(--arc-am-counter-text);
	font-weight: 700;
	text-anchor: middle;
	dominant-baseline: central;
	pointer-events: none;
	font-family: system-ui, -apple-system, sans-serif;
}
.arc-am-counter { pointer-events: none; }

/* ── Side panel ────────────────────────────────────────────── */
.arc-am-panel {
	background: #fff;
	border: 1px solid var(--arc-am-border);
	border-radius: 12px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
	height: 100%;
}
.arc-am-panel-head {
	background: #f2f6f3;
	color: var(--arc-am-ink);
	padding: 11px 16px;
	border-bottom: 1px solid var(--arc-am-border);
	flex: 0 0 auto;
}
.arc-am-eyebrow {
	font-size: 9px;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--arc-am-muted);
	font-weight: 600;
	margin-bottom: 2px;
}
.arc-am-country-name {
	font-size: 17px;
	font-weight: 700;
	line-height: 1.1;
	display: flex;
	align-items: center;
	gap: 7px;
	color: var(--arc-am-ink);
}
.arc-am-country-name .arc-am-flag { font-size: 17px; line-height: 1; }
.arc-am-headstats {
	display: flex;
	gap: 16px;
	margin-top: 8px;
}
.arc-am-headstats .arc-am-hs {
	display: flex;
	flex-direction: column;
}
.arc-am-headstats .arc-am-hs-label {
	font-size: 9px;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--arc-am-muted);
	font-weight: 600;
}
.arc-am-headstats .arc-am-hs-value {
	font-size: 15px;
	font-weight: 700;
	color: var(--arc-am-ink);
}

/* Body fills the gap between head and foot; the list scrolls inside it
   so the panel height always equals the map height. */
.arc-am-panel-body {
	padding: 6px 18px;
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
}

.arc-am-empty {
	text-align: center;
	color: var(--arc-am-muted);
	padding: 34px 8px;
	margin: auto 0;
}
.arc-am-empty svg { color: var(--arc-am-accent); opacity: .65; }
.arc-am-empty p { margin: 12px 0 0; font-size: 13px; }

.arc-am-list-wrap {
	display: flex;
	flex-direction: column;
	min-height: 0;
	flex: 1 1 auto;
}
.arc-am-list-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	font-size: 10px;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--arc-am-muted);
	font-weight: 600;
	padding: 12px 0 8px;
	border-bottom: 1px solid var(--arc-am-border);
	flex: 0 0 auto;
}
.arc-am-list {
	list-style: none;
	margin: 0;
	padding: 0;
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
}
.arc-am-list li {
	display: flex;
	gap: 10px;
	align-items: flex-start;
	padding: 11px 0;
	border-bottom: 1px solid var(--arc-am-border);
}
.arc-am-list li:last-child { border-bottom: 0; }
.arc-am-rank {
	flex: 0 0 auto;
	font-size: 11px;
	font-weight: 700;
	color: var(--arc-am-muted);
	min-width: 18px;
	padding-top: 2px;
}
.arc-am-inst { flex: 1 1 auto; min-width: 0; }
.arc-am-inst-name {
	font-size: 13px;
	font-weight: 600;
	color: var(--arc-am-accent);
	text-decoration: none;
	line-height: 1.3;
}
.arc-am-inst-name:hover { text-decoration: underline; }
.arc-am-inst-name.is-plain { color: var(--arc-am-ink); }
.arc-am-inst-city {
	font-size: 11px;
	color: var(--arc-am-muted);
	margin-top: 2px;
}
.arc-am-inst-flag { margin-right: 5px; font-size: 12px; line-height: 1; }
.arc-am-inst-papers {
	flex: 0 0 auto;
	font-size: 11px;
	color: var(--arc-am-muted);
	white-space: nowrap;
	padding-top: 2px;
}
.arc-am-inst-papers strong { color: var(--arc-am-ink); font-weight: 700; }

.arc-am-panel-foot { padding: 14px 18px; flex: 0 0 auto; }
.arc-am-viewall {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 7px;
	width: 100%;
	padding: 11px 14px;
	background: var(--arc-am-accent);
	color: #fff;
	border-radius: 8px;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	transition: background .2s ease;
}
.arc-am-viewall:hover { background: var(--arc-am-panel); color: #fff; }
.arc-am-viewall svg { flex: 0 0 auto; }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 1024px) {
	.arc-am-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 860px) {
	/* Stacked: columns no longer share a row, so don't force equal height. */
	.arc-am-grid { grid-template-columns: 1fr; }
	.arc-am-mapcol, .arc-am-panelcol { display: block; }
	.arc-am-panel { height: auto; }
	.arc-am-list { max-height: 360px; }
}
@media (max-width: 520px) {
	.arc-am-cards { grid-template-columns: 1fr 1fr; }
	.arc-am-card-value { font-size: 24px; }
}
