/* PJ PDF Embed — visualizador público (sem segurança) + botão e janela no editor */

.pdfembed {
	--pdf-altura: 800px;
	--pdf-borda: #d8dce3;
	--pdf-fundo: #f3f4f7;
	--pdf-barra: #ffffff;
	--pdf-texto: #23282d;
	--pdf-acento: #d4af37;
	--pdf-acento-forte: #b8912a;
	--pdf-acento-texto: #0b2545;

	margin: 24px 0;
	border: 1px solid var(--pdf-borda);
	border-radius: 6px;
	overflow: hidden;
	background: var(--pdf-barra);
	color: var(--pdf-texto);
	outline: none;
}

.pdfembed-titulo {
	margin: 0;
	padding: 14px 16px 0;
	font-size: 18px;
	line-height: 1.3;
}

/* ---- barra de ferramentas ---- */

.pdfembed-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding: 10px 12px;
	background: var(--pdf-barra);
	border-bottom: 1px solid var(--pdf-borda);
}

.pdfembed-bar-grupo {
	display: flex;
	align-items: center;
	gap: 6px;
}

.pdfembed-bar-direita {
	margin-left: auto;
}

.pdfembed-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 34px;
	height: 34px;
	padding: 0 12px;
	border: 1px solid var(--pdf-borda);
	border-radius: 4px;
	background: #fff;
	color: var(--pdf-texto);
	font: inherit;
	font-size: 14px;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: background .15s, border-color .15s;
}

.pdfembed-btn:hover,
.pdfembed-btn:focus {
	background: #eef1f6;
	border-color: #b9c0cc;
	color: var(--pdf-texto);
	text-decoration: none;
}

.pdfembed-btn-download {
	background: var(--pdf-acento);
	border-color: var(--pdf-acento-forte);
	color: var(--pdf-acento-texto);
	font-weight: 700;
	box-shadow: 0 1px 2px rgba(11, 37, 69, .18);
}

.pdfembed-btn-download:hover,
.pdfembed-btn-download:focus {
	background: var(--pdf-acento-forte);
	border-color: var(--pdf-acento-forte);
	color: var(--pdf-acento-texto);
}

.pdfembed-paginacao {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	font-size: 14px;
}

.pdfembed-pagina {
	width: 48px;
	height: 34px;
	padding: 0 6px;
	border: 1px solid var(--pdf-borda);
	border-radius: 4px;
	text-align: center;
	font: inherit;
	font-size: 14px;
	background: #fff;
}

.pdfembed-sep {
	color: #7a8290;
}

/* ---- palco ---- */

.pdfembed-palco {
	position: relative;
	height: var(--pdf-altura);
	overflow: auto;
	padding: 12px;
	background: var(--pdf-fundo);
	text-align: center;
	-webkit-overflow-scrolling: touch;
}

.pdfembed-canvas {
	display: inline-block;
	max-width: 100%;
	background: #fff;
	box-shadow: 0 1px 6px rgba(0, 0, 0, .18);
	vertical-align: top;
}

.pdfembed-aviso {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	max-width: 80%;
	padding: 12px 18px;
	border-radius: 4px;
	background: rgba(255, 255, 255, .95);
	box-shadow: 0 1px 6px rgba(0, 0, 0, .15);
	font-size: 14px;
	color: #4a5260;
}

.pdfembed-aviso-erro {
	color: #8a1f1f;
	background: #fdf0f0;
}

/* ---- conteúdo não selecionável ---- */

.pdfembed-palco,
.pdfembed-canvas {
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;
}

/* ---- mensagem no lugar do visualizador ---- */

.pdfembed-mensagem {
	margin: 24px 0;
	padding: 16px 18px;
	border: 1px solid #e3d4a8;
	border-left: 4px solid #d8b24c;
	border-radius: 4px;
	background: #fdf8e9;
	font-size: 15px;
	color: #4a4a3f;
}

/* ---- tela cheia ---- */

.pdfembed:fullscreen,
.pdfembed:-webkit-full-screen {
	margin: 0;
	border: 0;
	border-radius: 0;
	display: flex;
	flex-direction: column;
	background: #fff;
}

.pdfembed:fullscreen .pdfembed-palco,
.pdfembed:-webkit-full-screen .pdfembed-palco {
	flex: 1 1 auto;
	height: auto;
}

/* ---- celular ---- */

@media (max-width: 600px) {
	.pdfembed-bar {
		padding: 8px;
	}

	.pdfembed-bar-direita {
		margin-left: 0;
		width: 100%;
	}

	.pdfembed-btn-download {
		width: 100%;
	}

	.pdfembed-palco {
		height: min(var(--pdf-altura), 70vh);
		padding: 8px;
	}

	.pdfembed-btn[data-act="full"] {
		display: none;
	}
}

/* ---- impressão ---- */

@media print {
	.pdfembed-palco,
	.pdfembed-bar {
		display: none !important;
	}

	.pdfembed::after {
		content: "Este documento pode ser baixado pelo link do visualizador.";
		display: block;
		padding: 16px;
		font-size: 13px;
	}
}

/* ==========================================================================
 * Botão no editor (TinyMCE) e janela de escolha/envio rápido
 * ========================================================================== */

i.mce-i-pdfembed:before {
	font-family: dashicons, sans-serif;
	content: "\f497";
	font-size: 20px;
	line-height: 1;
	vertical-align: top;
	speak: never;
	-webkit-font-smoothing: antialiased;
	color: #2271b1;
}

