/* MediaElement Vidéo (plugin SPIP) */
.mejs-spip-wrapper {
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	margin: 1em auto;
}
.mejs-spip-wrapper video,
.mejs-spip-wrapper audio {
	max-width: 100%;
}
.mejs-spip-wrapper .mejs__container {
	max-width: 100%;
	margin: 0 auto;
}

/* Portfolio de vidéos : lecteur au-dessus, vignettes en dessous */
.mejs-portfolio {
	--mejs-vignette: 200px;
	box-sizing: border-box;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	margin: 1.5em 0;
}
.mejs-portfolio-lecteur,
.mejs-spip-video {
	--mejs-ratio: 16 / 9;
	max-width: 100%;
	margin: 0 auto 0.75em;
}
/* Lecteur adaptatif dès le premier affichage : MediaElement.js fixe des dimensions en pixels
   avant de connaître la largeur disponible ; on impose la largeur et le rapport (hors plein écran) */
.mejs-portfolio-lecteur .mejs__container:not(.mejs__container-fullscreen),
.mejs-spip-video .mejs__container:not(.mejs__container-fullscreen) {
	width: 100% !important;
	height: auto !important;
	aspect-ratio: var(--mejs-ratio);
}
.mejs-portfolio-lecteur .mejs__container:not(.mejs__container-fullscreen) .mejs__inner,
.mejs-spip-video .mejs__container:not(.mejs__container-fullscreen) .mejs__inner,
.mejs-portfolio-lecteur .mejs__container:not(.mejs__container-fullscreen) .mejs__mediaelement,
.mejs-spip-video .mejs__container:not(.mejs__container-fullscreen) .mejs__mediaelement,
.mejs-portfolio-lecteur .mejs__container:not(.mejs__container-fullscreen) .mejs__layers,
.mejs-spip-video .mejs__container:not(.mejs__container-fullscreen) .mejs__layers,
.mejs-portfolio-lecteur .mejs__container:not(.mejs__container-fullscreen) video,
.mejs-spip-video .mejs__container:not(.mejs__container-fullscreen) video {
	width: 100% !important;
	height: 100% !important;
}
.mejs-portfolio-lecteur .mejs__container:not(.mejs__container-fullscreen) video,
.mejs-spip-video .mejs__container:not(.mejs__container-fullscreen) video {
	object-fit: contain;
}
.mejs-portfolio-lecteur .mejs__container,
.mejs-spip-video .mejs__container {
	max-width: 100%;
	background: #000;
}
/* Les couches du lecteur (bouton lecture, affiche…) occupent la zone vidéo, au-dessus de la barre de contrôle */
.mejs-portfolio-lecteur .mejs__container:not(.mejs__container-fullscreen) .mejs__layer,
.mejs-spip-video .mejs__container:not(.mejs__container-fullscreen) .mejs__layer {
	width: 100% !important;
	height: calc(100% - 40px) !important;
}
.mejs-portfolio-titre,
.mejs-spip-titre {
	margin: 0.5em 0 0;
	text-align: left;
}
.mejs-portfolio-titre:empty,
.mejs-spip-titre:empty {
	display: none;
}
.mejs-portfolio-descriptif,
.mejs-spip-descriptif {
	opacity: 0.8;
}
.mejs-portfolio-descriptif {
	opacity: 0.8;
}
.mejs-portfolio-vignettes {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(var(--mejs-vignette), 100%), 1fr));
	gap: 0.75em;
	margin: 0;
	padding: 0;
	list-style: none;
}
.mejs-portfolio-item {
	margin: 0;
	padding: 0;
}
.mejs-vignette {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	background: #222;
	border: 3px solid transparent;
	border-radius: 4px;
	color: #fff;
	text-decoration: none;
	cursor: pointer;
}
.mejs-vignette img,
.mejs-vignette .mejs-vignette-video {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	pointer-events: none;
}
.mejs-vignette:hover,
.mejs-vignette:focus-visible {
	border-color: rgba(255, 255, 255, 0.6);
	outline: none;
}
.mejs-portfolio-item.on .mejs-vignette {
	border-color: #e5392b;
}
/* Icône « lecture » */
.mejs-vignette-play {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 2.6em;
	height: 2.6em;
	margin: -1.3em 0 0 -1.3em;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.55);
}
.mejs-vignette-play::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	margin: -0.55em 0 0 -0.3em;
	border-style: solid;
	border-width: 0.55em 0 0.55em 0.9em;
	border-color: transparent transparent transparent #fff;
}
.mejs-vignette-duree {
	position: absolute;
	top: 0.3em;
	right: 0.3em;
	padding: 0 0.4em;
	border-radius: 3px;
	background: rgba(0, 0, 0, 0.7);
	font-size: 0.8em;
}
.mejs-vignette-legende {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	padding: 0.3em 0.5em;
	background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
	font-size: 0.85em;
	line-height: 1.25;
	text-align: left;
}
