/*
 * Lumevo Privacy Popup.
 *
 * The values below are only a starting point taken from the theme's colour
 * presets. When the popup opens, the script replaces them with the colours,
 * fonts and button style it reads from the theme itself.
 */

.lpp,
.lpp-reopen {
	--lpp-bg: var(--wp--preset--color--base, #fff);
	--lpp-fg: var(--wp--preset--color--contrast, #1e1e1e);
	--lpp-line: rgba(0, 0, 0, 0.14);
	--lpp-accent: var(--wp--preset--color--primary, var(--wp--preset--color--contrast, #1e1e1e));
	--lpp-accent-fg: var(--wp--preset--color--base, #fff);
	--lpp-link: var(--lpp-accent);
	--lpp-radius: 10px;
	--lpp-btn-radius: 4px;
}

.lpp {
	position: fixed;
	z-index: 2147483000;
	box-sizing: border-box;
	font-family: inherit;
	font-size: 0.95em;
	line-height: 1.55;
	color: var(--lpp-fg);
	text-align: left;
}

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

.lpp *,
.lpp *::before,
.lpp *::after {
	box-sizing: border-box;
}

.lpp__panel {
	position: relative;
	padding: 20px 22px;
	color: var(--lpp-fg);
	background: var(--lpp-bg);
	border: 1px solid var(--lpp-line);
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
	animation: lpp-in 0.25s ease-out;
}

.lpp.is-dark .lpp__panel {
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
}

.lpp__panel.has-close {
	padding-right: 48px;
}

.lpp__heading {
	margin: 0 0 6px;
	padding: 0;
	font-family: var(--lpp-heading-font, inherit);
	font-size: 1.15em;
	font-weight: var(--lpp-heading-weight, 700);
	line-height: 1.3;
	color: inherit;
}

.lpp__message,
.lpp__links {
	margin: 0;
	padding: 0;
	color: inherit;
}

.lpp__links {
	margin-top: 8px;
	font-size: 0.93em;
}

.lpp__link,
.lpp__link:visited {
	color: var(--lpp-link);
	text-decoration: underline;
	text-underline-offset: 2px;
}

.lpp__link:hover,
.lpp__link:focus {
	color: var(--lpp-link);
	text-decoration: none;
}

.lpp__sep {
	margin: 0 0.5em;
	opacity: 0.6;
}

.lpp__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 16px;
}

.lpp__btn {
	flex: 1 1 auto;
	width: auto;
	min-height: 44px;
	margin: 0;
	padding: 0.65em 1.4em;
	font-family: var(--lpp-btn-font, inherit);
	font-size: 1em;
	font-weight: var(--lpp-btn-weight, 600);
	line-height: 1.2;
	letter-spacing: var(--lpp-btn-spacing, normal);
	text-align: center;
	text-transform: var(--lpp-btn-transform, none);
	text-shadow: none;
	color: var(--lpp-accent-fg);
	background: var(--lpp-accent);
	border: 2px solid var(--lpp-accent);
	border-radius: var(--lpp-btn-radius);
	box-shadow: none;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: opacity 0.15s ease;
}

/* Same size as Accept, so refusing is as easy as agreeing. */
.lpp__btn--reject {
	color: var(--lpp-fg);
	background: transparent;
	border-color: currentColor;
}

.lpp__btn:hover {
	opacity: 0.88;
}

.lpp__btn:focus-visible,
.lpp__close:focus-visible,
.lpp-reopen:focus-visible {
	outline: 2px solid var(--lpp-accent);
	outline-offset: 2px;
}

.lpp__close {
	position: absolute;
	top: 8px;
	right: 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	margin: 0;
	padding: 0;
	font: inherit;
	font-size: 24px;
	line-height: 1;
	color: inherit;
	background: transparent;
	border: 0;
	border-radius: 50%;
	box-shadow: none;
	letter-spacing: normal;
	text-transform: none;
	cursor: pointer;
	opacity: 0.7;
}

.lpp__close:hover {
	opacity: 1;
}

/* ---------- bar along the bottom ---------- */

.lpp--bar {
	right: 0;
	bottom: 0;
	left: 0;
}

.lpp--bar .lpp__panel {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 14px 32px;
	padding-right: max(22px, calc((100vw - 1200px) / 2));
	padding-left: max(22px, calc((100vw - 1200px) / 2));
	border-width: 1px 0 0;
	animation-name: lpp-up;
}

.lpp--bar .lpp__panel.has-close {
	padding-right: max(56px, calc((100vw - 1200px) / 2));
}

.lpp--bar .lpp__body {
	flex: 1 1 420px;
}

.lpp--bar .lpp__actions {
	flex: 0 1 auto;
	margin-top: 0;
}

/* ---------- Customize ---------- */

/* A quiet text button, so the box stays slim with three choices. */
.lpp .lpp__actions .lpp__btn--customize {
	flex: 0 0 auto;
	padding-right: 0.4em;
	padding-left: 0.4em;
	color: var(--lpp-fg);
	background: transparent;
	border-color: transparent;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.lpp__btn--save {
	color: var(--lpp-fg);
	background: transparent;
	border-color: currentColor;
}

.lpp__btn--save,
.lpp.is-customizing .lpp__btn--customize,
.lpp.is-customizing .lpp__btn--reject,
.lpp.is-customizing .lpp__more,
.lpp.is-customizing .lpp__body .lpp__message {
	display: none;
}

.lpp.is-customizing .lpp__btn--save {
	display: block;
}

.lpp__prefs {
	margin-top: 12px;
	max-height: min(320px, 50vh);
	padding-right: 6px;
	overflow-y: auto;
	overscroll-behavior: contain;
}

.lpp__prefs[hidden] {
	display: none;
}

.lpp__cats {
	margin: 0;
	padding: 0;
	list-style: none;
}

.lpp__cat {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	margin: 0;
	padding: 10px 0;
	border-top: 1px solid var(--lpp-line);
}

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

.lpp__cat-text {
	flex: 1 1 auto;
	min-width: 0;
}

.lpp__cat-name {
	display: block;
	margin: 0 0 2px;
	font-weight: 600;
	color: inherit;
	cursor: pointer;
}

.lpp__cat-desc {
	display: block;
	font-size: 0.9em;
	line-height: 1.45;
	opacity: 0.8;
}

.lpp__switch {
	position: relative;
	flex: 0 0 auto;
	display: inline-flex;
	margin-top: 2px;
}

.lpp__switch {
	cursor: pointer;
}

/* Invisible but on top of the track, and the whole switch is its label too. */
.lpp__switch input {
	position: absolute;
	inset: 0;
	z-index: 1;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	opacity: 0;
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
}

.lpp__switch-track {
	position: relative;
	display: block;
	width: 38px;
	height: 22px;
	background: transparent;
	border: 1.5px solid var(--lpp-fg);
	border-radius: 999px;
	transition: background-color 0.15s ease;
}

.lpp__switch-track::after {
	content: "";
	position: absolute;
	top: 2px;
	left: 2px;
	width: 15px;
	height: 15px;
	background: var(--lpp-fg);
	border-radius: 50%;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
	transition: transform 0.15s ease;
}

.lpp__switch input:checked + .lpp__switch-track {
	background: var(--lpp-accent);
	border-color: var(--lpp-accent);
}

.lpp__switch input:checked + .lpp__switch-track::after {
	background: var(--lpp-accent-fg);
	transform: translateX(16px);
}

.lpp__switch input:focus-visible + .lpp__switch-track {
	outline: 2px solid var(--lpp-accent);
	outline-offset: 2px;
}

.lpp__switch.is-locked {
	opacity: 0.55;
}

.lpp__switch.is-locked input {
	cursor: not-allowed;
}

/* ---------- "See more" ---------- */

.lpp.has-more:not(.is-customizing) .lpp__message:not(.is-open) {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
}

.lpp__more {
	display: inline;
	width: auto;
	min-height: 0;
	letter-spacing: normal;
	text-transform: none;
	border-radius: 0;
	margin: 2px 0 0;
	padding: 0;
	font: inherit;
	font-size: 0.92em;
	font-weight: 600;
	color: var(--lpp-link);
	background: none;
	border: 0;
	box-shadow: none;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

.lpp__more[hidden] {
	display: none;
}

.lpp__more:hover {
	text-decoration: none;
}

.lpp__more:focus-visible {
	outline: 2px solid var(--lpp-accent);
	outline-offset: 2px;
}

/* ---------- small box in a corner ---------- */

.lpp--box-left,
.lpp--box-right {
	bottom: 20px;
	width: min(360px, calc(100vw - 32px));
	font-size: 0.875em;
}

.lpp--box-left {
	left: 20px;
}

.lpp--box-right {
	right: 20px;
}

.lpp--box-left .lpp__panel,
.lpp--box-right .lpp__panel {
	padding: 16px 18px;
	border-radius: var(--lpp-radius);
	animation-name: lpp-up;
}

.lpp--box-left .lpp__panel.has-close,
.lpp--box-right .lpp__panel.has-close {
	padding-right: 42px;
}

.lpp--box-left .lpp__heading,
.lpp--box-right .lpp__heading {
	font-size: 1.08em;
}

.lpp--box-left .lpp__links,
.lpp--box-right .lpp__links {
	margin-top: 6px;
}

/* Two buttons side by side, sharing the width. */
.lpp--box-left .lpp__actions,
.lpp--box-right .lpp__actions {
	gap: 8px;
	margin-top: 12px;
}

.lpp--box-left .lpp__btn,
.lpp--box-right .lpp__btn {
	flex: 1 1 0;
	min-width: 0;
	min-height: 40px;
	padding: 0.55em 0.9em;
}

.lpp--box-left .lpp__close,
.lpp--box-right .lpp__close {
	top: 4px;
	right: 4px;
	width: 32px;
	height: 32px;
	font-size: 20px;
}

/* ---------- centre of the screen ---------- */

.lpp--modal {
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(0, 0, 0, 0.5);
}

.lpp--modal .lpp__panel {
	width: 100%;
	max-width: 520px;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	padding: 26px 28px;
	border-radius: var(--lpp-radius);
}

.lpp--modal .lpp__panel.has-close {
	padding-right: 52px;
}

html.lpp-locked,
html.lpp-locked body {
	overflow: hidden;
}

/* ---------- "Privacy settings" button ---------- */

.lpp-reopen {
	position: fixed;
	bottom: 16px;
	z-index: 2147482999;
	margin: 0;
	padding: 8px 14px;
	font-family: inherit;
	font-size: 13px;
	line-height: 1.2;
	color: var(--lpp-fg);
	background: var(--lpp-bg);
	border: 1px solid var(--lpp-line);
	border-radius: 999px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.14);
	cursor: pointer;
}

.lpp-reopen--left {
	left: 16px;
}

.lpp-reopen--right {
	right: 16px;
}

/* ---------- small screens ---------- */

@media (max-width: 600px) {
	/* A slim card across the bottom, clear of the phone's home bar. */
	.lpp--box-left,
	.lpp--box-right {
		right: 10px;
		bottom: calc(10px + env(safe-area-inset-bottom, 0px));
		left: 10px;
		width: auto;
	}

	.lpp--box-left .lpp__panel,
	.lpp--box-right .lpp__panel {
		padding: 14px 16px;
	}

	.lpp--box-left .lpp__actions,
	.lpp--box-right .lpp__actions {
		margin-top: 10px;
	}

	/* Reject and Accept share a row, each on one line; Customize gets its own line below. */
	.lpp__btn {
		white-space: nowrap;
	}

	.lpp .lpp__actions .lpp__btn--customize {
		flex: 1 1 100%;
		order: 3;
		min-height: 32px;
		padding-top: 0.2em;
		padding-bottom: 0.2em;
	}

	.lpp--bar .lpp__panel {
		padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px));
		font-size: 0.92em;
	}

	.lpp--bar .lpp__btn {
		flex: 1 1 0;
		min-height: 40px;
	}

	.lpp-reopen {
		bottom: calc(12px + env(safe-area-inset-bottom, 0px));
	}

	.lpp--bar .lpp__panel.has-close {
		padding-right: 48px;
	}

	.lpp--bar .lpp__actions {
		flex: 1 1 100%;
	}

	.lpp--modal .lpp__panel {
		padding: 22px 20px;
	}
}

@keyframes lpp-in {
	from {
		opacity: 0;
		transform: scale(0.97);
	}
}

@keyframes lpp-up {
	from {
		opacity: 0;
		transform: translateY(16px);
	}
}

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