/* ==========================================================================
   INHEA theme – layout and components (design D: "Simple")
   Colours/typography come from theme.json presets.
   ========================================================================== */

:root {
	--inhea-max: 1240px;
	--inhea-gutter: clamp(1rem, 3vw, 1.5rem);
	--inhea-sidebar: var(--wp--custom--sidebar-width, 260px);
	--inhea-radius: 6px;
	--inhea-maroon-deep: var(--wp--preset--color--maroon-deep, #430000);
	--inhea-red: var(--wp--preset--color--red, #990000);
	--inhea-beige: var(--wp--preset--color--beige, #cbbd9b);
	--inhea-tan: var(--wp--preset--color--tan, #9e8f77);
	--inhea-panel: #fbf8f1;
	--inhea-rule: #e6dcc6;
	--inhea-muted: #6b5c43;
	--inhea-serif: var(--wp--preset--font-family--heading, Georgia, serif);
}

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body { margin: 0; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }

/* Remove default block gap between the top-level template sections. */
.wp-site-blocks > * + * { margin-block-start: 0; }

:where(a, button, input, select):focus-visible {
	outline: 2px solid var(--inhea-red);
	outline-offset: 2px;
}

/* ---------- Header ---------- */

.inhea-site-header { position: relative; z-index: 10; }

.inhea-header {
	background: var(--inhea-maroon-deep);
	color: #fff;
	border-bottom: 4px solid var(--inhea-red);
}
.inhea-header :where(figure, p) { margin: 0; }

.inhea-header__inner {
	max-width: var(--inhea-max);
	margin-inline: auto;
	padding: 18px var(--inhea-gutter);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 18px 28px;
	box-sizing: border-box;
}

.inhea-brand {
	display: flex;
	align-items: center;
	gap: 16px;
	min-width: 0;
	flex: 1 1 420px;
}
.inhea-brand > * { margin: 0 !important; }

.inhea-logo img {
	display: block;
	width: clamp(60px, 7vw, 80px);
	height: auto;
	border-radius: 3px;
}

.inhea-brand__text { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.inhea-brand__text > * { margin: 0 !important; }

.inhea-site-name {
	font-family: var(--inhea-serif);
	font-weight: 600;
	font-size: clamp(1.15rem, 2.1vw, 1.55rem);
	line-height: 1.2;
}
.inhea-site-name a { color: #fff; text-decoration: none; }
.inhea-site-name a:hover { color: #f1e7d2; }

.inhea-tagline {
	color: #c2b08c;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.2em;
	font-size: clamp(0.66rem, 1vw, 0.76rem);
	line-height: 1.4;
}

.inhea-header__right {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 14px 22px;
}
.inhea-header__right > * { margin: 0 !important; }

.inhea-partners { display: flex; align-items: center; gap: 12px; }
.inhea-partners > * { margin: 0 !important; }
.inhea-partner img { display: block; height: 56px; width: auto; border-radius: 3px; }
.inhea-partner--ukzn img { background: var(--inhea-beige); padding: 3px; box-sizing: border-box; }

/* Search */
.inhea-search { margin: 0; min-width: 200px; }
.inhea-search .wp-block-search__inside-wrapper {
	background: #f1ece2;
	border: 0;
	border-radius: var(--inhea-radius);
	padding: 2px;
}
.inhea-search .wp-block-search__input {
	border: 0;
	background: transparent;
	font: inherit;
	font-size: 0.9rem;
	padding: 0.5rem 0.65rem;
	min-width: 0;
	color: #2f2a22;
}
.inhea-search .wp-block-search__input:focus { outline: none; }
.inhea-search .wp-block-search__inside-wrapper:focus-within { box-shadow: 0 0 0 2px var(--inhea-tan); }
.inhea-search .wp-block-search__button {
	background: transparent;
	color: #4a4236;
	border: 0;
	padding: 0.3rem 0.5rem;
	margin: 0;
	border-radius: 4px;
}
.inhea-search .wp-block-search__button:hover { background: rgba(0, 0, 0, 0.08); }
.inhea-search .wp-block-search__button svg { width: 20px; height: 20px; fill: currentColor; }

/* ---------- Layout ---------- */

.inhea-layout {
	max-width: var(--inhea-max);
	margin-inline: auto;
	padding: 28px var(--inhea-gutter) 48px;
	display: grid;
	grid-template-columns: var(--inhea-sidebar) minmax(0, 1fr);
	gap: 28px;
	align-items: start;
	box-sizing: border-box;
}
.inhea-layout > * { margin-block: 0 !important; }
.inhea-layout--full { grid-template-columns: minmax(0, 1fr); }

.inhea-main {
	background: var(--inhea-panel);
	border-radius: var(--inhea-radius);
	padding: clamp(1.25rem, 3vw, 2rem) clamp(1.25rem, 3.2vw, 2.4rem) clamp(1.5rem, 3.5vw, 2.4rem);
	min-width: 0;
	box-sizing: border-box;
}
.inhea-main > * + * { margin-block-start: var(--wp--style--block-gap, 1.1rem); }

/* ---------- Sidebar ---------- */

.inhea-sidebar {
	display: flex;
	flex-direction: column;
	gap: 16px;
	position: sticky;
	top: 1rem;
	max-height: calc(100vh - 2rem);
	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-width: thin;
	scrollbar-color: var(--inhea-tan) transparent;
}
.inhea-sidebar > * { margin: 0 !important; }
.admin-bar .inhea-sidebar { top: calc(32px + 1rem); max-height: calc(100vh - 32px - 2rem); }

.inhea-sidebar-nav { background: var(--inhea-beige); border-radius: var(--inhea-radius); padding: 8px 0; }
.inhea-sidebar-nav__toggle { display: none; }

.inhea-menu,
.inhea-menu__sub { list-style: none; margin: 0; padding: 0; }

.inhea-menu__row { display: flex; align-items: stretch; }

.inhea-menu__link {
	flex: 1;
	display: block;
	padding: 9px 10px 9px 16px;
	color: var(--wp--preset--color--ink, #2f2a22);
	font-weight: 600;
	font-size: 0.92rem;
	line-height: 1.35;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}
.inhea-menu__link:hover,
.inhea-menu__link:focus-visible {
	background: rgba(255, 255, 255, 0.3);
	color: var(--inhea-red);
}
.inhea-menu__item.is-current > .inhea-menu__row > .inhea-menu__link {
	color: var(--inhea-red);
	font-weight: 700;
	background: #e4d9c0;
	box-shadow: inset 3px 0 0 var(--inhea-red);
}

.inhea-menu__toggle {
	flex: 0 0 2.25rem;
	border: 0;
	background: transparent;
	cursor: pointer;
	color: #4a4236;
	position: relative;
}
.inhea-menu__toggle:hover { background: rgba(255, 255, 255, 0.3); }
.inhea-menu__toggle::before {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 7px;
	height: 7px;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
	transition: transform 0.2s ease;
}
.inhea-menu__item.is-open > .inhea-menu__row > .inhea-menu__toggle::before { transform: translateY(1px) rotate(-135deg); }

.inhea-menu__sub { display: none; background: #d8cbac; padding-block: 4px 8px; }
.inhea-menu__item.is-open > .inhea-menu__sub { display: block; }

.inhea-menu__sub .inhea-menu__link { font-weight: 400; font-size: 0.85rem; padding-block: 5px; padding-left: 28px; }
.inhea-menu__sub .inhea-menu__item.is-current > .inhea-menu__row > .inhea-menu__link { background: transparent; box-shadow: none; }
.inhea-menu__sub .inhea-menu__sub .inhea-menu__link { padding-left: 40px; }

/* Country picker box */
.inhea-country-picker {
	background: var(--inhea-panel);
	border-radius: var(--inhea-radius);
	padding: 16px;
}
.inhea-country-picker label { display: block; font-weight: 700; font-size: 0.9rem; color: var(--inhea-maroon-deep); margin-bottom: 6px; }
.inhea-country-picker__note { margin: 8px 0 0; font-size: 0.78rem; color: var(--inhea-muted); }

.inhea-country-form { margin: 0; }
.inhea-country-form__row { display: flex; gap: 6px; }
.inhea-country-select {
	flex: 1;
	min-width: 0;
	font: inherit;
	font-size: 0.9rem;
	padding: 8px 10px;
	border: 1px solid #d8c9a8;
	border-radius: 4px;
	background: #fff;
	color: #2f2a22;
}
.inhea-country-form__go {
	font: inherit;
	font-size: 0.85rem;
	font-weight: 600;
	border: 0;
	border-radius: 4px;
	background: var(--inhea-red);
	color: #fff;
	padding: 0 12px;
	cursor: pointer;
}
.inhea-country-form__go[hidden] { display: none; }

/* ---------- Breadcrumbs ---------- */

.inhea-breadcrumbs { font-size: 0.85rem; color: var(--inhea-muted); }
.inhea-breadcrumbs ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; }
.inhea-breadcrumbs li { display: inline-flex; align-items: center; gap: 0.5rem; }
.inhea-breadcrumbs li + li::before { content: "»"; color: var(--inhea-tan); }
.inhea-breadcrumbs a { color: var(--inhea-red); text-decoration: none; }
.inhea-breadcrumbs a:hover { text-decoration: underline; }

/* ---------- Title row (+ country navigation) ---------- */

.inhea-title-row {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: flex-end;
	gap: 14px 24px;
}
.inhea-title-row > * { margin: 0 !important; }
.inhea-page-title { margin: 0; line-height: 1.15; }
.home .inhea-title-row { margin: 0 !important; }

.inhea-country-page .inhea-title-row {
	padding-bottom: 16px;
	border-bottom: 2px solid var(--inhea-red);
}

.inhea-country-nav { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px; }
.inhea-country-nav__step {
	font-size: 0.875rem;
	text-decoration: none;
	padding: 8px 12px;
	border: 1px solid #d8c9a8;
	border-radius: 4px;
	color: var(--inhea-maroon-deep);
	background: #fff;
	white-space: nowrap;
}
.inhea-country-nav__step:hover { border-color: var(--inhea-red); color: var(--inhea-red); }
.inhea-country-nav .inhea-country-form label { display: block; font-size: 0.75rem; color: var(--inhea-muted); margin-bottom: 2px; }
.inhea-country-nav .inhea-country-select { min-width: 170px; }

/* ---------- Content (classic-editor content from the old site) ---------- */

.inhea-content { overflow-wrap: break-word; }
.inhea-content > :first-child { margin-top: 0; }
.inhea-content img { max-width: 100%; height: auto; }
.inhea-content iframe,
.inhea-content video,
.inhea-content embed,
.inhea-content object { max-width: 100%; }
.inhea-content table { border-collapse: collapse; width: 100%; max-width: 100%; display: block; overflow-x: auto; }
.inhea-content td,
.inhea-content th { border: 1px solid var(--inhea-rule); padding: 0.45rem 0.6rem; vertical-align: top; }
.inhea-content th { background: #f1e9d8; text-align: left; }
.inhea-content hr { border: 0; border-top: 1px solid #e0d4bb; margin-block: 2rem; }
.inhea-content blockquote { border-left: 4px solid var(--inhea-red); margin-inline: 0; padding-left: 1.25rem; }
.inhea-content ul,
.inhea-content ol { padding-left: 1.4rem; }
.inhea-content h2,
.inhea-content h3 { color: var(--inhea-maroon-deep); }

.aligncenter { display: block; margin-inline: auto; text-align: center; }
.alignleft { float: left; margin: 0.35rem 1.5rem 1rem 0; }
.alignright { float: right; margin: 0.35rem 0 1rem 1.5rem; }
.inhea-content::after { content: ""; display: table; clear: both; }
.wp-caption { max-width: 100%; }
.wp-caption-text,
.wp-element-caption { font-size: 0.85rem; color: var(--inhea-muted); margin-top: 0.4rem; }

@media (max-width: 600px) {
	.alignleft,
	.alignright { float: none; display: block; margin: 1rem auto; }
}

/* Country news pages: existing markup is h3 (headline) + p (date) + p (summary). */
.inhea-country-page .inhea-content > h3:first-child { border-top: 0; padding-top: 0; }
.inhea-country-page .inhea-content > h3 {
	font-size: 1.3rem;
	line-height: 1.35;
	margin: 0;
	padding-top: 1.4rem;
	border-top: 1px solid var(--inhea-rule);
}
.inhea-country-page .inhea-content > h3:first-child:has(> strong:only-child) {
	/* The "10 November, 2026" update line at the top of each page */
	border-top: 0;
	padding-top: 0;
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.9rem;
	font-weight: 600;
	color: var(--inhea-muted);
	margin-bottom: 0.4rem;
}
.inhea-country-page .inhea-content > h3:first-child:has(> strong:only-child) strong { font-weight: 600; }
.inhea-country-page .inhea-content > h3:first-child:has(> strong:only-child)::before { content: "Updated "; }
.inhea-country-page .inhea-content > h3 + p {
	margin-top: 0.35rem;
	font-size: 0.82rem;
	font-weight: 700;
	color: #8a7756;
}
.inhea-country-page .inhea-content > h3:first-child:has(> strong:only-child) + h3 { border-top: 0; }
.inhea-country-page .inhea-content > p { margin-block: 0.4rem 1.4rem; }
.inhea-country-page .inhea-content a { font-weight: 600; }

/* Single post meta */
.inhea-post-date { margin-top: 0.25rem !important; }
.inhea-post-terms { font-size: 0.85rem; color: var(--inhea-muted); border-top: 1px solid var(--inhea-rule); padding-top: 1rem; }

/* ---------- Lists (news, archive, search) ---------- */

.inhea-list .wp-block-post-template { list-style: none; margin: 0; padding: 0; }
.inhea-card { padding-block: 1.1rem; border-bottom: 1px solid var(--inhea-rule); }
.inhea-card > * + * { margin-block-start: 0.35rem; }
.inhea-card .wp-block-post-title { margin: 0; }
.inhea-card .wp-block-post-title a { text-decoration: none; color: var(--inhea-maroon-deep); }
.inhea-card .wp-block-post-title a:hover { text-decoration: underline; }
.inhea-card .wp-block-post-excerpt__more-link { font-weight: 600; }
.wp-block-query-pagination { margin-top: 1.5rem; font-weight: 600; }

.inhea-search-inline { max-width: 520px; }
.inhea-search-inline .wp-block-search__input { border: 1px solid #d8c9a8; border-radius: 4px; background: #fff; padding: 0.55rem 0.7rem; }
.inhea-search-inline .wp-block-search__button { border-radius: 4px; }

/* ---------- Footer ---------- */

.inhea-footer { background: var(--inhea-maroon-deep); color: #e6dcc6; font-size: 0.875rem; }
.inhea-footer__inner {
	max-width: var(--inhea-max);
	margin-inline: auto;
	padding: 22px var(--inhea-gutter);
	box-sizing: border-box;
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: 10px 28px;
	line-height: 1.6;
}
.inhea-footer p { margin: 0; }
.inhea-footer__about { max-width: 720px; }
.inhea-footer__meta { color: #b5a37f; }
.inhea-footer a { color: #fff; text-decoration-color: rgba(255, 255, 255, 0.4); text-underline-offset: 3px; }
.inhea-footer a:hover { color: #fff; text-decoration-color: #fff; }

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
	.inhea-layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding: 0 0 32px; }
	.inhea-main { border-radius: 0; }

	.inhea-sidebar { position: static; max-height: none; overflow: visible; gap: 0; }
	.inhea-sidebar-nav { border-radius: 0; padding: 0; }
	.inhea-country-picker { border-radius: 0; border-bottom: 1px solid var(--inhea-rule); padding: 12px var(--inhea-gutter); }
	.inhea-country-picker__note { display: none; }

	.inhea-sidebar-nav__toggle {
		display: flex;
		align-items: center;
		gap: 0.65rem;
		width: 100%;
		border: 0;
		background: var(--inhea-beige);
		color: #2f2a22;
		font: inherit;
		font-weight: 700;
		font-size: 1rem;
		padding: 0.8rem var(--inhea-gutter);
		cursor: pointer;
	}
	.inhea-burger,
	.inhea-burger::before,
	.inhea-burger::after {
		display: block;
		width: 20px;
		height: 2px;
		background: currentColor;
		border-radius: 2px;
		transition: transform 0.2s ease, opacity 0.2s ease;
	}
	.inhea-burger { position: relative; }
	.inhea-burger::before,
	.inhea-burger::after { content: ""; position: absolute; left: 0; }
	.inhea-burger::before { top: -6px; }
	.inhea-burger::after { top: 6px; }
	.inhea-sidebar-nav.is-open .inhea-burger { background: transparent; }
	.inhea-sidebar-nav.is-open .inhea-burger::before { transform: translateY(6px) rotate(45deg); }
	.inhea-sidebar-nav.is-open .inhea-burger::after { transform: translateY(-6px) rotate(-45deg); }

	.inhea-menu { display: none; padding-bottom: 0.5rem; border-top: 1px solid rgba(0, 0, 0, 0.08); }
	.inhea-sidebar-nav.is-open .inhea-menu { display: block; }
	.inhea-menu__link { padding-block: 0.65rem; padding-left: var(--inhea-gutter); }
	.inhea-menu__toggle { flex-basis: 3rem; }
}

@media (max-width: 640px) {
	.inhea-header__inner { padding-block: 14px; }
	.inhea-brand { flex-basis: 100%; }
	.inhea-header__right { width: 100%; justify-content: space-between; }
	.inhea-partner img { height: 44px; }
	.inhea-search { flex: 1; min-width: 0; }
	.inhea-country-nav { width: 100%; }
	.inhea-country-nav .inhea-country-form { flex: 1 1 100%; order: -1; }
}

@media print {
	.inhea-site-header,
	.inhea-sidebar,
	.inhea-site-footer,
	.inhea-breadcrumbs,
	.inhea-country-nav { display: none !important; }
	.inhea-layout { display: block; }
	.inhea-main { background: #fff; }
	body { background: #fff; }
}

/* On a country page the title row already has a country dropdown. */
@media (max-width: 860px) {
	.inhea-country-page .inhea-country-picker { display: none; }
}


/* ---------- Africa map ([bgmp-map] / [inhea-africa-map]) ---------- */

.inhea-map {
	margin: 1.5rem auto;
	max-width: 640px;
	text-align: center;
}
.inhea-map__generals { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-bottom: 14px; }
.inhea-map__general {
	background: var(--inhea-red);
	color: #fff !important;
	text-decoration: none !important;
	font-weight: 600;
	font-size: 0.9rem;
	padding: 8px 14px;
	border-radius: 4px;
}
.inhea-map__general:hover { background: var(--inhea-maroon-deep); }
.inhea-map__svg { display: block; width: 100%; height: auto; }
.inhea-map__country path {
	stroke: #fbf8f1;
	stroke-width: 0.8;
	stroke-linejoin: round;
	transition: fill 0.15s ease;
}
.inhea-map__country.has-news path { fill: #c4b089; cursor: pointer; }
.inhea-map__country.has-news:hover path,
.inhea-map__country.has-news:focus-visible path { fill: var(--inhea-red); }
.inhea-map__country.has-news:focus-visible { outline: none; }
.inhea-map__country.is-current path { fill: var(--inhea-maroon-deep); }
.inhea-map__country.no-news path { fill: #ebe5d9; }
.inhea-map__caption { min-height: 1.6em; margin-top: 8px; font-size: 0.95rem; }
.inhea-map__hint { color: var(--inhea-muted); }
.inhea-map__label { font-weight: 700; color: var(--inhea-maroon-deep); }
.inhea-map.is-hovering .inhea-map__hint { display: none; }
.inhea-map__islands { margin: 10px 0 0; font-size: 0.9rem; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; }
.inhea-map__islands span { color: var(--inhea-muted); }
.inhea-map__islands a { font-weight: 600; }
