/**
 * Liseuse PDF.
 *
 * Deux rendus coexistent : l'<object> natif sur desktop, et la liseuse
 * PDF.js ailleurs. Le cadre reçoit la classe « est-liseuse » quand le
 * second prend le relais.
 *
 * @package CGT_Publications
 */

.cgt-article__liseuse-cadre {
	position: relative;
}

/* ---------------------------------------------------------------------
 * Rendu natif (desktop)
 * ------------------------------------------------------------------ */

.cgt-article__pdf {
	display: block;
	width: 100%;
	height: 80vh;
	min-height: 480px;
	border: 0;
	background: #f4f4f4;
}

/* ---------------------------------------------------------------------
 * Liseuse PDF.js
 * ------------------------------------------------------------------ */

.cgt-article__liseuse-cadre.est-liseuse {
	border: 1px solid #ddd;
	border-radius: 4px;
	overflow: hidden;
	background: #525659;
}

/* Barre d'outils. Collée en haut du cadre, elle reste accessible pendant
   le défilement des pages. */
.cgt-liseuse__barre {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 8px;
	background: #3a3d40;
	color: #fff;
}

.cgt-liseuse__btn {
	flex: 0 0 auto;
	min-width: 40px;
	min-height: 40px; /* cible tactile confortable */
	padding: 0 10px;
	border: 0;
	border-radius: 4px;
	background: rgba( 255, 255, 255, 0.12 );
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

.cgt-liseuse__btn:hover:not( :disabled ),
.cgt-liseuse__btn:focus-visible {
	background: rgba( 255, 255, 255, 0.24 );
}

.cgt-liseuse__btn:disabled {
	opacity: 0.35;
	cursor: default;
}

.cgt-liseuse__compteur {
	display: flex;
	align-items: center;
	gap: 4px;
	margin: 0 4px;
	font-size: 14px;
	white-space: nowrap;
}

.cgt-liseuse__champ {
	width: 3.5em;
	min-height: 32px;
	padding: 2px 4px;
	border: 1px solid rgba( 255, 255, 255, 0.3 );
	border-radius: 3px;
	background: rgba( 0, 0, 0, 0.25 );
	color: #fff;
	font-size: 14px;
	text-align: center;
	-moz-appearance: textfield;
}

.cgt-liseuse__champ::-webkit-outer-spin-button,
.cgt-liseuse__champ::-webkit-inner-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

/* Zone défilante. La hauteur fixe reproduit le cadre de l'<object> et
   laisse la suite de la page atteignable. overscroll-behavior empêche le
   défilement de se propager au document une fois la fin atteinte. */
.cgt-article__pdf-pages {
	position: relative;
	height: 80vh;
	min-height: 420px;
	max-height: 900px;
	padding: 12px 0;
	overflow: auto;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
	text-align: center;
}

.cgt-article__pdf-page {
	display: inline-block;
	height: auto;
	margin-bottom: 12px;
	background: #fff;
	box-shadow: 0 1px 6px rgba( 0, 0, 0, 0.4 );
}

.cgt-article__pdf-page:last-child {
	margin-bottom: 0;
}

.cgt-article__pdf-etat {
	margin: 0;
	padding: 24px 0;
	color: #666;
	text-align: center;
}

.cgt-article__repli {
	padding: 32px;
	text-align: center;
}

@media ( max-width: 480px ) {

	.cgt-liseuse__barre {
		gap: 4px;
		padding: 6px;
	}

	.cgt-article__pdf-pages {
		height: 70vh;
	}
}
