/* Relish Cookie Consent. Colours and sizes come from CSS variables set in the admin. */

#rcc-root,
#rcc-root * {
	box-sizing: border-box;
}

#rcc-root [hidden] {
	display: none !important;
}

#rcc-root .rcc-banner {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2147483000;
	background: var(--rcc-bg);
	color: var(--rcc-text);
	font-family: inherit;
	font-size: var(--rcc-font-size);
	line-height: 1.5;
	box-shadow: 0 -2px 16px rgba(0, 0, 0, .15);
}

#rcc-root .rcc-inner {
	max-width: 1280px;
	margin: 0 auto;
	padding: 16px 24px;
	display: flex;
	align-items: center;
	gap: 16px 32px;
}

#rcc-root .rcc-message {
	flex: 1 1 auto;
	margin: 0;
	padding: 0;
	color: inherit;
	font-size: inherit;
	line-height: inherit;
}

#rcc-root a {
	color: var(--rcc-link);
	text-decoration: underline;
}

#rcc-root .rcc-policy-link {
	margin-left: .25em;
	white-space: nowrap;
}

#rcc-root .rcc-actions {
	flex: 0 0 auto;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

#rcc-root .rcc-btn,
.rcc-placeholder .rcc-btn {
	display: inline-block;
	margin: 0;
	padding: .65em 1.4em;
	min-width: 0;
	border: 2px solid var(--rcc-btn-border, var(--rcc-btn-bg));
	border-radius: var(--rcc-radius);
	background: var(--rcc-btn-bg);
	color: var(--rcc-btn-text);
	font-family: inherit;
	font-size: var(--rcc-btn-font-size);
	font-weight: 600;
	line-height: 1.2;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
	box-shadow: none;
	transition: background-color .45s cubic-bezier(.25, .1, .25, 1), color .45s cubic-bezier(.25, .1, .25, 1), border-color .45s cubic-bezier(.25, .1, .25, 1);
}

/* Hover: background and text colour swap; the border takes the new text colour. */
#rcc-root .rcc-btn:hover {
	background: var(--rcc-btn-text);
	color: var(--rcc-btn-bg);
	border-color: var(--rcc-btn-bg);
}

#rcc-root .rcc-btn:focus-visible,
#rcc-root .rcc-close:focus-visible,
#rcc-root .rcc-reopen:focus-visible,
#rcc-root .rcc-switch input:focus-visible + .rcc-slider {
	outline: 2px solid var(--rcc-link);
	outline-offset: 2px;
}

#rcc-root .rcc-btn-outline {
	background: transparent;
	color: var(--rcc-text);
}

/* The outline button fills in with the normal button colours on hover. */
#rcc-root .rcc-btn-outline:hover {
	background: var(--rcc-btn-bg);
	color: var(--rcc-btn-text);
	border-color: var(--rcc-btn-bg);
}

/* Preferences panel */

html.rcc-panel-open {
	overflow: hidden;
}

#rcc-root .rcc-panel {
	position: fixed;
	inset: 0;
	z-index: 2147483001;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(0, 0, 0, .5);
	font-family: inherit;
	font-size: var(--rcc-font-size);
	line-height: 1.5;
}

#rcc-root .rcc-panel-box {
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 640px;
	max-height: calc(100vh - 32px);
	background: var(--rcc-bg);
	color: var(--rcc-text);
	border-radius: 8px;
	box-shadow: 0 8px 40px rgba(0, 0, 0, .3);
	overflow: hidden;
}

#rcc-root .rcc-panel-head,
#rcc-root .rcc-panel-foot {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 16px 24px;
}

#rcc-root .rcc-panel-head {
	justify-content: space-between;
	border-bottom: 1px solid rgba(127, 127, 127, .3);
}

#rcc-root .rcc-panel-head h2 {
	margin: 0;
	padding: 0;
	color: inherit;
	font-family: inherit;
	font-size: 1.25em;
	font-weight: 700;
	line-height: 1.3;
}

#rcc-root .rcc-close {
	margin: 0;
	padding: 0 6px;
	border: 0;
	background: transparent;
	color: inherit;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

#rcc-root .rcc-panel-body {
	flex: 1 1 auto;
	padding: 8px 24px;
	overflow-y: auto;
}

#rcc-root .rcc-panel-foot {
	flex-wrap: wrap;
	justify-content: flex-end;
	border-top: 1px solid rgba(127, 127, 127, .3);
}

#rcc-root .rcc-cat {
	padding: 14px 0;
	border-bottom: 1px solid rgba(127, 127, 127, .2);
}

#rcc-root .rcc-cat-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
}

#rcc-root .rcc-cat-name {
	font-weight: 700;
}

#rcc-root .rcc-always {
	font-size: .875em;
	font-weight: 600;
	opacity: .8;
}

