/*
 * ANALYTICS-01 — consent banner and footer "Cookie settings" control.
 * Markup: vu-core/inc/analytics-consent.php. Uses the child theme's
 * design tokens where present, with literal fallbacks so the banner
 * stays usable under any theme.
 */

/*
 * Dimmed backdrop over the page while the banner is modal. It blocks
 * pointer input; the script makes the page itself inert.
 * Stacking: above the sticky header and mobile action bar (400), below
 * nothing the visitor can open while the page is inert.
 */
.vu-consent-backdrop {
	position: fixed;
	inset: 0;
	z-index: 99998;
	background: rgba(var(--vu-color-bg-rgb, 20, 22, 24), .75);
}

.vu-consent-backdrop[hidden] {
	display: none !important;
}

/* No page scrolling behind the modal banner. */
html.vu-consent-locked,
html.vu-consent-locked body {
	overflow: hidden;
}

.vu-consent {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 99999;
	box-sizing: border-box;
	max-height: 100vh;
	max-height: 100dvh;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 16px var(--vu-gutter, 20px) calc(16px + env(safe-area-inset-bottom, 0px));
	background: var(--vu-color-white, #F2F1EF);
	border-top: 3px solid var(--vu-color-red, #C41E24);
	box-shadow: 0 -8px 24px rgba(0, 0, 0, .35);
	color: var(--vu-color-bg, #141618);
	font-family: var(--vu-font-body, sans-serif);
	font-size: var(--vu-text-base, .875rem);
	line-height: 1.5;
}

.vu-consent[hidden],
.vu-consent-settings[hidden],
.vu-consent [hidden] {
	display: none !important;
}

.vu-consent:focus {
	outline: none;
}

.vu-consent:focus-visible {
	outline: 2px solid var(--vu-color-bg, #141618);
	outline-offset: -4px;
}

.vu-consent__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 24px;
	max-width: var(--vu-container-max, 1280px);
	margin: 0 auto;
}

.vu-consent__label,
.vu-consent__text,
.vu-consent__status {
	flex: 1 1 100%;
	margin: 0;
}

.vu-consent__label {
	font-weight: 600;
}

.vu-consent__text {
	flex: 1 1 32rem;
	color: var(--vu-color-gray-dark, #5A5C60);
}

.vu-consent__text a {
	color: var(--vu-color-bg, #141618);
	text-decoration: underline;
}

.vu-consent__status {
	font-weight: 600;
}

.vu-consent__actions {
	display: flex;
	flex: 0 0 auto;
	gap: 12px;
}

/* Accept and Refuse share one style: equal prominence by design. */
.vu-consent__button {
	min-width: 8.5rem;
	min-height: 44px;
	padding: 10px 20px;
	border: 2px solid var(--vu-color-bg, #141618);
	border-radius: var(--vu-radius, 4px);
	background: transparent;
	color: var(--vu-color-bg, #141618);
	font-family: inherit;
	font-size: var(--vu-text-md, .9375rem);
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
}

.vu-consent__button:hover {
	background: var(--vu-color-bg, #141618);
	color: var(--vu-color-white, #F2F1EF);
}

.vu-consent__button:focus-visible {
	outline: 2px solid var(--vu-color-red, #C41E24);
	outline-offset: 2px;
}

/* Shown only when an existing choice is reopened: secondary, text style. */
.vu-consent__close {
	flex: 0 0 auto;
	min-height: 44px;
	padding: 10px 4px;
	border: 0;
	background: none;
	color: var(--vu-color-gray-dark, #5A5C60);
	font-family: inherit;
	font-size: var(--vu-text-base, .875rem);
	text-decoration: underline;
	cursor: pointer;
}

.vu-consent__close:hover {
	color: var(--vu-color-bg, #141618);
}

.vu-consent__close:focus-visible {
	outline: 2px solid var(--vu-color-bg, #141618);
	outline-offset: 2px;
}

@media (max-width: 640px) {
	.vu-consent__actions {
		flex: 1 1 100%;
	}

	.vu-consent__button {
		flex: 1 1 0;
		min-width: 0;
	}

	.vu-consent__close {
		margin: -8px auto 0;
	}
}

/*
 * Small or short screens: the panel is a column that never exceeds the
 * viewport; only the text scrolls, so both buttons always stay visible.
 */
@media (max-width: 640px), (max-height: 520px) {
	.vu-consent {
		display: flex;
		flex-direction: column;
		overflow: hidden;
	}

	.vu-consent__inner {
		flex: 1 1 auto;
		flex-direction: column;
		flex-wrap: nowrap;
		align-items: stretch;
		min-height: 0;
		width: 100%;
	}

	.vu-consent__label,
	.vu-consent__status,
	.vu-consent__actions,
	.vu-consent__close {
		flex: 0 0 auto;
	}

	.vu-consent__text {
		flex: 0 1 auto;
		min-height: 0;
		overflow-y: auto;
	}
}

/* Footer control: looks like the neighbouring bottom-footer links. */
.vu-consent-settings {
	margin: .25rem 0 0;
	font-family: var(--vu-font-body, sans-serif);
	font-size: .875rem;
	line-height: 1.6;
}

.vu-consent-settings__button {
	padding: 0;
	border: 0;
	background: none;
	color: var(--vu-color-gray, #9A9CA0);
	font: inherit;
	text-decoration: none;
	cursor: pointer;
}

.vu-consent-settings__button:hover,
.vu-consent-settings__button:focus {
	color: var(--vu-color-white, #F2F1EF);
}

.vu-consent-settings__button:focus-visible {
	outline: 2px solid var(--vu-color-white, #F2F1EF);
	outline-offset: 2px;
}
