/*
 * L'Agenda (« l'affiche et le calendrier », choisie par le propriétaire le 26/11/2026) : ce qui est en cours et à venir en grand et
 * en couleur, ce qui a eu lieu plus petit et en noir et blanc. La menthe est la couleur des événements. Chaque partie commence par
 * la barre commune des listes (`.barre-liste`, dans designmaroc.css), comme Les Créatifs.
 */

.agenda {
	container: agenda / inline-size;
	padding-bottom: 90px;
}

.agenda__partie + .agenda__partie,
.annoncer + .agenda__partie {
	margin-top: clamp(44px, 5cqi, 70px);
}

.agenda__liste {
	margin-top: 16px;
}


/* La grille d'en cours et à venir. Grand écran : l'affiche et le calendrier côte à côte, de même hauteur, la liste dessous sur
   toute la largeur. Écran moyen : l'affiche en entier, puis le calendrier à côté de la liste. Téléphone : l'un sous l'autre. */

.agenda__grille {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	grid-template-areas:
		"affiche"
		"calendrier"
		"liste";
	align-items: start;
	gap: 16px;
	margin-top: 16px;
}

.affiche {
	grid-area: affiche;
}

.calendrier {
	grid-area: calendrier;
}

.agenda__grille > .rdvs {
	grid-area: liste;
}

@container agenda (min-width: 48rem) {
	.agenda__grille {
		grid-template-columns: 20rem minmax(0, 1fr);
		grid-template-areas:
			"affiche affiche"
			"calendrier liste";
	}
}

@container agenda (min-width: 80rem) {
	.agenda__grille {
		grid-template-columns: minmax(0, 1fr) 22rem;
		grid-template-areas:
			"affiche calendrier"
			"liste liste";
	}

	.agenda__grille > .affiche,
	.agenda__grille > .calendrier {
		align-self: stretch;
	}
}


/* Un événement de la liste : le pavé de date, puis le texte. Toute la carte est cliquable. */

.rdvs {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr));
	align-content: start;
	gap: 12px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.rdv {
	position: relative;
	display: grid;
	grid-template-columns: 4.9rem minmax(0, 1fr);
	gap: 14px;
	padding: 8px;
	border-radius: var(--dm-rayon);
	background: var(--dm-blanc);
	transition: box-shadow 0.55s var(--dm-souple), translate 0.55s var(--dm-souple);
}

.rdv[hidden] {
	display: none;
}

@media (hover: hover) {
	.rdv:hover {
		box-shadow: var(--dm-ombre);
		translate: 0 -4px;
	}
}

.rdv:has(.rdv__lien:focus-visible) {
	outline: 3px solid var(--dm-encre);
	outline-offset: 2px;
}

/* Le pavé : menthe pour ce qui vient, encre pour ce qui est en cours (on y lit la date de clôture). */
.rdv__pave {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 5.4rem;
	padding: 10px 4px;
	border-radius: var(--dm-rayon-image);
	background: var(--dm-menthe);
	font-family: var(--dm-police-titres);
	line-height: 1;
	text-align: center;
}

.rdv__jour {
	font-size: 2.15rem;
	font-weight: 800;
	letter-spacing: -0.05em;
}

.rdv__mois {
	margin-top: 5px;
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: -0.01em;
}

.rdv__avant,
.rdv__fin {
	font-family: var(--dm-police-texte);
	font-size: 0.76rem;
	font-weight: 600;
	line-height: 1.2;
}

.rdv__avant {
	margin-bottom: 6px;
}

.rdv__fin {
	margin-top: 7px;
}

.rdv--en-cours .rdv__pave {
	background: var(--dm-encre);
	color: var(--dm-blanc);
}

.rdv--en-cours .rdv__jour {
	color: var(--dm-menthe);
}

.rdv__corps {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	gap: 7px;
	min-width: 0;
	padding: 6px 10px 6px 0;
}

.rdv__haut {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
}

.rdv__statut {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	padding: 4px 11px;
	border-radius: var(--dm-capsule);
	background: var(--dm-fond);
	font-size: 0.8rem;
	font-weight: 700;
	line-height: 1.4;
}

.rdv--en-cours .rdv__statut {
	background: var(--dm-menthe);
}

/* En cours : un point qui bat doucement. */
.rdv--en-cours .rdv__statut::before {
	content: "";
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--dm-encre);
	animation: agenda-pouls 1.8s ease-in-out infinite;
}

@keyframes agenda-pouls {
	50% {
		opacity: 0.2;
	}
}

.rdv__titre {
	margin: 0;
	font-size: 1.08rem;
	font-weight: 700;
	line-height: 1.16;
	letter-spacing: -0.02em;
	text-wrap: balance;
}