#rcc-root .rcc-cat-desc,
#rcc-root .rcc-panel-policy {
	margin: 6px 0 0;
	font-size: .9em;
	opacity: .9;
}

#rcc-root .rcc-panel-policy {
	margin-top: 14px;
}

#rcc-root .rcc-cookies {
	margin-top: 8px;
	font-size: .85em;
}

#rcc-root .rcc-cookies summary {
	cursor: pointer;
	text-decoration: underline;
}

/* Toggle switch */

#rcc-root .rcc-switch {
	position: relative;
	flex: 0 0 auto;
	width: 44px;
	height: 24px;
	margin: 0;
}

#rcc-root .rcc-switch input {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
	z-index: 1;
}

#rcc-root .rcc-slider {
	position: absolute;
	inset: 0;
	border-radius: 24px;
	background: rgba(127, 127, 127, .5);
	transition: background .15s;
}

#rcc-root .rcc-slider::before {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	transition: transform .15s;
}

#rcc-root .rcc-switch input:checked + .rcc-slider {
	background: var(--rcc-btn-bg);
}

#rcc-root .rcc-switch input:checked + .rcc-slider::before {
	transform: translateX(20px);
	background: var(--rcc-btn-text);
}

/* Cookie tables (panel and [rcc_cookie_list]) */

.rcc-table-wrap {
	overflow-x: auto;
	margin: 8px 0 16px;
}

.rcc-cookie-table {
	width: 100%;
	border-collapse: collapse;
	font-size: inherit;
}

.rcc-cookie-table th,
.rcc-cookie-table td {
	padding: 6px 8px;
	border-bottom: 1px solid rgba(127, 127, 127, .25);
	text-align: left;
	vertical-align: top;
}

.rcc-cookie-table code {
	font-size: .95em;
	word-break: break-all;
}

/* Inside the panel the table follows the banner colours, not the theme's table styles. */
#rcc-root .rcc-cookies summary,
#rcc-root .rcc-cookie-table,
#rcc-root .rcc-cookie-table thead,
#rcc-root .rcc-cookie-table tbody,
#rcc-root .rcc-cookie-table tr,
#rcc-root .rcc-cookie-table th,
#rcc-root .rcc-cookie-table td,
#rcc-root .rcc-cookie-table code {
	background: transparent;
	color: inherit;
	font-family: inherit;
}

#rcc-root .rcc-cookie-table th,
#rcc-root .rcc-cookie-table td {
	border: 0;
	border-bottom: 1px solid rgba(127, 127, 127, .25);
}

#rcc-root .rcc-cookie-table code {
	padding: 0;
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* Re-open button */

#rcc-root .rcc-reopen {
	position: fixed;
	bottom: 16px;
	z-index: 2147482999;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--rcc-bg);
	color: var(--rcc-text);
	box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
	cursor: pointer;
}

#rcc-root .rcc-reopen-left {
	left: 16px;
}

#rcc-root .rcc-reopen-right {
	right: 16px;
}

/* Blocked iframe placeholder */

iframe[data-rcc-src] {
	display: none !important;
}

.rcc-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	width: 100%;
	min-height: 200px;
	padding: 24px;
	background: #f2f2f2;
	color: #333;
	text-align: center;
	font-size: 15px;
	line-height: 1.5;
}

.rcc-placeholder .rcc-btn {
	border-color: var(--rcc-bg);
	background: var(--rcc-bg);
	color: var(--rcc-text);
}

.rcc-placeholder .rcc-btn:hover {
	border-color: var(--rcc-bg);
	background: var(--rcc-text);
	color: var(--rcc-bg);
}

.rcc-placeholder p {
	margin: 0;
	max-width: 480px;
}

/* Mobile */

@media (max-width: 782px) {
	#rcc-root .rcc-inner {
		flex-direction: column;
		align-items: stretch;
		padding: 16px;
	}

	#rcc-root .rcc-actions {
		display: grid;
		grid-template-columns: 1fr 1fr;
	}

	#rcc-root .rcc-actions .rcc-btn-outline {
		grid-column: 1 / -1;
		order: 3;
	}

	#rcc-root .rcc-panel {
		padding: 0;
		align-items: flex-end;
	}

	#rcc-root .rcc-panel-box {
		max-height: 100vh;
		border-radius: 8px 8px 0 0;
	}

	#rcc-root .rcc-panel-head,
	#rcc-root .rcc-panel-foot,
	#rcc-root .rcc-panel-body {
		padding-left: 16px;
		padding-right: 16px;
	}

	#rcc-root .rcc-panel-foot .rcc-btn {
		flex: 1 1 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	#rcc-root *,
	#rcc-root *::before {
		transition: none !important;
	}
}
