/*
 * Site footer: brand | three link columns | help, then the bottom bar with the legal buttons.
 * Desktop (>= 900px): columns always visible, toggle buttons hidden. Mobile: the three columns are accordions
 * (assets/js/components/accordion.js, closed by default), the help block stays open, bottom bar stacked.
 */
.cw-footer {
	margin-top: 72px;
	border-top: 1px solid var(--cw-color-line);
	background: var(--cw-color-surface);
	color: var(--cw-color-ink);
}

.cw-footer__grid {
	display: grid;
	grid-template-columns: 1.4fr 1fr 1fr 1fr 1.2fr;
	align-items: start;
	gap: 40px;
	padding: 56px 0 40px;
}

/* The wrapper only exists to host the accordion behavior; on desktop its columns are grid items. */
.cw-footer__columns {
	display: contents;
}

.cw-footer__brand-link {
	display: inline-block;
}

/* Two classes: must beat `.woocommerce-page img` (0,1,1) of woocommerce-layout.css. */
.cw-footer .cw-footer__logo {
	display: block;
	width: auto;
	max-width: 100%;
	height: 64px;
	object-fit: contain;
}

.cw-footer__site-name {
	display: block;
	font-size: 22px;
	line-height: 1.2;
}

.cw-footer__tagline {
	max-width: 260px;
	margin: 14px 0 0;
	color: var(--cw-color-text-2);
	font-size: 14px;
	line-height: 1.6;
}

.cw-footer__instagram {
	display: grid;
	width: 40px;
	height: 40px;
	margin-top: 16px;
	place-items: center;
	border: 1px solid var(--cw-color-line-strong);
	border-radius: var(--cw-radius);
	color: var(--cw-color-ink);
	text-decoration: none;
	transition: border-color .15s ease;
}

.cw-footer__instagram:hover,
.cw-footer__instagram:focus-visible {
	border-color: var(--cw-color-ink);
	text-decoration: none;
}

.cw-footer__instagram .cw-icon {
	width: 20px;
	height: 20px;
}

/* Column titles: h2 elements with a 15px visual size. */
.cw-footer__title {
	margin: 0 0 4px;
	color: var(--cw-color-ink);
	font-family: inherit;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0;
	line-height: 1.3;
}

.cw-footer .cw-footer__toggle {
	display: none;
}

/* wp_nav_menu() markup (or the link-list fallback). */
.cw-footer__menu {
	display: grid;
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cw-footer__menu a {
	color: var(--cw-color-text-2);
	font-size: 14px;
	text-decoration: none;
	transition: color .2s ease;
}

.cw-footer__menu a:hover,
.cw-footer__menu a:focus-visible {
	color: var(--cw-color-ink);
	text-decoration: underline;
}

/* Closed panels are only a mobile concept: on desktop the content is always visible. It needs !important to beat the
   global [hidden] rule of base.css (documented in DESIGN-SYSTEM §4). */
@media (min-width: 900px) {
	.cw-footer__panel[hidden] {
		display: block !important;
	}
}

.cw-footer__help-text {
	margin: 0 0 4px;
	color: var(--cw-color-text-2);
	font-size: 14px;
	line-height: 1.6;
}

.cw-footer__contact {
	margin-top: 12px;
}

.cw-footer__contact .cw-icon {
	width: 24px;
	height: 24px;
}

.cw-footer__bottom {
	border-top: 1px solid var(--cw-color-line-soft);
}

.cw-footer__bottom-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	padding-block: 20px;
}

.cw-footer__disclaimer {
	min-width: 0;
	margin: 0;
	color: var(--cw-color-muted);
	font-size: 12px;
	line-height: 1.5;
}

.cw-footer__legal-actions {
	display: flex;
	flex: 0 0 auto;
	flex-wrap: wrap;
	gap: 10px;
}

@media (max-width: 1100px) and (min-width: 900px) {
	.cw-footer__grid {
		gap: 28px;
	}
}

@media (max-width: 899px) {
	.cw-footer {
		margin-top: 48px;
	}

	.cw-footer__grid {
		grid-template-columns: 1fr;
		gap: 0;
		padding: 32px 0 8px;
	}

	.cw-footer__brand {
		padding-bottom: 24px;
	}

	.cw-footer__columns {
		display: block;
		border-top: 1px solid var(--cw-color-line-soft);
	}

	.cw-footer__column {
		display: block;
		border-bottom: 1px solid var(--cw-color-line-soft);
	}

	.cw-footer__title--static {
		display: none;
	}

	.cw-footer .cw-footer__toggle {
		display: flex;
		width: 100%;
		min-height: 52px;
		align-items: center;
		justify-content: space-between;
		gap: 12px;
		margin: 0;
		padding: 0;
		border: 0;
		background: transparent;
		color: var(--cw-color-ink);
		cursor: pointer;
		text-align: left;
	}

	.cw-footer .cw-footer__toggle .cw-footer__title {
		margin: 0;
	}

	.cw-footer__toggle-caret {
		width: 18px;
		height: 18px;
		color: var(--cw-color-muted);
		transition: transform .2s ease;
	}

	.cw-footer__toggle[aria-expanded="true"] .cw-footer__toggle-caret {
		transform: rotate(180deg);
	}

	.cw-footer__panel[hidden] {
		display: none;
	}

	.cw-footer__panel {
		padding-bottom: 12px;
	}

	.cw-footer__menu {
		gap: 0;
	}

	.cw-footer__menu a {
		display: flex;
		min-height: 44px;
		align-items: center;
	}

	.cw-footer__help {
		padding-block: 24px 16px;
	}

	.cw-footer__contact {
		width: 100%;
	}

	.cw-footer__bottom-row {
		flex-direction: column;
		align-items: stretch;
		gap: 16px;
	}

	.cw-footer__legal-actions {
		flex-direction: column;
	}

	.cw-footer__legal-actions .cw-button {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.cw-footer__toggle-caret {
		transition: none;
	}
}
