/* AFRC shared — Manifest (editorial chapters: homepage, The Team, Training).
 *
 * "The Club" / "How We Play Rugby" (navy band) / "The Third Half":
 * alternating text + photo rows. Image reveal-on-scroll is driven by the
 * .is-visible class (assets/js/reveal.js). Design tokens + box-sizing reset
 * are global (base.css).
 *
 * Rule order is load-bearing (the original page layered several !important
 * passes); kept intact. Dead rules removed: the superseded first titleline/
 * subline definitions and a mobile background later overridden by the base. */

.afrc-manifest:before {
	content: "";
	position: absolute;
	inset: 0 0 auto;
	height: 320px;
	background: linear-gradient(180deg, rgba(0,27,104,.10), rgba(0,27,104,0));
	pointer-events: none;
}

.afrc-manifest__inner {
	position: relative;
	max-width: 1360px;
	margin: 0 auto;
}

.afrc-manifest__chapter:last-child {
	border-bottom: 0;
}

.afrc-manifest__text {
	max-width: 600px;
}

.afrc-manifest__media:after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0,27,104,0), rgba(0,27,104,.24));
	mix-blend-mode: multiply;
	pointer-events: none;
}

.afrc-manifest__chapter--club .afrc-manifest__media img {
	object-position: center 48%;
}

.afrc-manifest__chapter--play .afrc-manifest__media {
	box-shadow: 0 30px 85px rgba(0,0,0,.30);
}

.afrc-manifest__chapter--play .afrc-manifest__media:before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(115deg, rgba(227,6,19,.28), rgba(255,255,255,0) 42%, rgba(245,184,0,.18));
	pointer-events: none;
}

.afrc-manifest__chapter--third .afrc-manifest__media img {
	object-position: center 55%;
}

.afrc-manifest__chapter--third h3 {
	max-width: 720px;
}

@media (max-width: 900px) {
	.afrc-manifest {
		padding: 64px 18px;
	}

	.afrc-manifest__chapter,
	.afrc-manifest__chapter--play {
		grid-template-columns: 1fr;
		margin-left: 0;
		margin-right: 0;
		padding: 38px 0;
		border-radius: 0;
		background: transparent;
		color: var(--afrc-navy-deep);
	}

	.afrc-manifest__chapter--play {
		border-top: 0;
	}

	.afrc-manifest__chapter--play .afrc-manifest__media {
		order: 2;
	}

	.afrc-manifest__chapter--play .afrc-manifest__text {
		order: 1;
	}

	.afrc-manifest__chapter--play h3 {
		color: var(--afrc-navy-deep);
		font-size: clamp(32px, 9vw, 48px);
	}

	.afrc-manifest__media {
		min-height: 300px;
	}
}

@media (max-width: 520px) {
	.afrc-manifest {
		padding-top: 54px;
	}

	.afrc-manifest h3 {
		font-size: 31px;
	}

	.afrc-manifest__media {
		min-height: 235px;
	}
}

/* manifest image motion */
.afrc-manifest__media img {
	width: 100%;
	height: 100%;
	min-height: inherit;
	object-fit: cover;
	display: block;
	transform: scale(1.02);
	transition: transform 900ms cubic-bezier(.2,.8,.2,1), filter 900ms ease;
	will-change: transform;
}

.afrc-manifest__chapter.is-visible .afrc-manifest__media {
	transform: translateY(0);
	opacity: 1;
}

.afrc-manifest__media:hover img {
	transform: scale(1.065);
}

.afrc-manifest__media:hover {
	box-shadow: 0 34px 86px rgba(0,27,104,.22);
}

.afrc-manifest__chapter--play .afrc-manifest__media:hover {
	box-shadow: 0 38px 94px rgba(0,0,0,.36);
}

@media (prefers-reduced-motion: reduce) {
	.afrc-manifest__media,
	.afrc-manifest__media img {
		transition: none !important;
		transform: none !important;
		opacity: 1 !important;
	}

	.afrc-manifest__media:hover img {
		transform: none !important;
	}
}

@media (max-width: 760px) {
	.afrc-manifest__media {
		transform: translateY(10px);
		transition: transform 520ms ease, opacity 520ms ease;
	}

	.afrc-manifest__media:hover img {
		transform: scale(1.02);
	}
}

/* refinement pass */
.afrc-manifest__chapter {
	display: grid;
	grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
	gap: clamp(28px, 5vw, 76px);
	align-items: center;
	padding: clamp(26px, 3.6vw, 52px) 0 !important;
	border-top: 0;
}

