/* ============================================================================
   Football Arena — Footer
   A branded pre-footer CTA band (injected in shining/footer.php via the theme's
   TieLabs/before_footer hook) plus a polish pass on Jannah's copyright strip.
   Token-driven, responsive, reduced-motion safe. Loaded after skin.css.
   ============================================================================ */

/* ── Pre-footer CTA band ──────────────────────────────────────────────────*/
.sa-prefooter {
	position: relative;
	overflow: hidden;
	background:
		radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--sa-violet) 16%, transparent), transparent 60%),
		var(--sa-bg-2);
	border-top: 1px solid var(--sa-border);
}
/* gradient hairline riding the top edge */
.sa-prefooter::before {
	content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px;
	background: var(--sa-gradient); opacity: .85;
}
.sa-prefooter__inner {
	display: flex; align-items: center; justify-content: space-between;
	gap: 2rem; flex-wrap: wrap;
	padding: 3rem 0;
}
.sa-prefooter__copy { flex: 1 1 340px; min-width: 0; }
.sa-prefooter__eyebrow {
	display: inline-flex; align-items: center; gap: .5rem;
	margin: 0 0 .6rem;
	font-family: var(--sa-font-display);
	font-size: .74rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
	color: var(--sa-text-dim);
}
.sa-prefooter__spark { width: 1em; height: 1em; color: var(--sa-heart); }
.sa-prefooter__title {
	margin: 0 0 .5rem;
	font-family: var(--sa-font-display);
	font-weight: 700; line-height: 1.08;
	font-size: clamp(1.7rem, 3.4vw, 2.7rem);
}
.sa-prefooter__sub {
	margin: 0; max-width: 46ch;
	color: var(--sa-text-muted); font-size: 1.02rem; line-height: 1.55;
}
.sa-prefooter__actions {
	flex: 0 0 auto;
	display: flex; flex-direction: column; align-items: flex-start; gap: 1rem;
}
.sa-prefooter__cta {
	display: inline-flex; align-items: center; gap: .1rem;
	padding: .85em 1.9em;
	border-radius: var(--sa-radius-pill);
	background: var(--sa-gradient);
	color: var(--sa-on-accent) !important;
	font-family: var(--sa-font-display);
	font-weight: 700; font-size: 1.02rem; letter-spacing: .03em; text-transform: uppercase;
	box-shadow: var(--sa-button-depth), 0 12px 30px -10px var(--sa-violet), inset 0 0 0 1px rgba(255, 255, 255, .18);
	transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}
.sa-prefooter__cta:hover {
	transform: translateY(-2px);
	filter: saturate(1.08);
	box-shadow: var(--sa-button-depth), 0 16px 38px -10px var(--sa-violet), inset 0 0 0 1px rgba(255, 255, 255, .24);
	color: var(--sa-on-accent) !important;
}
.sa-prefooter__cta span { transition: transform .18s ease; }
.sa-prefooter__cta:hover span { transform: translateX(3px); }
/* Stack cleanly on small screens. */
@media (max-width: 782px) {
	.sa-prefooter__inner { padding: 2.2rem 0; gap: 1.4rem; }
	.sa-prefooter__actions { align-items: stretch; width: 100%; }
	.sa-prefooter__cta { justify-content: center; }
}

/* ══ The footer body ══════════════════════════════════════════════════════
   Rendered by shining_footer_body() into Jannah's <footer>, above the
   copyright strip. Which pieces exist is decided in PHP by
   shining_footer_style_uses(); this file only lays out whatever arrived.
   The active style rides on <html> as .sa-footer-{a,b,c,d} because
   templates/footer.php:25 hardcodes the footer's class with no filter.
   ═══════════════════════════════════════════════════════════════════════ */

/* Jannah floats the footer 50px below the content (.site-footer{margin-top:50px}),
   which opened an unpainted strip of page background between the CTA band and the
   footer body. The bands stack edge-to-edge instead, and the footer's own surface
   is retargeted from Jannah's #1C1D21 to the same token the band uses, so anything
   its children don't paint still reads as the same colour. */
#tie-wrapper #footer {
	margin-top: 0;
	background: var(--sa-bg-2);
}

#tie-wrapper #footer .sa-fbody {
	background: var(--sa-bg-2);
	border-top: 1px solid var(--sa-border);
	padding: 2.6rem 0 2.2rem;
}
/* Pulse puts the stat band flush against the top edge, so the padding moves
   below it rather than doubling up. */
#tie-wrapper #footer .sa-fbody--c { padding-top: 0; }

