/* ==========================================================================
   MG Liseuse Gazette
   ========================================================================== */

/* --------------------------------------------------------------------------
   Styles requis par StPageFlip (page-flip 2.0.7, licence MIT).
   Repris de src/Style/stPageFlip.css et integres ici pour qu ils soient
   toujours charges. Sans eux le bloc de pages n a pas de hauteur et le canvas
   de rendu n est pas positionne : la liseuse reste vide.
   Le selecteur .stf__wrapper corrige au passage une coquille de la librairie,
   qui ecrit .sft__wrapper dans sa feuille d origine.
   -------------------------------------------------------------------------- */

.stf__parent {
	position: relative;
	display: block;
	box-sizing: border-box;
	transform: translateZ(0);
	-ms-touch-action: pan-y;
	touch-action: pan-y;
}

.stf__wrapper,
.sft__wrapper {
	position: relative;
	width: 100%;
	box-sizing: border-box;
}

.stf__parent canvas {
	position: absolute;
	width: 100%;
	height: 100%;
	left: 0;
	top: 0;
}

.stf__block {
	position: absolute;
	width: 100%;
	height: 100%;
	box-sizing: border-box;
	perspective: 2000px;
}

.stf__item {
	display: none;
	position: absolute;
	transform-style: preserve-3d;
}

.stf__outerShadow,
.stf__innerShadow,
.stf__hardShadow,
.stf__hardInnerShadow {
	position: absolute;
	left: 0;
	top: 0;
}

.mgl-wrap {
	--mgl-paper: #ffffff;
	--mgl-stage: #eceae5;
	--mgl-ink: #2b2b2b;
	--mgl-rule: rgba(0, 0, 0, .12);
	display: block;
}

.mgl-notice {
	padding: 18px 20px;
	border: 1px dashed var(--mgl-rule);
	border-radius: 4px;
	font-size: 14px;
	line-height: 1.5;
	color: var(--mgl-ink);
	background: #fafafa;
}

/* --------------------------------------------------------------------------
   Liseuse
   -------------------------------------------------------------------------- */

.mgl-reader {
	margin: 0 auto;
	max-width: 1000px;
}

.mgl-current-title {
	margin: 0 0 12px;
	text-align: center;
	font-size: 1.15em;
	line-height: 1.3;
}

.mgl-stage {
	position: relative;
	background: var(--mgl-stage);
	padding: 20px;
	border-radius: 3px;
	overflow: hidden;
	min-height: 220px;
	transition: height .25s ease;
}

.mgl-flip {
	margin: 0 auto;
	touch-action: pan-y;
}

/* Pages rendues par StPageFlip */
.mgl-flip .stf__item img,
.mgl-flip img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	background: var(--mgl-paper);
	pointer-events: none;
	-webkit-user-drag: none;
	user-select: none;
}

.mgl-has-shadow .mgl-flip .stf__item {
	box-shadow: 0 2px 14px rgba(0, 0, 0, .22);
}

/* Decoupe de la moitie vide quand une page est seule (voir mgl-liseuse.js) */
.mgl-flip.mgl-clip-right canvas {
	clip-path: inset(0 0 0 50%);
}

.mgl-flip.mgl-clip-left canvas {
	clip-path: inset(0 50% 0 0);
}

/* Chargement */
.mgl-loader {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	background: var(--mgl-stage);
	font-size: 14px;
	color: var(--mgl-ink);
	z-index: 5;
}

.mgl-loader[hidden] {
	display: none;
}

.mgl-spinner {
	width: 26px;
	height: 26px;
	border: 2px solid var(--mgl-rule);
	border-top-color: var(--mgl-ink);
	border-radius: 50%;
	animation: mgl-spin .8s linear infinite;
}

@keyframes mgl-spin {
	to {
		transform: rotate(360deg);
	}
}

/* --------------------------------------------------------------------------
   Barre d outils
   -------------------------------------------------------------------------- */

.mgl-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 14px;
}

.mgl-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 40px;
	height: 40px;
	padding: 0 11px;
	border: 0;
	border-radius: 6px;
	background-color: #1d3557;
	color: #fff;
	font: inherit;
	font-size: 14px;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .18s ease, opacity .18s ease;
}

.mgl-btn:hover,
.mgl-btn:focus-visible {
	background-color: #457b9d;
	color: #fff;
	text-decoration: none;
}

.mgl-btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.mgl-btn[disabled] {
	opacity: .35;
	cursor: default;
}

.mgl-btn svg {
	width: 18px;
	height: 18px;
	flex: 0 0 18px;
}

.mgl-btn-text {
	padding: 0 15px;
}

