/* ==========================================================================
   Smart Jhuri — Footer
   Three boxes (brand + social · quick links · contact) above a thin bar.
   Every colour here comes from a custom property so the Customizer can drive
   it; the values below are the fallbacks for a fresh install.
   ========================================================================== */

/* Declared on :root, not on .sj-footer — the Customizer prints its own
   :root block after this file, and a declaration on .sj-footer itself would
   shadow it for everything inside the footer. */
:root {
	--sj-footer-bg: #0F172A;
	--sj-footer-box-bg: #16213A;
	--sj-footer-box-border: #26334F;
	--sj-footer-heading: #FFFFFF;
	--sj-footer-text: #94A3B8;
	--sj-footer-hover: #FF7A00;
	--sj-footer-accent: #2563EB;
	--sj-footer-radius: 14px;
	--sj-footer-gap: 64px;
	--sj-footer-cols: 2;
	--sj-footer-logo-h: 46px;
}

.sj-footer {
	position: relative;
	margin-top: var(--sj-footer-gap);
	background: var(--sj-footer-bg);
	color: var(--sj-footer-text);
	font-family: var(--sj-font-body);
	font-size: 14.5px;
	line-height: 1.7;
}

/* The brand line across the top edge: blue → orange → green, the three
   theme colours in the order the header uses them. */
.sj-footer--stripe::before {
	content: "";
	position: absolute;
	inset: 0 0 auto;
	height: 3px;
	background: linear-gradient(90deg, var(--sj-blue) 0%, var(--sj-blue) 34%, var(--sj-orange) 34%, var(--sj-orange) 67%, var(--sj-green) 67%);
}

/* Only `.sj-footer` counts towards specificity here; the `a` sits inside
   :where(). That lands this rule at one class — heavy enough to beat the bare
   `a { color: var(--sj-blue) }` in base.css, light enough that the
   single-class component rules further down (.sj-fwa, .sj-ftop,
   .sj-fsocial__link) win on source order and keep their white text. */
.sj-footer :where(a) {
	color: inherit;
	transition: color var(--sj-ease);
}
.sj-footer :where(a:hover) { color: var(--sj-footer-hover); }

.sj-footer :where(a, button):focus-visible {
	outline: 2px solid var(--sj-footer-hover);
	outline-offset: 3px;
}

/* -------------------------------------------------------------- The grid -- */

.sj-footer__top { padding: 56px 0 44px; }

.sj-footer__grid {
	display: grid;
	/* The brand box carries the most copy, so it gets the extra room. */
	grid-template-columns: 1.35fr 1fr 1.15fr;
	gap: 28px;
	align-items: stretch;
}

/* Switching a box off should not leave a gap where it stood. */
.sj-footer--boxes-2 .sj-footer__grid { grid-template-columns: 1.3fr 1fr; }
.sj-footer--boxes-1 .sj-footer__grid { grid-template-columns: minmax(0, 640px); justify-content: center; }

/* ------------------------------------------------------------- The boxes -- */

.sj-fbox { min-width: 0; }

.sj-footer--cards .sj-fbox {
	padding: 28px 26px;
	border: 1px solid var(--sj-footer-box-border);
	border-radius: var(--sj-footer-radius);
	background: var(--sj-footer-box-bg);
	transition: border-color var(--sj-ease);
}

.sj-footer--cards .sj-fbox:hover {
	border-color: color-mix(in srgb, var(--sj-footer-accent) 45%, var(--sj-footer-box-border));
}

.sj-footer--plain .sj-fbox { padding: 4px 0; }

/* Headings carry a short accent rule underneath — the same visual cue the
   section headings elsewhere on the site use. */
.sj-fbox__title {
	position: relative;
	margin: 0 0 22px;
	padding-bottom: 12px;
	font-family: var(--sj-font-head);
	font-size: 16px;
	font-weight: 600;
	letter-spacing: -.01em;
	color: var(--sj-footer-heading);
}

.sj-fbox__title::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 34px;
	height: 3px;
	border-radius: 3px;
	background: var(--sj-footer-accent);
}

/* --- Box 1: brand -------------------------------------------------------- */

.sj-fbox__brand { margin-bottom: 18px; }

.sj-logo--footer { display: inline-flex; }

.sj-logo--footer .sj-logo__img {
	max-height: var(--sj-footer-logo-h);
	width: auto;
}

/* Only when the footer is borrowing the header's mark. A logo drawn for a
   white header is usually dark ink, or sits on its own white plate; the halo
   stops it disappearing into the dark footer. A purpose-made footer logo
   needs none of this, so it never gets the filter. */
.sj-logo--footer-inherit .sj-logo__img {
	filter: drop-shadow(0 0 1px rgba(255, 255, 255, .55));
}

.sj-logo--footer .sj-logo__text {
	font-family: var(--sj-font-head);
	font-size: 22px;
	font-weight: 700;
	letter-spacing: -.02em;
	color: var(--sj-footer-heading);
}

.sj-fbox__text {
	margin: 0 0 22px;
	max-width: 46ch;
}

/* --- Social icons -------------------------------------------------------- */

.sj-fsocial__label {
	margin: 0 0 12px;
	font-family: var(--sj-font-head);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--sj-footer-heading);
	opacity: .75;
}