.sa-fbody__inner {
	display: grid;
	gap: 2rem clamp(1.4rem, 4vw, 3rem);
	grid-template-columns: minmax(0, 1fr);
}
@media (min-width: 783px) {
	/* Hub: a wide brand column then three link columns.
	   Never a bare 1fr — min-width:auto lets long labels push the grid wider
	   than its container, which is what clipped the mobile hero once already. */
	.sa-fbody--a .sa-fbody__inner {
		grid-template-columns: minmax(0, 1.35fr) repeat(3, minmax(0, .8fr));
	}
	/* Spotlight: two link lists, sized to their content rather than stretched
	   across the page. auto-fit + 1fr gave each column half the viewport, which
	   left four words floating in 590px of nothing. */
	.sa-fbody--b .sa-fbody__inner {
		grid-template-columns: repeat(2, minmax(0, 220px));
		justify-content: start;
	}
	/* Pulse: a brand column carries the width, the two link lists stay tight. */
	.sa-fbody--c .sa-fbody__inner {
		grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 220px));
	}
}

/* ── Brand column ─────────────────────────────────────────────────────────*/
.sa-fbrand__name {
	display: flex; align-items: center; gap: .5rem;
	margin: 0 0 .55rem;
	font-family: var(--sa-font-display);
	font-weight: 800; font-size: 1.05rem; letter-spacing: -.02em;
	color: var(--sa-text);
}
.sa-fbrand__heart { width: 1rem; height: 1rem; color: var(--sa-heart); flex: none; }
.sa-fbrand__blurb {
	margin: 0; max-width: 34ch;
	color: var(--sa-text-muted); font-size: .88rem; line-height: 1.55;
}

/* Subscribe (Hub only, and only when an endpoint was saved). */
.sa-fsub { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.sa-fsub__field {
	flex: 1 1 150px; min-width: 0;
	background: var(--sa-surface-1) !important;
	border: 1px solid var(--sa-border) !important;
	border-radius: var(--sa-radius-pill) !important;
	padding: .55rem 1rem !important;
	color: var(--sa-text) !important; font-size: .86rem;
}
.sa-fsub__field::placeholder { color: var(--sa-text-dim); }
.sa-fsub__btn {
	flex: 0 0 auto;
	border: 0; border-radius: var(--sa-radius-pill);
	padding: .55rem 1.25rem;
	background: var(--sa-gradient);
	color: var(--sa-on-accent) !important;
	font-family: var(--sa-font-display); font-weight: 700; font-size: .84rem;
	cursor: pointer;
	box-shadow: var(--sa-button-depth);
	transition: transform .16s ease, filter .16s ease; letter-spacing: .05em; text-transform: uppercase;
	}
.sa-fsub__btn:hover { transform: translateY(-1px); filter: saturate(1.08); box-shadow: var(--sa-button-depth); }

/* ── Link columns ─────────────────────────────────────────────────────────*/
.sa-fcol__t {
	margin: 0 0 .6rem;
	font-family: var(--sa-font-display);
	font-size: .68rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
	color: var(--sa-text-dim);
}
.sa-fcol__list { margin: 0; padding: 0; list-style: none; }
.sa-fcol__list li { margin: 0; }
#tie-wrapper #footer .sa-fcol__list a {
	display: block; padding: .24rem 0;
	color: var(--sa-text-muted); font-size: .88rem;
	transition: color .16s ease, transform .16s ease;
}
#tie-wrapper #footer .sa-fcol__list a:hover {
	color: var(--sa-text); transform: translateX(3px);
}

/* ── Stat band (Pulse) ────────────────────────────────────────────────────*/
/* The band is already full-width — it is the .container INSIDE it that is
   constrained — so the gradient hairline is just a 2px background stripe on the
   top edge, with no negative-margin trick and no extra element. */
.sa-fstats {
	border-bottom: 1px solid var(--sa-border);
	background-image: var(--sa-gradient);
	background-repeat: no-repeat;
	background-size: 100% 2px;
	background-position: 0 0;
}
.sa-fstats__grid {
	display: grid; gap: 1px; margin: 2px 0 0;
	grid-template-columns: repeat(auto-fit, minmax(min(150px, 100%), 1fr));
	background: var(--sa-border);
}
.sa-fstat {
	display: flex; flex-direction: column;
	background: var(--sa-bg-2);
	padding: 1.1rem clamp(.9rem, 2.4vw, 1.5rem);
	/* Reserve the tile's height before the cached counts paint, so a cold
	   transient can't shift the page under someone who already scrolled. */
	min-height: 5.4rem;
}
/* dt/dd are in spec order in the markup; the number is lifted above its label
   here rather than by reversing the DOM, which would hurt reading order. */
