/*
 * Complianz cookie banner in Casa Roni colours. Complianz prints its colours as --cmplz_* custom
 * properties on :root (from its banner settings in the database); setting them on the banner itself
 * overrides those, so the look lives here, in git, and survives a settings reset.
 */

.cmplz-cookiebanner,
#cmplz-manage-consent .cmplz-manage-consent {
	--cmplz_banner_background_color: var(--wp--preset--color--ink);
	--cmplz_banner_border_color: var(--wp--preset--color--gold);
	--cmplz_banner_border_radius: var(--cr-radius);
	--cmplz_text_color: var(--wp--preset--color--cream);
	--cmplz_hyperlink_color: var(--wp--preset--color--butter);
	--cmplz_text_font_size: 14px;
	--cmplz_link_font_size: 13px;
	--cmplz_button_font_size: 14px;
	--cmplz_button_border_radius: var(--cr-radius);
	--cmplz_button_accept_background_color: var(--wp--preset--color--gold);
	--cmplz_button_accept_border_color: var(--wp--preset--color--gold);
	--cmplz_button_accept_text_color: var(--wp--preset--color--ink);
	--cmplz_button_deny_background_color: transparent;
	--cmplz_button_deny_border_color: var(--wp--preset--color--cream);
	--cmplz_button_deny_text_color: var(--wp--preset--color--cream);
	--cmplz_button_settings_background_color: transparent;
	--cmplz_button_settings_border_color: transparent;
	--cmplz_button_settings_text_color: var(--wp--preset--color--butter);
	--cmplz_category_header_always_active_color: var(--wp--preset--color--gold);
	--cmplz_slider_active_color: var(--wp--preset--color--gold);
	--cmplz_slider_inactive_color: var(--wp--preset--color--stone);
	--cmplz_slider_bullet_color: var(--wp--preset--color--ink);
	font-family: var(--cr-font-sans);
}

.cmplz-cookiebanner {
	border-left: 3px solid var(--wp--preset--color--gold);
	box-shadow: 0 18px 40px rgb(0 0 0 / 0.35);
}

/* Visitors reopen the banner from "Cookie settings" in the footer, so Complianz's floating tab isn't needed. */
#cmplz-manage-consent {
	display: none;
}

body .cmplz-cookiebanner .cmplz-header .cmplz-title {
	font-family: var(--cr-font-serif);
	font-size: 20px;
	color: var(--wp--preset--color--butter);
}

/* "View preferences" rows: Complianz's light grey rows and black arrows vanish on the ink banner. */
body .cmplz-cookiebanner .cmplz-categories .cmplz-category {
	background-color: rgb(255 255 255 / 0.07);
	color: var(--wp--preset--color--cream);
}

body .cmplz-cookiebanner .cmplz-categories .cmplz-category .cmplz-category-header .cmplz-category-title {
	color: var(--wp--preset--color--cream);
}

body .cmplz-cookiebanner .cmplz-categories .cmplz-category .cmplz-category-header .cmplz-category-toggle,
body .cmplz-cookiebanner .cmplz-categories .cmplz-category .cmplz-icon svg {
	color: var(--wp--preset--color--cream);
	fill: currentColor;
}

body .cmplz-cookiebanner .cmplz-buttons .cmplz-btn {
	font-weight: 600;
}

/*
 * Phones: a slim bar (max 70px) – one line of text and three small buttons. "Manage" adds
 * .cmplz-categories-visible, which brings back the full panel for anyone who wants the details.
 */
@media (max-width: 768px) {
	body .cmplz-cookiebanner:not(.cmplz-categories-visible) {
		top: auto;
		bottom: 0;
		left: 0;
		right: 0;
		width: 100%;
		max-width: 100%;
		max-height: 70px;
		margin: 0;
		padding: 8px 12px;
		gap: 6px;
		grid-template-rows: auto auto; /* Complianz's minmax(0, 1fr) squeezes the text row to nothing here. */
		align-content: center;
		transform: none;
		overflow: hidden;
		border: 0;
		border-top: 2px solid var(--wp--preset--color--gold);
		border-radius: 0;
	}

	body .cmplz-cookiebanner:not(.cmplz-categories-visible) :is(.cmplz-header, .cmplz-divider, .cmplz-links, .cmplz-documents) {
		display: none;
	}

	body .cmplz-cookiebanner:not(.cmplz-categories-visible) .cmplz-body,
	body .cmplz-cookiebanner:not(.cmplz-categories-visible) .cmplz-message {
		max-height: none;
		margin: 0;
		padding: 0;
		overflow: visible;
		font-size: 13px;
		line-height: 16px;
		text-align: left;
	}

	body .cmplz-cookiebanner:not(.cmplz-categories-visible) .cmplz-buttons {
		display: flex;
		flex-direction: row;
		gap: 6px;
		margin: 0;
		padding: 0;
	}

	body .cmplz-cookiebanner:not(.cmplz-categories-visible) .cmplz-buttons .cmplz-btn {
		flex: 1 1 0;
		min-width: 0;
		min-height: 0;
		height: 32px;
		margin: 0;
		padding: 0 8px;
		font-size: 13px;
	}
}

body .cmplz-cookiebanner .cmplz-buttons .cmplz-btn:focus-visible,
body .cmplz-cookiebanner .cmplz-close:focus-visible {
	outline: 2px solid var(--wp--preset--color--butter);
	outline-offset: 2px;
}
