/* Site footer. Tokens live in assets/base.css. */

.rkl-footer {
	--rkl-footer-column: 200px;
	--rkl-footer-muted: rgba(255, 255, 255, 0.82);

	box-sizing: border-box;
	color: var(--rkl-white);
	font-family: var(--rkl-font);
	overflow: hidden;
	padding: 80px clamp(20px, 3.4vw, 56px) 40px;
	position: relative;

	/*
	 * The design's background is the artwork itself, not an approximation of
	 * it. Both halves come from the Figma library section „Efects and
	 * gradients" (2613:86697): the green field with the olive corner glow
	 * („Footer gradient desktop" 2613:86704, „… mobile" 2613:86700) with the
	 * bright arc and the warm streak („Footer efect desktop" 2613:86692,
	 * „… mobile" 2613:86694) screened over it.
	 *
	 * The two frames are composited into one JPEG per breakpoint rather than
	 * layered here, so the footer stays a single request and the blend cannot
	 * drift. This replaces a stack of six hand-drawn gradients that guessed at
	 * the arc's geometry from a screenshot.
	 *
	 * The desktop frame is 1920x487 and the mobile one 400x1441 — far enough
	 * apart in aspect that `cover` alone cannot serve both, hence the swap at
	 * 768px below.
	 */
	background-color: #04120e;
	background-image: url("../../assets/footer-bg.jpg?v=2");
	background-position: center;
	background-repeat: no-repeat;
	background-size: cover;
}

/* An uploaded artwork replaces the bundled one rather than sitting on top of
   it, so nothing shows through and the upload is what the editor sees. */
.rkl-footer.has-image {
	background-image: var(--rkl-footer-image);
	background-position: center;
}

.rkl-footer *,
.rkl-footer *::before,
.rkl-footer *::after {
	box-sizing: border-box;
}

.rkl-footer__sr {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	white-space: nowrap;
	width: 1px;
}

/* Top half ---------------------------------------------------------------- */

.rkl-footer__inner {
	display: flex;
	flex-wrap: wrap;
	gap: 48px clamp(32px, 4vw, 64px);
	justify-content: space-between;
}

/* The brand column needs two different gaps: 48px under the logo, 24px above the
   socials. A flex `gap` is one value, so it carries the smaller of the two and
   the tagline adds the remainder. :not(:first-child) keeps that remainder from
   becoming stray space at the top when the logo is toggled off. */
.rkl-footer__brand {
	display: flex;
	flex: 1 1 340px;
	flex-direction: column;
	gap: 24px;
	max-width: 460px;
}

.rkl-footer__logo-link {
	display: inline-flex;
	width: fit-content;
}

.rkl-footer__logo {
	display: block;
	height: auto;
	max-height: 46px;
	max-width: 200px;
	width: auto;
}

.rkl-footer__tagline {
	color: var(--rkl-white);
	font-family: "Boldonse", var(--rkl-font);
	font-size: 28px;
	font-weight: 400;
	line-height: 190%;
	margin: 0;
	/* max-width: 11em; */
	text-transform: uppercase;
}

.rkl-footer__tagline:not(:first-child) {
	margin-top: 24px;
}

