/**
 * Cookie banner: non-blocking bar at the bottom, aligned with the page panels.
 * Colours and fonts come from the BlackRaven theme presets, with fallbacks for other themes.
 */

.br-consent {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 100;
	box-sizing: border-box;
	max-width: 960px;
	max-height: 100vh;
	max-height: 100dvh;
	overflow-y: auto;
	margin: 0 auto;
	padding: 16px 56px 16px 20px;
	border: 1px solid var(--wp--preset--color--border, #414345);
	border-bottom: 0;
	background: var(--br-dots, none), var(--wp--preset--color--panel-dark, #1e1f21);
	box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.6);
	color: var(--wp--preset--color--contrast, #d6dadd);
	font-size: 15px;
	line-height: 1.5;
}

.br-consent[hidden] {
	display: none;
}

.br-consent__text {
	margin: 0 0 12px;
}

.br-consent__text a {
	color: var(--wp--preset--color--accent, #ffeb9e);
}

/* Preferences: one row per category, description under the switch. */
.br-consent__prefs {
	margin: 0 0 14px;
	padding: 0;
	border: 0;
}

.br-consent__prefs[hidden] {
	display: none;
}

.br-consent__legend {
	margin: 0 0 6px;
	padding: 0;
	color: var(--wp--preset--color--accent-light, #fff9e5);
	font-family: var(--wp--preset--font-family--abel, inherit);
	font-size: 16px;
	text-transform: uppercase;
}

.br-consent__categories {
	margin: 0;
	padding: 0;
	list-style: none;
}

.br-consent__category {
	padding: 10px 0;
	border-top: 1px solid var(--wp--preset--color--border, #414345);
}

.br-consent__label {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 44px;
	color: var(--wp--preset--color--accent-light, #fff9e5);
	font-weight: 700;
	cursor: pointer;
}

.br-consent__label:has(:disabled) {
	cursor: default;
}

/* Native checkbox drawn as a switch: keeps keyboard and screen-reader behaviour. */
.br-consent__label input {
	position: relative;
	flex-shrink: 0;
	width: 40px;
	height: 22px;
	margin: 0;
	border: 1px solid var(--wp--preset--color--border, #414345);
	border-radius: 11px;
	background: #2f3133;
	box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.6);
	appearance: none;
	cursor: inherit;
	transition: background 0.15s;
}

.br-consent__label input::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: var(--wp--preset--color--contrast, #d6dadd);
	transition: transform 0.15s;
}

.br-consent__label input:checked {
	border-color: var(--wp--preset--color--accent, #ffeb9e);
	background: var(--wp--preset--color--accent-dark, #4b4632);
}

.br-consent__label input:checked::after {
	background: var(--wp--preset--color--accent, #ffeb9e);
	transform: translateX(18px);
}

.br-consent__label input:disabled {
	opacity: 0.6;
}

.br-consent__always {
	margin-left: 8px;
	color: var(--wp--preset--color--muted, #8a8c8c);
	font-size: 13px;
	text-transform: uppercase;
}

.br-consent__desc {
	margin: 2px 0 0 50px;
	font-size: 14px;
}

@media (prefers-reduced-motion: reduce) {
	.br-consent__label input,
	.br-consent__label input::after {
		transition: none;
	}
}

.br-consent__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

/* Same look as the theme's search button / menubar tabs; 44px targets. */
.br-consent__button {
	box-sizing: border-box;
	min-width: 44px;
	min-height: 44px;
	margin: 0;
	padding: 0 16px;
	border: 1px solid rgba(0, 0, 0, 0.6);
	border-radius: 2px;
	background: linear-gradient(180deg, #46484a 0%, #3c3e40 45%, #2f3133 100%);
	box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 1px 1px rgba(0, 0, 0, 0.9);
	color: var(--wp--preset--color--accent-light, #fff9e5);
	font-family: var(--wp--preset--font-family--abel, inherit);
	font-size: 16px;
	line-height: 22px;
	text-shadow: 0 1px 0 rgba(0, 0, 0, 0.5);
	text-transform: uppercase;
	cursor: pointer;
}

.br-consent__button:hover,
.br-consent__button:focus-visible {
	background: linear-gradient(180deg, #4b4d4f 0%, #404244 45%, #333537 100%);
	color: #fff;
	text-shadow: 0 0 6px rgba(255, 144, 0, 0.55), 0 0 1px rgba(255, 200, 120, 0.6);
}

.br-consent__close {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--wp--preset--color--contrast, #d6dadd);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

.br-consent__close:hover {
	color: var(--wp--preset--color--accent, #ffeb9e);
}

.br-consent__button[hidden] {
	display: none;
}

.br-consent__button:focus-visible,
.br-consent__close:focus-visible,
.br-consent__label input:focus-visible {
	outline: 2px solid var(--wp--preset--color--accent, #ffeb9e);
	outline-offset: 2px;
}

@media (max-width: 767px) {
	.br-consent {
		padding: 12px 52px 12px 15px;
	}

	.br-consent__desc {
		margin-left: 0;
	}
}
