/*!
 * Sterling Sports Group — site footer.
 *
 * Loaded as its own stylesheet (handle: ssg-footer) by ssg_enqueue_assets()
 * in functions.php. Depends on the brand tokens declared in style.css.
 *
 * Three stacked rows: link columns, oversized wordmark, bottom bar.
 *
 * Markup: template-parts/footer/site-footer.php
 * Behaviour: assets/js/main.js (accordion toggling below the breakpoint)
 */

.ssg-footer {
	background-color: #16150f; /* Charcoal — a touch lifted off --ssg-ink. */
	color: rgba(255, 255, 255, 0.72);
}

.ssg-footer__inner {
	width: min(100% - 2.5rem, 1320px);
	margin-inline: auto;
	padding-block: clamp(3rem, 6vw, 5rem);
}

/* --------------------------------------------------------------
 * Row 1 — link columns
 * ----------------------------------------------------------- */
.ssg-footer__columns {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(2rem, 5vw, 5rem);
}

.ssg-footer__group {
	min-width: 0;
}

.ssg-footer__label {
	display: block;
	margin-bottom: 1.25rem;
	font-family: var(--ssg-font-mono);
	font-size: 0.75rem;
	font-weight: 500;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--ssg-primary-on-dark);
	/* Removes the native disclosure triangle in every engine. */
	list-style: none;
	cursor: default;
}

.ssg-footer__label::-webkit-details-marker {
	display: none;
}

.ssg-footer__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ssg-footer__list li {
	margin: 0 0 0.7rem;
	list-style: none;
}

.ssg-footer__list li:last-child {
	margin-bottom: 0;
}

.ssg-footer__list a,
.ssg-footer__contact a {
	font-size: 0.9375rem;
	text-decoration: none;
	color: rgba(255, 255, 255, 0.72);
	transition: color var(--ssg-transition);
}

.ssg-footer__list a:hover,
.ssg-footer__list a:focus-visible,
.ssg-footer__contact a:hover,
.ssg-footer__contact a:focus-visible {
	color: var(--ssg-white);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Contact column --------------------------------------------- */
.ssg-footer__contact p {
	margin: 0 0 0.7rem;
	font-size: 0.9375rem;
	line-height: 1.6;
}

.ssg-footer__contact p:last-child {
	margin-bottom: 0;
}

.ssg-footer__locations span {
	margin-inline: 0.25rem;
	color: var(--ssg-primary-on-dark);
}

.ssg-footer__hours {
	color: rgba(255, 255, 255, 0.58);
}

.ssg-footer__contact-line a {
	font-family: var(--ssg-font-mono);
	font-size: 0.875rem;
	letter-spacing: 0.01em;
}

/* --------------------------------------------------------------
 * Row 2 — oversized wordmark
 * ----------------------------------------------------------- */
.ssg-footer__mark {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1.75rem;
	margin-top: clamp(2.5rem, 6vw, 5rem);
	text-align: center;
}

/*
 * Full width and a query container, so the wordmark below can size itself
 * against this box. Without the stretch it would shrink to fit its own text
 * under `align-items: center`, and sizing the text from that width would be
 * circular.
 */
.ssg-footer__mark-text {
	align-self: stretch;
	width: 100%;
	min-width: 0;
	container-type: inline-size;
}

/*
 * Set as type rather than an image: it scales cleanly to any width, costs no
 * request, and sidesteps the dark-artwork problem the PNG wordmark has on
 * this background.
 */
.ssg-footer__wordmark {
	/* Single tuning knob: raise to fill more of the width, lower for more
	   breathing room. ~14.2 puts the mark just inside the container edges. */
	--ssg-wordmark-scale: 14.2cqw;

	margin: 0;
	max-width: 100%;
	font-family: var(--ssg-font-heading);
	/* Fallback for engines without container queries. */
	font-size: clamp(2.5rem, 12.5vw, 11rem);
	font-weight: 700;
	line-height: 0.84;
	letter-spacing: 0.005em;
	text-transform: uppercase;
	color: var(--ssg-white);
}

/*
 * Sized against the container rather than the viewport. `vw` keeps growing on
 * ultra-wide screens while the container is capped at 1320px, so a vw-sized
 * mark either overflows there or has to be capped — and a cap means it stops
 * filling the width. Container units hold the same proportion at every size,
 * from a 320px phone to a 4K display, with no breakpoints.
 */
@supports (container-type: inline-size) {
	.ssg-footer__wordmark {
		font-size: var(--ssg-wordmark-scale);
	}
}

.ssg-footer__tagline {
	max-width: 52ch;
	/* auto sides keep the measure capped while staying centred under the mark. */
	margin: 1.25rem auto 0;
	font-size: clamp(0.9375rem, 0.9rem + 0.2vw, 1.0625rem);
	line-height: 1.6;
	color: rgba(255, 255, 255, 0.62);
	text-wrap: pretty;
}

/* Social ------------------------------------------------------ */
.ssg-footer__social {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.6rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ssg-footer__social li {
	margin: 0;
	list-style: none;
}

.ssg-footer__social a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	height: 42px;
	color: rgba(255, 255, 255, 0.78);
	border: 1px solid rgba(173, 174, 176, 0.24);
	border-radius: var(--ssg-radius);
	transition: background-color var(--ssg-transition), border-color var(--ssg-transition), color var(--ssg-transition);
}

.ssg-footer__social a:hover,
.ssg-footer__social a:focus-visible {
	background-color: var(--ssg-primary);
	border-color: var(--ssg-primary);
	color: var(--ssg-white);
}

/* --------------------------------------------------------------
 * Row 3 — bottom bar
 * ----------------------------------------------------------- */
.ssg-footer__bar {
	border-top: 1px solid rgba(173, 174, 176, 0.16);
}

.ssg-footer__bar-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem 1.5rem;
	width: min(100% - 2.5rem, 1320px);
	margin-inline: auto;
	padding-block: 1.5rem;
}

