/* ==========================================================================
   Footer — Andrés Carne de Res
   Built by Contra Studio
   ========================================================================== */

/* --------------------------------------------------------------------------
   Shell
   -------------------------------------------------------------------------- */

.site-footer {
	--footer-hubspot-padding: 40px;
	background-color: var(--color-bg-subtle);
	color: var(--color-text);
	min-height: 615px;
	position: relative;
	isolation: isolate;
	background-image: url('../../images/illustrations/illstration-butterfly.webp');
	background-repeat: no-repeat;
	background-size: 185px 205px;
	background-position: max(188px, calc((100vw - 1440px) / 2 + 188px)) 330px;
	display: flex;
	flex-direction: column;
}

.site-footer::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	background: var(--texture-paper) center bottom / cover;
	mix-blend-mode: overlay;
	opacity: 0.33;
	pointer-events: none;
}

.site-footer__inner {
	max-width: 1440px;
	margin-inline: auto;
	padding: 40px 32px 0;
	flex: 1;
	display: flex;
	flex-direction: column;
	width: 100%;
}

/* --------------------------------------------------------------------------
   Top — row 1: logo / row 2: menus + newsletter
   -------------------------------------------------------------------------- */

.site-footer__top {
	display: grid;
	/* Preserve the desktop newsletter column at two thirds of the canvas. */
	grid-template-columns: minmax(0, 1fr) minmax(320px, calc((100% + 64px) / 3 - 32px));
	grid-template-areas: "brand brand" "menus newsletter";
	gap: 64px;
	align-content: start;
	align-items: start;
	padding-bottom: 2rem;
	flex: 1;
}

/* --------------------------------------------------------------------------
   Brand — row 1 (logo only)
   -------------------------------------------------------------------------- */

.site-footer__brand {
	grid-area: brand;
	line-height: 0;
}

.site-footer__brand .custom-logo-link img {
	display: block;
	width: 132px;
	height: 49px;
	object-fit: contain;
}

.site-footer__brand .custom-logo-link {
	display: inline-block;
}

.site-footer__logo-link {
	font-family: var(--font-primary);
	font-size: var(--fs-body-2);
	color: var(--color-text);
	text-decoration: none;
}

/* --------------------------------------------------------------------------
   Body — menu column
   -------------------------------------------------------------------------- */

.site-footer__body {
	grid-area: menus;
	min-width: 0;
}

/* --------------------------------------------------------------------------
   Menu columns
   -------------------------------------------------------------------------- */

.site-footer__menus {
	display: flex;
	flex-direction: column;
	gap: 2.5rem;
}

.site-footer__menus-row {
	display: flex;
	flex-direction: row;
	justify-content: flex-start;
	gap: clamp(24px, calc((100vw - 1120px) / 5), 64px);
}

.site-footer__menus-media {
	display: flex;
	flex-direction: row;
	justify-content: flex-start;
}

.site-footer__col {
	flex: 0 1 auto;
	min-width: 0;
}

.site-footer__col-title {
	font-family: var(--font-primary);
	font-size: var(--fs-body-4);
	font-weight: var(--fw-body-4);
	letter-spacing: var(--ls-body-4);
	line-height: var(--lh-body-4);
	text-transform: uppercase;
	margin: 0 0 20px;
}

.site-footer__col-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
	font-family: var(--font-secondary);
	font-size: var(--fs-body-6);
	line-height: var(--lh-body-6);
}

.site-footer__col-list li a {
	font-family: var(--font-secondary);
	font-size: var(--fs-body-6);
	font-weight: var(--fw-body-6);
	line-height: var(--lh-body-6);
	letter-spacing: var(--ls-body-6);
	color: var(--color-text);
	text-decoration: none;
}

.site-footer__col-list li a:hover {
	text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Newsletter
   -------------------------------------------------------------------------- */

.site-footer__newsletter {
	grid-area: newsletter;
	width: 100%;
	min-width: 0;
}

.site-footer__newsletter-title {
	font-family: var(--font-primary);
	font-size: var(--fs-body-1);
	font-weight: var(--fw-body-1);
	letter-spacing: var(--ls-body-1);
	line-height: var(--lh-body-1);
	text-transform: uppercase;
	margin: 0 0 32px;
	/* Align with the fields inside HubSpot's embedded form. */
	padding-inline-start: var(--footer-hubspot-padding);
}

.site-footer__embed {
	width: 100%;
}

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

.site-footer__bottom {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding-block: 1.25rem;
}

.site-footer__copyright,
.site-footer__credit {
	margin: 0;
	text-transform: uppercase;
}

.site-footer__credit a {
	color: var(--color-text);
	text-decoration: underline;
}

.site-footer__credit a:hover {
	opacity: 0.7;
}

/* --------------------------------------------------------------------------
   Responsive — tablet / mobile
   -------------------------------------------------------------------------- */

/* Stack the newsletter before the desktop columns become cramped. */
@media (max-width: 1199px) {
	.site-footer__top {
		grid-template-columns: 1fr;
		grid-template-areas: "brand" "menus" "newsletter";
		gap: 48px;
	}

	.site-footer__menus-row {
		gap: 40px 64px;
	}

	.site-footer__newsletter {
		max-width: 449px;
		/* Clip only the embed's outer padding, keeping the fields full width. */
		overflow: clip;
	}

	.site-footer__newsletter-title {
		padding-inline-start: 0;
	}

	.site-footer__embed {
		/* HubSpot retains 40px on both sides even at mobile widths. */
		width: calc(100% + 2 * var(--footer-hubspot-padding));
		margin-inline: calc(-1 * var(--footer-hubspot-padding));
	}

	.site-footer {
		background-position: right 32px bottom 100px;
	}
}

/* iPad — 2 menus per row */
@media (max-width: 1024px) {
	.site-footer__menus-row {
		flex-wrap: wrap;
		gap: 40px 60px;
	}

	.site-footer__col {
		flex: 0 0 calc(50% - 30px);
	}
}

/* Mobile — 1 menu per row */
@media (max-width: 768px) {
	.site-footer {
		background-image: none;
	}

	.site-footer__inner {
		padding-inline: 20px;
		padding-top: 30px;
	}

	.site-footer__top {
		gap: 64px;
		padding-block: 0 1.5rem;
	}

	.site-footer__body {
		background: url('../../images/illustrations/illstration-butterfly.webp') no-repeat right 20px top 230px / 145px auto;
	}

	.site-footer__newsletter-title {
		margin-bottom: 16px;
	}

	.site-footer__menus-row {
		flex-direction: column;
		gap: 64px;
	}

	.site-footer__col {
		flex: 0 0 auto;
	}

	.site-footer__col:not(:last-child) .site-footer__col-title {
		margin-bottom: 24px;
	}

	.site-footer__col:not(:last-child) .site-footer__col-list {
		gap: 6px;
	}

	.site-footer__col:not(:last-child) .site-footer__col-list a {
		display: flex;
		align-items: center;
		min-height: 29px;
	}

	.site-footer__bottom {
		flex-direction: column;
		align-items: flex-start;
		gap: 30px;
	}

	.site-footer__credit {
		order: -1;
	}
}
