/* Bibliothèque de vidéos — styles front */

.hsavl__heading {
	margin: 0 0 18px;
	color: #111;
	font-size: 34px;
	font-weight: 800;
	line-height: 1.15;
	text-transform: uppercase;
}

/* --- Filtres -------------------------------------------------------------- */

.hsavl__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 22px;
	margin-bottom: 20px;
}

.hsavl__filter {
	color: #111;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 1px;
	text-decoration: none;
	text-transform: uppercase;
	transition: color 180ms ease;
}

.hsavl__filter.is-active {
	color: #f5b301;
}

.hsavl__filter:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 4px;
}

/* --- Grille ---------------------------------------------------------------- */

.hsavl__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.hsavl__item {
	margin: 0;
	min-width: 0;
}

.hsavl__card {
	--hsavl-ratio: 9 / 16;
	position: relative;
	aspect-ratio: var(--hsavl-ratio);
	overflow: hidden;
	background-color: #14282e;
}

@supports not (aspect-ratio: 1 / 1) {
	.hsavl__card {
		min-height: 420px;
	}
}

.hsavl__media {
	position: absolute;
	inset: 0;
}

/* Deux classes : indispensable pour passer devant « .elementor img { height: auto } ». */
.hsavl__media .hsavl__img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	object-position: center center;
	transition: transform 500ms ease;
}

.hsavl__card:hover .hsavl__media .hsavl__img {
	transform: scale(1.03);
}

.hsavl__overlay {
	--hsavl-overlay: rgba(0, 0, 0, 0.35);
	position: absolute;
	inset: 0;
	background-image: linear-gradient(var(--hsavl-angle, 180deg), var(--hsavl-overlay) 0%, transparent 45%);
}

.hsavl__text {
	position: absolute;
	inset: 0 0 auto 0;
	z-index: 2;
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: 18px;
}

/* Marge portée par le titre : l'ordre des deux éléments peut être inversé. */
.hsavl__tag + .hsavl__title {
	margin-top: 8px;
}

.hsavl__tag {
	margin: 0;
	color: #f5b301;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 1px;
	text-transform: uppercase;
}

.hsavl__title {
	margin: 0;
	order: 0;
	color: #fff;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.25;
	text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
	text-wrap: balance;
}

.hsavl__play {
	--hsavl-play: 58px;
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--hsavl-play);
	height: var(--hsavl-play);
	padding: 0;
	transform: translate(-50%, -50%);
	border: 0;
	border-radius: 50%;
	background-color: rgba(255, 255, 255, 0.85);
	cursor: pointer;
	transition: background-color 200ms ease, transform 200ms ease;
}

.hsavl__card:hover .hsavl__play {
	transform: translate(-50%, -50%) scale(1.06);
	background-color: #fff;
}

.hsavl__play svg {
	width: 45%;
	height: 45%;
	fill: #111;
	margin-left: 6%;
}

.hsavl__play:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

/* --- Pagination ------------------------------------------------------------ */

.hsavl__pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 32px;
	margin-top: 28px;
	color: #111;
	font-size: 15px;
	font-weight: 600;
	letter-spacing: 1px;
	text-transform: uppercase;
}

.hsavl__page {
	color: inherit;
	text-decoration: none;
}

.hsavl__page:hover,
.hsavl__page:focus-visible {
	text-decoration: underline;
	text-underline-offset: 4px;
}

.hsavl__page.is-disabled {
	opacity: 0.35;
}

.hsavl-empty {
	padding: 24px;
	border: 1px dashed #c3c4c7;
	color: #50575e;
	text-align: center;
}

/* --- Fenêtre de lecture ----------------------------------------------------- */

.hsavl-modal[hidden] {
	display: none;
}

.hsavl-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.hsavl-modal__backdrop {
	position: absolute;
	inset: 0;
	background-color: rgba(255, 255, 255, 0.72);
	backdrop-filter: blur(2px);
}

.hsavl-modal__box {
	--hsavl-modal-h: 92vh;
	--hsavl-modal-w: 94vw;
	position: relative;
	display: flex;
	max-width: var(--hsavl-modal-w);
	max-height: var(--hsavl-modal-h);
	height: var(--hsavl-modal-h);
	background-color: #000;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

/* Format imposé : la fenêtre se dimensionne sur la hauteur disponible. */
.hsavl-modal__box:not(.is-auto) {
	width: auto;
}

/* Format adapté : c'est le fichier qui impose ses proportions,
   la fenêtre épouse l'image sans ajouter de bandes. */
.hsavl-modal__box.is-auto {
	width: auto;
	height: auto;
	background-color: transparent;
	box-shadow: none;
}

.hsavl-modal__box.is-auto .hsavl-modal__stage {
	width: auto;
	height: auto;
	line-height: 0;
}

.hsavl-modal__box.is-auto .hsavl__player {
	position: static;
	width: auto;
	height: auto;
	max-width: var(--hsavl-modal-w);
	max-height: var(--hsavl-modal-h);
}

.hsavl-modal__stage {
	position: relative;
	width: 100%;
	height: 100%;
}

.hsavl__player {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
	background-color: #000;
}

/* Recadrage : la vidéo remplit le cadre, les bandes encodées dans le
   fichier sortent du champ au lieu d'être affichées. */
.hsavl-modal__box.is-crop .hsavl-modal__stage {
	overflow: hidden;
}

.hsavl-modal__box.is-crop .hsavl__player {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Croix placée au-dessus du cadre, jamais par-dessus l'image. */
.hsavl-modal.is-close-outside .hsavl-modal__close {
	top: -46px;
	right: 0;
}

.hsavl-modal.is-close-outside .hsavl-modal__box {
	margin-top: 46px;
}

.hsavl-modal__close {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 2;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6);
}

.hsavl-modal__close:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* Le fond ne défile pas pendant la lecture. */
body.hsavl-locked {
	overflow: hidden;
}

/* --- Tablettes et mobiles --------------------------------------------------- */

@media (max-width: 1024px) {
	.hsavl__filters {
		gap: 16px;
	}

	.hsavl__title {
		font-size: 15px;
	}

	.hsavl-modal {
		padding: 12px;
	}

	.hsavl-modal__box {
		max-width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.hsavl__filter,
	.hsavl__play,
	.hsavl__media .hsavl__img {
		transition: none;
	}
}

/* Un widget Elementor est un élément flex : sans min-width il s'élargit
   à la taille de son contenu. */
.elementor-widget-hsa_video_library {
	min-width: 0;
	max-width: 100%;
}

.hsavl,
.hsavl__grid {
	max-width: 100%;
	min-width: 0;
}