.ssg-footer__copyright,
.ssg-footer__rights {
	margin: 0;
	font-family: var(--ssg-font-mono);
	font-size: 0.8125rem;
	letter-spacing: 0.06em;
	color: rgba(255, 255, 255, 0.5);
}

/* --------------------------------------------------------------
 * Accordion below the breakpoint
 * ----------------------------------------------------------- */
@media (max-width: 860px) {

	.ssg-footer__columns {
		grid-template-columns: minmax(0, 1fr);
		gap: 0;
	}

	.ssg-footer__group {
		border-top: 1px solid rgba(173, 174, 176, 0.16);
	}

	.ssg-footer__group:last-of-type {
		border-bottom: 1px solid rgba(173, 174, 176, 0.16);
	}

	.ssg-footer__label {
		display: flex;
		align-items: center;
		justify-content: space-between;
		margin: 0;
		padding: 1.15rem 0;
		cursor: pointer;
		/* Muted while collapsed — near --ssg-silver, but the exact value the
		   design calls for. The chevron inherits it via currentColor. */
		color: #aba8a9;
		transition: color var(--ssg-transition);
	}

	/* Opened: label and chevron both go accent red. */
	.ssg-footer__group[open] .ssg-footer__label {
		color: var(--ssg-primary-on-dark);
	}

	/* Chevron, rotated when the group is open. */
	.ssg-footer__label::after {
		content: "";
		width: 9px;
		height: 9px;
		margin-left: 1rem;
		border-right: 2px solid currentColor;
		border-bottom: 2px solid currentColor;
		transform: translateY(-2px) rotate(45deg);
		transition: transform var(--ssg-transition);
		flex: 0 0 auto;
	}

	.ssg-footer__group[open] .ssg-footer__label::after {
		transform: translateY(2px) rotate(-135deg);
	}

	.ssg-footer__list,
	.ssg-footer__contact {
		padding-bottom: 1.35rem;
	}

	.ssg-footer__list li {
		margin-bottom: 0.9rem;
	}

	.ssg-footer__mark {
		margin-top: 2.5rem;
	}

	.ssg-footer__bar-inner {
		justify-content: flex-start;
	}
}

/* Desktop: the summary is a static label, not a control. */
@media (min-width: 861px) {
	.ssg-footer__label {
		pointer-events: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ssg-footer__social a,
	.ssg-footer__list a,
	.ssg-footer__contact a,
	.ssg-footer__label,
	.ssg-footer__label::after {
		transition: none;
	}
}
