/* ═══════════════════════════════════════════════════════════
   COMPLIANZ COOKIE BANNER – Terracore branding.
   Complianz sets its colours as CSS variables on :root (generated
   from its admin settings). Redefining them on the banner itself wins
   over :root, so these brand values apply whatever is picked in
   Complianz → Consent Banner, and they travel with the theme to every
   environment. Loaded only while Complianz is active (inc/enqueue.php).
   Complianz's stylesheet loads after this one, so the rules below double
   the .cmplz-cookiebanner class to outrank its selectors.
   ═══════════════════════════════════════════════════════════ */

.cmplz-cookiebanner,
#cmplz-manage-consent {
	--cmplz_banner_background_color: var(--color-offwhite);
	--cmplz_banner_border_color: var(--color-line);
	--cmplz_banner_border_width: 1px;
	--cmplz_banner_border_radius: 0;
	--cmplz_text_color: var(--color-black);
	--cmplz_hyperlink_color: var(--color-green-dark);
	--cmplz_title_font_size: 16px;
	--cmplz_text_font_size: 13px;
	--cmplz_link_font_size: 12px;
	--cmplz_category_body_font_size: 12px;
	--cmplz_category_header_title_font_size: 13px;
	--cmplz_category_header_active_font_size: 11px;
	--cmplz_category_header_always_active_color: var(--color-green-dark);
	--cmplz_button_font_size: var(--text-button);
	--cmplz_button_border_radius: 0;
	--cmplz_button_accept_background_color: var(--color-green-dark);
	--cmplz_button_accept_border_color: var(--color-green-dark);
	--cmplz_button_accept_text_color: var(--color-offwhite);
	--cmplz_button_deny_background_color: transparent;
	--cmplz_button_deny_border_color: var(--color-orange);
	--cmplz_button_deny_text_color: var(--color-green-dark);
	--cmplz_button_settings_background_color: transparent;
	--cmplz_button_settings_border_color: var(--color-orange);
	--cmplz_button_settings_text_color: var(--color-green-dark);
	--cmplz_slider_active_color: var(--color-green);
	--cmplz_slider_inactive_color: rgba(24, 14, 2, 0.35);
	--cmplz_slider_bullet_color: var(--color-white);
	font-family: var(--font-body);
	letter-spacing: 0.01em;
}

/* Card: square corners, green top rule, soft shadow (like the site cards). */
.cmplz-cookiebanner.cmplz-cookiebanner {
	border-top: 3px solid var(--color-green);
	box-shadow: 0 12px 32px rgba(24, 14, 2, 0.14);
}

/* Title: brand heading style. */
.cmplz-cookiebanner.cmplz-cookiebanner .cmplz-header .cmplz-title {
	color: var(--color-green-dark);
	font-weight: 600;
	letter-spacing: var(--ls-base);
	text-transform: uppercase;
}

.cmplz-cookiebanner.cmplz-cookiebanner .cmplz-close {
	color: var(--color-green-dark);
}

.cmplz-cookiebanner.cmplz-cookiebanner .cmplz-close svg path {
	fill: currentColor;
}

.cmplz-cookiebanner.cmplz-cookiebanner .cmplz-close:hover,
.cmplz-cookiebanner.cmplz-cookiebanner .cmplz-close:focus-visible {
	color: var(--color-orange);
}

/* Links in the message and under the buttons. */
.cmplz-cookiebanner.cmplz-cookiebanner .cmplz-message a,
.cmplz-cookiebanner.cmplz-cookiebanner .cmplz-links .cmplz-link {
	text-underline-offset: 2px;
	transition: color var(--transition-base);
}

.cmplz-cookiebanner.cmplz-cookiebanner .cmplz-message a:hover,
.cmplz-cookiebanner.cmplz-cookiebanner .cmplz-links .cmplz-link:hover {
	color: var(--color-orange);
}

/* Buttons: the site's .btn – uppercase, square, orange outline; Accept filled green. */
.cmplz-cookiebanner.cmplz-cookiebanner .cmplz-buttons .cmplz-btn {
	font-family: inherit;
	font-weight: 500;
	letter-spacing: var(--ls-base);
	text-transform: uppercase;
	transition: background-color var(--transition-base), border-color var(--transition-base), color var(--transition-base);
}

.cmplz-cookiebanner.cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-btn:hover,
.cmplz-cookiebanner.cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-btn:focus-visible {
	border-color: var(--color-orange);
	background-color: var(--color-orange);
	color: var(--color-white);
}

.cmplz-cookiebanner.cmplz-cookiebanner .cmplz-buttons .cmplz-btn.cmplz-btn:focus-visible {
	outline: 2px solid var(--color-green-dark);
	outline-offset: 2px;
}

/* Preference categories: light-green rows instead of grey. */
.cmplz-cookiebanner.cmplz-cookiebanner .cmplz-categories .cmplz-category {
	background-color: var(--color-green-light);
}

.cmplz-cookiebanner.cmplz-cookiebanner .cmplz-categories .cmplz-category .cmplz-category-header .cmplz-category-title {
	color: var(--color-green-dark);
	font-weight: 600;
}