.afrc-manifest__chapter--play {
	grid-template-columns: minmax(0, 1.16fr) minmax(0, .84fr);
	margin-left: calc(clamp(18px, 4vw, 64px) * -1);
	margin-right: calc(clamp(18px, 4vw, 64px) * -1);
	padding: clamp(34px, 4.2vw, 62px) clamp(18px, 4vw, 64px) !important;
	background: linear-gradient(135deg, var(--afrc-navy-flag) 0%, var(--afrc-navy-bar) 58%, #152f7b 100%);
	color: #fff;
	border-top: 0;
	border-radius: 0;
}

.afrc-manifest__media {
	position: relative;
	margin: 0;
	min-height: clamp(270px, 30vw, 430px) !important;
	overflow: hidden;
	border-radius: 8px;
	box-shadow: 0 26px 70px rgba(0,27,104,.16);
	isolation: isolate;
	transform: translateY(18px);
	opacity: .88;
	transition: transform 900ms cubic-bezier(.2,.8,.2,1), opacity 900ms ease, box-shadow 280ms ease;
}

.afrc-manifest h3 {
	margin: 0 0 22px;
	color: var(--afrc-navy-deep);
	font-family: var(--afrc-font);
	font-size: clamp(29px, 3.4vw, 48px) !important;
	line-height: 1.02;
	font-weight: 760;
	letter-spacing: -.035em;
}

.afrc-manifest__chapter--play h3 {
	color: #fff;
	font-size: clamp(34px, 4.3vw, 60px) !important;
	font-style: italic;
}

@media (max-width: 760px) {
	.afrc-manifest {
		padding-top: 28px !important;
	}

	.afrc-manifest__chapter {
		padding: 28px 0 !important;
	}

	.afrc-manifest__media {
		min-height: 220px !important;
	}
}

/* titleline + subline — resolved to the final "harmonization" / "size
   refinement" passes (the earlier definitions were fully overridden). */
.afrc-manifest .afrc-manifest__subline,
.afrc-manifest .afrc-manifest__chapter--play .afrc-manifest__subline {
	margin: 0 0 22px !important;
	font-family: var(--afrc-font);
	font-size: clamp(19px, 1.55vw, 24px) !important;
	line-height: 1.22 !important;
	font-weight: 700 !important;
	font-style: italic !important;
	letter-spacing: -.015em !important;
}

.afrc-manifest .afrc-manifest__titleline,
.afrc-manifest .afrc-manifest__subline {
	color: var(--afrc-navy-deep) !important;
}

.afrc-manifest .afrc-manifest__chapter--play .afrc-manifest__titleline,
.afrc-manifest .afrc-manifest__chapter--play .afrc-manifest__subline {
	color: #fff !important;
}

.afrc-manifest .afrc-manifest__titleline,
.afrc-manifest .afrc-manifest__chapter--play .afrc-manifest__titleline {
	display: flex !important;
	align-items: baseline !important;
	gap: .34em !important;
	margin: 0 0 10px !important;
	font-family: var(--afrc-font);
	font-size: clamp(30px, 3.05vw, 44px) !important;
	line-height: 1.04 !important;
	font-weight: 760 !important;
	font-style: normal !important;
	letter-spacing: -.03em !important;
	white-space: nowrap !important;
}

.afrc-manifest .afrc-manifest__titleline span,
.afrc-manifest .afrc-manifest__chapter--play .afrc-manifest__titleline span {
	font: inherit !important;
	color: inherit !important;
	letter-spacing: inherit !important;
}

@media (max-width: 760px) {
	.afrc-manifest .afrc-manifest__titleline,
	.afrc-manifest .afrc-manifest__chapter--play .afrc-manifest__titleline {
		font-size: clamp(27px, 8vw, 32px) !important;
		white-space: normal !important;
	}

	.afrc-manifest .afrc-manifest__subline,
	.afrc-manifest .afrc-manifest__chapter--play .afrc-manifest__subline {
		font-size: 19px !important;
		margin-bottom: 18px !important;
	}
}

/* base section box — resolved (kept after the chapter rules above, matching
   the original cascade). */
.afrc-manifest {
	position: relative;
	overflow: hidden;
	background: linear-gradient(180deg, rgba(0,27,104,.09) 0%, rgba(0,27,104,.045) 26%, #f8fafc 62%, #fff 100%) !important;
	color: var(--afrc-navy-deep);
	font-family: var(--afrc-font);
	padding: clamp(34px, 4vw, 58px) clamp(18px, 4vw, 64px) clamp(70px, 7vw, 112px);
	padding-top: clamp(22px, 3vw, 42px) !important;
	padding-bottom: clamp(28px, 3.2vw, 54px) !important;
}

.afrc-manifest__chapter--third {
	padding-bottom: clamp(18px, 2.2vw, 34px) !important;
}

@media (max-width: 760px) {
	.afrc-manifest {
		padding-bottom: 32px !important;
	}

	.afrc-manifest__chapter--third {
		padding-bottom: 22px !important;
	}
}

/* "How We Play Rugby" — full-bleed navy band on phones. */
@media (max-width: 680px) {
	#club-culture .afrc-manifest__chapter--play {
		position: relative !important;
		z-index: 1 !important;
		background: linear-gradient(135deg, var(--afrc-navy-flag) 0%, var(--afrc-navy-bar) 58%, #152f7b 100%) !important;
		box-shadow: 0 0 0 100vmax var(--afrc-navy-flag) !important;
		clip-path: inset(0 -100vmax) !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
		padding-top: 54px !important;
		padding-bottom: 58px !important;
		isolation: isolate !important;
	}

	#club-culture .afrc-manifest__chapter--play .afrc-manifest__text,
	#club-culture .afrc-manifest__chapter--play .afrc-manifest__media {
		position: relative !important;
		z-index: 2 !important;
	}

	#club-culture .afrc-manifest__chapter--play h3,
	#club-culture .afrc-manifest__chapter--play .afrc-manifest__subline {
		color: #fff !important;
		text-shadow: 0 10px 28px rgba(0,0,0,.18) !important;
	}
}