.sa-fstat__n { order: 1; }
.sa-fstat__l { order: 2; }
.sa-fstat__n {
	margin: 0 0 .25rem;
	font-family: var(--sa-font-display);
	font-size: clamp(1.5rem, 3.6vw, 2.1rem); font-weight: 800;
	letter-spacing: -.04em; line-height: 1;
	font-variant-numeric: tabular-nums;
	color: var(--sa-text);
}
.sa-fstat__l {
	font-size: .7rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
	color: var(--sa-text-dim);
}

/* ── Wordmark ─────────────────────────────────────────────────────────────*/
.sa-fbody--d .sa-fbody__inner { justify-items: center; text-align: center; }
.sa-fmark__eyebrow {
	display: inline-flex; align-items: center; gap: .45rem;
	margin: 0 0 .7rem;
	font-family: var(--sa-font-display);
	font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
	color: var(--sa-text-dim);
}
.sa-fmark__heart { width: .85em; height: .85em; color: var(--sa-heart); flex: none; }
.sa-fmark__name {
	margin: 0;
	font-family: var(--sa-font-display);
	font-size: clamp(2.1rem, 8vw, 4.4rem); font-weight: 800;
	letter-spacing: -.05em; line-height: 1;
}

/* ── Spotlight: the band becomes a raised panel ───────────────────────────*/
html.sa-footer-b .sa-prefooter {
	background: var(--sa-bg-2);
	border-top: 1px solid var(--sa-border);
}
html.sa-footer-b .sa-prefooter::before { display: none; }
html.sa-footer-b .sa-prefooter__inner {
	border: 1px solid var(--sa-border-strong);
	border-radius: 18px;
	background:
		radial-gradient(120% 160% at 88% 0%, color-mix(in srgb, var(--sa-magenta) 22%, transparent), transparent 62%),
		var(--sa-surface-1);
	padding: clamp(1.4rem, 3.6vw, 2.4rem);
	margin: 2.4rem 0 0;
}
@media (max-width: 782px) {
	html.sa-footer-b .sa-prefooter__inner { padding: 1.6rem 1.3rem; margin-top: 1.6rem; }
}

/* ── Phone: the footer becomes one centred column ─────────────────────────
   On a narrow screen the link columns stack, and a stack of left-aligned
   lists reads as leftover desktop layout. Centring them — with a hairline
   between each group and a gradient tick under each heading — turns the
   stack into a deliberate single column. */
@media (max-width: 782px) {
	/* Desktop's 2.6rem of breathing room reads as ~80px of dead space once the
	   columns stack — the band above already supplies the separation. */
	#tie-wrapper #footer .sa-fbody { padding: 1.5rem 0 1.3rem; }
	.sa-fbody__inner { gap: 0; }

	.sa-fcol { text-align: center; padding: 1.15rem 0; border-top: 1px solid var(--sa-border); }
	.sa-fcol:first-child { border-top: 0; padding-top: 0; }
	.sa-fcol:last-child { padding-bottom: .2rem; }

	.sa-fcol__t {
		display: inline-block;
		margin-bottom: .75rem;
	}
	.sa-fcol__t::after {
		content: ""; display: block;
		width: 26px; height: 2px; margin: .5rem auto 0;
		background: var(--sa-gradient); border-radius: 2px;
	}
	/* Roomier rows: these are the footer's only tap targets on a phone. Kept at
	   .42rem so a row still clears 40px without the list drifting apart. */
	#tie-wrapper #footer .sa-fcol__list a { padding: .42rem 0; font-size: .95rem; }
	/* The desktop hover nudge slides text off-centre here. */
	#tie-wrapper #footer .sa-fcol__list a:hover { transform: none; }

	.sa-fbrand { text-align: center; }
	.sa-fbrand__name { justify-content: center; }
	.sa-fbrand__blurb { margin-inline: auto; }
	.sa-fsub { justify-content: center; }
}

/* ── Copyright strip polish ───────────────────────────────────────────────*/
#tie-wrapper #footer .site-info {
	background: var(--sa-bg) !important;
	border-top: 1px solid var(--sa-border);
}
#tie-wrapper #footer .site-info .tie-row {
	display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 1rem;
}
/* Jannah puts the whole strip in ONE full-width column, so `space-between` on the
   row above never had two children to separate — the credit line centred itself
   and the icons stayed pinned left. Centre the column's own contents instead, and
   stack them: icons first (the only thing here anyone clicks), then the credit,
   then the legal links. Same shape at every width — the phone layout was already
   this, and one behaviour beats two. */
