/* Neon Calendar */

.ncal,
.ncal-fiche,
.ncal-modal {
	--ncal-accent: #00abaa;
	--ncal-texte: #2b2f38;
	--ncal-doux: #6b7280;
	--ncal-ligne: #e3e6ea;
	--ncal-fond: #ffffff;
	--ncal-fond-2: #f6f7f9;
	--ncal-rayon: 10px;
	box-sizing: border-box;
}
.ncal *,
.ncal-modal * {
	box-sizing: border-box;
}

.ncal {
	color: var(--ncal-texte);
	margin: 0 0 2rem;
	position: relative;
}

/* ---------- En-tête ---------- */

.ncal__entete {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: .75rem 1rem;
	margin-bottom: 1rem;
}
.ncal__titre {
	flex: 1 1 auto;
	margin: 0 !important;
	font-size: 1.5rem;
	line-height: 1.2;
	text-align: center;
}
.ncal__nav,
.ncal__vues {
	display: flex;
	gap: .375rem;
}

/* Police du site, mais pas « font: inherit » : ce raccourci écraserait les tailles des boutons ci-dessous. */
.ncal button {
	font-family: inherit;
	letter-spacing: normal;
	text-transform: none;
	cursor: pointer;
	margin: 0;
}
.ncal__fleche,
.ncal__aujourdhui,
.ncal__vues button,
.ncal-filtre {
	border: 1px solid var(--ncal-ligne);
	background: var(--ncal-fond);
	color: var(--ncal-texte);
	border-radius: 999px;
	padding: .4em 1em;
	font-size: .9rem;
	line-height: 1.2;
	transition: background .15s, border-color .15s, color .15s;
}
.ncal__fleche {
	width: 2.25rem;
	height: 2.25rem;
	padding: 0;
	font-size: 1.4rem;
	line-height: 1;
}
.ncal__fleche:hover,
.ncal__aujourdhui:hover,
.ncal__vues button:hover,
.ncal-filtre:hover {
	border-color: var(--ncal-accent);
}
.ncal__vues button[aria-pressed="true"] {
	background: var(--ncal-accent);
	border-color: var(--ncal-accent);
	color: #fff;
}
.ncal button:focus-visible,
.ncal a:focus-visible,
.ncal-case:focus-visible,
.ncal-modal button:focus-visible,
.ncal-modal a:focus-visible {
	outline: 2px solid var(--ncal-accent);
	outline-offset: 2px;
}

/* La liste montre tout ce qui est à venir : pas de navigation par mois. */
.ncal[data-vue="liste"] .ncal__nav,
.ncal[data-vue="cartes"] .ncal__nav {
	visibility: hidden;
}

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

.ncal__filtres {
	display: flex;
	flex-wrap: wrap;
	gap: .4rem;
	margin-bottom: 1rem;
}
.ncal-filtre {
	display: inline-flex;
	align-items: center;
	gap: .45em;
	font-size: .85rem;
}
.ncal-pastille {
	width: .7em;
	height: .7em;
	border-radius: 50%;
	background: var(--ncal-couleur);
}
.ncal-filtre[aria-pressed="true"] {
	background: var(--ncal-couleur, var(--ncal-accent));
	border-color: var(--ncal-couleur, var(--ncal-accent));
	color: #fff;
}
.ncal-filtre[aria-pressed="true"] .ncal-pastille {
	background: #fff;
}

/* ---------- Chargement ---------- */

.ncal__corps {
	transition: opacity .2s;
}
.ncal.is-chargement .ncal__corps {
	opacity: .45;
	pointer-events: none;
}
.ncal__vide {
	padding: 2rem 1rem;
	text-align: center;
	color: var(--ncal-doux);
	background: var(--ncal-fond-2);
	border-radius: var(--ncal-rayon);
	margin: 0;
}

/* ---------- Vue mois ---------- */

.ncal-mois {
	border: 1px solid var(--ncal-ligne);
	border-radius: var(--ncal-rayon);
	overflow: hidden;
	background: var(--ncal-fond);
}
.ncal-mois__jours,
.ncal-mois__grille {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
}
.ncal-mois__jours div {
	padding: .6rem .25rem;
	text-align: center;
	font-size: .8rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: var(--ncal-doux);
	background: var(--ncal-fond-2);
	border-bottom: 1px solid var(--ncal-ligne);
}
.ncal-case {
	min-height: 7.5rem;
	padding: .35rem;
	border-right: 1px solid var(--ncal-ligne);
	border-bottom: 1px solid var(--ncal-ligne);
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}
.ncal-case:nth-child(7n) {
	border-right: 0;
}
.ncal-case.a-evenements {
	cursor: pointer;
}
.ncal-case.is-hors {
	background: var(--ncal-fond-2);
}
.ncal-case.is-hors .ncal-case__num {
	opacity: .45;
}
.ncal-case__num {
	font-size: .85rem;
	font-weight: 600;
	width: 1.8rem;
	height: 1.8rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	align-self: flex-end;
}
.ncal-case.is-aujourdhui .ncal-case__num {
	background: var(--ncal-accent);
	color: #fff;
}

