/*
 * Highland Consent bar.
 * The accent comes from the site with no setup: settings override, then
 * Elementor global colours, then block theme presets, then a neutral default.
 */

.hc-bar {
	--hc-accent: var(--hc-accent-override,
		var(--e-global-color-accent,
		var(--e-global-color-primary,
		var(--wp--preset--color--primary, #1f2937))));
	--hc-font: inherit;
	--hc-bg: #111827;
	--hc-fg: #f9fafb;
	--hc-edge: rgba(255, 255, 255, 0.6);

	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	/* Elementor popups sit at 9999 and must stay above the bar. */
	z-index: 9990;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px 24px;
	margin: 0;
	padding: 10px 16px;
	background: var(--hc-bg);
	color: var(--hc-fg);
	font-family: var(--hc-font);
	font-size: 14px;
	line-height: 1.45;
	box-shadow: 0 -1px 8px rgba(0, 0, 0, 0.18);
	animation: hc-fade 0.2s ease-out;
}

.hc-bar--light {
	--hc-bg: #ffffff;
	--hc-fg: #111827;
	--hc-edge: rgba(0, 0, 0, 0.6);
}

/* display:flex would otherwise beat the hidden attribute. */
.hc-bar[hidden] {
	display: none;
}

.hc-bar:focus {
	outline: none;
}

.hc-bar:focus-visible {
	outline: 2px solid var(--hc-fg);
	outline-offset: -4px;
}

.hc-bar .hc-bar__text {
	margin: 0;
	padding: 0;
	color: inherit;
	font-size: 14px;
}

.hc-bar .hc-bar__link,
.hc-bar .hc-bar__link:hover,
.hc-bar .hc-bar__link:visited {
	color: inherit;
	text-decoration: underline;
}

.hc-bar .hc-bar__actions {
	display: flex;
	flex: 0 0 auto;
	gap: 8px;
}

/* Both buttons share this one rule, so they cannot differ in size or weight. */
.hc-bar .hc-bar__button,
.hc-bar .hc-bar__button:hover,
.hc-bar .hc-bar__button:focus,
.hc-bar .hc-bar__button:active {
	box-sizing: border-box;
	min-width: 88px;
	min-height: 36px;
	margin: 0;
	padding: 6px 16px;
	border: 1px solid var(--hc-edge);
	border-radius: 4px;
	background: var(--hc-accent);
	/* The script replaces this with black or white after measuring the accent. */
	color: #ffffff;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: normal;
	text-transform: none;
	text-decoration: none;
	box-shadow: none;
	cursor: pointer;
}

.hc-bar .hc-bar__button:hover {
	filter: brightness(1.12);
}

.hc-bar .hc-bar__button:focus-visible,
.hc-bar .hc-bar__link:focus-visible {
	outline: 2px solid var(--hc-fg);
	outline-offset: 2px;
}

@media (max-width: 640px) {
	.hc-bar {
		flex-direction: column;
		align-items: stretch;
		padding: 12px 16px;
	}

	.hc-bar .hc-bar__button,
	.hc-bar .hc-bar__button:hover,
	.hc-bar .hc-bar__button:focus,
	.hc-bar .hc-bar__button:active {
		flex: 1 1 0;
		min-height: 44px;
	}
}

@keyframes hc-fade {
	from {
		opacity: 0;
	}

	to {
		opacity: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hc-bar {
		animation: none;
	}
}

@media print {
	.hc-bar {
		display: none;
	}
}