.rdv__lien {
	text-decoration: none;
}

.rdv__lien::after {
	content: "";
	position: absolute;
	z-index: 2;
	inset: 0;
	border-radius: var(--dm-rayon);
}

.rdv__lien:focus-visible {
	outline: none;
}

.rdv__infos {
	display: flex;
	flex-direction: column;
	gap: 2px;
	margin: 0;
	font-size: 0.93rem;
	line-height: 1.4;
}

.rdv__quand {
	font-weight: 700;
}

.rdv__ou {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	color: var(--dm-gris);
	font-weight: 600;
}

.rdv__ou svg {
	flex: none;
}

.rdv__programme {
	position: relative;
	z-index: 3; /* Au-dessus du lien de l'affiche. */
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 7px 13px;
	border-radius: var(--dm-capsule);
	background: var(--dm-fond);
	color: var(--dm-encre);
	font-size: 0.86rem;
	font-weight: 700;
	line-height: 1.3;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

@media (hover: hover) {
	.rdv__programme:hover {
		background: var(--dm-encre);
		color: var(--dm-blanc);
	}
}


/* L'affiche du prochain rendez-vous. Ses textes suivent sa largeur. */

.affiche {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 8px;
	margin: 0;
	padding: 8px;
	border-radius: var(--dm-rayon);
	background: var(--dm-blanc);
	transition: box-shadow 0.55s var(--dm-souple);
}

@container agenda (min-width: 56rem) {
	.affiche {
		grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
	}
}

.affiche--sans-image {
	grid-template-columns: minmax(0, 1fr);
}

.affiche--sans-image .affiche__image {
	display: none;
}

@media (hover: hover) {
	.affiche:hover {
		box-shadow: var(--dm-ombre);
	}

	.affiche:hover .affiche__image img {
		scale: 1.03;
	}
}

.affiche:has(.affiche__lien:focus-visible) {
	outline: 3px solid var(--dm-encre);
	outline-offset: 2px;
}

.affiche__image {
	position: relative;
	overflow: hidden;
	aspect-ratio: 16 / 10;
	border-radius: var(--dm-rayon-image);
	background: var(--dm-filet);
}

.affiche__image img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: scale 0.9s var(--dm-courbe);
}

/* Côte à côte, l'image prend toute la hauteur de l'affiche. */
@container agenda (min-width: 56rem) {
	.affiche__image {
		align-self: stretch;
		min-height: 22rem;
		aspect-ratio: auto;
	}
}

.affiche__corps {
	container: affiche / inline-size;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 14px;
	min-width: 0;
	padding: clamp(10px, 1.6cqi, 26px);
}

.affiche__surtitre {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0;
}

.affiche .rdv__statut {
	background: var(--dm-menthe);
}

.affiche__titre {
	margin: 0;
	font-size: clamp(1.5rem, 0.8rem + 5.2cqi, 2.6rem);
	font-weight: 800;
	line-height: 1.04;
	letter-spacing: -0.035em;
	text-wrap: balance;
}

.affiche__lien {
	text-decoration: none;
}

.affiche__lien::after {
	content: "";
	position: absolute;
	z-index: 2;
	inset: 0;
	border-radius: var(--dm-rayon);
}

.affiche__lien:focus-visible {
	outline: none;
}

.affiche__infos {
	display: flex;
	flex-direction: column;
	gap: 4px;
	margin: 0;
	font-size: 1.02rem;
	line-height: 1.4;
}

.affiche__quand {
	font-weight: 700;
}

/* Le compte des jours, en grand, avec un trait menthe sous le chiffre. */
.affiche__compte {
	display: flex;
	align-items: flex-end;
	gap: 12px;
	margin: auto 0 0;
	padding-top: 8px;
}

.affiche__nombre {
	font-family: var(--dm-police-titres);
	font-size: clamp(3rem, 1.4rem + 9cqi, 5.4rem);
	font-weight: 800;
	line-height: 0.8;
	letter-spacing: -0.06em;
	box-shadow: inset 0 -0.16em 0 var(--dm-menthe);
}

.affiche__unite {
	max-width: 8.5em;
	padding-bottom: 2px;
	color: var(--dm-gris);
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.2;
}


/* Le calendrier : plus la menthe est soutenue, plus il y a de rendez-vous ce jour-là ; point plein : ouverture, anneau :
   clôture. */

.calendrier {
	display: flex;
	flex-direction: column;
	padding: 14px 14px 16px;
	border-radius: var(--dm-rayon);
	background: var(--dm-blanc);
}

.calendrier__tete {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	margin: 0 0 8px;
}

