/* The site's footer (_includes/footer.html; UV, 3 Nov). On a phone the
   mark and its line are centred, Visit runs the full width and Play and The
   club sit side by side; from 48rem everything is one row of four columns. */

/* A short page still puts the footer at the foot of the screen: the main
   area takes at least the room the nav and the home bar leave. */
main {
	min-height: calc(100dvh - var(--nav-total) - env(safe-area-inset-bottom, 0px));
}

/* Partners and sponsors (_includes/footer.html; UV, 16 Nov): a band in the
   site's grey above the footer, each icon in the site's background colour.
   Only the icon's shape is used: scripts/partners.js draws it in that colour
   and gives it to the icon as its picture (--pt-tinted). No mask anywhere in
   the banner (UV, 16 Nov): Safari flickered the masked icons while the page's
   light moved. */
.site-partners {
	position: relative;
	background: var(--text-muted);
	/* Sunk into the page, above and below only (UV, 16 Nov): the shadow along its top
	   edge, the highlight along its foot, in the design's colours (--nm-dark, --nm-lit),
	   nothing down its sides. Fixed, not following the light: a shadow that followed it
	   would draw the banner again at every step of the light, as the masks did. */
	/* --nm-depth for the distance, --nm-blur for the softness: with no blur (UV,
	   3 Dec: hard shadows) a hard band of half the depth along the top, and the
	   spread follows the blur, so nothing shows down the sides either way */
	box-shadow:
		inset 0 calc(var(--nm-depth) / 2) calc(var(--nm-blur) / 2) calc(var(--nm-blur) / -2) var(--nm-dark),
		inset 0 calc(var(--nm-depth) / -2) calc(var(--nm-blur) / 2) calc(var(--nm-blur) / -2) var(--nm-lit);
	/* A layer of its own (UV, 16 Nov: it flickered while the light moved): the light
	   repaints the page round it every 66ms, and without this the banner was drawn
	   again each time (measured: every paint of the page covered it) */
	will-change: transform;
	/* Tight round the icons, so they fill the band (UV, 16 Nov), and a gap
	   below it before the footer. */
	padding: var(--space-4) var(--space-5);
	margin-bottom: var(--space-5);
}
.pt-list {
	list-style: none;
	margin: 0 auto;
	padding: 0;
	max-width: 1040px;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: var(--space-5) var(--space-7);
}
.pt-logo {
	display: block;
	width: 10rem;
	height: 5rem;
	background: var(--pt-tinted, none) center / contain no-repeat;
	transition: opacity 0.15s;
}
a.pt-logo:hover,
a.pt-logo:focus-visible {
	opacity: 0.75;
}
/* On a phone (UV, 16 Nov): one row, edge to edge. Icons that fit sit centred
   and still; when they do not, scripts/partners.js makes the row a carousel
   (.is-carousel: the icons twice over, slid left by one set, endlessly) or,
   with less motion, a row swiped by hand (.is-swipe). Either way the icons
   fade out at the banner's edges rather than being cut off. The gap is each
   icon's own padding, not the list's gap, so the two sets measure the same
   and the loop has no seam. */
@media (max-width: 47.99rem) {
	.site-partners {
		padding-inline: 0;
	}
	.pt-list {
		flex-wrap: nowrap;
		gap: 0;
	}
	.pt-list li {
		flex: 0 0 auto;
		padding-inline: var(--space-2);
	}
	/* The fade at the edges: the banner's grey laid over them, not a mask; on the
	   banner, so it stays put while a swiped row scrolls under it */
	.site-partners:has(.is-carousel, .is-swipe)::before,
	.site-partners:has(.is-carousel, .is-swipe)::after {
		content: "";
		position: absolute;
		z-index: 1;
		top: 0;
		bottom: 0;
		width: var(--space-6);
		pointer-events: none;
	}
	.site-partners:has(.is-carousel, .is-swipe)::before {
		left: 0;
		background: linear-gradient(to right, var(--text-muted), transparent);
	}
	.site-partners:has(.is-carousel, .is-swipe)::after {
		right: 0;
		background: linear-gradient(to left, var(--text-muted), transparent);
	}
	.pt-view.is-carousel {
		overflow: hidden;
	}
	.is-carousel .pt-list {
		width: max-content;
		max-width: none;
		justify-content: flex-start;
		animation: pt-drift var(--pt-loop, 20s) linear infinite;
	}
	/* Held still while a finger or the pointer is on it, or an icon has focus */
	.is-carousel:hover .pt-list,
	.is-carousel:active .pt-list,
	.is-carousel:focus-within .pt-list {
		animation-play-state: paused;
	}
	.pt-view.is-swipe {
		overflow-x: auto;
		scrollbar-width: none;
		overscroll-behavior-x: contain;
	}
	.pt-view.is-swipe::-webkit-scrollbar { display: none; }
	.is-swipe .pt-list {
		width: max-content;
		max-width: none;
		justify-content: flex-start;
		padding-inline: var(--space-6);   /* the first and last icon clear the fade */
	}
}
@keyframes pt-drift {
	to { transform: translateX(-50%); }
}

/* The focus ring goes round the icon's list item (it was clipped by the old
   mask; kept so it sits where it did). */
a.pt-logo:focus-visible { outline: none; }
.pt-list li:has(a.pt-logo:focus-visible) {
	outline: 2px solid var(--bg-base);
	outline-offset: 4px;
	border-radius: 2px;
}

