/*
 * Revive Consent.
 * Brand colour, background, text colour and corner radius come from inline custom
 * properties set per site. Type is inherited from the site so the banner looks native.
 * Sizes use em from a fixed 16px base so themes that shrink the root font cannot break it.
 */

.rc,
.rc *,
.rc-reopen,
.rc-reopen *,
.rc-embed,
.rc-embed * {
	box-sizing: border-box;
}

.rc[hidden],
.rc__view[hidden],
.rc-reopen[hidden] {
	display: none !important;
}

/* ---------------------------------------------------------------- Layout */

.rc {
	position: fixed;
	z-index: 2147483000;
	left: 10px;
	right: 10px;
	bottom: 10px;
	font-family: inherit;
	font-size: 16px;
	font-weight: 400;
	line-height: 1.5;
	letter-spacing: normal;
	text-transform: none;
	text-align: left;
	color: var(--rc-text, #1a1a1a);
	-webkit-font-smoothing: antialiased;
	-webkit-text-size-adjust: 100%;
}

.rc__panel {
	position: relative;
	background: var(--rc-bg, #fff);
	color: var(--rc-text, #1a1a1a);
	border: 1px solid rgba(127, 127, 127, 0.22);
	border-radius: var(--rc-radius, 16px);
	padding: 20px;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 18px 48px -12px rgba(0, 0, 0, 0.35);
	max-height: calc(100vh - 20px);
	max-height: calc(100dvh - 20px);
	overflow-y: auto;
	overscroll-behavior: contain;
	outline: none;
	animation: rc-in 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes rc-in {
	from {
		opacity: 0;
		transform: translateY(14px);
	}
}

@media (min-width: 601px) {
	.rc {
		bottom: 20px;
	}

	.rc__panel {
		padding: 24px;
		max-height: calc(100vh - 40px);
		max-height: calc(100dvh - 40px);
	}

	.rc--bottom-left,
	.rc--bottom-right {
		width: calc(100% - 40px);
		max-width: 420px;
	}

	.rc--bottom-left {
		left: 20px;
		right: auto;
	}

	.rc--bottom-right {
		left: auto;
		right: 20px;
	}

	/* Bottom bar: inset and centred, never edge to edge. */
	.rc--bottom {
		left: 20px;
		right: 20px;
		max-width: 1040px;
		margin-inline: auto;
	}
}

/* On wide screens the bar puts the message on the left and the buttons on the right. */
@media (min-width: 860px) {
	/* Room on the right so the close button never sits on top of the buttons. */
	.rc--bottom .rc__panel {
		padding-right: 60px;
	}

	.rc--bottom .rc__close {
		top: 14px;
		right: 14px;
	}

	.rc--bottom .rc__view {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		column-gap: 40px;
		align-items: center;
	}

	.rc--bottom .rc__view .rc__title {
		grid-column: 1;
		grid-row: 1;
	}

	.rc--bottom .rc__view .rc__text {
		grid-column: 1;
		grid-row: 2;
		margin-bottom: 0;
		max-width: 62ch;
	}

	.rc--bottom .rc__view .rc__actions {
		grid-column: 2;
		grid-row: 1 / span 2;
		width: 340px;
	}

	/* Opened, the preferences take a full-width row of their own, one column per category. */
	.rc--bottom .rc__view .rc__more {
		grid-column: 1 / -1;
		grid-row: 3;
	}

	.rc--bottom .rc__more-body {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
		gap: 0 32px;
	}

	.rc--bottom .rc__more-body .rc__cat {
		align-self: start;
	}

	.rc--bottom.rc--open .rc__view {
		grid-template-rows: auto 1fr auto;
		align-items: start;
	}

	.rc--bottom.rc--open .rc__view .rc__text {
		margin-bottom: 0;
	}

	.rc--bottom.rc--open .rc__view .rc__actions {
		margin-bottom: 16px;
	}
}

/* ------------------------------------------------------------------ Text */

.rc .rc__title {
	margin: 0 0 6px;
	padding: 0;
	font-family: inherit !important;
	font-size: 1.0625em !important;
	font-weight: 600 !important;
	line-height: 1.3 !important;
	letter-spacing: -0.005em !important;
	text-transform: none !important;
	color: inherit;
}

.rc .rc__title:focus {
	outline: none;
}

/* Keep the heading clear of the close button. */
.rc .rc__title {
	padding-right: 32px;
}

.rc .rc__close {
	position: absolute !important;
	top: 10px;
	right: 10px;
	z-index: 2;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 32px !important;
	height: 32px !important;
	min-width: 0 !important;
	min-height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50% !important;
	background: transparent !important;
	box-shadow: none !important;
	color: inherit !important;
	opacity: 0.6;
	cursor: pointer;
	transition: opacity 0.15s ease, background-color 0.15s ease;
}

.rc .rc__close:hover {
	opacity: 1;
	background: rgba(127, 127, 127, 0.16) !important;
}

.rc .rc__close:focus-visible {
	opacity: 1;
	outline: 2px solid var(--rc-primary, #0b3d91);
	outline-offset: 1px;
}

.rc .rc__close svg {
	display: block;
	width: 18px;
	height: 18px;
	pointer-events: none;
}

.rc .rc__text {
	margin: 0 0 18px;
	padding: 0;
	font-size: 0.875em !important;
	line-height: 1.55 !important;
	color: inherit;
	opacity: 0.88;
}

.rc .rc__link {
	color: inherit !important;
	font-weight: 500;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.rc .rc__link:hover {
	text-decoration-thickness: 2px;
}

/* --------------------------------------------------------------- Buttons */

.rc .rc__actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin: 0;
}

/* Accept and Reject share one class so neither is visually favoured. */
.rc .rc__btn {
	-webkit-appearance: none;
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 46px;
	margin: 0;
	padding: 0 16px;
	border: 0;
	border-radius: calc(var(--rc-radius, 16px) * 0.7) !important;
	background: var(--rc-primary, #0b3d91);
	color: var(--rc-primary-text, #fff);
	font-family: inherit !important;
	font-size: 0.9375em !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	letter-spacing: normal !important;
	text-align: center !important;
	text-decoration: none;
	text-transform: none !important;
	box-shadow: none;
	cursor: pointer;
	transition: filter 0.15s ease;
}

.rc .rc__btn:hover {
	filter: brightness(0.92);
}

.rc .rc__btn:active {
	filter: brightness(0.86);
}

/* Third action: a quiet link that expands the preferences, then an outlined save button once open. */
.rc .rc__btn--ghost {
	grid-column: 1 / -1;
	background: transparent;
	color: inherit;
}

.rc .rc__btn--manage {
	min-height: 36px;
	padding: 0 8px;
	font-size: 0.875em !important;
	font-weight: 500 !important;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	opacity: 0.85;
}

.rc .rc__btn--manage::after {
	content: "";
	display: inline-block;
	width: 0.4em;
	height: 0.4em;
	margin-left: 0.65em;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg) translateY(-0.12em);
}

.rc .rc__btn--manage:hover {
	filter: none;
	opacity: 1;
	text-decoration-thickness: 2px;
}

.rc .rc__btn--save {
	box-shadow: inset 0 0 0 1.5px rgba(127, 127, 127, 0.6);
}

.rc .rc__btn--save:hover {
	filter: none;
	box-shadow: inset 0 0 0 1.5px currentColor;
}

.rc.rc--open .rc__btn--manage,
.rc:not(.rc--open) .rc__btn--save {
	display: none;
}

.rc .rc__btn:focus-visible,
.rc-reopen:focus-visible,
.rc-embed__btn:focus-visible,
.rc .rc__link:focus-visible,
.rc .rc__details summary:focus-visible,
.rc .rc__switch input:focus-visible + .rc__slider {
	outline: 2px solid var(--rc-primary, #0b3d91);
	outline-offset: 3px;
}

/* ----------------------------------------------------------- Preferences */

/* The preferences live inside the banner and unfold in place. */
.rc__more {
	display: grid;
	grid-template-rows: 0fr;
	visibility: hidden;
	outline: none;
	transition: grid-template-rows 0.34s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.34s;
}

.rc.rc--open .rc__more {
	grid-template-rows: 1fr;
	visibility: visible;
	transition: grid-template-rows 0.34s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s;
}

.rc__more-inner {
	min-height: 0;
	overflow: hidden;
}

.rc__more-body {
	padding: 0 0 12px;
}

.rc.rc--open .rc__text {
	margin-bottom: 10px;
}

.rc .rc__cat {
	padding: 14px 0;
	border-top: 1px solid rgba(127, 127, 127, 0.22);
}

.rc .rc__cat-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 4px;
}

.rc .rc__cat-title {
	font-size: 0.9375em !important;
	font-weight: 600 !important;
}

.rc .rc__cat-desc {
	margin: 0 0 6px;
	font-size: 0.8125em !important;
	line-height: 1.5 !important;
	color: inherit;
	opacity: 0.78;
}

.rc .rc__always {
	padding: 3px 10px;
	border-radius: 999px;
	background: rgba(127, 127, 127, 0.16);
	font-size: 0.75em !important;
	font-weight: 600 !important;
	white-space: nowrap;
}

.rc .rc__details {
	font-size: 0.8125em !important;
}

.rc .rc__details summary {
	display: list-item;
	padding: 4px 0;
	font-weight: 500;
	cursor: pointer;
}

.rc .rc__details ul {
	margin: 6px 0 0;
	padding: 0;
	list-style: none;
}

.rc .rc__details li {
	margin: 0 0 8px;
	padding: 0;
}

.rc .rc__details li strong {
	display: block;
	font-weight: 600;
}

.rc .rc__details li span {
	display: block;
	opacity: 0.78;
}

.rc .rc__foot {
	margin: 14px 0 0;
	font-size: 0.8125em !important;
	text-align: center !important;
	opacity: 0.8;
}

/* Switch. */
.rc .rc__switch {
	position: relative;
	display: inline-block;
	flex: none;
	width: 44px;
	height: 26px;
}

.rc .rc__switch input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
	z-index: 1;
}

.rc .rc__slider {
	position: absolute;
	inset: 0;
	border-radius: 26px;
	background: rgba(127, 127, 127, 0.5);
	transition: background 0.18s ease;
}

.rc .rc__slider::before {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
	transition: transform 0.18s ease;
}

.rc .rc__switch input:checked + .rc__slider {
	background: var(--rc-primary, #0b3d91);
}

.rc .rc__switch input:checked + .rc__slider::before {
	transform: translateX(18px);
}

/* ------------------------------------------------- Floating re-open button */

.rc-reopen {
	position: fixed;
	z-index: 2147482999;
	left: 16px;
	bottom: 16px;
	display: inline-flex;
	align-items: center;
	gap: 0;
	box-sizing: border-box;
	min-height: 36px;
	margin: 0;
	padding: 0 8px;
	opacity: 0.8;
	border: 1px solid rgba(127, 127, 127, 0.28);
	border-radius: 999px !important;
	background: var(--rc-bg, #fff);
	color: var(--rc-text, #1a1a1a);
	font-family: inherit !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	letter-spacing: normal !important;
	text-transform: none !important;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 8px 24px -8px rgba(0, 0, 0, 0.35);
	cursor: pointer;
	transition: transform 0.15s ease;
}

.rc-reopen:hover,
.rc-reopen:focus-visible {
	opacity: 1;
	transform: translateY(-1px);
}

/* Just the icon until the visitor hovers or tabs to it, so it stays out of the way. */
.rc-reopen .rc-reopen__icon {
	flex: none;
	display: block;
}

.rc-reopen > span {
	display: block;
	max-width: 0;
	overflow: hidden;
	white-space: nowrap;
	opacity: 0;
	transition: max-width 0.22s ease, opacity 0.18s ease, margin 0.22s ease;
}

.rc-reopen:hover > span,
.rc-reopen:focus-visible > span {
	max-width: 160px;
	margin-left: 8px;
	margin-right: 4px;
	opacity: 1;
}

.rc-open-link {
	-webkit-appearance: none;
	appearance: none;
	background: none;
	border: 0;
	padding: 0;
	color: inherit;
	font: inherit;
	text-decoration: underline;
	cursor: pointer;
}

/* ----------------------------------------------- Blocked embed placeholder */

.rc-embed {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px 16px;
	background: rgba(127, 127, 127, 0.1);
	border: 1px solid rgba(127, 127, 127, 0.22);
	border-radius: var(--rc-radius, 16px);
	text-align: center;
	color: inherit;
	font-family: inherit;
	font-size: 16px;
	line-height: 1.5;
}

.rc-embed__inner {
	max-width: 420px;
}

.rc-embed__text {
	margin: 0 0 14px;
	font-size: 0.875em !important;
	line-height: 1.55 !important;
}

.rc-embed__btn {
	-webkit-appearance: none;
	appearance: none;
	min-height: 44px;
	margin: 0;
	padding: 0 20px;
	border: 0;
	border-radius: calc(var(--rc-radius, 16px) * 0.7) !important;
	background: var(--rc-primary, #0b3d91);
	color: var(--rc-primary-text, #fff);
	font-family: inherit !important;
	font-size: 0.9375em !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	cursor: pointer;
	transition: filter 0.15s ease;
}

.rc-embed__btn:hover {
	filter: brightness(0.92);
}

/* ------------------------------------------------- Cookie table shortcode */

.rc-table table {
	width: 100%;
	border-collapse: collapse;
	margin: 0 0 1.5em;
}

.rc-table th,
.rc-table td {
	padding: 8px 10px;
	border: 1px solid rgba(127, 127, 127, 0.35);
	text-align: left;
	vertical-align: top;
	word-break: break-word;
}

@media (max-width: 600px) {
	.rc__panel {
		padding: 18px;
	}

	.rc-reopen {
		left: 10px;
		bottom: 10px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.rc-reopen > span {
		transition: none;
	}
}

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

	.rc__more,
	.rc.rc--open .rc__more,
	.rc .rc__slider,
	.rc .rc__slider::before,
	.rc .rc__btn,
	.rc-reopen,
	.rc-embed__btn {
		transition: none;
	}
}