.calendrier__nom {
	margin: 0;
	font-family: var(--dm-police-titres);
	font-size: 1.2rem;
	font-weight: 800;
	letter-spacing: -0.02em;
}

.calendrier__fleche {
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--dm-fond);
	color: var(--dm-encre);
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.calendrier__fleche--suite svg {
	rotate: 180deg;
}

.calendrier__fleche:disabled {
	opacity: 0.35;
	cursor: default;
}

@media (hover: hover) {
	.calendrier__fleche:not(:disabled):hover {
		background: var(--dm-encre);
		color: var(--dm-blanc);
	}
}

/* Sans script, tous les mois sont là, les uns sous les autres, et les flèches ne servent à rien. */
html:not(.js) .calendrier__fleche {
	visibility: hidden;
}

.js .calendrier__mois:not(.est-visible) {
	display: none;
}

.calendrier__mois {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
}

.calendrier__mois + .calendrier__mois {
	margin-top: 14px;
}

.calendrier__mois th {
	padding: 2px 0 8px;
	color: var(--dm-gris);
	font-size: 0.78rem;
	font-weight: 700;
	text-align: center;
}

.calendrier__mois abbr {
	text-decoration: none;
}

.calendrier__mois td {
	padding: 2px;
	text-align: center;
}

.cal-jour {
	position: relative;
	display: grid;
	place-items: center;
	width: 100%;
	max-width: 2.6rem;
	aspect-ratio: 1;
	margin: 0 auto;
	padding: 0;
	border: 0;
	border-radius: 10px;
	background: none;
	color: var(--dm-encre);
	font: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1;
	transition: background-color 0.2s ease, color 0.2s ease;
}

button.cal-jour {
	cursor: pointer;
}

.cal-jour--passe {
	color: #b3ada3;
}

.cal-jour--n1 {
	background: rgb(0 231 180 / 0.16);
}

.cal-jour--n2 {
	background: rgb(0 231 180 / 0.38);
}

.cal-jour--n3 {
	background: rgb(0 231 180 / 0.62);
}

.cal-jour--aujourdhui {
	box-shadow: inset 0 0 0 2px var(--dm-encre);
	font-weight: 800;
}

.cal-jour--ouvre::before,
.cal-jour--ferme::after {
	content: "";
	position: absolute;
	bottom: 4px;
	left: 50%;
	width: 6px;
	height: 6px;
	box-sizing: border-box;
	translate: -50% 0;
	border-radius: 50%;
}

.cal-jour--ouvre::before {
	background: currentColor;
}

.cal-jour--ferme::after {
	border: 1.5px solid currentColor;
}

.cal-jour--ouvre.cal-jour--ferme::before {
	translate: -130% 0;
}

.cal-jour--ouvre.cal-jour--ferme::after {
	translate: 30% 0;
}

/* Les jours d'un rendez-vous survolé dans la liste. */
.cal-jour.est-dans {
	background: var(--dm-menthe);
	font-weight: 800;
}

.cal-jour[aria-pressed="true"] {
	background: var(--dm-encre);
	color: var(--dm-blanc);
}

@media (hover: hover) {
	button.cal-jour:not([aria-pressed="true"]):hover {
		box-shadow: inset 0 0 0 2px var(--dm-encre);
	}
}

.calendrier__legende {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin: auto 0 0; /* En bas de la carte, quand elle est aussi haute que l'affiche. */
	padding-top: 12px;
	color: var(--dm-gris);
	font-size: 0.8rem;
	font-weight: 600;
}

.calendrier__point {
	width: 7px;
	height: 7px;
	box-sizing: border-box;
	border-radius: 50%;
}

.calendrier__point--ouvre {
	background: var(--dm-encre);
}

.calendrier__point--ferme {
	margin-left: 10px;
	border: 1.5px solid var(--dm-encre);
}


/* Les outils des barres : « Tous les jours », « Toutes » et la liste déroulante des années, habillée comme un filtre. Menthe pour
   le choix en cours. */

.agenda .filtre {
	border: 0;
	font: inherit;
	font-size: 0.92rem;
	font-weight: 600;
	cursor: pointer;
}

.agenda .filtre[aria-pressed="true"] {
	background: var(--dm-menthe);
	color: var(--dm-encre);
}

/* Dans la barre blanche, un filtre est sur le fond de la page, comme la recherche des Créatifs. */
.barre-liste .filtre:not([aria-pressed="true"]) {
	background: var(--dm-fond);
}

@media (hover: hover) {
	.barre-liste .filtre:hover {
		background: var(--dm-encre);
		color: var(--dm-blanc);
	}
}

.barre-liste--passe {
	--couleur: var(--dm-fond); /* Ce qui a eu lieu : une bulle sans couleur. */
}