i.mce-i-pdfembed {
	font: 400 20px/1 dashicons, sans-serif;
	padding: 0;
	vertical-align: top;
	margin: 0;
	width: 20px;
	height: 20px;
	text-align: center;
}

.pdfembed-pick-fundo {
	display: none;
	position: fixed;
	inset: 0;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 160000;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, .55);
}

.pdfembed-pick,
.pdfembed-pick * {
	box-sizing: border-box;
}

.pdfembed-pick {
	width: 540px;
	max-width: calc(100vw - 32px);
	max-height: calc(100vh - 64px);
	overflow: auto;
	padding: 20px 22px;
	border-radius: 4px;
	background: #fff;
	box-shadow: 0 4px 24px rgba(0, 0, 0, .3);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 14px;
	line-height: 1.5;
	color: #1d2327;
	text-align: left;
}

.pdfembed-pick h2.pdfembed-pick-titulo {
	margin: 0 0 14px;
	padding: 0;
	font-family: inherit;
	font-size: 18px;
	font-weight: 600;
	line-height: 1.3;
	color: #1d2327;
	text-transform: none;
	letter-spacing: normal;
}

.pdfembed-pick-zona {
	padding: 18px 16px 16px;
	margin-bottom: 12px;
	border: 2px dashed #c3c4c7;
	border-radius: 4px;
	background: #f6f7f7;
	text-align: center;
	transition: border-color .15s, background .15s;
}

.pdfembed-pick-zona-ativa {
	border-color: #2271b1;
	background: #f0f6fc;
}

.pdfembed-pick-icone {
	font-size: 28px;
	width: 28px;
	height: 28px;
	color: #787c82;
}

.pdfembed-pick-zona-texto {
	margin: 6px 0 10px;
	font-size: 13px;
	color: #50575e;
}

.pdfembed-pick-limite {
	margin: 10px 0 0;
	font-size: 12px;
	color: #787c82;
}

.pdfembed-pick-arquivo {
	display: none;
}

.pdfembed-pick-progresso {
	display: none;
	height: 6px;
	margin-bottom: 10px;
	border-radius: 3px;
	background: #dcdcde;
	overflow: hidden;
}

.pdfembed-pick-barra {
	width: 0;
	height: 100%;
	background: #2271b1;
	transition: width .15s linear;
}

.pdfembed-pick-recado {
	margin: 0;
	font-size: 13px;
	line-height: 1.5;
}

.pdfembed-pick-recado-erro {
	margin-bottom: 10px;
	padding: 8px 10px;
	border-left: 4px solid #d63638;
	background: #fcf0f1;
	color: #8a1f1f;
}

.pdfembed-pick-recado-aviso {
	margin-bottom: 10px;
	padding: 8px 10px;
	border-left: 4px solid #dba617;
	background: #fcf9e8;
	color: #6a5100;
}

.pdfembed-pick-ou {
	margin: 4px 0 10px;
	padding-top: 12px;
	border-top: 1px solid #dcdcde;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: #787c82;
}

.pdfembed-pick-busca {
	width: 100%;
	margin-bottom: 10px;
}

.pdfembed-pick-lista {
	width: 100%;
	margin-bottom: 14px;
	padding: 4px;
	border: 1px solid #8c8f94;
	border-radius: 3px;
	font-size: 13px;
	background: #fff;
	height: auto;
}

.pdfembed-pick-lista option {
	padding: 4px 6px;
}

.pdfembed-pick-sem-arquivo {
	color: #b32d2e;
}

.pdfembed-pick-opcoes {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	padding: 12px 0;
	border-top: 1px solid #dcdcde;
	font-size: 13px;
}

.pdfembed-pick-opcoes label {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-family: inherit;
	font-size: 13px;
	font-weight: 400;
	color: #1d2327;
}

.pdfembed-pick-altura {
	width: 84px;
}

.pdfembed-pick input[type="search"],
.pdfembed-pick input[type="number"],
.pdfembed-pick select:not(.pdfembed-pick-lista) {
	height: 32px;
	padding: 0 8px;
	border: 1px solid #8c8f94;
	border-radius: 3px;
	background: #fff;
	font-family: inherit;
	font-size: 13px;
	line-height: 1.4;
	color: #2c3338;
	box-shadow: none;
}

.pdfembed-pick input:focus,
.pdfembed-pick select:focus {
	border-color: #2271b1;
	outline: 2px solid transparent;
	box-shadow: 0 0 0 1px #2271b1;
}

.pdfembed-pick-rodape {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-top: 6px;
	padding-top: 14px;
	border-top: 1px solid #dcdcde;
}

.pdfembed-pick-link {
	font-size: 13px;
	text-decoration: none;
	color: #2271b1;
}

.pdfembed-pick-botoes {
	display: flex;
	gap: 8px;
	margin-left: auto;
}

.pdfembed-b {
	display: inline-block;
	min-height: 32px;
	padding: 4px 14px;
	border: 1px solid #2271b1;
	border-radius: 3px;
	background: #f6f7f7;
	color: #2271b1;
	font-family: inherit;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.6;
	text-align: center;
	text-decoration: none;
	cursor: pointer;
	box-shadow: none;
}

.pdfembed-b:hover,
.pdfembed-b:focus {
	background: #f0f0f1;
	border-color: #0a4b78;
	color: #0a4b78;
}

.pdfembed-b-primario {
	border-color: #2271b1;
	background: #2271b1;
	color: #fff;
}

.pdfembed-b-primario:hover,
.pdfembed-b-primario:focus {
	background: #135e96;
	border-color: #135e96;
	color: #fff;
}
