/**
 * NewMetro
 * Footer and back-to-top button.
 */

.footer {
	background: var(--fascia-deep);
	color: var(--on-fascia-soft);
	font-size: 0.9375rem;
}

.footer__inner {
	display: grid;
	grid-template-columns: minmax(0, 4fr) repeat(3, minmax(0, 2.6fr));
	gap: 40px 32px;
	padding-block: 64px 48px;
}

.footer__logo img {
	width: auto;
	max-height: 44px;
}

.footer__brand p {
	max-width: 32ch;
	margin-block: 16px 8px;
}

.footer__heading {
	margin-bottom: 10px;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--on-fascia);
}

.footer__col a,
.footer__legal a {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	color: var(--on-fascia-soft);
	text-decoration: none;
}

.footer__base {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 24px;
	padding-block: 16px 24px;
	background: linear-gradient(var(--fascia-line), var(--fascia-line)) center top / calc(100% - 2 * var(--gutter)) 1px no-repeat;
}

.footer__legal {
	display: flex;
	flex-wrap: wrap;
	gap: 0 20px;
}

/* Grouped menus: parent items read as small headings over their links. */
.footer__col .menu-item-has-children + .menu-item-has-children {
	margin-top: 14px;
}

.footer__col .menu-item-has-children > a {
	min-height: 32px;
	font-weight: 600;
	color: var(--on-fascia);
}

.footer__col .sub-menu {
	margin: 0;
	padding: 0;
	list-style: none;
}

.footer__col .sub-menu a {
	min-height: 36px;
}

@media (hover: hover) and (pointer: fine) {
	.footer__col a:hover,
	.footer__legal a:hover {
		color: var(--on-fascia);
		text-decoration: underline;
	}
}

@media (max-width: 960px) {
	.footer__inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.footer__brand { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
	.footer__inner { grid-template-columns: minmax(0, 1fr); }
}


/* ==========================
   Back to top
========================== */

.back-to-top {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 40;
	display: grid;
	place-items: center;
	width: 48px;
	height: 48px;
	padding: 0;
	background: var(--fascia);
	border: 1px solid var(--fascia-line);
	border-radius: 50%;
	color: var(--on-fascia);
	box-shadow: 0 12px 24px -12px rgba(12, 39, 31, 0.5);
	cursor: pointer;
	opacity: 0;
	transform: translateY(8px);
	visibility: hidden;
	transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), visibility 0s linear 200ms;
}

.back-to-top.is-visible {
	opacity: 1;
	transform: none;
	visibility: visible;
	transition: opacity 200ms var(--ease-out), transform 200ms var(--ease-out), visibility 0s;
}

.back-to-top:focus-visible {
	outline-color: var(--gold);
}

.back-to-top:active {
	transform: scale(0.97);
}

@media (prefers-reduced-motion: reduce) {
	.back-to-top,
	.back-to-top.is-visible {
		transform: none;
	}
}