.sj-fsocial__list {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sj-fsocial__link {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border-radius: 10px;
	border: 1px solid var(--sj-footer-box-border);
	background: color-mix(in srgb, var(--sj-footer-heading) 5%, transparent);
	color: var(--sj-footer-heading);
	transition: background var(--sj-ease), border-color var(--sj-ease), color var(--sj-ease), transform var(--sj-ease);
}

/* --sj-net is the network's own brand colour, set inline per link. */
.sj-fsocial__link:hover {
	background: var(--sj-net, var(--sj-footer-accent));
	border-color: var(--sj-net, var(--sj-footer-accent));
	color: #fff;
	transform: translateY(-2px);
}

.sj-footer--social-solid .sj-fsocial__link {
	background: var(--sj-net, var(--sj-footer-accent));
	border-color: transparent;
	color: #fff;
}
.sj-footer--social-solid .sj-fsocial__link:hover {
	filter: brightness(1.12);
	transform: translateY(-2px);
}

/* X's brand colour is near-black, which disappears on a dark footer. */
.sj-footer--social-solid .sj-fsocial__link--twitter,
.sj-footer--social-solid .sj-fsocial__link--tiktok {
	border-color: var(--sj-footer-box-border);
}

/* --- Box 2: links -------------------------------------------------------- */

.sj-flinks {
	margin: 0;
	padding: 0;
	list-style: none;
	columns: var(--sj-footer-cols);
	column-gap: 24px;
}

.sj-flinks li {
	break-inside: avoid;
	margin-bottom: 10px;
}

.sj-flinks a {
	display: inline-block;
	position: relative;
	padding-left: 14px;
}

/* A small chevron that slides out on hover, rather than a bullet. */
.sj-flinks a::before {
	content: "";
	position: absolute;
	left: 0;
	top: 50%;
	width: 5px;
	height: 5px;
	margin-top: -3px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(-45deg);
	opacity: .45;
	transition: transform var(--sj-ease), opacity var(--sj-ease);
}

.sj-flinks a:hover::before {
	opacity: 1;
	transform: rotate(-45deg) translate(2px, 2px);
}

/* --- Box 3: contact ------------------------------------------------------ */

.sj-fcontact {
	margin: 0 0 22px;
	padding: 0;
	list-style: none;
	display: grid;
	gap: 16px;
}

.sj-fcontact__row {
	display: grid;
	grid-template-columns: 34px 1fr;
	align-items: start;
	gap: 12px;
}

.sj-fcontact__icon {
	display: grid;
	place-items: center;
	width: 34px;
	height: 34px;
	border-radius: 9px;
	background: color-mix(in srgb, var(--sj-footer-accent) 16%, transparent);
	color: var(--sj-footer-accent);
}

.sj-fcontact__value { padding-top: 4px; }

a.sj-fcontact__value { color: var(--sj-footer-heading); }
a.sj-fcontact__value:hover { color: var(--sj-footer-hover); }

.sj-fwa {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	height: 42px;
	padding: 0 18px;
	border-radius: var(--sj-radius-sm);
	background: #25D366;
	color: #fff;
	font-family: var(--sj-font-head);
	font-size: 14px;
	font-weight: 600;
	transition: background var(--sj-ease), transform var(--sj-ease);
}
.sj-fwa:hover {
	background: #1EBE5A;
	color: #fff;
	transform: translateY(-1px);
}
.sj-fwa .sj-icon { color: #fff; }

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

.sj-footer__bottom {
	border-top: 1px solid var(--sj-footer-box-border);
	font-size: 13.5px;
}

.sj-footer__bottom-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px 28px;
	padding-block: 20px;
}

.sj-footer__legal {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 22px;
}

.sj-footer__copy { margin: 0; }

.sj-footer__legal-menu {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 20px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sj-footer__legal-menu a { opacity: .85; }
.sj-footer__legal-menu a:hover { opacity: 1; }

.sj-footer__extras {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px 22px;
}

.sj-fpay {
	display: inline-flex;
	align-items: center;
	gap: 10px;
}

.sj-fpay__label {
	font-family: var(--sj-font-head);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .04em;
	opacity: .8;
}

.sj-fpay__img {
	height: 28px;
	width: auto;
}

.sj-ftop {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	height: 34px;
	padding: 0 14px;
	border: 1px solid var(--sj-footer-box-border);
	border-radius: 999px;
	font-family: var(--sj-font-head);
	font-size: 12.5px;
	font-weight: 600;
	color: var(--sj-footer-heading);
	transition: border-color var(--sj-ease), background var(--sj-ease), color var(--sj-ease);
}
.sj-ftop:hover {
	background: var(--sj-footer-accent);
	border-color: var(--sj-footer-accent);
	color: #fff;
}
.sj-ftop:hover .sj-icon { transform: translateY(-1px); }
.sj-ftop .sj-icon { transition: transform var(--sj-ease); }

/* The "back to top" link is an in-page anchor, so this is all it needs. */
@media (prefers-reduced-motion: no-preference) {
	html { scroll-behavior: smooth; }
}

/* ---------------------------------------------------------- Breakpoints -- */

@media (max-width: 991px) {
	/* Two up: brand keeps the full width, links and contact share the row. */
	.sj-footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.sj-footer--boxes-3 .sj-fbox--about { grid-column: 1 / -1; }
	.sj-footer--boxes-1 .sj-footer__grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 767px) {
	.sj-footer__top { padding: 40px 0 32px; }

	.sj-footer__grid,
	.sj-footer--boxes-2 .sj-footer__grid,
	.sj-footer--boxes-3 .sj-footer__grid {
		grid-template-columns: minmax(0, 1fr);
		gap: 20px;
	}

	.sj-footer--boxes-3 .sj-fbox--about { grid-column: auto; }

	.sj-footer--cards .sj-fbox { padding: 24px 20px; }

	.sj-fbox__text { max-width: none; }

	/* One column of links reads better than two narrow ones on a phone. */
	.sj-flinks { columns: 1; }

	.sj-footer__bottom-inner {
		flex-direction: column;
		align-items: flex-start;
		text-align: left;
	}
}
