/* =====================================================================
 * UNIVERSAL CONTAINERS — Site footer
 *
 * Markup:  template-parts/layout/footer-content.php
 * Design:  Figma "All New Designs" → Footer (compact, desktop), node 189:1067
 *
 * Plain CSS for now. When the theme moves to SCSS (like dg-blocks), the
 * custom properties below map 1:1 onto dg-blocks/src/shared/scss/_tokens.scss.
 *
 * Layout:
 *   < 600px      single column, everything stacked
 *   600–1023px   brand on top, then a 2×2 grid: Quick Links + Company,
 *                Legal + Contact
 *   1024–1279px  brand on top, 3 menus + contact side by side
 *   ≥ 1280px     5 columns, as per the Figma desktop frame
 * ===================================================================== */

.uc-footer {
	/* Tokens (match _tokens.scss) */
	--uc-footer-black: #0a0a0a;    /* $dg-black */
	--uc-footer-white: #ffffff;    /* $dg-white */
	--uc-footer-lime: #dff22a;     /* $dg-lime */
	--uc-footer-muted: #a3a39e;    /* $dg-grey-400 */
	--uc-footer-rule: #242424;
	--uc-footer-font: AktivGrotesk, "Helvetica Neue", Arial, sans-serif; /* $dg-font-body */
	--uc-footer-transition: 0.2s ease;

	/* Width: mirrors the header nav (.container lg:px-4 xl:px-5) so the
	   footer lines up with it at every screen size. Max width includes the
	   gutters, same as Tailwind's .container. See "Container" below. */
	--uc-footer-gutter: 18px; /* mobile — wider than the header's 8px on purpose */
	--uc-footer-max: 100%;

	background: var(--uc-footer-black);
	color: var(--uc-footer-muted);
	font-family: var(--uc-footer-font);
	font-size: 14px;
	line-height: normal;
}

.uc-footer p,
.uc-footer ul {
	margin: 0;
	padding: 0;
}

.uc-footer ul {
	list-style: none;
}

.uc-footer img {
	display: block;
	max-width: none;
}

.uc-footer__inner {
	box-sizing: border-box;
	width: 100%;
	max-width: var(--uc-footer-max);
	margin: 0 auto;
	padding: 48px var(--uc-footer-gutter) 32px;
}

/* ---- Container: same steps as the header's .container lg:px-4 xl:px-5 -- */

@media (min-width: 640px)  { .uc-footer { --uc-footer-max: 640px; } }
@media (min-width: 768px)  { .uc-footer { --uc-footer-max: 768px; } }
@media (min-width: 1024px) { .uc-footer { --uc-footer-max: 1024px; } }
@media (min-width: 1280px) { .uc-footer { --uc-footer-max: 1280px; --uc-footer-gutter: 1.25rem; } }
@media (min-width: 1536px) { .uc-footer { --uc-footer-max: 1536px; } }


/* ---- Columns -------------------------------------------------------- */

.uc-footer__columns {
	display: grid;
	grid-template-columns: 1fr;
	gap: 32px;
}


/* ---- Brand ---------------------------------------------------------- */

.uc-footer__brand {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 16px;
}

.uc-footer__logo img {
	width: auto;
	height: 40px;
}

.uc-footer__tagline {
	max-width: 320px;
	line-height: 22px;
}


/* ---- Headings (menu names + "Contact") ------------------------------ */

.uc-footer__heading {
	color: var(--uc-footer-lime);
	font-weight: 700;
	letter-spacing: 1px;
	text-transform: uppercase;
}


/* ---- Menus ---------------------------------------------------------- */

.uc-footer__menu {
	display: flex;
	flex-direction: column;
	gap: 15px; /* heading → list */
}

.uc-footer__links,
.uc-footer__links .sub-menu {
	display: flex;
	flex-direction: column;
	gap: 15px; /* between links */
}

.uc-footer__links .sub-menu {
	margin-top: 15px;
}

.uc-footer__links a {
	color: var(--uc-footer-muted);
	text-decoration: none;
	text-underline-offset: 3px;
	transition: color var(--uc-footer-transition);
}

.uc-footer__links a:hover,
.uc-footer__links a:focus-visible,
.uc-footer__links .current-menu-item > a {
	color: var(--uc-footer-white);
	text-decoration: underline;
}


/* ---- Contact -------------------------------------------------------- */

.uc-footer__contact {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
	order: -1; /* mobile: contact details first (reset at 600px) */
}

.uc-footer__address {
	max-width: 295px;
	line-height: 22px;
}

.uc-footer__contact-link {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--uc-footer-white);
	text-decoration: none;
	text-underline-offset: 3px;
}

.uc-footer__contact-link--phone {
	font-size: 16px;
	font-weight: 700;
}

.uc-footer__contact-link:hover span,
.uc-footer__contact-link:focus-visible span {
	text-decoration: underline;
}


/* ---- Bottom row ----------------------------------------------------- */

.uc-footer__bottom {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 16px;
	margin-top: 32px;
	padding-top: 32px;
	border-top: 1px solid var(--uc-footer-rule);
}

.uc-footer__copyright {
	font-size: 12px;
	line-height: 1.5;
}

.uc-footer__social {
	display: flex;
	gap: 10px;
}

.uc-footer__social-link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	background: var(--uc-footer-lime);
	transition: background-color var(--uc-footer-transition);
}

.uc-footer__social-link:hover,
.uc-footer__social-link:focus-visible {
	background: var(--uc-footer-white);
}


/* ---- Focus ---------------------------------------------------------- */

.uc-footer a:focus-visible {
	outline: 2px solid var(--uc-footer-lime);
	outline-offset: 2px;
}


/* =====================================================================
 * Tablet (600px+): brand on top, then 2×2 — Quick Links + Company,
 * Legal + Contact
 * ===================================================================== */

@media (min-width: 600px) {
	.uc-footer__columns {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 40px 24px;
	}

	.uc-footer__brand {
		grid-column: 1 / -1;
	}

	.uc-footer__contact {
		order: 0;
	}

	.uc-footer__bottom {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
	}
}


/* =====================================================================
 * Small desktop (1024px+): brand on top, 3 menus + contact in one row
 * ===================================================================== */

@media (min-width: 1024px) {
	.uc-footer__columns {
		grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.25fr);
	}
}


/* =====================================================================
 * Desktop (1280px+): 5 columns, as per Figma
 * ===================================================================== */

@media (min-width: 1280px) {
	.uc-footer__inner {
		padding-top: 56px;
	}

	.uc-footer__columns {
		/* Brand 200px, menus as wide as their longest link, contact up to 295px
		   (as per Figma). Any spare width goes into the gaps (min 40px), so the
		   contact column always finishes at the right-hand edge, in line with
		   the social icons. */
		grid-template-columns:
			200px
			repeat(3, max-content)
			minmax(0, 295px);
		justify-content: space-between;
		gap: 40px;
	}

	.uc-footer__brand,
	.uc-footer__contact {
		grid-column: auto;
	}

	.uc-footer__tagline {
		max-width: 200px;
	}

	.uc-footer__links a {
		white-space: nowrap;
	}
}
