/**
 * Orbit Consent banner.
 *
 * Selectors repeat their own class (.orbit-btn.orbit-btn) to raise specificity to 0,2,0. A theme rule
 * as ordinary as `.elementor button { background: … }` is 0,1,1 and beats a single class, which on one
 * site painted all three actions in the theme's accent instead of the configured one. Repeating the
 * class wins without !important and without tying the button to a container, so the shortcode button
 * still works on a policy page outside the banner.
 *
 * Core design language, no framework. BEM with an orbit- prefix so nothing here can collide with
 * a theme, and every rule scoped under a plugin class so a theme cannot reach in either.
 *
 * The button rules are the compliance-critical part. Everything visual lives on .orbit-btn; the
 * three action modifiers may only set colour, and by default they resolve to the same values. A
 * filled Accept beside an outlined Reject is the pattern supervisory authorities cite, so parity
 * is the default and any difference has to be introduced deliberately through the variables.
 */

/* ---------------------------------------------------------------- first layer */

/* Position is repeated here as well as in the inlined critical CSS. The inline copy prevents the
   flash; this copy is what keeps the banner out of flow when the critical CSS was not injected,
   which happens whenever the output buffer is not running. */
.orbit-banner.orbit-banner {
	position: fixed;
	left: 0;
	right: 0;
	z-index: 2147483000;
	box-sizing: border-box;
	padding: 20px;
	border-top: 1px solid var(--orbit-border, rgba(26, 26, 26, 0.18));
	box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.08);
	font-size: 0.9375rem;
	line-height: 1.5;
	max-height: 85vh;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.orbit-banner--bottom {
	bottom: 0;
}

.orbit-banner--top {
	top: 0;
	border-top: 0;
	border-bottom: 1px solid var(--orbit-border, rgba(26, 26, 26, 0.18));
	box-shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
}

.orbit-banner__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--orbit-gap, 16px);
	max-width: 1200px;
	margin: 0 auto;
}

.orbit-banner__text {
	flex: 1 1 420px;
	min-width: 0;
}

.orbit-banner__title {
	margin: 0 0 6px;
	font-size: 1.0625rem;
	font-weight: 700;
	line-height: 1.3;
	color: inherit;
}

.orbit-banner__text p {
	margin: 0 0 4px;
	color: inherit;
}

.orbit-banner__links a {
	color: inherit;
	text-decoration: underline;
}

.orbit-banner__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	flex: 0 1 auto;
}

/* -------------------------------------------------------------------- buttons */

