/**
 * Galaxy Gym — Planning
 *
 * Reprend les valeurs qui étaient générées par Elementor pour les widgets
 * statiques (#planning de la page 139) : en-tête de jour noir arrondi,
 * typographie des cartes, largeurs de colonnes. Le fond, la bordure et le
 * rayon des cartes viennent toujours de .pxl-list5 dans le thème gymcare.
 */

.gg-planning {
	--gg-gap: 6px;
	/* Plafond : nombre de jours réellement affichés (posé en style inline par le
	   rendu, il baisse quand les jours vides sont masqués). */
	--gg-cols-max: 7;
	/* Point de rupture : nombre de colonnes que la largeur autorise. */
	--gg-cols-bp: 7;
	--gg-card-h: 150px;
}

/* La grille prend le plus petit des deux : jamais plus de colonnes qu'il n'y a
   de jours, jamais plus que ce que l'écran permet. */
.gg-planning__row {
	--gg-cols: min(var(--gg-cols-max), var(--gg-cols-bp));
}

/* ---- Sélecteur de salle ---- */

.gg-planning__switch {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0 0 25px;
}

.gg-planning__pill {
	appearance: none;
	border: 1px solid rgba(0, 0, 0, 0.12);
	background: transparent;
	color: inherit;
	border-radius: 10px;
	padding: 15px 30px;
	font-size: 16px;
	font-weight: 600;
	line-height: 1;
	text-transform: uppercase;
	letter-spacing: -0.32px;
	cursor: pointer;
	transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.gg-planning__pill:hover {
	border-color: rgba(0, 0, 0, 0.35);
}

.gg-planning__pill.is-active {
	background-color: #000;
	border-color: #000;
	color: #fff;
}

.gg-planning__pill:focus-visible {
	outline: 2px solid #000;
	outline-offset: 3px;
}

/* ---- Rangée des jours ---- */

.gg-planning__panel[hidden] {
	display: none;
}

.gg-planning__row {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	gap: var(--gg-gap);
}

.gg-planning__day {
	flex: 0 0 calc((100% - (var(--gg-cols) - 1) * var(--gg-gap)) / var(--gg-cols));
	max-width: calc((100% - (var(--gg-cols) - 1) * var(--gg-gap)) / var(--gg-cols));
	/* Sans min-width:0 un flex-item refuse de passer sous la largeur de son
	   contenu : « MERCREDI » débordait et provoquait un scroll horizontal. */
	min-width: 0;
	box-sizing: border-box;
}

.gg-planning__dayhead {
	background-color: #000;
	color: #fff;
	border-radius: 10px;
	padding: 15px 5px;
	text-align: center;
	font-size: 16px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: -0.32px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.gg-planning__list {
	margin-top: 5px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

/* ---- Cartes de cours ---- */

/* Hauteur fixe : toutes les cases font exactement la même taille, quel que
   soit le nombre de lignes du titre. Le contenu est centré verticalement. */
.gg-planning .pxl--item {
	height: var(--gg-card-h);
	margin: 0;
	padding: 12px 8px;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 2px;
	text-align: center;
	overflow: hidden;
}

.gg-planning .pxl--time {
	font-size: 16px;
	font-weight: 400;
	line-height: 1.3;
}

.gg-planning .pxl--title {
	color: #000;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.25;
	text-transform: uppercase;
	letter-spacing: -0.32px;
	/* Garde-fou : un titre exceptionnellement long ne doit pas casser la grille. */
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.gg-planning .pxl--name {
	font-size: 16px;
	font-weight: 400;
	line-height: 1.3;
}

/* Ajouté au modèle d'origine : deux cours peuvent tomber à la même heure
   dans deux salles différentes, la salle est ce qui les distingue. */
.gg-planning .pxl--room {
	font-size: 13px;
	font-weight: 400;
	line-height: 1.3;
	opacity: 0.6;
}

.gg-planning__empty .pxl--title {
	font-weight: 400;
	text-transform: none;
	opacity: 0.45;
}

/* La couleur du nom de cours est posée en style inline par le rendu (elle vient
   des réglages), elle l'emporte donc sur le color:#000 défini plus haut. */

/* Liseré de la même couleur : optionnel, [galaxy_planning accent="yes"] */
.gg-planning--accent .pxl--item[style*="--gg-accent"] {
	border-left: 3px solid var(--gg-accent);
	padding-left: 6px;
}

.gg-planning__notice {
	padding: 20px;
	text-align: center;
	opacity: 0.7;
}

/* ---- Apparition en fondu ---- */

@keyframes gg-fade-in {
	from {
		opacity: 0;
		transform: translateY(12px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* Les colonnes arrivent l'une après l'autre : le décalage se lit comme un
   balayage de gauche à droite, et relance à chaque changement de salle. */
.gg-planning__panel.is-active .gg-planning__day {
	animation: gg-fade-in 0.45s both ease-out;
}

.gg-planning__panel.is-active .gg-planning__day:nth-child(1) { animation-delay: 0s; }
.gg-planning__panel.is-active .gg-planning__day:nth-child(2) { animation-delay: 0.05s; }
.gg-planning__panel.is-active .gg-planning__day:nth-child(3) { animation-delay: 0.1s; }
.gg-planning__panel.is-active .gg-planning__day:nth-child(4) { animation-delay: 0.15s; }
.gg-planning__panel.is-active .gg-planning__day:nth-child(5) { animation-delay: 0.2s; }
.gg-planning__panel.is-active .gg-planning__day:nth-child(6) { animation-delay: 0.25s; }
.gg-planning__panel.is-active .gg-planning__day:nth-child(7) { animation-delay: 0.3s; }

/* Animation désactivée depuis Réglages ▸ Planning Galaxy Gym. */
.gg-planning--no-anim .gg-planning__panel.is-active .gg-planning__day {
	animation: none;
}

@media (prefers-reduced-motion: reduce) {
	.gg-planning__panel.is-active .gg-planning__day {
		animation: none;
	}

	.gg-planning__pill {
		transition: none;
	}
}

/* ---- Responsive ---- */

/* Grand écran serré : on garde 7 colonnes en réduisant la typographie. */
@media (max-width: 1400px) {
	.gg-planning {
		--gg-card-h: 145px;
	}

	.gg-planning__dayhead {
		font-size: 15px;
	}

	.gg-planning .pxl--title {
		font-size: 14px;
	}

	.gg-planning .pxl--time,
	.gg-planning .pxl--name {
		font-size: 15px;
	}
}

@media (max-width: 1200px) {
	.gg-planning {
		--gg-cols-bp: 4;
		--gg-card-h: 140px;
	}
}

/* Tablette : 3 colonnes, comme la version statique d'origine. */
@media (max-width: 1024px) {
	.gg-planning {
		--gg-cols-bp: 3;
	}
}

@media (max-width: 880px) {
	.gg-planning {
		--gg-cols-bp: 2;
	}
}

/* Mobile : une colonne, hauteur libre — une case fixe n'a plus d'intérêt
   quand elle occupe toute la largeur. */
@media (max-width: 640px) {
	.gg-planning {
		--gg-cols-bp: 1;
	}

	.gg-planning__day {
		margin-bottom: 14px;
	}

	.gg-planning .pxl--item {
		height: auto;
		min-height: 0;
		padding: 16px 10px;
	}

	.gg-planning__pill {
		flex: 1 1 auto;
		padding: 14px 18px;
		text-align: center;
	}
}
