/*
 * Leitor de PDF do Acervo (assets/js/leitor-pdf.js): ocupa a tela toda, com
 * a barra no alto e as páginas uma embaixo da outra.
 */

.mer-leitor-aberto,
.mer-leitor-aberto body {
	overflow: hidden;
}

.mer-leitor {
	width: 100vw;
	max-width: none;
	height: 100vh;
	height: 100dvh;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: #3a3330;
	color: #fff;
}

.mer-leitor[open] {
	display: flex;
	flex-direction: column;
}

.mer-leitor::backdrop {
	background: rgba(20, 5, 5, 0.85);
}

.mer-leitor__barra {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.6rem 1rem;
	background: linear-gradient(135deg, #a50311 0%, #6e0008 100%);
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.mer-leitor__titulo {
	min-width: 0;
	margin: 0;
	overflow: hidden;
	font-family: 'Cormorant Garamond', Georgia, serif;
	font-size: 1.3rem;
	font-weight: 700;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.mer-leitor__controles {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

.mer-leitor__pagina {
	margin-right: 0.5rem;
	color: #f3cf8a;
	font-size: 0.95rem;
	white-space: nowrap;
}

.mer-leitor__botao {
	min-width: 40px;
	height: 40px;
	display: inline-grid;
	place-items: center;
	padding: 0 0.85rem;
	border: 0;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.14);
	color: #fff !important;
	font-family: 'EB Garamond', Georgia, serif;
	font-size: 1.15rem;
	font-weight: 700;
	line-height: 1;
	text-decoration: none !important;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.mer-leitor__botao:hover,
.mer-leitor__botao:focus-visible {
	background: rgba(255, 255, 255, 0.28);
}

.mer-leitor__baixar {
	font-size: 1rem;
}

.mer-leitor__fechar {
	position: relative;
	padding: 0;
	background: #fff;
}

.mer-leitor__fechar::before,
.mer-leitor__fechar::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 16px;
	height: 2px;
	background: #a50311;
	transform: translate(-50%, -50%) rotate(45deg);
}

.mer-leitor__fechar::after {
	transform: translate(-50%, -50%) rotate(-45deg);
}

.mer-leitor__fechar:hover {
	background: #f6eee6;
}

.mer-leitor__area {
	flex: 1 1 auto;
	overflow: auto;
	padding: 1rem;
	-webkit-overflow-scrolling: touch;
}

.mer-leitor__aviso {
	margin: 3rem 0;
	color: rgba(255, 255, 255, 0.8);
	font-size: 1.1rem;
	text-align: center;
}

.mer-leitor__folhas {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 1rem;
}

/* Margem automática centraliza sem cortar a esquerda quando a folha,
   ampliada, fica mais larga que a tela. */
.mer-leitor__folha {
	flex: 0 0 auto;
	max-width: none;
	margin: 0 auto;
	background: #fff;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

.mer-leitor__folha canvas {
	display: block;
	width: 100%;
	height: 100%;
}

@media (max-width: 575.98px) {
	.mer-leitor__barra {
		flex-wrap: wrap;
		gap: 0.4rem;
	}

	.mer-leitor__titulo {
		flex: 1 1 100%;
		font-size: 1.1rem;
	}

	.mer-leitor__controles {
		width: 100%;
		justify-content: flex-end;
	}

	.mer-leitor__pagina {
		margin-right: auto;
	}

	.mer-leitor__area {
		padding: 0.5rem;
	}
}
