/*
 * Texte défilant : couleurs et typo du site Centre Pilates Québec.
 * Rouge #990000 (menu et boutons Divi), Montserrat déjà chargée par Divi.
 * Pour changer une couleur sur une seule page : surcharger les variables --jb-texte-defilant-*.
 */
.jb-texte-defilant {
	--jb-texte-defilant-fond: #990000;
	--jb-texte-defilant-couleur: #ffffff;
	--jb-texte-defilant-taille: 16px;
	position: relative;
	box-sizing: border-box;
	overflow: hidden;
	margin: 0;
	padding: 14px 0;
	background: var(--jb-texte-defilant-fond);
	color: var(--jb-texte-defilant-couleur);
	font-family: Montserrat, Helvetica, Arial, Lucida, sans-serif;
	font-size: var(--jb-texte-defilant-taille);
	font-weight: 600;
	line-height: 1.4;
	letter-spacing: .06em;
	text-transform: uppercase;
}

/* Pleine largeur d'écran, même dans une rangée Divi plus étroite. La barre de défilement est soustraite par le JS. */
.jb-texte-defilant-pleine {
	width: calc(100vw - var(--jb-texte-defilant-scrollbar, 0px));
	max-width: none;
	margin-left: calc(50% - 50vw + var(--jb-texte-defilant-scrollbar, 0px) / 2);
	margin-right: 0;
}

.jb-texte-defilant-fenetre {
	overflow: hidden;
}

.jb-texte-defilant-piste {
	display: flex;
	width: max-content;
	will-change: transform;
}

/* Remise à zéro : les listes de Divi ont des puces, une marge et un retrait. */
.jb-texte-defilant .jb-texte-defilant-groupe {
	display: flex;
	flex-shrink: 0;
	margin: 0;
	padding: 0;
	list-style: none;
	line-height: inherit;
}

.jb-texte-defilant .jb-texte-defilant-item {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	margin: 0;
	padding: 0;
	list-style: none;
	white-space: nowrap;
}

.jb-texte-defilant .jb-texte-defilant-item::before,
.jb-texte-defilant .jb-texte-defilant-item::marker {
	content: none;
}

.jb-texte-defilant-sep {
	display: inline-block;
	min-width: 1px;
	margin: 0 1.25em;
}

.jb-texte-defilant .jb-texte-defilant-lien,
.jb-texte-defilant .jb-texte-defilant-lien:visited {
	color: inherit;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: .25em;
}

.jb-texte-defilant .jb-texte-defilant-lien:hover {
	color: inherit;
	text-decoration-thickness: 2px;
}

.jb-texte-defilant a:focus-visible,
.jb-texte-defilant-pause:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

/* Texte lu seulement par les lecteurs d'écran. */
.jb-texte-defilant-lecteur {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Animation : le JS calcule la distance (largeur d'un groupe) et la durée selon la vitesse. */
.jb-texte-defilant-actif .jb-texte-defilant-piste {
	animation: jb-texte-defilant-boucle var(--jb-texte-defilant-duree, 30s) linear infinite;
}

@keyframes jb-texte-defilant-boucle {
	from { transform: translate3d(0, 0, 0); }
	to { transform: translate3d(calc(-1 * var(--jb-texte-defilant-distance, 50%)), 0, 0); }
}

/* Pause : souris sur le bandeau, lien sélectionné au clavier, ou bouton pause. */
@media (hover: hover) {
	.jb-texte-defilant:hover .jb-texte-defilant-piste {
		animation-play-state: paused;
	}
}

.jb-texte-defilant-fenetre:focus-within .jb-texte-defilant-piste,
.jb-texte-defilant-en-pause .jb-texte-defilant-piste {
	animation-play-state: paused;
}

/* Bouton pause, à droite, sur un dégradé pour ne pas couper le texte net. */
.jb-texte-defilant-pause {
	position: absolute;
	top: 50%;
	right: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	margin: 0;
	padding: 0;
	border: 1px solid currentColor;
	border-radius: 50%;
	background: var(--jb-texte-defilant-fond);
	box-shadow: -24px 0 16px 4px var(--jb-texte-defilant-fond);
	color: inherit;
	cursor: pointer;
	transform: translateY(-50%);
}

.jb-texte-defilant-pause[hidden] {
	display: none;
}

.jb-texte-defilant-pause:hover {
	background: var(--jb-texte-defilant-couleur);
	color: var(--jb-texte-defilant-fond);
}

.jb-texte-defilant-icone-lecture,
.jb-texte-defilant-en-pause .jb-texte-defilant-icone-pause {
	display: none;
}

.jb-texte-defilant-en-pause .jb-texte-defilant-icone-lecture {
	display: block;
}

@media (max-width: 767px) {
	.jb-texte-defilant {
		--jb-texte-defilant-taille: 14px;
		padding: 12px 0;
	}
}

/* Mouvement réduit (réglage du système) : pas d'animation, les messages s'affichent sur une ou plusieurs lignes. */
@media (prefers-reduced-motion: reduce) {
	.jb-texte-defilant .jb-texte-defilant-piste {
		width: auto;
		justify-content: center;
		animation: none !important;
	}

	.jb-texte-defilant .jb-texte-defilant-groupe {
		flex-wrap: wrap;
		justify-content: center;
		padding: 0 16px;
	}

	.jb-texte-defilant .jb-texte-defilant-clone,
	.jb-texte-defilant .jb-texte-defilant-pause {
		display: none;
	}
}