.site-footer {
	/* The mark's height; the name is set to match it. */
	--ft-mark: 2.5rem;

	/* The footer stands over the page, casting a shadow up onto it, so the
	   page reads as sunken behind (UV, 3 Nov). Its own background, so the
	   drifting light does not show through. */
	position: relative;
	background: var(--bg-base);
	border-top: 1px solid var(--border-color);
	box-shadow: 0 -4px 0 0 rgba(0, 0, 0, var(--sunken-alpha));   /* hard (UV, 3 Dec): what showed above the footer, as a band; was 0 -12px 24px -8px */
	padding: var(--space-7) var(--space-5) 0;
	font-size: 0.95rem;
	line-height: 1.5;
}

.ft-inner {
	max-width: 1040px;
	margin: 0 auto;
}

.ft-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));   /* a long word must not widen the page */
	gap: var(--space-6) var(--space-5);
}
.ft-brand,
.ft-visit {
	grid-column: 1 / -1;
}

/* The mark and its line, centred on a phone. */
.ft-brand {
	display: grid;
	grid-template-columns: minmax(0, 1fr);   /* or the tagline's width sets it, off-centre on a narrow phone */
	justify-items: center;
	gap: var(--space-4);
	text-align: center;
}
.ft-mark {
	display: flex;
	align-items: center;
	gap: var(--space-3);
	color: var(--text-primary);
	text-decoration: none;
}
.ft-mark img {
	width: var(--ft-mark);
	height: var(--ft-mark);
}
/* The name as tall as the mark: Rushford Clean's capitals are 1.05 of its
   size, and the line is trimmed to them so the two centre on each other. On a
   screen under about 375px it shrinks to fit (UV, 7 Nov): it does not wrap, and
   pushed every page wider than the screen. The sum is the screen less the footer's
   padding, the mark and their gap, over the name's width in its own size. */
.ft-name {
	font-family: var(--font-display);
	font-size: min(calc(var(--ft-mark) / 1.05), calc((100vw - 6.25rem) / 7.15));
	line-height: 1;
	text-box: trim-both cap alphabetic;
	white-space: nowrap;
}
.ft-tag {
	margin: 0;
	max-width: 32ch;
	color: var(--text-muted);
}

/* The social buttons: green circles, the icon in the colour that sits on
   green. */
.site-footer .ft-social {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--space-3);
}
/* .site-footer in front, to outrank the text links' rules below. */
.site-footer .ft-social a {
	text-decoration: none;
	display: grid;
	place-items: center;
	width: 2.5rem;
	height: 2.5rem;
	border-radius: 50%;
	background: var(--color-primary);
	color: var(--color-on-primary);
	cursor: pointer;
	transition: box-shadow 0.15s;
}
.site-footer .ft-social a:hover,
.site-footer .ft-social a:focus-visible {
	color: var(--color-on-primary);
	box-shadow: var(--glow-primary);
}
.ft-social svg {
	width: 1.3rem;
	height: 1.3rem;
}
/* Outlined parts as heavy as a ring's line (UV, 5 Nov: no bold icons). */
.ft-social svg [stroke] { stroke-width: var(--icon-line); vector-effect: non-scaling-stroke; }

/* Headings: the display face, one size, the same gap to what follows as
   the links have between them. */
.site-footer h2 {
	font-family: var(--font-display);
	font-size: 1.15rem;
	line-height: 1.32;
	letter-spacing: 0.04em;
	color: var(--color-primary);
	margin: 0 0 var(--space-4);
}

/* Plain information is muted; anything that can be tapped is cream and
   underlined, so the two never read alike. */
.site-footer address,
.ft-hours {
	font-style: normal;
	color: var(--text-muted);
	margin: 0;
}
.ft-hours {
	margin-top: var(--space-3);
}

.site-footer ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: var(--space-3);
}
.site-footer ul a {
	color: var(--text-primary);
	text-decoration: underline;
	text-decoration-color: color-mix(in srgb, var(--color-primary) 50%, transparent);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.3em;
	transition: color 0.15s, text-decoration-color 0.15s;
}
.site-footer ul a:hover,
.site-footer ul a:focus-visible {
	color: var(--color-primary);
	text-decoration-color: var(--color-primary);
}
.site-footer a:focus-visible {
	outline: 2px solid var(--color-primary);
	outline-offset: 3px;
	border-radius: 2px;
}

/* The legal line. */
.ft-base {
	margin-top: var(--space-7);
	padding: var(--space-4) 0 calc(var(--space-5) + env(safe-area-inset-bottom, 0px));
	border-top: 1px solid var(--border-color);
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	align-items: center;
	gap: var(--space-2) var(--space-5);
	color: var(--text-muted);
	font-size: 0.85rem;
}
.ft-base ul {
	display: flex;
	gap: var(--space-5);
}
.ft-base ul a {
	color: var(--text-muted);
}

@media (min-width: 48rem) {
	.site-footer {
		padding: var(--space-7) var(--space-6) 0;
	}
	.ft-grid {
		grid-template-columns: 1.6fr 1.2fr 1fr 1fr;
		gap: var(--space-5) var(--space-7);
	}
	.ft-brand,
	.ft-visit {
		grid-column: auto;
	}
	.ft-brand {
		grid-template-columns: none;
		justify-items: start;
		align-content: start;
		text-align: left;
	}
	.site-footer .ft-social {
		justify-content: flex-start;
	}
}

@media (prefers-reduced-motion: reduce) {
	.site-footer a,
	.pt-logo { transition: none; }}
@media print {
	.site-footer,
	.site-partners { display: none; }
}
