/* ==========================================================================
   Andy's Junior CTA banner and footer.
   ========================================================================== */

/* ========================================================= CTA banner === */

.aj-cta {
	margin-top: 64px;
	position: relative;
	isolation: isolate;
	overflow: hidden;
	background: var(--aj-sage);
}

/* Tiled the way the hero does it - 1440 keeps the stars at their drawn size
   and the pattern repeats down a tall block instead of stretching. */
.aj-cta__bg {
	position: absolute;
	inset: 0;
	z-index: -2;
	opacity: 0.4;
	background-image: var(--aj-cta-bg);
	background-repeat: repeat;
	background-position: top center;
	background-size: auto;
}

/* Characters hug the container, 406 plus 470 of content plus 406 fills the 1280 */
.aj-cta__deco {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: -1;
	width: clamp(160px, 33vw, 469px);
	pointer-events: none;
}

.aj-cta__deco--left  { left: -48px; }
.aj-cta__deco--right { right: -48px; }

/* The mobile photo is a separate field and desktop does not use it */
.aj-cta__deco--mobile { display: none; }

.aj-cta__deco-img {
	width: 100%;
	height: auto;
}

.aj-cta__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	position: relative;
	gap: 14px;
	padding-block: 64px;
	text-align: center;
}

/* 48/48 over three lines with the longest at 319px, copy is 18/24 */
.aj-cta__title {
	max-width: 470px;
	font-size: 48px;
	line-height: 1;
	font-weight: 600;
}

.aj-cta__text {
	max-width: 460px;
	font-size: 18px;
	line-height: 1.333;
	color: var(--aj-ink-soft);
}

.aj-cta__actions {
	display: flex;
	gap: 8px;
	margin-top: 8px;
	flex-wrap: wrap;
	justify-content: center;
}

/* Both buttons share one size, 231x48 */
.aj-cta__actions .aj-btn {
	min-width: 231px;
	padding: 14px 24px;
}

/* ============================================================= Footer === */

.aj-footer {
	padding-block: 64px 20px;
	background: var(--aj-beige);
}

/* Design columns are 185, 185, 290 and the rest goes to the brand logos */
.aj-footer__inner {
	display: grid;
	grid-template-columns: 185px 185px 290px minmax(0, 1fr);
	gap: 32px;
	align-items: start;
}

.aj-logo--footer .aj-logo__img {
	height: 80px;
}

.aj-footer__label {
	display: block;
	margin-bottom: 10px;
	font-size: 16px;
	font-weight: 600;
	color: var(--aj-red);
}

.aj-footer__group + .aj-footer__group,
.aj-footer__val + .aj-footer__label {
	margin-top: 20px;
}

.aj-footer__list li + li {
	margin-top: 7px;
}

.aj-footer__list a,
.aj-footer__val {
	font-size: 16px;
	line-height: 1.5;
	color: var(--aj-ink-soft);
	transition: color .2s;
}

.aj-footer__list a:hover,
.aj-footer__val a:hover {
	color: var(--aj-red);
}

/* ------------------------------------------------------- Brand logos ---- */

.aj-brands {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 16px;
}

.aj-brands__item a {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1;
	padding: 10px;
	background: var(--aj-white);
	border-radius: var(--aj-radius-sm);
	box-shadow: var(--aj-shadow-soft);
	transition: transform .2s;
}

.aj-brands__item a:hover {
	transform: translateY(-2px);
}

.aj-brands__logo {
	width: 100%;
	height: auto;
	max-height: 40px;
	object-fit: contain;
}

.aj-brands__stub {
	font-size: 10px;
	font-weight: 700;
	text-align: center;
	color: var(--aj-muted);
}

/* No rule above the copyright in the design */
.aj-footer__bottom {
	grid-column: 1 / -1;
	margin-top: 64px;
	font-size: 16px;
	color: var(--aj-muted);
}

/* ======================================================= Responsive ===== */

/* Keeps the balloons clear of the 470px text column */
@media (max-width: 1180px) {
	.aj-cta__deco {
		width: min(469px, calc((100vw - 470px) / 2));
	}
}

@media (max-width: 1024px) {
	/* Sits between 48 on desktop and 32 on mobile */
	.aj-cta__title {
		font-size: 40px;
	}

	.aj-footer__inner {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	/* Mobile design, 390px */
	.aj-cta__title {
		font-size: 32px;
		max-width: 326px;
	}

	.aj-footer__label,
	.aj-footer__list a,
	.aj-footer__val {
		font-size: 14px;
	}

	.aj-footer__bottom {
		font-size: 12px;
		line-height: 1.333;
	}

	.aj-cta__inner {
		padding-block: 32px;
	}

	/* The side characters give way to the photo from the mobile field */
	.aj-cta__deco--left,
	.aj-cta__deco--right {
		display: none;
	}

	.aj-cta__deco--mobile {
		display: block;
		top: 0;
		left: 50%;
		right: auto;
		width: 100vw;
		transform: translateX(-50%);
	}

	/* Room for the photo, without it the padding is not needed */
	.aj-cta:has(.aj-cta__deco--mobile) .aj-cta__inner {
		padding-top: 339px;
	}

	.aj-cta {
		margin-top: 40px;
	}

	.aj-footer {
		padding-block: 32px 20px;
	}

	/* align-self is center rather than stretch, otherwise max-width pins the block left */
	.aj-cta__actions {
		flex-direction: column;
		align-self: center;
		flex-wrap: nowrap;
		width: min(326px, 100%);
	}

	.aj-cta__actions .aj-btn {
		width: 100%;
		min-width: 0;
		padding-block: 14px;
	}

	/* The logo drops down and sits to the right of the copyright */
	.aj-footer__inner {
		grid-template-columns: minmax(0, 1fr) auto;
		gap: 24px;
	}

	.aj-footer__col {
		grid-column: 1 / -1;
	}

	.aj-footer__col--links {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 16px;
		align-items: start;
	}

	.aj-footer__list li + li {
		margin-top: 11px;
	}

	.aj-brands {
		gap: 8px;
	}

	.aj-footer__col--links .aj-footer__group + .aj-footer__group {
		margin-top: 0;
	}

	.aj-footer__bottom {
		grid-column: 1;
		order: 9;
		margin-top: 24px;
	}

	.aj-footer__brand {
		grid-column: 2;
		order: 10;
		align-self: end;
		justify-self: end;
		margin-top: 24px;
	}

	.aj-logo--footer .aj-logo__img {
		height: 44px;
	}
}