.rkl-footer__socials {
	display: flex;
	flex-wrap: wrap;
	gap: 18px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.rkl-footer__social-link {
	align-items: center;
	color: var(--rkl-white);
	display: inline-flex;
	justify-content: center;
	position: relative;
	transition: opacity 0.2s ease;
}

.rkl-footer__social-link:hover {
	opacity: 0.7;
}

.rkl-footer__icon {
	display: block;
}

/* Link columns ------------------------------------------------------------ */

/* No column gap by design: the 200px cell already carries the space, which is
   how the four columns fit on one line next to the tagline at 1440px. */
.rkl-footer__columns {
	display: flex;
	flex-wrap: wrap;
	gap: 40px 0;
}

.rkl-footer__column {
	flex: 0 0 var(--rkl-footer-column);
	min-width: 0; /* Long lines wrap instead of forcing the row wider. */
	padding-right: 16px;
}

.rkl-footer__heading {
	color: var(--rkl-white);
	font-family: var(--rkl-font);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
	margin: 0 0 28px;
}

/*
 * The heading's button. On desktop it is indistinguishable from the old heading
 * and does nothing; on a phone it is the accordion control.
 */
.rkl-footer__toggle {
	align-items: center;
	background: none;
	border: 0;
	color: inherit;
	cursor: default;
	display: flex;
	font: inherit;
	gap: 12px;
	justify-content: space-between;
	margin: 0;
	padding: 0;
	text-align: left;
	width: 100%;
}

.rkl-footer__chevron {
	color: var(--rkl-white);
	display: none;
	flex: none;
	height: 14px;
	transition: transform 0.2s ease;
	width: 14px;
}

@media (prefers-reduced-motion: reduce) {
	.rkl-footer__chevron {
		transition: none;
	}
}

.rkl-footer__list {
	display: flex;
	flex-direction: column;
	gap: 21px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.rkl-footer__item {
	font-size: 15px;
	line-height: 1.4;
}

.rkl-footer__link {
	color: var(--rkl-footer-muted);
	text-decoration: none;
	transition: color 0.2s ease;
}

.rkl-footer__link:hover,
.rkl-footer__link:focus-visible {
	color: var(--rkl-white);
	text-decoration: underline;
}

.rkl-footer__text {
	color: var(--rkl-footer-muted);
}

.rkl-footer :focus-visible {
	border-radius: 4px;
	outline: 2px solid var(--rkl-green-02);
	outline-offset: 3px;
}

/* Bottom bar -------------------------------------------------------------- */

.rkl-footer__bottom {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 12px 32px;
	justify-content: space-between;
	margin-top: 96px;
}

.rkl-footer__copyright,
.rkl-footer__terms,
.rkl-footer__credit {
	color: rgba(255, 255, 255, 0.7);
	font-size: 14px;
	line-height: 1.4;
	margin: 0;
}

/* Desktop: copyright · terms on the left, credit pushed to the right. */
.rkl-footer__credit {
	margin-left: auto;
}

@media (prefers-reduced-motion: reduce) {
	.rkl-footer__social-link,
	.rkl-footer__link {
		transition: none;
	}
}

@media (max-width: 900px) {
	.rkl-footer__inner {
		flex-direction: column;
	}

	/* In a column flex container flex-basis is a height, so the desktop
	   `1 1 340px` would reserve 340px of blank space under the socials. */
	.rkl-footer__brand {
		flex: 0 0 auto;
		max-width: none;
	}
}

@media (max-width: 768px) {
	.rkl-footer {
		padding: 56px 20px 28px;
	}

	/*
	 * The 400x1441 mobile artwork. `:not(.has-image)` so an upload still wins,
	 * and it out-specifies the desktop rule above without an `!important`.
	 */
	.rkl-footer:not(.has-image) {
		background-image: url("../../assets/footer-bg-mobile.jpg?v=2");
	}

	.rkl-footer__inner {
		gap: 64px;
	}

	/*
	 * One collapsible row per group, as in the mobile design — not the desktop
	 * grid squeezed into two columns.
	 */
	.rkl-footer__columns {
		flex-direction: column;
		gap: 0;
	}

	.rkl-footer__column {
		border-bottom: 1px solid rgba(255, 255, 255, 0.14);
		flex: 1 1 auto;
		padding-right: 0;
		width: 100%;
	}

	.rkl-footer__column:first-child {
		border-top: 1px solid rgba(255, 255, 255, 0.14);
	}

	.rkl-footer__heading {
		margin: 0;
	}

	.rkl-footer__toggle {
		cursor: pointer;
		padding: 24px 0;
	}

	/* The design keeps the chevron pointing down in both states, so it is not
	   rotated on open — the open list is the affordance. */
	.rkl-footer__chevron {
		display: block;
	}

	.rkl-footer__list {
		padding-bottom: 18px;
	}

	.rkl-footer__list[hidden] {
		display: none;
	}

	.rkl-footer__list {
		gap: 12px;
	}

	/*
	 * Mobile bottom bar: the terms link centred on its own line, with the
	 * copyright and the build credit on the row beneath it.
	 */
	.rkl-footer__bottom {
		gap: 18px 12px;
		margin-top: 64px;
	}

	.rkl-footer__terms {
		order: 1;
		text-align: center;
		width: 100%;
	}

	.rkl-footer__copyright {
		order: 2;
	}

	.rkl-footer__credit {
		order: 3;
	}
}
