/* Real images (theme 0.7.0): the apple.com manner CCAF asked for, kept cool and calm.
 * Large pictures with room around them; photographs settle slowly into place as they scroll in;
 * real objects stand on white, large, and turn gently into the light. Credits are small and
 * quiet under each picture. Motion runs only for people who have not asked for less of it. */

.ccaf-real { margin: 0; }
.ccaf-real picture { display: block; overflow: hidden; border-radius: clamp(18px, 1.2rem + 0.6vw, 28px); aspect-ratio: var(--ccaf-real-ratio, auto); background: var(--surface-2); }
.ccaf-real--photo .ccaf-real__img { display: block; inline-size: 100%; block-size: 100%; object-fit: cover; object-position: var(--ccaf-real-pos, 50% 50%); transform-origin: 50% 60%; }
.ccaf-real__credit { margin-block-start: var(--s-2); font-size: 0.75rem; line-height: 1.5; color: var(--text-muted); text-align: end; }
.ccaf-real__credit a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 2px; }
.ccaf-real__credit a:hover { color: var(--link); }

/* The stage: a page's picture under its head, with Apple's generous space. */
.ccaf-real-stage { margin-block: clamp(1.5rem, 0.5rem + 3vw, 3.5rem) clamp(0.5rem, 2vw, 1.5rem); }
.ccaf-real.is-hero picture { box-shadow: 0 30px 60px -30px rgb(10 20 14 / 0.35); }

/* Objects: on white, big, never cropped; a soft shadow lifts them off the plinth. */
/* The photograph's own white background melts into a soft stand (multiply), so only the brass
   object shows, as on apple.com; no frame, no box. */
