/**
 * Footer — styles Astra's Footer Builder output.
 * Dark background with the hero's grid lines and a red glow, so it matches
 * the hero. Structure is set in Customizer > Footer Builder:
 *   Primary row: HTML 1 (logo + intro + button) | Footer Menu | HTML 2 (contact) | Social
 *   Below row:   Copyright | HTML 3 (legal links)
 */

.site-footer {
	position: relative;
	isolation: isolate;
	background-color: var(--cxo-ink);
	color: rgba(255, 255, 255, 0.72);
	overflow: hidden;
}

/* Grid lines + red glow, drawn behind every footer row. */
.site-footer::before {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	pointer-events: none;
	background-image:
		radial-gradient(70% 90% at 0% 100%, rgba(196, 18, 26, 0.55) 0%, rgba(196, 18, 26, 0) 65%),
		linear-gradient(to right, var(--cxo-grid-line) 1px, transparent 1px),
		linear-gradient(to bottom, var(--cxo-grid-line) 1px, transparent 1px);
	background-size: auto, var(--cxo-cell) var(--cxo-cell), var(--cxo-cell) var(--cxo-cell);
}

/* Rows are transparent so the background shows through. */
.site-footer .site-above-footer-wrap,
.site-footer .site-primary-footer-wrap,
.site-footer .site-below-footer-wrap {
	background: transparent;
	border-top: 0;
}

/* Same side gutter as the hero and sections (footer rows have no
 * .ast-container, so target the row container itself). */
.site-footer .ast-builder-grid-row-container {
	max-width: none;
	padding-inline: var(--cxo-gutter);
}

.site-footer .site-primary-footer-wrap {
	padding-block: clamp(3.5rem, 2rem + 6vw, 7rem) clamp(2.5rem, 1.5rem + 3vw, 4.5rem);
}

.site-footer .site-below-footer-wrap {
	padding-block: 1.5rem;
	border-top: 1px solid rgba(255, 255, 255, 0.12);
}

/* Stack columns with breathing room on mobile. */
.site-footer .site-primary-footer-wrap .ast-builder-grid-row {
	gap: 2.5rem;
}

/* ---------- Text ---------- */
.site-footer,
.site-footer p,
.site-footer .ast-builder-html-element {
	font-size: 1rem;
	line-height: 1.55;
}

.site-footer a,
.site-footer a:visited {
	color: var(--cxo-white);
	text-decoration: none;
	transition: opacity 0.2s;
}

.site-footer a:hover,
.site-footer a:focus-visible {
	color: var(--cxo-white);
	opacity: 0.65;
}