.orbit-btn.orbit-btn {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 11px 20px;
	min-width: 150px;
	min-height: 44px;
	border: 2px solid transparent;
	border-radius: var(--orbit-radius, 6px);
	background-color: var(--orbit-btn-bg, #1a1a1a);
	color: var(--orbit-btn-fg, #ffffff);
	font-family: inherit;
	font-size: 0.9375rem;
	font-weight: 600;
	font-style: normal;
	letter-spacing: 0;
	text-align: center;
	text-decoration: none;
	text-transform: none;
	line-height: 1.2;
	cursor: pointer;
	box-shadow: none;
	transition: opacity 0.15s ease;
}

.orbit-btn.orbit-btn:hover {
	opacity: 0.88;
}

/* Colour only. Same defaults, so the three actions are indistinguishable until somebody
   deliberately sets a variable and accepts the consequences. */
.orbit-btn.orbit-btn--accept {
	background-color: var(--orbit-accept-bg, var(--orbit-btn-bg, #1a1a1a));
	color: var(--orbit-accept-fg, var(--orbit-btn-fg, #ffffff));
	border-color: var(--orbit-accept-bg, var(--orbit-btn-bg, #1a1a1a));
}

.orbit-btn.orbit-btn--reject {
	background-color: var(--orbit-reject-bg, var(--orbit-btn-bg, #1a1a1a));
	color: var(--orbit-reject-fg, var(--orbit-btn-fg, #ffffff));
	border-color: var(--orbit-reject-bg, var(--orbit-btn-bg, #1a1a1a));
}

.orbit-btn.orbit-btn--configure {
	background-color: var(--orbit-configure-bg, var(--orbit-btn-bg, #1a1a1a));
	color: var(--orbit-configure-fg, var(--orbit-btn-fg, #ffffff));
	border-color: var(--orbit-configure-bg, var(--orbit-btn-bg, #1a1a1a));
}

.orbit-btn.orbit-btn--save {
	background-color: var(--orbit-btn-bg, #1a1a1a);
	color: var(--orbit-btn-fg, #ffffff);
	border-color: var(--orbit-btn-bg, #1a1a1a);
}

.orbit-btn.orbit-btn--inline {
	min-width: 0;
	padding: 8px 14px;
	font-size: 0.875rem;
}

/* ------------------------------------------------------------- second layer */

.orbit-modal {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.orbit-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
}

.orbit-modal__panel.orbit-modal__panel {
	position: relative;
	box-sizing: border-box;
	width: 100%;
	max-width: 640px;
	max-height: 85vh;
	overflow-y: auto;
	padding: 24px;
	border-radius: calc(var(--orbit-radius, 6px) * 1.5);
	background: var(--orbit-bg, #ffffff);
	color: var(--orbit-fg, #1a1a1a);
	font-size: 0.9375rem;
	line-height: 1.5;
}

.orbit-modal__title {
	margin: 0 0 16px;
	font-size: 1.25rem;
	font-weight: 700;
	color: inherit;
}

.orbit-modal__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 20px;
}

/* --------------------------------------------------------------- categories */

.orbit-cat {
	padding: 14px 0;
	border-top: 1px solid var(--orbit-border, rgba(26, 26, 26, 0.18));
}

.orbit-cat:first-child {
	border-top: 0;
	padding-top: 0;
}

.orbit-cat__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}

.orbit-cat__label {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-weight: 600;
	cursor: pointer;
}

.orbit-cat__label input {
	width: 18px;
	height: 18px;
	margin: 0;
	flex: 0 0 auto;
	accent-color: var(--orbit-btn-bg, #1a1a1a);
}

.orbit-cat__label input:disabled {
	cursor: not-allowed;
}

.orbit-cat__always {
	font-size: 0.8125rem;
	opacity: 0.7;
}

.orbit-cat__purpose {
	margin: 6px 0 0;
	opacity: 0.85;
}

.orbit-svc {
	margin-top: 8px;
	font-size: 0.875rem;
}

.orbit-svc summary {
	cursor: pointer;
	text-decoration: underline;
}

.orbit-svc ul {
	margin: 8px 0 0;
	padding-left: 18px;
}

.orbit-svc code {
	font-size: 0.8125rem;
	opacity: 0.75;
	word-break: break-all;
}

.orbit-svc__vendor {
	opacity: 0.7;
}

/* ------------------------------------------------------------------- revoke */

.orbit-revoke.orbit-revoke {
	position: fixed;
	bottom: 16px;
	left: 16px;
	z-index: 2147482999;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 1px solid var(--orbit-border, rgba(26, 26, 26, 0.18));
	border-radius: 50%;
	background: var(--orbit-bg, #ffffff);
	color: var(--orbit-fg, #1a1a1a);
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.15);
}

/* -------------------------------------------------------- blocked embeds */

.orbit-embed {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	border: 1px dashed var(--orbit-border, rgba(26, 26, 26, 0.18));
	border-radius: var(--orbit-radius, 6px);
	background: rgba(0, 0, 0, 0.03);
	color: inherit;
	text-align: center;
}

.orbit-embed__inner {
	padding: 20px;
	max-width: 460px;
}

.orbit-embed__text {
	margin: 0 0 12px;
	font-size: 0.9375rem;
	line-height: 1.4;
}

.orbit-embed__load.orbit-embed__load,
.orbit-embed__settings.orbit-embed__settings {
	box-sizing: border-box;
	margin: 4px;
	padding: 9px 16px;
	min-height: 40px;
	border: 2px solid var(--orbit-btn-bg, #1a1a1a);
	border-radius: var(--orbit-radius, 6px);
	background: var(--orbit-btn-bg, #1a1a1a);
	color: var(--orbit-btn-fg, #ffffff);
	font-family: inherit;
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
}

.orbit-embed__settings {
	background: transparent;
	color: inherit;
	border-color: var(--orbit-border, rgba(26, 26, 26, 0.18));
}

/* -------------------------------------------------------------- a11y & motion */

.orbit-banner :focus-visible,
.orbit-modal :focus-visible,
.orbit-revoke:focus-visible,
.orbit-embed :focus-visible,
.orbit-consent-open:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.orbit-btn,
	.orbit-embed__load {
		transition: none;
	}
}

@media (forced-colors: active) {
	.orbit-btn,
	.orbit-revoke,
	.orbit-embed__load,
	.orbit-embed__settings {
		border-color: ButtonBorderText;
	}
}

@media (max-width: 640px) {
	.orbit-banner__actions {
		width: 100%;
	}

	.orbit-btn {
		flex: 1 1 100%;
	}
}