#tie-wrapper #footer .site-info .tie-row > [class*="tie-col"] {
	display: flex; flex-direction: column; align-items: center; gap: 1.05rem; width: 100%;
}
#tie-wrapper #footer .site-info .social-icons { order: 1; }
#tie-wrapper #footer .copyright-text {
	order: 2;
	color: var(--sa-text-dim); font-size: .86rem; line-height: 1.6; margin: 0;
	text-align: center; max-width: 68ch;
}
#tie-wrapper #footer .site-info .sa-flegal { order: 3; justify-content: center; }
/* The row of icons reads as one object rather than six: a hairline that fades out
   at both ends draws the group's width, and a soft accent bloom sits under it.
   Both are pseudo-elements on the list, so no extra markup and nothing to escape. */
#tie-wrapper #footer .site-info .social-icons { position: relative; padding-top: 1.15rem; }
#tie-wrapper #footer .site-info .social-icons::before {
	content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
	width: min(220px, 60%); height: 1px;
	background: linear-gradient(90deg, transparent, var(--sa-border-strong), transparent);
}
#tie-wrapper #footer .site-info .social-icons::after {
	content: ""; position: absolute; z-index: 0; top: 50%; left: 50%;
	width: 260px; height: 90px; transform: translate(-50%, -42%);
	background: radial-gradient(closest-side, color-mix(in srgb, var(--sa-violet) 16%, transparent), transparent);
	pointer-events: none;
}
#tie-wrapper #footer .site-info .social-icons > li { position: relative; z-index: 1; }
/* Footer social → dark chips inside a gradient ring.
   The ring is a two-layer background rather than a border-colour: the chip
   fill is painted to the padding box and the gradient to the border box, so
   a 1px hairline of the brand gradient traces the circle without needing a
   pseudo-element or a second wrapper. */
#tie-wrapper #footer .site-info .social-icons { display: flex; justify-content: center; flex-wrap: wrap; gap: .6rem; margin: 0; }
#tie-wrapper #footer .site-info .social-icons a {
	display: inline-flex; align-items: center; justify-content: center;
	width: 42px; height: 42px; border-radius: 50%;
	border: 1px solid transparent;
	background:
		linear-gradient(var(--sa-surface-1), var(--sa-surface-1)) padding-box,
		var(--sa-gradient) border-box;
	color: var(--sa-text-muted) !important;
	transition: transform .16s ease, color .16s ease, box-shadow .16s ease, background .16s ease;
}
#tie-wrapper #footer .site-info .social-icons a:hover {
	transform: translateY(-3px);
	/* Fill flips to the gradient; the ring stays, so the shape doesn't shift. */
	background: var(--sa-gradient) padding-box, var(--sa-gradient) border-box;
	box-shadow: 0 10px 24px -10px var(--sa-violet);
	color: var(--sa-on-accent) !important;
}

/* Keyboard focus has to be visible on a dark chip whose hover state is a fill —
   an outline that hugs the circle, not the square the browser would draw. */
#tie-wrapper #footer .site-info .social-icons a:focus-visible {
	outline: 2px solid var(--sa-violet-light, var(--sa-violet));
	outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
	#tie-wrapper #footer .site-info .social-icons a { transition: none; }
	#tie-wrapper #footer .site-info .social-icons a:hover { transform: none; }
}

/* Phone: keep the complete social set on one line. Six 48px chips plus the old
   gaps needed more width than the copyright column owns, so WhatsApp wrapped
   by itself. The circles stay comfortably above WCAG's 24px minimum target,
   while the fluid size and tighter gap preserve the group at 320–430px. */
@media (max-width: 782px) {
	#tie-wrapper #footer .site-info .social-icons {
		width: 100%;
		max-width: 100%;
		flex-wrap: nowrap;
		gap: clamp(.3rem, 1.8vw, .55rem);
	}
	#tie-wrapper #footer .site-info .social-icons > li { flex: 0 0 auto; }
	#tie-wrapper #footer .site-info .social-icons a {
		/* Jannah forces 48px with !important below 768px. These declarations
		   deliberately beat that mobile-only rule; the desktop size is untouched. */
		width: clamp(38px, 10.5vw, 42px) !important;
		height: clamp(38px, 10.5vw, 42px) !important;
		line-height: clamp(38px, 10.5vw, 42px) !important;
		font-size: .95rem;
	}
	#tie-wrapper #footer .sa-flegal { justify-content: center; }
}

/* Legal links + the text back-to-top, appended inside the copyright strip. */
.sa-flegal {
	display: flex; flex-wrap: wrap; align-items: center; gap: .35rem 1.2rem;
	width: 100%;
}
#tie-wrapper #footer .sa-flegal a {
	color: var(--sa-text-dim) !important;
	font-size: .8rem;
	transition: color .16s ease;
}
#tie-wrapper #footer .sa-flegal a:hover { color: var(--sa-text) !important; }
#tie-wrapper #footer .sa-flegal__top { margin-left: auto; }
@media (max-width: 782px) {
	#tie-wrapper #footer .sa-flegal__top { margin-left: 0; }
}