/* Re-assert single column on phones/tablets (the desktop chapter grids carry
   no mobile guard, so this is appended last to win the cascade). */
@media (max-width: 900px) {
	.afrc-manifest__chapter,
	.afrc-manifest__chapter--club,
	.afrc-manifest__chapter--play,
	.afrc-manifest__chapter--third {
		grid-template-columns: 1fr !important;
	}
}


/* -------------------------------------------------------------
   Flexible editorial modules.
   Keeps the current three chapters, but makes the pattern repeatable: each
   module uses text then media in the markup; even modules reverse visually and
   receive the navy editorial band. Image frames use one shared ratio/height so
   future modules do not drift in size.
   ------------------------------------------------------------- */
.afrc-manifest__inner {
	display: grid;
	gap: clamp(12px, 2vw, 26px);
}

.afrc-manifest__chapter,
.afrc-manifest__chapter--club,
.afrc-manifest__chapter--play,
.afrc-manifest__chapter--third {
	grid-template-columns: minmax(280px, .84fr) minmax(320px, 1.16fr) !important;
	gap: clamp(30px, 5vw, 82px) !important;
	align-items: center !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
	padding: clamp(34px, 4.6vw, 68px) 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	color: var(--afrc-blue-ink) !important;
}

.afrc-manifest__chapter:nth-child(even) {
	grid-template-columns: minmax(320px, 1.16fr) minmax(280px, .84fr) !important;
	margin-left: calc(clamp(18px, 4vw, 64px) * -1) !important;
	margin-right: calc(clamp(18px, 4vw, 64px) * -1) !important;
	padding: clamp(42px, 5.2vw, 76px) clamp(18px, 4vw, 64px) !important;
	background: linear-gradient(135deg, var(--afrc-navy-flag) 0%, var(--afrc-blue) 58%, #152f7b 100%) !important;
	color: var(--afrc-white) !important;
}

.afrc-manifest__chapter:nth-child(even) .afrc-manifest__media {
	order: -1 !important;
	box-shadow: 0 34px 90px rgba(0,0,0,.30) !important;
}

.afrc-manifest__text {
	max-width: 620px !important;
}

.afrc-manifest__media {
	height: clamp(310px, 31vw, 430px) !important;
	min-height: 0 !important;
	aspect-ratio: 16 / 11;
	width: 100%;
	border-radius: 8px;
}

.afrc-manifest__media img {
	height: 100% !important;
	min-height: 0 !important;
}

.afrc-manifest .afrc-manifest__titleline,
.afrc-manifest .afrc-manifest__subline {
	color: var(--afrc-blue-deep) !important;
}

.afrc-manifest__chapter:nth-child(even) .afrc-manifest__titleline,
.afrc-manifest__chapter:nth-child(even) .afrc-manifest__subline {
	color: var(--afrc-white) !important;
}

/* Body text on the navy band keeps the chapter's white: the Training page's
   own `.afrc-training-page p` grey is unreadable there. */
.afrc-manifest__chapter:nth-child(even) .afrc-manifest__text p:not(.afrc-manifest__subline) {
	color: inherit;
}

.afrc-manifest__chapter:nth-child(even) .afrc-manifest__titleline {
	font-size: clamp(34px, 4.3vw, 60px) !important;
	font-style: italic !important;
}

@media (max-width: 900px) {
	.afrc-manifest__chapter,
	.afrc-manifest__chapter--club,
	.afrc-manifest__chapter--play,
	.afrc-manifest__chapter--third,
	.afrc-manifest__chapter:nth-child(even) {
		grid-template-columns: 1fr !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
	}

	.afrc-manifest__chapter:nth-child(even) {
		box-shadow: 0 0 0 100vmax var(--afrc-navy-flag) !important;
		clip-path: inset(0 -100vmax) !important;
	}

	.afrc-manifest__chapter:nth-child(even) .afrc-manifest__media {
		order: 2 !important;
	}

	.afrc-manifest__chapter:nth-child(even) .afrc-manifest__text {
		order: 1 !important;
	}
}

@media (max-width: 760px) {
	.afrc-manifest__inner {
		gap: 0;
	}

	.afrc-manifest__chapter,
	.afrc-manifest__chapter:nth-child(even) {
		padding-top: 36px !important;
		padding-bottom: 40px !important;
	}

	.afrc-manifest__media {
		height: auto !important;
		aspect-ratio: 4 / 3;
	}
}


/* Mobile sizing fix for the proposal: the navy module keeps the full-bleed
   background, but its content returns to the same inner width as other modules. */
@media (max-width: 900px) {
	.afrc-manifest__chapter:nth-child(even) {
		padding-left: 0 !important;
		padding-right: 0 !important;
	}
}


/* Typography harmonization for flexible manifest modules. */
.afrc-manifest .afrc-manifest__titleline,
.afrc-manifest .afrc-manifest__chapter:nth-child(even) .afrc-manifest__titleline {
	font-family: var(--afrc-font) !important;
	font-size: clamp(31px, 3.25vw, 48px) !important;
	font-weight: 780 !important;
	font-style: normal !important;
	line-height: 1.04 !important;
	letter-spacing: 0 !important;
}

.afrc-manifest .afrc-manifest__subline,
.afrc-manifest .afrc-manifest__chapter:nth-child(even) .afrc-manifest__subline {
	font-family: var(--afrc-font) !important;
	font-size: clamp(18px, 1.45vw, 23px) !important;
	font-weight: 720 !important;
	font-style: italic !important;
	line-height: 1.24 !important;
	letter-spacing: 0 !important;
}

.afrc-manifest__text p:not(.afrc-manifest__subline) {
	font-family: var(--afrc-font) !important;
	font-size: clamp(16px, 1.05vw, 18px) !important;
	font-weight: 430 !important;
	font-style: normal !important;
	line-height: 1.68 !important;
	letter-spacing: 0 !important;
}

@media (max-width: 760px) {
	.afrc-manifest .afrc-manifest__titleline,
	.afrc-manifest .afrc-manifest__chapter:nth-child(even) .afrc-manifest__titleline {
		font-size: clamp(29px, 8vw, 34px) !important;
	}

	.afrc-manifest .afrc-manifest__subline,
	.afrc-manifest .afrc-manifest__chapter:nth-child(even) .afrc-manifest__subline {
		font-size: 19px !important;
	}
}


/* Vertical rhythm fix for flexible manifest modules. */
.afrc-manifest__chapter,
.afrc-manifest__chapter--club,
.afrc-manifest__chapter--play,
.afrc-manifest__chapter--third,
.afrc-manifest__chapter:nth-child(even) {
	row-gap: clamp(30px, 3vw, 42px) !important;
}

@media (max-width: 900px) {
	.afrc-manifest__chapter,
	.afrc-manifest__chapter--club,
	.afrc-manifest__chapter--play,
	.afrc-manifest__chapter--third,
	.afrc-manifest__chapter:nth-child(even) {
		padding-top: 40px !important;
		padding-bottom: 40px !important;
		row-gap: 32px !important;
	}

	.afrc-manifest__media {
		margin-top: 0 !important;
		margin-bottom: 0 !important;
	}
}


/* Final spacing override for the flexible manifest modules: old ID-scoped mobile
   rules and reveal transforms must not change perceived image margins. */
#club-culture .afrc-manifest__media {
	transform: none !important;
	opacity: 1 !important;
}

@media (max-width: 900px) {
	#club-culture .afrc-manifest__chapter,
	#club-culture .afrc-manifest__chapter--club,
	#club-culture .afrc-manifest__chapter--play,
	#club-culture .afrc-manifest__chapter--third,
	#club-culture .afrc-manifest__chapter:nth-child(even) {
		padding-top: 40px !important;
		padding-bottom: 40px !important;
		row-gap: 32px !important;
	}
}


/* Section edge rhythm: the first module owns the top breathing room, so the
   distance from hero-to-image matches image-to-next-section. */
#club-culture.afrc-manifest {
	padding-top: 0 !important;
	padding-bottom: 0 !important;
}


#club-culture .afrc-manifest__inner {
	gap: 0 !important;
}