.ncal-puce {
	display: block;
	width: 100%;
	text-align: left;
	border: 0;
	border-left: 3px solid var(--ncal-couleur);
	background: var(--ncal-fond-2);
	background: color-mix(in srgb, var(--ncal-couleur) 14%, #fff);
	color: var(--ncal-texte);
	border-radius: 4px;
	padding: .2em .4em;
	font-size: .78rem !important;
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.ncal-puce.is-multi {
	background: var(--ncal-couleur);
	color: #fff;
}
.ncal-puce:hover {
	filter: brightness(.95);
}
.ncal-puce__heure {
	font-weight: 700;
}
.ncal-case__plus {
	font-size: .75rem;
	color: var(--ncal-doux);
	padding-left: .4em;
}
.ncal-case__points {
	display: none;
}

/* ---------- Vue liste ---------- */

.ncal-liste {
	list-style: none;
	margin: 0;
	padding: 0;
}
.ncal-item {
	display: grid;
	grid-template-columns: 6.5rem minmax(0, 1fr);
	gap: 1.5rem 2rem;
	align-items: center;
	margin: 0;
	padding: 1.5rem 0;
	border-bottom: 1px solid var(--ncal-ligne);
}
.ncal-item:last-child {
	border-bottom: 0;
}
.ncal-item.a-image {
	grid-template-columns: 6.5rem minmax(0, 1fr) minmax(0, 17rem);
}
.ncal-item::before {
	content: none !important;
}
.ncal-item__date {
	text-align: center;
	line-height: 1;
}
.ncal-item__rond {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 6rem;
	height: 6rem;
	margin: 0 auto .6rem;
	border-radius: 50%;
	background: var(--ncal-fond-2);
	background: color-mix(in srgb, var(--ncal-couleur) 25%, #fff);
	color: #fff;
	font-size: 2.6rem;
	font-weight: 700;
	transition: background .2s;
}
.ncal-item:hover .ncal-item__rond,
.ncal-item:focus-within .ncal-item__rond {
	background: var(--ncal-couleur);
}
.ncal-item__mois {
	display: block;
	font-size: 1.4rem;
	text-transform: uppercase;
	letter-spacing: .25em;
	padding-left: .25em;
}
.ncal-item__titre {
	margin: 0 0 .6rem !important;
	font-size: 2.4rem;
	line-height: 1.15;
}
.ncal-item__titre a {
	color: inherit;
	text-decoration: none;
}
.ncal-item__titre a:hover {
	color: var(--ncal-couleur);
}
.ncal-item__cat {
	margin: 0 0 .3rem;
	font-size: 1rem;
}
.ncal-item .ncal-ligne {
	font-size: 1rem;
}
.ncal-item__extrait {
	margin: .3rem 0 0;
	font-size: 1.15rem;
	display: -webkit-box;
	-webkit-line-clamp: 5;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.ncal-item__liens {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem 1.5rem;
	margin: 1rem 0 0;
}
.ncal-item__plus {
	color: inherit !important;
	text-decoration: underline;
	text-underline-offset: 3px;
}
.ncal-item__plus:hover {
	color: var(--ncal-couleur) !important;
}
.ncal-item__image img {
	display: block;
	width: 100%;
	height: auto;
	max-height: 15rem;
	object-fit: cover;
}

/* ---------- Éléments communs ---------- */

.ncal-ligne {
	margin: .15rem 0;
	font-size: .95rem;
	padding-left: 1.5em;
	position: relative;
}
.ncal-ligne::before {
	position: absolute;
	left: 0;
	top: .1em;
	width: 1.1em;
	height: 1.1em;
	content: "";
	background: var(--ncal-doux);
	-webkit-mask: var(--ncal-icone) no-repeat center / contain;
	mask: var(--ncal-icone) no-repeat center / contain;
}
.ncal-ligne--quand {
	--ncal-icone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20zm0 2a8 8 0 1 1 0 16 8 8 0 0 1 0-16zm-1 3v6l5 3 1-1.7-4-2.3V7z'/%3E%3C/svg%3E");
}
.ncal-ligne--adresse {
	--ncal-icone: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2a7 7 0 0 0-7 7c0 5.3 7 13 7 13s7-7.7 7-13a7 7 0 0 0-7-7zm0 9.5A2.5 2.5 0 1 1 12 6.5a2.5 2.5 0 0 1 0 5z'/%3E%3C/svg%3E");
}
.ncal-ligne a {
	color: inherit;
}
.ncal-detail__cats,
.ncal-fiche__cats {
	display: flex;
	flex-wrap: wrap;
	gap: .3rem;
	margin: 0 0 .4rem;
}
.ncal-badge {
	display: inline-block;
	background: var(--ncal-couleur);
	color: #fff;
	font-size: .72rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .05em;
	padding: .25em .7em;
	border-radius: 999px;
	line-height: 1.3;
}
.ncal-actions {
	display: flex;
	flex-wrap: wrap;
	gap: .5rem;
	margin: .8rem 0 0;
}
.ncal-bouton {
	display: inline-block;
	background: var(--ncal-accent);
	border: 2px solid var(--ncal-accent);
	color: #fff !important;
	text-decoration: none !important;
	padding: .45em 1.1em;
	border-radius: 999px;
	font-size: .9rem;
	font-weight: 600;
	line-height: 1.3;
}
.ncal-bouton--contour {
	background: transparent;
	color: var(--ncal-accent) !important;
}
.ncal-bouton:hover {
	filter: brightness(.92);
}

/* ---------- Fenêtre de détails ---------- */

.ncal-modal-ouvert {
	overflow: hidden;
}
.ncal-modal[hidden] {
	display: none;
}
.ncal-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	color: var(--ncal-texte);
}
.ncal-modal__fond {
	position: absolute;
	inset: 0;
	background: rgba(17, 24, 39, .55);
}
.ncal-modal__boite {
	position: relative;
	background: var(--ncal-fond);
	border-radius: 14px;
	width: 100%;
	max-width: 32rem;
	max-height: calc(100vh - 2rem);
	overflow: auto;
	padding: 3rem 1.5rem 1.5rem;
	box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
	outline: none;
}
.ncal-modal__fermer {
	position: absolute;
	top: .5rem;
	right: .6rem;
	width: 2.2rem;
	height: 2.2rem;
	border: 0;
	background: transparent;
	font-size: 1.7rem;
	line-height: 1;
	color: var(--ncal-doux);
	cursor: pointer;
	border-radius: 50%;
}
.ncal-modal__fermer:hover {
	background: var(--ncal-fond-2);
}
.ncal-modal__jour {
	margin: 0 0 1rem !important;
	font-size: 1.3rem;
}
.ncal-detail {
	border-top: 4px solid var(--ncal-couleur);
	padding-top: .9rem;
}
.ncal-detail + .ncal-detail {
	margin-top: 1.5rem;
}
.ncal-detail__titre {
	margin: 0 0 .5rem !important;
	font-size: 1.3rem;
	line-height: 1.3;
	padding-right: 1.5rem;
}
.ncal-detail__extrait {
	margin: .75rem 0 0;
}

/* ---------- Fiche (page de l'événement) ---------- */

.ncal-fiche {
	background: #f6f7f9;
	border-left: 5px solid var(--ncal-couleur, var(--ncal-accent));
	border-radius: 10px;
	padding: 1.1rem 1.4rem;
	margin: 0 0 1.75rem;
}
.ncal-fiche__ligne {
	margin: .35rem 0;
}
.ncal-fiche .ncal-ico {
	display: inline-block;
	width: 1.4em;
}
.ncal-fiche .ncal-bouton {
	margin-top: .4rem;
}

/* ---------- Retour au calendrier (page de l'événement) ---------- */

.ncal-retour {
	margin: 0 0 1.25rem;
}
.ncal-fiche ~ .ncal-retour,
.ncal-retour:last-child {
	margin: 2rem 0 0;
}
.ncal-retour__lien {
	display: inline-flex;
	align-items: center;
	gap: .5em;
	padding: .5em 1.2em;
	border: 2px solid var(--ncal-accent, #00abaa);
	border-radius: 999px;
	color: var(--ncal-accent, #00abaa) !important;
	font-weight: 600;
	text-decoration: none !important;
	line-height: 1.3;
	transition: background .15s, color .15s;
}
.ncal-retour__lien:hover,
.ncal-retour__lien:focus-visible {
	background: var(--ncal-accent, #00abaa);
	color: #fff !important;
}

/* ---------- Position des filtres (filtres="haut|bas|gauche|droite") ---------- */

.ncal {
	container-type: inline-size;
}
.ncal--filtres-bas .ncal__cadre {
	display: flex;
	flex-direction: column-reverse;
}
.ncal--filtres-bas .ncal__filtres {
	margin: 1rem 0 0;
}
.ncal--filtres-gauche .ncal__cadre,
.ncal--filtres-droite .ncal__cadre {
	display: grid;
	grid-template-columns: minmax(9rem, 13rem) minmax(0, 1fr);
	gap: 1.5rem;
	align-items: start;
}
.ncal--filtres-droite .ncal__cadre {
	grid-template-columns: minmax(0, 1fr) minmax(9rem, 13rem);
}
.ncal--filtres-droite .ncal__filtres {
	order: 2;
}
.ncal--filtres-gauche .ncal__filtres,
.ncal--filtres-droite .ncal__filtres {
	flex-direction: column;
	align-items: stretch;
	margin: 0;
	position: sticky;
	top: 1rem;
}
.ncal--filtres-gauche .ncal-filtre,
.ncal--filtres-droite .ncal-filtre {
	justify-content: flex-start;
	border-radius: var(--ncal-rayon);
	text-align: left;
}

/* Colonne trop étroite : les filtres latéraux repassent au-dessus. */
@container (max-width: 640px) {
	.ncal--filtres-gauche .ncal__cadre,
	.ncal--filtres-droite .ncal__cadre {
		display: block;
	}
	.ncal--filtres-gauche .ncal__filtres,
	.ncal--filtres-droite .ncal__filtres {
		flex-direction: row;
		flex-wrap: wrap;
		position: static;
		margin-bottom: 1rem;
	}
	.ncal--filtres-gauche .ncal-filtre,
	.ncal--filtres-droite .ncal-filtre {
		border-radius: 999px;
	}
}

/* ---------- Mini-calendrier (vue="mini") ---------- */

.ncal--mini {
	max-width: 22rem;
	font-size: .95rem;
}
.ncal--mini .ncal__entete {
	flex-wrap: nowrap;
	margin-bottom: .5rem;
}
.ncal--mini .ncal__titre {
	order: -1;
	flex-basis: auto;
	font-size: 1.05rem;
	text-align: left;
}
.ncal--mini .ncal__fleche {
	width: 1.9rem;
	height: 1.9rem;
	font-size: 1.15rem;
}
.ncal--mini .ncal__filtres {
	gap: .3rem;
}
.ncal--mini .ncal-filtre {
	font-size: .75rem;
	padding: .3em .75em;
}
.ncal-mini__jours,
.ncal-mini__grille {
	display: grid;
	grid-template-columns: repeat(7, minmax(0, 1fr));
	gap: 2px;
	text-align: center;
}
.ncal-mini__jours span {
	padding: .25rem 0;
	font-size: .7rem;
	text-transform: uppercase;
	color: var(--ncal-doux);
}
.ncal .ncal-mini__case {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 1;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: none;
	color: inherit;
	font-size: .85rem;
	line-height: 1;
}
.ncal-mini__case.is-hors {
	opacity: .4;
}
.ncal .ncal-mini__case.a-evenements {
	font-weight: 700;
	background: var(--ncal-fond-2);
}
.ncal .ncal-mini__case.a-evenements:hover {
	background: var(--ncal-ligne);
}
.ncal-mini__case.is-aujourdhui {
	box-shadow: inset 0 0 0 2px var(--ncal-accent);
}
.ncal .ncal-mini__case[aria-pressed="true"] {
	background: var(--ncal-accent);
	color: #fff;
}
.ncal-mini__points {
	position: absolute;
	bottom: 14%;
	left: 0;
	right: 0;
	display: flex;
	justify-content: center;
	gap: 2px;
}
.ncal-mini__points i {
	width: 4px;
	height: 4px;
	border-radius: 50%;
}
.ncal-mini__case[aria-pressed="true"] .ncal-mini__points i {
	background: #fff !important;
}
.ncal-mini__detail {
	margin-top: .75rem;
	padding-top: .75rem;
	border-top: 1px solid var(--ncal-ligne);
}
.ncal .ncal-mini__date {
	margin: 0 0 .5rem;
	font-size: .85rem;
	font-weight: 700;
}
.ncal .ncal-mini__vide {
	margin: 0;
	font-size: .85rem;
	color: var(--ncal-doux);
}
.ncal .ncal-mini__ev {
	display: flex;
	align-items: baseline;
	gap: .5rem;
	width: 100%;
	margin: 0 0 .35rem;
	padding: .45rem .6rem;
	border: 0;
	border-left: 3px solid var(--ncal-couleur);
	border-radius: 6px;
	background: var(--ncal-fond-2);
	color: inherit;
	font-size: .85rem;
	line-height: 1.3;
	text-align: left;
}
.ncal .ncal-mini__ev:hover {
	background: var(--ncal-ligne);
}
.ncal-mini__ev small {
	flex: none;
	color: var(--ncal-doux);
	font-size: .8em;
}

/* ---------- Cartes (vue="cartes") ---------- */

.ncal .ncal-cartes {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
	gap: 1.25rem;
	margin: 0;
	padding: 0;
	list-style: none;
}
.ncal .ncal-carte {
	position: relative;
	display: flex;
	flex-direction: column;
	margin: 0;
	overflow: hidden;
	border: 1px solid var(--ncal-ligne);
	border-radius: var(--ncal-rayon);
	background: var(--ncal-fond);
	transition: box-shadow .2s, transform .2s;
}
.ncal-carte::before {
	content: none !important;
}
.ncal-carte:hover,
.ncal-carte:focus-within {
	box-shadow: 0 8px 24px rgba(17, 24, 39, .1);
	transform: translateY(-2px);
}
.ncal-carte__image {
	position: relative;
	aspect-ratio: 16 / 9;
	background: var(--ncal-couleur);
	background: linear-gradient(135deg, var(--ncal-couleur), color-mix(in srgb, var(--ncal-couleur) 55%, #000));
}
.ncal-carte__image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.ncal-carte__date {
	position: absolute;
	top: .75rem;
	left: .75rem;
	min-width: 3.2rem;
	padding: .35rem .5rem;
	border-radius: 8px;
	background: #fff;
	color: var(--ncal-texte);
	box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
	font-size: .7rem;
	line-height: 1.1;
	letter-spacing: .08em;
	text-align: center;
	text-transform: uppercase;
}
.ncal-carte__date b {
	display: block;
	font-size: 1.35rem;
	letter-spacing: 0;
	color: var(--ncal-couleur);
}
.ncal-carte__corps {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: .35rem;
	padding: 1rem 1.1rem 1.2rem;
}
.ncal .ncal-carte__cat {
	margin: 0;
	font-size: .72rem;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--ncal-doux);
}
.ncal .ncal-carte__titre {
	margin: 0 0 .25rem !important;
	font-size: 1.15rem;
	line-height: 1.3;
}
.ncal-carte__titre a {
	color: inherit;
	text-decoration: none;
}
/* Toute la carte est cliquable. */
.ncal-carte__titre a::after {
	content: "";
	position: absolute;
	inset: 0;
}
.ncal-carte .ncal-ligne {
	margin: 0;
	font-size: .85rem;
}

/* ---------- Mobile ---------- */

@media (max-width: 700px) {
	.ncal__titre {
		order: -1;
		flex-basis: 100%;
	}
	.ncal__entete {
		justify-content: space-between;
	}
	.ncal-case {
		min-height: 3.6rem;
		padding: .2rem;
		align-items: center;
	}
	.ncal-case__num {
		align-self: center;
		font-size: .8rem;
	}
	.ncal-puce,
	.ncal-case__plus {
		display: none;
	}
	.ncal-case__points {
		display: flex;
		gap: 2px;
		flex-wrap: wrap;
		justify-content: center;
	}
	.ncal-case__points i {
		width: 6px;
		height: 6px;
		border-radius: 50%;
	}
	.ncal-mois__jours div {
		font-size: .68rem;
		letter-spacing: 0;
	}
	.ncal-item,
	.ncal-item.a-image {
		grid-template-columns: 4rem minmax(0, 1fr);
		gap: 1rem;
		align-items: start;
	}
	.ncal-item__rond {
		width: 3.75rem;
		height: 3.75rem;
		font-size: 1.6rem;
	}
	.ncal-item__mois {
		font-size: 1rem;
		letter-spacing: .15em;
	}
	.ncal-item__titre {
		font-size: 1.6rem;
	}
	.ncal-item__image {
		grid-column: 1 / -1;
	}
}