.cmplz-cookiebanner.cmplz-cookiebanner .cmplz-categories .cmplz-category .cmplz-category-header .cmplz-always-active {
	text-transform: uppercase;
	letter-spacing: var(--ls-base);
}

.cmplz-cookiebanner.cmplz-cookiebanner .cmplz-categories .cmplz-category .cmplz-icon {
	filter: none;
}

.cmplz-cookiebanner.cmplz-cookiebanner .cmplz-categories .cmplz-category .cmplz-banner-checkbox input.cmplz-consent-checkbox:focus + .cmplz-label::before {
	box-shadow: 0 0 0 2px var(--color-orange);
}

/* ── Cookie icon: reopens the banner ──────────────────────────
   Complianz's own "Manage consent" button, restyled as a small green
   square with a cookie symbol, bottom-left. Complianz shows it only
   after a choice is made (.cmplz-show) and hides it while the banner is
   open (.cmplz-dismissed). The button text stays in the markup as its
   accessible name; font-size 0 just hides it visually. The footer
   "Cookie settings" link does the same job. */
#cmplz-manage-consent .cmplz-manage-consent.cmplz-manage-consent {
	position: fixed;
	z-index: 900;
	right: auto;
	bottom: 16px;
	left: 16px;
	width: 44px;
	min-width: 0;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 0;
	background-color: var(--color-green-dark);
	box-shadow: 0 6px 18px rgba(24, 14, 2, 0.22);
	color: var(--color-white);
	font-size: 0;
	line-height: 0;
	animation: none;
	transition: background-color var(--transition-base), transform var(--transition-base);
}

#cmplz-manage-consent .cmplz-manage-consent.cmplz-manage-consent.cmplz-show {
	display: flex;
	align-items: center;
	justify-content: center;
}

#cmplz-manage-consent .cmplz-manage-consent.cmplz-manage-consent::before {
	content: "";
	width: 22px;
	height: 22px;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a10 10 0 1 0 10 10 3 3 0 0 1-3.6-2.6A3.2 3.2 0 0 1 14.6 5.6 3 3 0 0 1 12 2Zm-3.5 5a1.6 1.6 0 1 1 0 3.2 1.6 1.6 0 0 1 0-3.2Zm6 6a1.6 1.6 0 1 1 0 3.2 1.6 1.6 0 0 1 0-3.2Zm-6.5 3a1.2 1.2 0 1 1 0 2.4 1.2 1.2 0 0 1 0-2.4Zm2.5-4.2a1 1 0 1 1 0 2 1 1 0 0 1 0-2Z'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill-rule='evenodd' d='M12 2a10 10 0 1 0 10 10 3 3 0 0 1-3.6-2.6A3.2 3.2 0 0 1 14.6 5.6 3 3 0 0 1 12 2Zm-3.5 5a1.6 1.6 0 1 1 0 3.2 1.6 1.6 0 0 1 0-3.2Zm6 6a1.6 1.6 0 1 1 0 3.2 1.6 1.6 0 0 1 0-3.2Zm-6.5 3a1.2 1.2 0 1 1 0 2.4 1.2 1.2 0 0 1 0-2.4Zm2.5-4.2a1 1 0 1 1 0 2 1 1 0 0 1 0-2Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

#cmplz-manage-consent .cmplz-manage-consent.cmplz-manage-consent:hover,
#cmplz-manage-consent .cmplz-manage-consent.cmplz-manage-consent:focus-visible {
	background-color: var(--color-orange);
	animation: none;
}

#cmplz-manage-consent .cmplz-manage-consent.cmplz-manage-consent:focus-visible {
	outline: 2px solid var(--color-green-dark);
	outline-offset: 3px;
}

/* Hover label on devices with a mouse: "Cookie settings" slides out. */
@media (hover: hover) {
	#cmplz-manage-consent .cmplz-manage-consent.cmplz-manage-consent::after {
		content: "Cookie settings";
		position: absolute;
		left: calc(100% + 8px);
		top: 50%;
		padding: 7px 12px;
		background: var(--color-black);
		color: var(--color-white);
		font-family: var(--font-body);
		font-size: var(--text-small);
		font-weight: 500;
		line-height: 1;
		letter-spacing: var(--ls-base);
		text-transform: uppercase;
		white-space: nowrap;
		opacity: 0;
		transform: translate(-4px, -50%);
		transition: opacity var(--transition-base), transform var(--transition-base);
		pointer-events: none;
	}

	#cmplz-manage-consent .cmplz-manage-consent.cmplz-manage-consent:hover::after,
	#cmplz-manage-consent .cmplz-manage-consent.cmplz-manage-consent:focus-visible::after {
		opacity: 1;
		transform: translate(0, -50%);
	}
}

@media (min-width: 768px) {
	#cmplz-manage-consent .cmplz-manage-consent.cmplz-manage-consent {
		bottom: 24px;
		left: 24px;
	}
}

@media (prefers-reduced-motion: reduce) {
	#cmplz-manage-consent .cmplz-manage-consent.cmplz-manage-consent,
	#cmplz-manage-consent .cmplz-manage-consent.cmplz-manage-consent::after {
		transition: none;
	}
}