.agenda__choix-annee {
	position: relative;
	display: inline-flex;
	align-items: center;
	color: var(--dm-encre);
}

.agenda__choix-annee select {
	min-height: 40px;
	padding: 0 42px 0 17px;
	border: 0;
	border-radius: var(--dm-capsule);
	background: var(--dm-fond);
	color: inherit;
	font: inherit;
	font-size: 0.92rem;
	font-weight: 600;
	cursor: pointer;
	appearance: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.agenda__choix-annee option {
	background: var(--dm-blanc);
	color: var(--dm-encre);
}

.agenda__choix-annee svg {
	position: absolute;
	right: 15px;
	width: 13px;
	height: 13px;
	rotate: -90deg; /* Le chevron du thème regarde à gauche : ici, vers le bas. */
	pointer-events: none;
}

.agenda__choix-annee.est-choisi select {
	background: var(--dm-menthe);
}

@media (hover: hover) {
	.agenda__choix-annee:hover {
		color: var(--dm-blanc);
	}

	.agenda__choix-annee:hover select {
		background: var(--dm-encre);
	}
}


/* L'appel aux organisateurs */

.annoncer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 16px 22px;
	margin-top: clamp(44px, 5cqi, 70px);
	padding: 18px 20px;
	border-radius: var(--dm-rayon);
	background: var(--dm-blanc);
}

.annoncer__icone {
	display: grid;
	flex: none;
	place-items: center;
	width: 54px;
	height: 54px;
	border-radius: 50%;
	background: var(--dm-menthe);
}

.annoncer__texte {
	flex: 1 1 20rem;
	min-width: 0;
}

.annoncer__titre {
	margin: 0 0 3px;
	font-size: 1.25rem;
	font-weight: 800;
	line-height: 1.15;
	letter-spacing: -0.02em;
}

.annoncer__texte p {
	margin: 0;
	color: var(--dm-gris);
	font-size: 0.98rem;
	line-height: 1.45;
}

.annoncer__bouton {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 46px;
	padding: 0 20px;
	border-radius: var(--dm-rayon-bouton);
	background: var(--dm-encre);
	color: var(--dm-blanc);
	font-weight: 700;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.2s ease, color 0.2s ease;
}

@media (hover: hover) {
	.annoncer__bouton:hover {
		background: var(--dm-menthe);
		color: var(--dm-encre);
	}
}


/* Ce qui a eu lieu : une liste serrée, une vignette carrée en noir et blanc par ligne ; la couleur revient au survol. */

.annee {
	margin-top: 26px;
	scroll-margin-top: 20px;
}

.annee[hidden] {
	display: none;
}

.annee__nom {
	display: flex;
	align-items: baseline;
	gap: 12px;
	margin: 0 0 6px;
	font-size: 1.5rem;
	font-weight: 800;
	letter-spacing: -0.03em;
}

.annee__compte {
	color: var(--dm-gris);
	font-family: var(--dm-police-texte);
	font-size: 0.9rem;
	font-weight: 600;
	letter-spacing: 0;
}

.passes {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 24rem), 1fr));
	gap: 0 28px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.passe {
	position: relative;
	display: grid;
	grid-template-columns: 3.4rem minmax(0, 1fr);
	align-items: center;
	gap: 14px;
	min-width: 0;
	padding: 10px 0;
	border-bottom: 1px solid var(--dm-filet);
}

.passe__image {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 1;
	border-radius: 8px;
	background: var(--dm-filet);
}

.passe__image img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	filter: grayscale(1);
	opacity: 0.8;
	transition: filter 0.45s ease, opacity 0.45s ease;
}

.passe__texte {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}

.passe__quand {
	color: var(--dm-gris);
	font-size: 0.78rem;
	font-weight: 600;
	line-height: 1.3;
}

.passe__lien {
	display: -webkit-box;
	overflow: hidden;
	font-family: var(--dm-police-titres);
	font-size: 0.95rem;
	font-weight: 700;
	line-height: 1.18;
	letter-spacing: -0.015em;
	text-decoration: none;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

.passe__lien::after {
	content: "";
	position: absolute;
	z-index: 2;
	inset: 0;
}

.passe__lien:focus-visible {
	outline: none;
}

.passe:has(.passe__lien:focus-visible) {
	outline: 3px solid var(--dm-encre);
	outline-offset: 2px;
}

@media (hover: hover) {
	.passe:hover .passe__image img {
		filter: none;
		opacity: 1;
	}
}


@media (prefers-reduced-motion: reduce) {
	.rdv,
	.affiche__image img,
	.passe__image img {
		transition: none;
	}

	.rdv--en-cours .rdv__statut::before {
		animation: none;
	}
}
