/**
 * Consent notice and "Your Privacy Choices" panel.
 * Built on the theme's --bb-* tokens, with fallbacks so it still reads
 * properly if the theme changes.
 */
.bb-consent-banner,
.bb-consent-dialog {
	--bbc-blue: var(--bb-color-blue, #1f335e);
	--bbc-pink: var(--bb-color-pink, #ff1e96);
	--bbc-gold: var(--bb-color-gold, #c2a155);
	--bbc-paper: var(--bb-color-paper, #f3ebdc);
	--bbc-ink: var(--bb-color-ink, #43433d);
	--bbc-white: var(--bb-color-white, #fff);
	--bbc-radius: var(--bb-radius-media, 10px);
	--bbc-ease: var(--bb-motion-ease, cubic-bezier(0.22, 1, 0.36, 1));
	--bbc-duration: var(--bb-motion-duration, 0.42s);
	--bbc-font-body: var(--bb-font-body, Arial, Helvetica, sans-serif);
	--bbc-font-strong: "Inter-600", var(--bbc-font-body);
	--bbc-font-label: var(--bb-font-heading, Arial, Helvetica, sans-serif);
	--bbc-font-display: var(--bb-font-display, Georgia, serif);

	box-sizing: border-box;
	font-family: var(--bbc-font-body);
}

.bb-consent-banner *,
.bb-consent-dialog * {
	box-sizing: border-box;
}

/* Without Bootstrap's reboot, the component display rules below would beat [hidden] */
.bb-consent-banner[hidden],
.bb-consent-banner [hidden],
.bb-consent-dialog [hidden] {
	display: none !important;
}

/* Banner: a compact card in the bottom-right corner. The details column opens
   out to the left, so the title and buttons stay where they are. */

.bb-consent-banner {
	--bbc-details-width: 340px;

	position: fixed;
	right: 16px;
	bottom: 16px;
	z-index: 1040; /* under Bootstrap modals and the off-canvas menu */
	display: grid;
	grid-template-columns: auto auto;
	grid-template-rows: auto 1fr;
	grid-template-areas:
		"details head"
		"details actions";
	max-width: calc(100vw - 32px);
	padding: 15px 18px;
	color: var(--bbc-white);
	background-color: rgb(31 51 94 / 90%); /* fallback for browsers without color-mix() */
	background-color: color-mix(in srgb, var(--bbc-blue) 90%, transparent);
	border-radius: var(--bbc-radius);
	box-shadow: 0 12px 32px rgb(17 28 51 / 28%);
	opacity: 0;
	transform: translateY(var(--bb-motion-distance, 12px));
	transition:
		opacity var(--bbc-duration) var(--bbc-ease),
		transform var(--bbc-duration) var(--bbc-ease);
}

.bb-consent-banner.is-visible {
	opacity: 1;
	transform: none;
}

.bb-consent-banner__head {
	grid-area: head;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin-bottom: 14px;
}

.bb-consent-banner__title {
	margin: 0;
	font-family: var(--bbc-font-label);
	font-size: 13px;
	line-height: 1.2;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--bbc-white);
}

/* Chevron points the way the details open, and flips once they're open */
.bb-consent-banner__expand {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	margin: 0;
	padding: 0;
	color: var(--bbc-white);
	cursor: pointer;
	background: transparent;
	border: 2px solid rgb(255 255 255 / 60%);
	border-radius: 50%;
	transition:
		background-color 0.25s ease,
		border-color 0.25s ease;
}

.bb-consent-banner__expand:hover {
	background-color: rgb(255 255 255 / 10%);
	border-color: var(--bbc-white);
}

.bb-consent-banner__expand svg {
	width: 14px;
	height: 14px;
	transition: transform var(--bbc-duration) var(--bbc-ease);
}

.bb-consent-banner.is-expanded .bb-consent-banner__expand svg {
	transform: rotate(180deg);
}

/* Closed, the details take no space and are hidden from keyboard and screen
   readers. The max-height keeps the wrapped text from stretching the compact
   card. Visibility flips at the end of the close and the start of the open. */
.bb-consent-banner__details {
	grid-area: details;
	align-self: center;
	width: 0;
	max-height: 0;
	overflow: hidden;
	opacity: 0;
	visibility: hidden;
	transition:
		width var(--bbc-duration) var(--bbc-ease),
		max-height var(--bbc-duration) var(--bbc-ease),
		opacity 0.2s ease,
		visibility 0s linear var(--bbc-duration);
}

.bb-consent-banner.is-expanded .bb-consent-banner__details {
	width: var(--bbc-details-width);
	max-height: 12em;
	opacity: 1;
	visibility: visible;
	transition:
		width var(--bbc-duration) var(--bbc-ease),
		max-height var(--bbc-duration) var(--bbc-ease),
		opacity var(--bbc-duration) ease 0.1s,
		visibility 0s;
}

/* Fixed width, so the text doesn't reflow while the column slides open */
.bb-consent-banner__text {
	width: calc(var(--bbc-details-width) - 24px);
	margin: 0;
	padding-right: 24px;
	font-size: 13px;
	line-height: 1.45;
	color: var(--bbc-white);
	border-right: 1px solid rgb(255 255 255 / 20%);
}

.bb-consent-banner__confirm {
	grid-row: 1 / -1;
	grid-column: 2;
	align-self: center;
	width: 240px;
	margin: 0;
	font-size: 13px;
	line-height: 1.45;
	color: var(--bbc-white);
}

.bb-consent-banner__confirm:empty {
	display: none;
}

/* The theme forces every link blue with !important */
.bb-consent-banner a {
	color: inherit !important;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.bb-consent-banner__actions {
	grid-area: actions;
	align-self: end;
	display: flex;
	gap: 12px;
}

/* Buttons: the theme's pill buttons, as real <button>s */

.bb-consent-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	margin: 0;
	padding: 10px 28px;
	font-family: var(--bbc-font-strong);
	font-size: 14px;
	line-height: 1.2;
	text-align: center;
	white-space: nowrap;
	cursor: pointer;
	border: 2px solid transparent;
	border-radius: 100px;
	transition:
		background-color 0.25s ease,
		border-color 0.25s ease,
		color 0.25s ease;
}

.bb-consent-btn:focus-visible,
.bb-consent-banner__expand:focus-visible,
.bb-consent-dialog__close:focus-visible {
	outline: 2px solid var(--bbc-gold);
	outline-offset: 3px;
}

/* Pink goes blue with a white edge on hover, as .site-button.pink does */
.bb-consent-btn--primary {
	color: var(--bbc-white);
	background-color: var(--bbc-pink);
	border-color: var(--bbc-pink);
}

.bb-consent-btn--primary:hover {
	background-color: var(--bbc-blue);
	border-color: var(--bbc-white);
}

.bb-consent-btn--ghost {
	color: var(--bbc-white);
	background-color: transparent;
	border-color: rgb(255 255 255 / 60%);
}

.bb-consent-btn--ghost:hover {
	background-color: rgb(255 255 255 / 10%);
	border-color: var(--bbc-white);
}

.bb-consent-btn--outline {
	color: var(--bbc-blue);
	background-color: transparent;
	border-color: var(--bbc-blue);
}

.bb-consent-btn--outline:hover {
	color: var(--bbc-white);
	background-color: var(--bbc-blue);
}

/* Your Privacy Choices panel */

.bb-consent-dialog {
	width: min(100% - 32px, 520px);
	max-height: calc(100% - 32px);
	overflow-y: auto; /* the open tool list can outgrow short screens */
	padding: 0;
	color: var(--bbc-ink);
	background-color: var(--bbc-paper);
	border: 0;
	border-radius: var(--bbc-radius);
	box-shadow: 0 20px 48px rgb(17 28 51 / 35%);
}

.bb-consent-dialog::backdrop {
	background-color: rgb(17 28 51 / 60%);
}

.bb-consent-dialog__inner {
	position: relative;
	padding: 40px 32px 32px;
}

/* Pink circle with a white x, matching the theme's .modal-close-custom */
.bb-consent-dialog__close {
	position: absolute;
	top: 12px;
	right: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	padding: 0;
	font-size: 24px;
	line-height: 1;
	color: var(--bbc-white);
	cursor: pointer;
	background-color: var(--bbc-pink);
	border: 0;
	border-radius: 50%;
	transition: background-color 0.25s ease;
}

.bb-consent-dialog__close:hover {
	background-color: var(--bbc-blue);
}

/* Panel scale, overriding the theme's h3 (Inter-600, 26px) */
.bb-consent-dialog__title {
	margin: 0 0 16px;
	padding: 0 40px 0 0;
	font-family: var(--bbc-font-strong);
	font-size: 26px;
	font-weight: 600;
	line-height: 1.1;
	text-transform: uppercase;
	color: var(--bbc-blue);
}

.bb-consent-dialog__text,
.bb-consent-dialog__status {
	margin: 0 0 16px;
	font-size: 16px;
	line-height: 1.45;
	color: var(--bbc-ink);
}

.bb-consent-dialog__status {
	color: var(--bbc-blue);
}

.bb-consent-dialog__status strong {
	font-family: var(--bbc-font-strong);
	font-weight: 600;
}

.bb-consent-dialog__gpc {
	margin: 0 0 16px;
	padding: 12px 16px;
	font-size: 14px;
	line-height: 1.45;
	color: var(--bbc-ink);
	background-color: rgb(255 255 255 / 55%);
	border-left: 4px solid var(--bbc-gold);
	border-radius: 4px;
}

.bb-consent-dialog__toggle {
	margin: 0 0 24px;
}

/* Tool list: closed by default so the opt-out stays the first thing people see */

.bb-consent-tools {
	margin: 0 0 24px;
	border-top: 1px solid rgb(31 51 94 / 15%);
	border-bottom: 1px solid rgb(31 51 94 / 15%);
}

.bb-consent-tools__summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 0;
	font-family: var(--bbc-font-strong);
	font-size: 15px;
	color: var(--bbc-blue);
	cursor: pointer;
	list-style: none;
}

.bb-consent-tools__summary::-webkit-details-marker {
	display: none;
}

.bb-consent-tools__summary::after {
	content: "+";
	font-size: 22px;
	line-height: 1;
}

.bb-consent-tools[open] .bb-consent-tools__summary::after {
	content: "\2212";
}

.bb-consent-tools__summary:focus-visible {
	outline: 2px solid var(--bbc-gold);
	outline-offset: 3px;
}

.bb-consent-tools__group {
	margin: 0 0 18px;
}

.bb-consent-tools__heading {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 8px;
	font-family: var(--bbc-font-label);
	font-size: 12px;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--bbc-blue);
}

.bb-consent-tools__note {
	font-family: var(--bbc-font-body);
	font-size: 12px;
	letter-spacing: 0;
	text-transform: none;
	color: var(--bbc-ink);
}

.bb-consent-tools__list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.bb-consent-tools__list li {
	margin: 0;
	padding: 10px 12px;
	font-size: 13px;
	line-height: 1.4;
	color: var(--bbc-ink);
	background-color: rgb(255 255 255 / 55%);
	border-radius: 4px;
}

.bb-consent-tools__list li + li {
	margin-top: 6px;
}

.bb-consent-tools__list strong {
	font-family: var(--bbc-font-strong);
	font-weight: 600;
	color: var(--bbc-blue);
}

.bb-consent-tools__provider::before {
	content: " \00b7 ";
}

.bb-consent-tools__purpose {
	display: block;
	margin-top: 2px;
}

.bb-consent-dialog__note {
	margin: 0;
	font-size: 13px;
	line-height: 1.45;
	color: var(--bbc-ink);
}

.bb-consent-dialog a {
	color: var(--bbc-blue) !important;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.bb-consent-dialog .bb-consent-btn--primary:hover {
	border-color: var(--bbc-blue);
}

/* Link and icon, wherever the site places them */

.bb-consent-link {
	white-space: nowrap;
}

.bb-consent-icon {
	width: auto;
	height: 1em;
	margin-left: 6px;
	vertical-align: -0.15em;
}

.bb-consent-sr {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* Mobile: no room to open sideways, so the card spans the screen and the
   details open between the title and the buttons, growing the card upwards. */
@media (max-width: 767px) {
	.bb-consent-banner {
		left: 16px;
		grid-template-columns: 1fr;
		grid-template-rows: auto 0fr auto;
		grid-template-areas:
			"head"
			"details"
			"actions";
		transition:
			opacity var(--bbc-duration) var(--bbc-ease),
			transform var(--bbc-duration) var(--bbc-ease),
			grid-template-rows var(--bbc-duration) var(--bbc-ease);
	}

	.bb-consent-banner.is-expanded {
		grid-template-rows: auto 1fr auto;
	}

	.bb-consent-banner__details,
	.bb-consent-banner.is-expanded .bb-consent-banner__details {
		width: auto;
		max-height: none;
		min-height: 0;
	}

	.bb-consent-banner__text {
		width: auto;
		padding: 0 0 16px;
		border-right: 0;
	}

	.bb-consent-banner__confirm {
		grid-row: auto;
		grid-column: auto;
		width: auto;
	}

	.bb-consent-banner__actions .bb-consent-btn {
		flex: 1 1 0;
		padding-inline: 16px;
	}

	/* Chevron points down to where the details open */
	.bb-consent-banner__expand svg {
		transform: rotate(-90deg);
	}

	.bb-consent-banner.is-expanded .bb-consent-banner__expand svg {
		transform: rotate(90deg);
	}

	.bb-consent-dialog__inner {
		padding: 32px 20px 24px;
	}

	.bb-consent-dialog__toggle {
		width: 100%;
		white-space: normal;
	}
}

@media (prefers-reduced-motion: reduce) {
	.bb-consent-banner,
	.bb-consent-banner__details,
	.bb-consent-banner.is-expanded .bb-consent-banner__details,
	.bb-consent-banner__expand svg,
	.bb-consent-btn,
	.bb-consent-dialog__close {
		transition: none;
	}
}

@media print {
	.bb-consent-banner {
		display: none !important;
	}
}