.ccaf-real--object picture { display: flex; align-items: center; justify-content: center; padding: clamp(1.5rem, 1rem + 4vw, 4.5rem); background: radial-gradient(120% 90% at 50% 40%, #ffffff 0%, #f3f2ee 100%); }
.ccaf-real--object .ccaf-real__img { display: block; inline-size: auto; max-inline-size: 100%; block-size: auto; max-block-size: min(60vh, 540px); object-fit: contain; mix-blend-mode: multiply; transform-origin: 50% 80%; }
.ccaf-real.is-hero.ccaf-real--object picture { box-shadow: none; }
.ccaf-real.is-portrait { max-inline-size: min(560px, calc(72vh * 816 / 1440)); margin-inline: auto; }

/* Cards that now carry a real photograph (Living Earth, Explore further, Go straight to). */
.ccaf-card picture, .ccaf-district-card picture { display: block; overflow: hidden; border-radius: var(--radius-lg); margin-block-end: var(--s-3); }
.ccaf-card picture .ccaf-card__photo, .ccaf-district-card picture .ccaf-district-card__photo { margin-block-end: 0; border-radius: 0; transition: transform 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
	a.ccaf-card:hover picture .ccaf-card__photo, .ccaf-district-card a:hover picture .ccaf-district-card__photo { transform: scale(1.04); }
}
.ccaf-card--real { border-block-start: 0; }

/* The Africa Memorial Day photograph beside "Our programmes". */
.ccaf-programmes__photo.ccaf-real picture { aspect-ratio: 800 / 409; }

/* The homepage Journey stages and the Journey page: a real picture for each stage. */
.ccaf-vj__stage::before {
	content: ""; display: block; aspect-ratio: 21 / 9; margin: calc(var(--s-5) * -1) calc(var(--s-5) * -1) var(--s-4);
	border-radius: var(--radius) var(--radius) 0 0; background: var(--surface-2) var(--ccaf-stage-img) var(--ccaf-stage-pos, 50% 50%) / var(--ccaf-stage-fit, cover) no-repeat;
}
.ccaf-vj__stage[data-stage="discover"]   { --ccaf-stage-img: image-set(url("../images/real/bm-ife-head-1440.avif") type("image/avif"), url("../images/real/bm-ife-head-720.jpg") type("image/jpeg")); --ccaf-stage-pos: 50% 24%; }
.ccaf-vj__stage[data-stage="explore"]    { --ccaf-stage-img: image-set(url("../images/real/atlas-rift-1440.avif") type("image/avif"), url("../images/real/atlas-rift-720.jpg") type("image/jpeg")); }
.ccaf-vj__stage[data-stage="understand"] { --ccaf-stage-img: image-set(url("../images/real/library-timbuktu-1440.avif") type("image/avif"), url("../images/real/library-timbuktu-720.jpg") type("image/jpeg")); }
.ccaf-vj__stage[data-stage="challenge"]  { --ccaf-stage-img: image-set(url("../images/real/goldweight-box-1440.avif") type("image/avif"), url("../images/real/goldweight-box-720.jpg") type("image/jpeg")); --ccaf-stage-fit: contain; }
.ccaf-vj__stage[data-stage="challenge"]::before { background-color: #fff; background-blend-mode: multiply; }
.ccaf-vj__stage[data-stage="engage"]     { --ccaf-stage-img: image-set(url("../images/real/ccaf-amd-hall-1440.avif") type("image/avif"), url("../images/real/ccaf-amd-hall-720.jpg") type("image/jpeg")); }
.ccaf-vj__stage[data-stage="contribute"] { --ccaf-stage-img: image-set(url("../images/real/join-kente-1440.avif") type("image/avif"), url("../images/real/join-kente-720.jpg") type("image/jpeg")); }

/* Phones: long stage texts fold behind "Read more" (word for word, nothing removed). */
.ccaf-fold.is-folded { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ccaf-fold__btn { display: inline-flex; align-items: center; min-block-size: 44px; padding: 0; border: 0; background: none; font: inherit; font-weight: 700; color: var(--link); cursor: pointer; }
.ccaf-fold__btn::after { content: " ›"; }

/* The "Picture credits" page. */
.ccaf-real-credits { display: grid; gap: var(--s-4); margin: 0; padding: 0; list-style: none; }
@media (min-width: 900px) { .ccaf-real-credits { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ccaf-real-credits li { display: flex; gap: var(--s-4); align-items: center; padding-block: var(--s-3); border-block-start: 1px solid var(--border); }
.ccaf-real-credits img { inline-size: 120px; block-size: 80px; object-fit: cover; border-radius: var(--radius); flex: none; background: var(--surface-2); }
.ccaf-real-credits b { display: block; color: var(--text); }
.ccaf-real-credits small { display: block; margin-block-start: 2px; color: var(--text-muted); font-size: 0.8125rem; }
.ccaf-real-credits small a { color: inherit; }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
	@supports (animation-timeline: view()) {
		.ccaf-real--photo .ccaf-real__img { animation: ccaf-real-settle linear both; animation-timeline: view(); animation-range: entry 0% cover 48%; }
		.ccaf-real--object .ccaf-real__img { animation: ccaf-real-turn linear both; animation-timeline: view(); animation-range: entry 5% cover 55%; }
	}
	@supports not (animation-timeline: view()) {
		.ccaf-real--photo .ccaf-real__img { transform: scale(1.08); transition: transform 1.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
		.ccaf-real--object .ccaf-real__img { transform: perspective(1000px) rotateY(-10deg) scale(0.92); transition: transform 1.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
		.ccaf-real.is-in .ccaf-real__img { transform: none; }
	}
}
@keyframes ccaf-real-settle {
	from { transform: scale(1.12); filter: saturate(0.88) brightness(0.94); }
	to   { transform: scale(1); filter: none; }
}
@keyframes ccaf-real-turn {
	from { transform: perspective(1000px) rotateY(-12deg) scale(0.88); filter: brightness(0.86); }
	65%  { filter: brightness(1.08); }
	to   { transform: none; filter: brightness(1); }
}
