/* RSW Tools Cookie Consent. Colours, fonts and sizes come from the
   --rswcc-* variables printed inline (branding.php). */

#rswcc-root, .rswcc-ph, .rswcc-link-root {
	--rswcc-z: 2147483000;
	--rswcc-muted: color-mix(in srgb, var(--rswcc-text) 70%, var(--rswcc-bg));
	--rswcc-line: color-mix(in srgb, var(--rswcc-text) 18%, var(--rswcc-bg));
	--rswcc-soft: color-mix(in srgb, var(--rswcc-text) 6%, var(--rswcc-bg));
}
#rswcc-root *, .rswcc-ph * { box-sizing: border-box; }
#rswcc-root [hidden] { display: none !important; }

#rswcc-root, .rswcc-ph {
	font-family: var(--rswcc-font-body);
	/* Text and buttons are 85% of the theme's body size; titles keep theirs. */
	font-size: calc(var(--rswcc-size-body) * .85);
	line-height: 1.5;
	color: var(--rswcc-text);
	text-align: left;
}

/* Buttons: Accept all and Reject all share the primary style. */
#rswcc-root .rswcc-btn, .rswcc-ph .rswcc-btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 40px; margin: 0; padding: 8px 18px;
	font: 600 calc(var(--rswcc-size-body) * .85)/1.2 var(--rswcc-font-body);
	letter-spacing: normal; text-transform: none; text-decoration: none; white-space: nowrap;
	border: 2px solid var(--rswcc-btn-border); border-radius: var(--rswcc-btn-radius);
	background: var(--rswcc-btn-bg); color: var(--rswcc-btn-text);
	cursor: pointer; box-shadow: none;
}
#rswcc-root .rswcc-outline { background: transparent; color: var(--rswcc-outline); border-color: var(--rswcc-outline); }
/* Hover only with a real mouse: on phones a hover change can make iOS
   Safari treat the first tap as a hover and wait for a second. */
@media (hover: hover) and (pointer: fine) {
	#rswcc-root .rswcc-btn:hover, .rswcc-ph .rswcc-btn:hover { filter: brightness(.92); }
	#rswcc-root .rswcc-outline:hover { background: var(--rswcc-soft); filter: none; }
}
#rswcc-root button, .rswcc-ph button, .rswcc-chat { touch-action: manipulation; }

#rswcc-root :focus-visible, .rswcc-ph :focus-visible {
	outline: 3px solid var(--rswcc-accent); outline-offset: 2px;
}
#rswcc-root .rswcc-title:focus { outline: none; }

#rswcc-root a { color: var(--rswcc-accent); text-decoration: underline; }

#rswcc-root .rswcc-title {
	margin: 0 0 .35em; padding: 0;
	font: 700 var(--rswcc-size-title)/1.25 var(--rswcc-font-heading);
	color: var(--rswcc-text); letter-spacing: normal; text-transform: none;
}
#rswcc-root p { margin: 0 0 .75em; color: var(--rswcc-text); font-size: inherit; }

/* Banner */
.rswcc-banner {
	position: fixed; z-index: var(--rswcc-z); left: 0; right: 0; bottom: 0;
	background: var(--rswcc-bg); color: var(--rswcc-text);
	border-top: 1px solid var(--rswcc-line);
	box-shadow: 0 -4px 24px rgba(0, 0, 0, .12);
	padding: 25px 25px calc(25px + env(safe-area-inset-bottom, 0px));
}
.rswcc-banner-in {
	max-width: 1180px; margin: 0 auto;
	display: flex; gap: 16px 32px; align-items: center;
}
.rswcc-copy { flex: 1 1 auto; }
.rswcc-copy .rswcc-text { margin: 0; }
.rswcc-actions { display: flex; flex-wrap: wrap; gap: 10px; flex: 0 0 auto; }

.rswcc-pos-box .rswcc-banner {
	left: 16px; right: auto; bottom: 16px; max-width: 400px;
	border: 1px solid var(--rswcc-line); border-radius: 10px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, .18);
}
.rswcc-pos-box-right .rswcc-banner { left: auto; right: 16px; }
.rswcc-pos-box .rswcc-banner-in { display: block; }
.rswcc-pos-box .rswcc-banner .rswcc-actions { margin-top: 14px; }
.rswcc-pos-box .rswcc-banner .rswcc-actions .rswcc-btn { flex: 1 1 calc(50% - 5px); }
.rswcc-pos-box .rswcc-banner .rswcc-actions .rswcc-outline { flex-basis: 100%; }

@media (max-width: 760px) {
	.rswcc-banner, .rswcc-pos-box .rswcc-banner {
		left: 0; right: 0; bottom: 0; max-width: none;
		border-radius: 14px 14px 0 0; border: 0;
		max-height: 85vh; overflow-y: auto;
	}
	.rswcc-banner-in { display: block; }
	.rswcc-actions { margin-top: 14px; }
	.rswcc-actions .rswcc-btn { flex: 1 1 calc(50% - 5px); }
	.rswcc-actions .rswcc-outline { flex-basis: 100%; }
}

