/*
 * Refinements to the original African Village design (docs/47).
 * Loaded last. It keeps the original colours, typefaces, layout and every word; it only adjusts
 * spacing, phone layouts, touch targets and type consistency. Removing this file returns the
 * site exactly to the original look.
 */

/* ---------- Type consistency: one size for all small uppercase labels ---------- */
.ccaf-eyebrow,
.ccaf-card__type,
.ccaf-hero__eyebrow,
.ccaf-explorer__kicker { font-size: 0.8rem; }

/* ---------- Touch targets: at least 44 px where a finger is the pointer ---------- */
@media (pointer: coarse) {
	.ccaf-btn--small { min-block-size: 44px; }
	.ccaf-toolbar button,
	.ccaf-langmenu > summary { min-block-size: 44px; min-inline-size: 44px; }
	.ccaf-section__head > a { display: inline-flex; align-items: center; min-block-size: 44px; }
}

/* ---------- Phones ---------- */
@media (max-width: 600px) {
	/* A calmer rhythm between sections: 56 px instead of 88 px. */
	.ccaf-section { padding-block: var(--s-7); }

	/* Hero: smaller emblem, so the headline appears sooner. */
	.ccaf-hero__badge { inline-size: min(56vw, 230px); }
	/* Hero buttons: equal width, one under another. */
	.ccaf-hero .ccaf-actions > .ccaf-btn { flex: 1 1 100%; justify-content: center; }
	.ccaf-page .ccaf-hero__motto { margin-block-start: var(--s-5); }

	/* Five dimensions: two columns instead of five stacked cards (the last one spans both). */
	.ccaf-dimensions { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); margin-block-start: var(--s-6); }
	.ccaf-dimension { padding: var(--s-3) var(--s-3) var(--s-4); align-content: start; }
	.ccaf-dimension:last-child:nth-child(odd) { grid-column: 1 / -1; }
	.ccaf-dimension__name { font-size: 1.02rem; }
	.ccaf-dimension__text { font-size: 0.82rem; }

	/* Sankofa steps and everyday-life cards: tighter, evenly spaced. */
	.ccaf-cycle { gap: var(--s-3); }
	.ccaf-cycle__step { padding: var(--s-4); }
	.ccaf-life__list { gap: var(--s-3); }
}

/* The hero emblem sits in a <picture> (AVIF with the PNG as fallback); keep the image as the layout item. */
.ccaf-hero__picture { display: contents; }

/* ---------- Round 2 (docs/47) ---------- */

/* Category chips on listing pages (e.g. Futures Forge: Innovation case study, Entrepreneur profile…):
   one line each, and the row scrolls sideways when it is wider than the screen. Before, the row ran
   off the edge on phones and the last categories could not be reached. */
.ccaf-tabs { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; padding-block-end: 4px; }
.ccaf-tabs a { flex: none; white-space: nowrap; }

/* Six cards (Our programmes) sit as two even rows of three on wide screens, not four and then two. */
@media (min-width: 900px) {
	.ccaf-card-grid:has(> :nth-child(6):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
	/* Search filters in page heads: two columns, so the head no longer fills the whole screen. */
	.ccaf-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3) var(--s-2); }
	.ccaf-filters__field--wide, .ccaf-filters__actions { grid-column: 1 / -1; }
	.ccaf-filters__actions .ccaf-btn { flex: 1 1 auto; justify-content: center; }
	.ccaf-filters select { min-inline-size: 0; inline-size: 100%; }
	/* Page heads: a little less space above the title on phones. */
	.ccaf-page-head { padding-block-start: var(--s-6); }
}

/* Origins Atlas "Show" and "When" chips: 44 px on touch screens (styles only; the atlas markup is unchanged). */
@media (pointer: coarse) {
	.ccaf-atlas .ccaf-atlas__layer, .ccaf-atlas .ccaf-atlas__era { min-block-size: 44px; }
}