.site-footer .cxo-footer-heading {
	margin: 0 0 1rem;
	color: rgba(255, 255, 255, 0.5);
	font-size: 0.8125rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.site-footer .cxo-footer-intro {
	max-width: 22ch;
	margin: 1.5rem 0 2rem;
	color: var(--cxo-white);
	font-size: clamp(1.375rem, 1.1rem + 1vw, 2rem);
	font-weight: 500;
	letter-spacing: -0.03em;
	line-height: 1.12;
}

.site-footer .cxo-btn--outline:hover,
.site-footer .cxo-btn--outline:focus-visible {
	opacity: 1;
	color: var(--cxo-ink);
}

.site-footer .cxo-logo img {
	width: 150px;
}

/* ---------- Columns: left-aligned like the hero ---------- */
.site-footer .site-primary-footer-wrap .site-footer-section {
	justify-content: flex-start;
	align-items: flex-start;
	text-align: left;
}

.site-footer .site-primary-footer-wrap .site-footer-section > * {
	width: 100%;
	text-align: left;
}

/* Below row: copyright left, legal links right (stacked on mobile). */
.site-footer .site-below-footer-wrap .site-footer-section {
	justify-content: flex-start;
	text-align: left;
}

@media (min-width: 922px) {
	.site-footer .site-below-footer-wrap .site-footer-section:last-child {
		justify-content: flex-end;
	}

	.site-footer .site-below-footer-wrap .site-footer-section:last-child .cxo-footer-legal {
		justify-content: flex-end;
	}
}

/* ---------- Footer menu: always a vertical list ---------- */
.site-footer .footer-nav-wrap .menu,
.site-footer .astra-footer-horizontal-menu,
.site-footer .astra-footer-vertical-menu {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.6rem;
	margin: 0;
	padding: 0;
}

.site-footer .footer-nav-wrap .menu-item {
	margin: 0;
	padding: 0;
	border: 0;
}

/* #astra-footer-menu: Astra's Customizer adds 20px link padding by ID. */
.site-footer #astra-footer-menu .menu-item > a,
.site-footer .footer-navigation .menu-item > .menu-link,
.site-footer .footer-navigation a {
	padding: 0;
	color: var(--cxo-white);
	font-size: 1.125rem;
}

/* ---------- Social ---------- */
.site-footer .footer-social-inner-wrap .ast-builder-social-element {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	margin: 0 0.5rem 0 0;
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 999px;
	background: transparent;
	transition: background-color 0.2s, border-color 0.2s;
}

.site-footer .footer-social-inner-wrap .ast-builder-social-element svg {
	width: 18px;
	height: 18px;
	fill: var(--cxo-white);
}

.site-footer .footer-social-inner-wrap .ast-builder-social-element:hover {
	opacity: 1;
	border-color: var(--cxo-red);
	background: var(--cxo-red);
}

/* ---------- Below row ---------- */
.site-footer .ast-footer-copyright,
.site-footer .ast-footer-copyright p,
.site-footer .site-below-footer-wrap .ast-builder-html-element {
	margin: 0;
	color: rgba(255, 255, 255, 0.55);
	font-size: 0.875rem;
}

.site-footer .cxo-footer-legal {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.site-footer .cxo-footer-legal a {
	color: rgba(255, 255, 255, 0.55);
}

/* Widget area used for the legal links (free Astra has only 2 HTML elements). */
.site-footer .footer-widget-area .widget,
.site-footer .footer-widget-area .wp-block-group {
	margin: 0;
}

/* ---------- Scroll-to-top button ---------- */
#ast-scroll-top {
	border-radius: 999px;
	background-color: var(--cxo-white);
	color: var(--cxo-ink);
	transition: background-color 0.2s, color 0.2s;
}

#ast-scroll-top:hover {
	background-color: var(--cxo-red);
	color: var(--cxo-white);
}

/* ---------- Left alignment at every size ----------
 * Astra's Customizer CSS centres the HTML, menu and social elements. Its
 * selectors use [data-section], so these repeat it to win. */
.site-footer .footer-widget-area[data-section] .ast-builder-html-element {
	text-align: left;
}

/* The menu list is ul#astra-footer-menu.ast-nav-menu (no .menu class);
 * Astra makes it a centred grid on tablet and mobile. */
.site-footer .footer-widget-area[data-section] .footer-nav-wrap .ast-nav-menu {
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	align-items: flex-start;
}

.site-footer .footer-widget-area[data-section] .footer-nav-wrap .menu-item {
	align-items: flex-start;
}

.site-footer .ast-builder-layout-element[data-section^="section-fb-social-icons-"],
.site-footer [data-section^="section-fb-social-icons-"] .footer-social-inner-wrap {
	justify-content: flex-start;
	text-align: left;
}

/* ---------- Tablet and mobile ----------
 * Astra keeps four narrow columns on tablet. Two columns on tablet, one on
 * mobile, everything stacked in the below row. */
@media (max-width: 921px) {
	/* Tablet: brand | menu, then contact | social. */
	.site-footer .site-primary-footer-wrap.site-primary-footer-wrap .ast-builder-grid-row {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 3rem 2rem;
	}

	.site-footer .site-primary-footer-wrap .site-footer-section {
		margin: 0;
	}

	/* Below row: copyright, then legal links, both on the left. */
	.site-footer .site-below-footer-wrap .ast-builder-grid-row {
		gap: 0.75rem;
	}

	.site-footer .site-below-footer-wrap .site-footer-section {
		margin: 0;
	}

	.site-footer .ast-footer-copyright.ast-footer-copyright,
	.site-footer .ast-footer-copyright.ast-builder-layout-element {
		justify-content: flex-start;
		text-align: left;
	}
}

/* Mobile: one column. */
@media (max-width: 544px) {
	.site-footer .site-primary-footer-wrap.site-primary-footer-wrap .ast-builder-grid-row {
		grid-template-columns: minmax(0, 1fr);
		gap: 2.5rem;
	}
}

/* ---------- Tablet / desktop ---------- */
@media (min-width: 922px) {
	.site-footer .site-primary-footer-wrap .ast-builder-grid-row {
		gap: clamp(2rem, 4vw, 5rem);
	}
}
