/**
 * Footer: share row on the left, utility links and copyright on the right,
 * return-to-top pinned to the end. Background is the site's primary colour,
 * which is why Western's footer is purple and the other two are near-black.
 */

.eco-rbc-footer {
	color: var(--eco-rbc-footer-text, var(--wp--preset--color--on-primary));
	background-color: var(--eco-rbc-footer-bg, var(--wp--preset--color--primary));
}

.eco-rbc-footer a {
	color: var(--eco-rbc-footer-text, var(--wp--preset--color--on-primary));
}

.eco-rbc-footer__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--40);
	padding-block: var(--wp--preset--spacing--50);
}

/* Share row -------------------------------------------------------------- */

.eco-rbc-footer__share {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--wp--preset--spacing--30);
}

.eco-rbc-footer__share-label {
	margin: 0;
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 600; /* SemiBold: heaviest Libre Franklin face loaded */
}

.eco-rbc-share {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.eco-rbc-share__item {
	margin: 0;
}

/**
 * Circular icon buttons. 44px keeps them at the WCAG 2.5.5 target size even
 * though the glyph inside is 20px.
 */
/**
 * These invert: brand-coloured glyph on a white disc.
 *
 * Selector has to out-specify `.eco-rbc-footer a` above (0,1,1) — a bare
 * `.eco-rbc-share__link` (0,1,0) loses, and the icons render white-on-white.
 * The glyph is an inline SVG filled with currentColor, so `color` here is what
 * actually draws it.
 */
.eco-rbc-footer a.eco-rbc-share__link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	color: var(--eco-rbc-footer-bg, var(--wp--preset--color--primary));
	background-color: var(--eco-rbc-footer-text, var(--wp--preset--color--on-primary));
	border-radius: 50%;
	text-decoration: none;
	transition: transform 150ms ease, opacity 150ms ease;
}

.eco-rbc-footer a.eco-rbc-share__link:hover,
.eco-rbc-footer a.eco-rbc-share__link:focus-visible {
	opacity: 0.85;
	transform: translateY(-2px);
}

.eco-rbc-icon {
	display: block;
}

/* Utility links ---------------------------------------------------------- */

.eco-rbc-footer__meta {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: var(--wp--preset--spacing--10);
	margin-left: auto;
	text-align: right;
}

.eco-rbc-footer__links {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: var(--wp--preset--spacing--30);
	margin: 0;
	padding: 0;
	list-style: none;
	font-size: var(--wp--preset--font-size--small);
}

.eco-rbc-footer__links li {
	margin: 0;
}

.eco-rbc-footer__copyright {
	margin: 0;
	font-size: var(--wp--preset--font-size--x-small);
}

/* Return to top ---------------------------------------------------------- */

.eco-rbc-footer__top {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.15rem;
	min-width: 44px;
	min-height: 44px;
	padding: 0.25rem 0.5rem;
	font-size: var(--wp--preset--font-size--x-small);
	text-decoration: none;
}

.eco-rbc-footer__top:hover .eco-rbc-footer__top-label,
.eco-rbc-footer__top:focus-visible .eco-rbc-footer__top-label {
	text-decoration: underline;
}

/* The arrow, drawn the same way as the accordion chevron. */
.eco-rbc-footer__top-arrow {
	width: 0.65em;
	height: 0.65em;
	border-top: 2px solid currentColor;
	border-left: 2px solid currentColor;
	transform: rotate(45deg) translate(0.1em, 0.1em);
}

@media (max-width: 781px) {
	.eco-rbc-footer__inner {
		flex-direction: column;
		align-items: flex-start;
	}

	.eco-rbc-footer__meta {
		align-items: flex-start;
		margin-left: 0;
		text-align: left;
	}

	.eco-rbc-footer__links {
		justify-content: flex-start;
	}
}