.mgl-counter {
	min-width: 92px;
	text-align: center;
	font-size: 14px;
	font-variant-numeric: tabular-nums;
	color: var(--mgl-ink);
}

.mgl-sep {
	width: 1px;
	height: 22px;
	margin: 0 4px;
	background: var(--mgl-rule);
}

/* --------------------------------------------------------------------------
   Plein ecran
   La mise en page est pilotee par la classe .is-fullscreen, posee par le JS,
   et non par la pseudo-classe :fullscreen : cela couvre aussi le plein ecran
   simule des navigateurs qui n exposent pas l API (iPhone notamment).
   -------------------------------------------------------------------------- */

.mgl-wrap.mgl-fs-fallback {
	position: fixed;
	inset: 0;
	z-index: 99999;
}

html.mgl-fs-lock,
html.mgl-fs-lock body {
	overflow: hidden;
}

.mgl-wrap.is-fullscreen {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 14px;
	background: var(--mgl-stage);
	box-sizing: border-box;
}

.mgl-wrap.is-fullscreen .mgl-reader {
	max-width: none !important;
	width: 100%;
	height: 100%;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.mgl-wrap.is-fullscreen .mgl-stage {
	background: none;
	padding: 0;
	overflow: visible;
	min-height: 0;
}

.mgl-wrap.is-fullscreen .mgl-archives {
	display: none;
}

/* --------------------------------------------------------------------------
   Carrousel des archives
   -------------------------------------------------------------------------- */

.mgl-archives {
	margin-top: 42px;
}

.mgl-archives-title {
	margin: 0 0 18px;
}

.mgl-carousel {
	position: relative;
	display: flex;
	align-items: center;
	gap: 8px;
}

.mgl-track {
	display: flex;
	gap: 18px;
	margin: 0;
	padding: 4px 2px 10px;
	list-style: none;
	overflow-x: auto;
	scroll-behavior: smooth;
	scroll-snap-type: x proximity;
	scrollbar-width: thin;
	flex: 1 1 auto;
}

.mgl-track.is-dragging {
	scroll-behavior: auto;
	cursor: grabbing;
	scroll-snap-type: none;
}

.mgl-archive-item {
	flex: 0 0 160px;
	width: 160px;
	display: flex;
	flex-direction: column;
	gap: 7px;
	scroll-snap-align: start;
}

.mgl-archive-cover {
	display: block;
	padding: 0;
	border: 0;
	background: var(--mgl-paper);
	border-radius: 2px;
	outline: 2px solid transparent;
	outline-offset: 2px;
	cursor: pointer;
	overflow: hidden;
	aspect-ratio: 1 / 1.414;
	box-shadow: 0 1px 6px rgba(0, 0, 0, .16);
	transition: transform .2s ease, box-shadow .2s ease;
}

.mgl-archive-cover img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top center;
}

.mgl-archive-cover:hover,
.mgl-archive-cover:focus-visible {
	transform: translateY(-3px);
	box-shadow: 0 6px 18px rgba(0, 0, 0, .22);
}

.mgl-archive-item.is-active .mgl-archive-cover {
	outline-color: #1d3557;
}

.mgl-cover-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: repeating-linear-gradient(-45deg, #f2f2f2, #f2f2f2 8px, #ebebeb 8px, #ebebeb 16px);
}

.mgl-archive-label {
	font-size: 14px;
	line-height: 1.3;
}

.mgl-archive-dl {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	font-size: 12px;
	line-height: 1;
	text-decoration: none;
	opacity: .75;
}

.mgl-archive-dl:hover {
	opacity: 1;
	text-decoration: underline;
}

.mgl-archive-dl svg {
	width: 13px;
	height: 13px;
	flex: 0 0 13px;
}

.mgl-nav {
	flex: 0 0 34px;
	width: 34px;
	height: 34px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 1px solid var(--mgl-rule);
	border-radius: 50%;
	background: var(--mgl-paper);
	color: var(--mgl-ink);
	cursor: pointer;
	transition: opacity .18s ease;
}

.mgl-nav svg {
	width: 16px;
	height: 16px;
}

.mgl-nav[disabled] {
	opacity: .25;
	cursor: default;
}

@media (max-width: 767px) {

	.mgl-nav {
		display: none;
	}

	.mgl-stage {
		padding: 10px;
	}

	.mgl-btn-text span {
		display: none;
	}

	.mgl-btn-text {
		padding: 0 11px;
	}
}

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

	.mgl-archive-cover,
	.mgl-stage {
		transition: none;
	}

	.mgl-spinner {
		animation-duration: 2s;
	}
}