/* Preferences centre */
.rswcc-locked, .rswcc-locked body { overflow: hidden; }
.rswcc-overlay {
	position: fixed; inset: 0; z-index: calc(var(--rswcc-z) + 1);
	background: rgba(0, 0, 0, .55);
	display: flex; align-items: center; justify-content: center; padding: 16px;
}
.rswcc-modal {
	width: 100%; max-width: 640px; max-height: calc(100vh - 32px);
	display: flex; flex-direction: column;
	background: var(--rswcc-bg); color: var(--rswcc-text);
	border-radius: 12px; box-shadow: 0 16px 48px rgba(0, 0, 0, .3);
}
.rswcc-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 24px 8px; }
.rswcc-modal-body { padding: 4px 24px 8px; overflow-y: auto; }
.rswcc-modal .rswcc-actions { padding: 16px 24px 20px; border-top: 1px solid var(--rswcc-line); justify-content: flex-end; }
#rswcc-root .rswcc-close {
	width: 44px; height: 44px; margin: -8px -12px 0 0; padding: 0;
	border: 0; background: transparent; color: var(--rswcc-text);
	font: 400 28px/1 var(--rswcc-font-body); cursor: pointer; border-radius: 6px;
}
.rswcc-cat { border: 1px solid var(--rswcc-line); border-radius: 8px; padding: 14px 16px; margin: 0 0 12px; }
.rswcc-cat.rswcc-highlight { border-color: var(--rswcc-accent); box-shadow: 0 0 0 2px var(--rswcc-accent); }
.rswcc-cat-head { display: flex; align-items: center; gap: 12px; }
#rswcc-root .rswcc-cat h3 { flex: 1 1 auto; margin: 0; font: 700 var(--rswcc-size-body)/1.3 var(--rswcc-font-heading); color: var(--rswcc-text); text-transform: none; letter-spacing: normal; }
#rswcc-root .rswcc-cat p { margin: 6px 0 4px; color: var(--rswcc-muted); }
.rswcc-note { font-size: .85em; color: var(--rswcc-muted); text-align: right; }
.rswcc-cat summary { cursor: pointer; font-size: .9em; color: var(--rswcc-accent); padding: 4px 0; }
.rswcc-list { margin: 6px 0 0 1.2em; padding: 0; font-size: .9em; color: var(--rswcc-muted); }
#rswcc-root .rswcc-id { font-size: .85em; color: var(--rswcc-muted); word-break: break-all; }

/* Switch */
#rswcc-root .rswcc-switch {
	position: relative; flex: 0 0 auto; width: 50px; height: 28px; margin: 0; padding: 0;
	border: 2px solid var(--rswcc-muted); border-radius: 28px;
	background: var(--rswcc-bg); cursor: pointer;
}
#rswcc-root .rswcc-switch::after {
	content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px;
	border-radius: 50%; background: var(--rswcc-muted);
}
#rswcc-root .rswcc-switch[aria-checked="true"] { background: var(--rswcc-btn-bg); border-color: var(--rswcc-btn-border); }
#rswcc-root .rswcc-switch[aria-checked="true"]::after { left: 25px; background: var(--rswcc-btn-text); }
#rswcc-root .rswcc-switch:disabled { cursor: not-allowed; opacity: .6; }

/* Floating widget */
#rswcc-root .rswcc-widget {
	/* top/right pinned: the BB theme nudges pressed buttons with top: 1px. */
	position: fixed; z-index: var(--rswcc-z); left: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); top: auto; right: auto;
	width: 48px; height: 48px; padding: 0; border-radius: 50%;
	display: flex; align-items: center; justify-content: center;
	border: 2px solid var(--rswcc-btn-border); background: var(--rswcc-btn-bg); color: var(--rswcc-btn-text);
	box-shadow: 0 4px 14px rgba(0, 0, 0, .2); cursor: pointer;
}

/* Chat stand-in */
#rswcc-root .rswcc-chat {
	position: fixed; z-index: var(--rswcc-z); right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); top: auto; left: auto;
	border-radius: 999px; box-shadow: 0 4px 14px rgba(0, 0, 0, .2);
}

/* The banner covers the corner until a choice is made. */
#rswcc-root.rswcc-has-banner .rswcc-chat { display: none; }

/* Placeholders for embeds */
.rswcc-ph {
	position: relative; display: flex; align-items: center; justify-content: center;
	width: 100%; max-width: 100%; margin: 0 auto;
	background: var(--rswcc-soft) center / cover no-repeat;
	border: 1px solid var(--rswcc-line); border-radius: 8px;
}
.rswcc-ph-in { max-width: 460px; padding: 20px; text-align: center; }
.rswcc-ph p { margin: 0 0 12px; color: var(--rswcc-text); }
.rswcc-ph .rswcc-ph-title { font: 700 var(--rswcc-size-title)/1.25 var(--rswcc-font-heading); margin-bottom: 6px; }
.rswcc-ph-always { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 12px; font-size: .9em; cursor: pointer; }
.rswcc-ph-always input { width: 18px; height: 18px; margin: 0; }
.rswcc-ph-video::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: rgba(0, 0, 0, .62); }
.rswcc-ph-video .rswcc-ph-in { position: relative; }
.rswcc-ph-video p, .rswcc-ph-video .rswcc-ph-always { color: #fff; }

/* Footer links from the shortcodes */
.rswcc-dns[hidden] { display: none; }

@media (forced-colors: active) {
	#rswcc-root .rswcc-switch[aria-checked="true"]::after { background: Highlight; }
	.rswcc-banner, .rswcc-modal { border: 2px solid CanvasText; }
}
