/* =========================================================
   LD — Ícone Flutuante
   As variáveis (--ld-fi-*) são geradas pelo PHP a partir
   das configurações do plugin.
   ========================================================= */

/*
 * A raiz é o elemento flutuante. É ela que o JS move
 * (translate/rotate/scale) — o círculo e a área de clique
 * vão junto, em vez de o miolo deslizar dentro de uma
 * caixa parada.
 */
.ld-fi-raiz {
	position: fixed;
	z-index: var(--ld-fi-z, 9998);
	width: var(--ld-fi-tamanho, 78px);
	height: var(--ld-fi-tamanho, 78px);
	pointer-events: none;
	overflow: visible !important;
	will-change: transform;
	transform: translate3d(0, 0, 0);
}

.ld-fi-top-left {
	top: var(--ld-fi-margem-y, 28px);
	left: var(--ld-fi-margem-x, 28px);
}

.ld-fi-top-right {
	top: var(--ld-fi-margem-y, 28px);
	right: var(--ld-fi-margem-x, 28px);
}

.ld-fi-bottom-left {
	bottom: var(--ld-fi-margem-y, 28px);
	left: var(--ld-fi-margem-x, 28px);
}

.ld-fi-bottom-right {
	bottom: var(--ld-fi-margem-y, 28px);
	right: var(--ld-fi-margem-x, 28px);
}


/* ---------- botão ---------- */

.ld-fi-botao {
	position: relative;
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	pointer-events: auto;
	-webkit-appearance: none;
	appearance: none;
	-webkit-tap-highlight-color: transparent;

	/*
	 * Blindagem. Temas costumam aplicar um reset em TODO botão
	 * (border-radius pequeno, overflow:hidden, min-height, uma
	 * transition de cor). O overflow:hidden é o pior: recorta a
	 * sombra do círculo e o scale do hover num quadrado.
	 */
	overflow: visible !important;
	border-radius: 50% !important;
	box-shadow: none !important;
	line-height: 0 !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-width: none !important;
	max-height: none !important;
	text-transform: none !important;
	letter-spacing: normal !important;
	transition: none !important;
	filter: none !important;
	clip-path: none !important;
}

.ld-fi-botao:focus {
	outline: none;
}

.ld-fi-botao:focus-visible .ld-fi-circulo {
	box-shadow:
		0 0 0 3px rgba(255, 255, 255, .9),
		0 0 0 6px rgba(20, 17, 14, .55);
}

/*
 * Mantida por compatibilidade com a marcação.
 * Desde a 1.0.2 não recebe mais transform — quem se
 * move é a .ld-fi-raiz.
 */
.ld-fi-flutua {
	display: block;
	width: 100%;
	height: 100%;
	overflow: visible !important;
}

.ld-fi-circulo {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50% !important;
	overflow: hidden;
	border: 0 !important;
	background: var(--ld-fi-slide-fundo, #F3EDE3);
	box-shadow: var(--ld-fi-sombra, none);
	transition: transform .35s cubic-bezier(.2, .8, .25, 1),
		box-shadow .35s ease;
	transform: scale(1);
}

.ld-fi-botao:hover .ld-fi-circulo {
	transform: scale(1.08);
}

.ld-fi-botao:active .ld-fi-circulo {
	transform: scale(.96);
}

.ld-fi-circulo img {
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	min-width: 0 !important;
	min-height: 0 !important;
	max-width: none !important;
	max-height: none !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	box-shadow: none !important;
	object-fit: cover;
	object-position: center;
	border-radius: 50%;
	user-select: none;
	-webkit-user-drag: none;
}

.ld-fi-oculto {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}


/* ---------- véu ---------- */

.ld-fi-veu {
	position: fixed;
	inset: 0;
	z-index: calc(var(--ld-fi-z, 9998) + 1);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: var(--ld-fi-veu, rgba(20, 17, 14, .55));
	opacity: 0;
	transition: opacity .28s ease;
	-webkit-backdrop-filter: blur(2px);
	backdrop-filter: blur(2px);
}

.ld-fi-veu[hidden] {
	display: none;
}

.ld-fi-veu.ld-fi-visivel {
	opacity: 1;
}


/* ---------- painel ---------- */

.ld-fi-painel {
	position: relative;
	display: flex;
	flex-direction: column;
	width: var(--ld-fi-slide-l, 80vw);
	height: var(--ld-fi-slide-a, 82vh);
	max-width: var(--ld-fi-slide-max-l, none);
	max-height: var(--ld-fi-slide-max-a, none);
	background: var(--ld-fi-slide-fundo, #F3EDE3);
	border-radius: var(--ld-fi-slide-raio, 6px);
	box-shadow: 0 24px 70px rgba(20, 17, 14, .38);
	overflow: hidden;
	transform: translateY(18px) scale(.98);
	opacity: 0;
	transition: transform .34s cubic-bezier(.2, .8, .25, 1),
		opacity .28s ease;
}

.ld-fi-veu.ld-fi-visivel .ld-fi-painel {
	transform: translateY(0) scale(1);
	opacity: 1;
}

.ld-fi-corpo {
	flex: 1 1 auto;
	min-height: 0;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
}

/* Um iframe colado no campo de HTML ocupa o painel inteiro */
.ld-fi-corpo > iframe {
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}


/* ---------- botão fechar ---------- */

.ld-fi-fechar {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, .86);
	color: #14110E;
	cursor: pointer;
	box-shadow: 0 2px 10px rgba(20, 17, 14, .18);
	transition: background .2s ease, transform .2s ease;
	-webkit-appearance: none;
	appearance: none;

	/* mesma blindagem contra o reset de botão do tema */
	overflow: visible !important;
	border-radius: 50% !important;
	line-height: 0 !important;
	min-width: 0 !important;
	min-height: 0 !important;
}

.ld-fi-fechar:hover {
	background: #fff;
	transform: rotate(90deg);
}

.ld-fi-fechar:focus-visible {
	outline: 2px solid #14110E;
	outline-offset: 2px;
}

.ld-fi-fechar svg {
	width: 18px;
	height: 18px;
	display: block;
}


/* ---------- corpo travado enquanto aberto ---------- */

html.ld-fi-travado,
body.ld-fi-travado {
	overflow: hidden !important;
}


/* ---------- telas pequenas ---------- */

@media (max-width: 640px) {

	.ld-fi-painel {
		width: 94vw;
		height: 88vh;
		max-width: none;
		max-height: none;
	}

	.ld-fi-veu {
		padding: 8px;
	}
}


/* ---------- reduzir movimento ---------- */

@media (prefers-reduced-motion: reduce) {

	.ld-fi-veu,
	.ld-fi-painel,
	.ld-fi-circulo,
	.ld-fi-fechar {
		transition-duration: .01ms !important;
	}
}
