/**
 * Vibrant Site Footer - Frontend Styles
 *
 * Mobile first. The column layout starts at 900px.
 *
 * @author  Accent - https://accentinteractive.nl
 * @package Vibrant
 * @since   1.0.0
 */

/* ==========================================================================
   Footer
   ========================================================================== */

.wp-block-vibrant-site-footer {
	/* Colors – theme presets with the design system as fallback. */
	--vb-ft-bg: var(--wp--preset--color--cream-50, #FBF9F3);
	--vb-ft-border: var(--wp--preset--color--green-200, #DFE5E0);
	--vb-ft-text: var(--wp--preset--color--green-900, #1D261F);
	--vb-ft-text-muted: var(--wp--preset--color--green-700, #525F55);
	--vb-ft-accent: var(--wp--preset--color--terracotta, #A23E2B);
	--vb-ft-action: var(--wp--preset--color--green-800, #2B4231);
	--vb-ft-mark-bg: var(--wp--preset--color--green-800, #2B4231);
	--vb-ft-mark-icon: var(--wp--preset--color--white, #FFFFFF);

	/* Typography */
	--vb-ft-font-display: var(--wp--preset--font-family--fraunces, "Fraunces", Georgia, serif);
	--vb-ft-font-body: var(--wp--preset--font-family--sora, "Sora", sans-serif);

	/* Layout */
	--vb-ft-max-width: 1280px;
	--vb-ft-gap: 40px;
	--vb-ft-columns-gap: 32px;
	--vb-ft-column-gap: 12px;
	--vb-ft-mark-size: 38px;

	box-sizing: border-box;
	padding: 48px 20px 32px;
	background: var(--vb-ft-bg);
	border-top: 1px solid var(--vb-ft-border);
	color: var(--vb-ft-text);
}

.wp-block-vibrant-site-footer *,
.wp-block-vibrant-site-footer *::before,
.wp-block-vibrant-site-footer *::after {
	box-sizing: border-box;
}

.vb-footer__inner {
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: var(--vb-ft-gap);
	max-width: var(--vb-ft-max-width);
	margin-inline: auto;
}

/* ==========================================================================
   Columns
   ========================================================================== */

.vb-footer__columns {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--vb-ft-columns-gap);
}

.vb-footer__brand {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 16px;
	width: 100%;
	min-width: 0;
}

/* Logo lockup, same build as the header. */
.wp-block-vibrant-site-footer .vb-footer__logo {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
	color: inherit;
	text-decoration: none;
	box-shadow: none;
}

.vb-footer__logo-mark {
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: var(--vb-ft-mark-size);
	height: var(--vb-ft-mark-size);
	background: var(--vb-ft-mark-bg);
	border-radius: 50%;
	color: var(--vb-ft-mark-icon);
}

.vb-footer__logo-mark svg {
	display: block;
	width: 20px;
	height: 20px;
}

.vb-footer__logo-text {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	min-width: 0;
}

.vb-footer__logo-title {
	display: block;
	font-family: var(--vb-ft-font-display);
	font-weight: 900;
	font-size: 1.125rem;
	line-height: 1.22;
	letter-spacing: 0;
	color: var(--vb-ft-text);
}

.vb-footer__logo-subtitle {
	display: block;
	font-family: var(--vb-ft-font-body);
	font-weight: 700;
	font-size: 0.75rem;
	line-height: 1.25;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--vb-ft-accent);
}

.vb-footer__logo-image {
	display: block;
	width: auto;
	max-width: 100%;
	max-height: 48px;
	height: auto;
}

.vb-footer__text {
	margin: 0;
	width: 100%;
	max-width: 340px;
	font-family: var(--vb-ft-font-body);
	font-weight: 400;
	font-size: 0.8125rem;
	line-height: 1.5;
	color: var(--vb-ft-text-muted);
}

.wp-block-vibrant-site-footer .vb-footer__button {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 12px 24px;
	background: transparent;
	border: 1.5px solid var(--vb-ft-action);
	border-radius: 100px;
	font-family: var(--vb-ft-font-body);
	font-weight: 700;
	font-size: 0.875rem;
	line-height: 1.29;
	color: var(--vb-ft-action);
	text-decoration: none;
	box-shadow: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.wp-block-vibrant-site-footer .vb-footer__button:hover,
.wp-block-vibrant-site-footer .vb-footer__button:focus-visible {
	background: var(--vb-ft-action);
	color: var(--vb-ft-bg);
}

/* ==========================================================================
   Menu columns
   ========================================================================== */

.vb-footer__menus {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--vb-ft-columns-gap);
	width: 100%;
}

.vb-footer__column {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: var(--vb-ft-column-gap);
	width: 100%;
	min-width: 0;
}

/* A heading element now, so the theme's h2 sizing has to be overruled. */
.wp-block-vibrant-site-footer .vb-footer__column-heading {
	margin: 0;
	font-family: var(--vb-ft-font-body);
	font-weight: 700;
	font-size: 0.875rem;
	line-height: 1.29;
	color: var(--vb-ft-text);
}

.vb-footer__legal .wp-block-navigation-submenu {
	display: none !important;
}

/*
 * The columns render a core/navigation, which brings its own flex layout and
 * link styling. This strips that back to a plain list in the design system's
 * type, without touching navigations elsewhere on the site.
 */
.vb-footer__column .wp-block-navigation,
.vb-footer__legal .wp-block-navigation {
	font-family: var(--vb-ft-font-body);
	font-size: 0.875rem;
	line-height: 1.29;
}

.vb-footer__column .wp-block-navigation__container {
	gap: 12px;
}

.vb-footer__legal .wp-block-navigation__container {
	flex-wrap: wrap;
	gap: 16px;
}

.wp-block-vibrant-site-footer .wp-block-navigation-item__content {
	padding: 0;
	font-family: var(--vb-ft-font-body);
	font-weight: 400;
	font-size: 0.875rem;
	line-height: 1.29;
	color: var(--vb-ft-text-muted);
	text-decoration: none;
	box-shadow: none;
	transition: color 0.2s ease;
}

.wp-block-vibrant-site-footer .wp-block-navigation-item__content span {
	color: var(--vb-ft-text-muted);
}

.wp-block-vibrant-site-footer .wp-block-navigation-item__content:hover span,
.wp-block-vibrant-site-footer .wp-block-navigation-item__content:focus-visible span {
	color: var(--vb-ft-accent);
	text-decoration: underline;
}

.wp-block-vibrant-site-footer .current-menu-item > .wp-block-navigation-item__content,
.wp-block-vibrant-site-footer .current_page_item > .wp-block-navigation-item__content {
	color: var(--vb-ft-accent);
}

/*
 * A footer column is a flat list. Any submenu in the chosen menu is shown
 * inline underneath its parent instead of as a floating dropdown.
 */
.wp-block-vibrant-site-footer .wp-block-navigation .has-child:not(.open-always) > .wp-block-navigation__submenu-container {
	position: static;
	width: auto;
	height: auto;
	min-width: 0;
	padding: 0;
	margin: var(--vb-ft-column-gap) 0 0 0;
	gap: var(--vb-ft-column-gap);
	overflow: visible;
	opacity: 1;
	visibility: visible;
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

.wp-block-vibrant-site-footer .wp-block-navigation .wp-block-navigation__submenu-icon {
	display: none;
}

/*
 * The child theme styles core submenu dropdowns as floating panels. Inside a
 * footer column they are an inline list, so the row styling from there is
 * taken back off with one class more.
 */
.wp-block-vibrant-site-footer .wp-block-navigation .has-child .wp-block-navigation__submenu-container > .wp-block-navigation-item > .wp-block-navigation-item__content {
	padding: 0;
	border-radius: 0;
	font-size: 0.875rem;
	line-height: 1.29;
	color: var(--vb-ft-text-muted);
}

.wp-block-vibrant-site-footer .wp-block-navigation .has-child .wp-block-navigation__submenu-container > .wp-block-navigation-item > .wp-block-navigation-item__content:hover,
.wp-block-vibrant-site-footer .wp-block-navigation .has-child .wp-block-navigation__submenu-container > .wp-block-navigation-item > .wp-block-navigation-item__content:focus-visible {
	background: transparent;
	color: var(--vb-ft-accent);
	text-decoration: underline;
}

/* ==========================================================================
   Bottom row
   ========================================================================== */

.vb-footer__divider {
	width: 100%;
	height: 1px;
	background: var(--vb-ft-border);
}

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

/*
 * Carries the block class so the type stays put when the global paragraph
 * styles load after this file; without it the copyright falls back to the
 * body size and reads bigger than the legal menu next to it.
 */
.wp-block-vibrant-site-footer .vb-footer__copyright {
	margin: 0;
	font-family: var(--vb-ft-font-body);
	font-weight: 400;
	font-size: 0.6875rem;
	line-height: 1.27;
	color: var(--vb-ft-text-muted);
}

.vb-footer__legal .wp-block-navigation-item__content {
	font-size: 0.6875rem;
	line-height: 1.27;
}

@media (prefers-reduced-motion: reduce) {

	.wp-block-vibrant-site-footer .vb-footer__button,
	.wp-block-vibrant-site-footer .wp-block-navigation-item__content {
		transition: none;
	}
}

/* ==========================================================================
   Tablet
   ========================================================================== */

@media (min-width: 600px) {

	.vb-footer__menus {
		flex-direction: row;
		flex-wrap: wrap;
		gap: 32px 48px;
	}

	.vb-footer__column {
		width: auto;
		min-width: 180px;
	}
}

/* ==========================================================================
   Desktop
   ========================================================================== */

@media (min-width: 900px) {

	.wp-block-vibrant-site-footer {
		--vb-ft-gap: 64px;
		--vb-ft-columns-gap: 48px;
		--vb-ft-column-gap: 16px;
		--vb-ft-mark-size: 48px;

		padding: 80px clamp(24px, 5.5vw, 80px) 40px;
	}

	.vb-footer__columns {
		flex-direction: row;
		align-items: flex-start;
	}

	.vb-footer__brand {
		flex: 0 0 auto;
		gap: 20px;
		width: 340px;
	}

	.vb-footer__logo-mark svg {
		width: 28px;
		height: 28px;
	}

	.vb-footer__logo-title {
		font-size: 1.25rem;
		line-height: 1.25;
	}

	/* Pushes the menu columns to the right, like the spacer in the design. */
	.vb-footer__menus {
		flex: 0 1 auto;
		flex-wrap: nowrap;
		gap: 48px;
		width: auto;
		margin-left: auto;
	}

	.vb-footer__column {
		width: 200px;
		min-width: 0;
	}

	.vb-footer__text {
		font-size: 0.875rem;
	}

	.vb-footer__bottom {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		margin-top: -1.25rem;
	}

	/* Same size and line height as the legal menu to its right. */
	.wp-block-vibrant-site-footer .vb-footer__copyright {
		font-size: 0.8125rem;
		line-height: 1.23;
	}

	.vb-footer__legal .wp-block-navigation__container {
		flex-wrap: nowrap;
		gap: 24px;
	}

	.vb-footer__legal .wp-block-navigation-item__content {
		font-size: 0.8125rem;
		line-height: 1.23;
	}
}
