/*
 * Carte des Événements — styles publics
 * Aux couleurs de La Forêt Jardin du Robin :
 *   rouge-gorge #fb5454 (titres et boutons du site), gris graphite
 *   #3a3a3a / #4b4f58 (textes), fonds blancs et gris très clair,
 *   police manuscrite « Cabin Sketch » (déjà chargée par le thème) pour
 *   quelques accents.
 *
 * Pour changer une couleur partout d'un coup, il suffit de modifier la
 * variable correspondante ci-dessous.
 */

:root {
	--fjre-robin: #fb5454;        /* rouge-gorge : marqueurs, badges */
	--fjre-robin-text: #d63a3a;   /* rouge un peu plus soutenu pour le petit texte (lisibilité) */
	--fjre-robin-pale: #fff3f3;   /* fond du prochain événement */
	--fjre-graphite: #3a3a3a;     /* titres */
	--fjre-text: #4b4f58;         /* texte courant */
	--fjre-muted: #80838a;        /* texte secondaire */
	--fjre-border: #e7e7e7;
	--fjre-bg-soft: #f5f5f5;
	--fjre-sketch: "Cabin Sketch", system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ======================================================================
   Liste des événements — [fjr_evenements]
   ====================================================================== */

.fjre-events-block {
	max-width: 760px;
	margin: 20px auto;
	text-align: left;
}

.fjre-events {
	list-style: none;
	margin: 0;
	padding: 0;
}

.fjre-events__group-label {
	margin: 0 0 6px;
	font-family: var(--fjre-sketch);
	font-size: 18px;
	font-weight: 700;
	color: var(--fjre-robin);
	line-height: 1.2;
}

.fjre-events--recurring {
	margin-bottom: 18px;
	padding: 4px 12px;
	border: 1.5px dashed rgba(251, 84, 84, 0.45);
	border-radius: 10px;
	background: #fff;
}

.fjre-events__item {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	column-gap: 8px;
	row-gap: 2px;
	padding: 9px 10px 9px 30px;
	border-bottom: 1px solid var(--fjre-border);
	font-size: 14px;
	line-height: 1.45;
	color: var(--fjre-text);
	transition: background-color 0.2s ease, opacity 0.2s ease;
}

.fjre-events__item:last-child {
	border-bottom: none;
}

/* Petite épingle rouge devant chaque événement (clin d'œil aux 📌 du site) */
.fjre-events__item::before {
	content: "";
	position: absolute;
	left: 8px;
	top: 12px;
	width: 13px;
	height: 17px;
	background-color: var(--fjre-robin);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 36'%3E%3Cpath d='M14 0C6.3 0 0 6.3 0 14c0 9.8 14 22 14 22s14-12.2 14-22C28 6.3 21.7 0 14 0Zm0 19.5a5.5 5.5 0 1 1 0-11 5.5 5.5 0 0 1 0 11Z'/%3E%3C/svg%3E") no-repeat center / contain;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 36'%3E%3Cpath d='M14 0C6.3 0 0 6.3 0 14c0 9.8 14 22 14 22s14-12.2 14-22C28 6.3 21.7 0 14 0Zm0 19.5a5.5 5.5 0 1 1 0-11 5.5 5.5 0 0 1 0 11Z'/%3E%3C/svg%3E") no-repeat center / contain;
}

.fjre-events__when {
	font-weight: 700;
	color: var(--fjre-robin-text);
}

/* Le titre, le lieu et les horaires passent sur une ligne à part */
.fjre-events__line {
	flex-basis: 100%;
	color: var(--fjre-text);
}

.fjre-events__title {
	font-weight: 700;
	color: var(--fjre-graphite);
}

.fjre-events__sep {
	margin: 0 3px;
	color: var(--fjre-muted);
}

.fjre-events__location {
	color: var(--fjre-text);
}

a.fjre-events__location {
	color: var(--fjre-text);
	text-decoration: none;
	border-bottom: 1px dotted var(--fjre-robin);
}

a.fjre-events__location:hover,
a.fjre-events__location:focus {
	color: var(--fjre-robin-text);
	border-bottom-style: solid;
}

.fjre-events__hours {
	white-space: nowrap;
	color: var(--fjre-muted);
}

/* Petite horloge devant les horaires */
.fjre-events__hours {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	margin-left: 8px;
}

.fjre-events__hours::before {
	content: "";
	width: 12px;
	height: 12px;
	background-color: currentColor;
	-webkit-mask: 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 2.2a7.8 7.8 0 1 1 0 15.6 7.8 7.8 0 0 1 0-15.6ZM11 6.5V12.6l4.6 2.8 1.1-1.8-3.5-2.1V6.5Z'/%3E%3C/svg%3E") no-repeat center / contain;
	mask: 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 2.2a7.8 7.8 0 1 1 0 15.6 7.8 7.8 0 0 1 0-15.6ZM11 6.5V12.6l4.6 2.8 1.1-1.8-3.5-2.1V6.5Z'/%3E%3C/svg%3E") no-repeat center / contain;
}

.fjre-events__desc {
	flex-basis: 100%;
	font-size: 13px;
	color: var(--fjre-muted);
}

/* Événements localisés : cliquables (ouvrent le marqueur sur la carte) */
.fjre-events__item[data-event-id] {
	cursor: pointer;
	border-radius: 8px;
}

.fjre-events__item[data-event-id]:hover {
	background-color: var(--fjre-bg-soft);
}

.fjre-events__item[data-event-id]:focus {
	outline: none;
}

.fjre-events__item[data-event-id]:focus-visible {
	outline: 2px solid var(--fjre-robin);
	outline-offset: -2px;
}

.fjre-events__item.is-clicked {
	background-color: rgba(251, 84, 84, 0.1);
}

/* Le prochain rendez-vous se détache du reste */
.fjre-events__item.is-next {
	background: var(--fjre-robin-pale);
	border-radius: 10px;
	border-bottom-color: transparent;
	box-shadow: inset 3px 0 0 var(--fjre-robin);
}

.fjre-events__item.is-next::before {
	transform: scale(1.15);
}

.fjre-events__item.is-next .fjre-events__title {
	font-size: 15px;
}

/* Événements terminés : estompés, pas masqués */
.fjre-events__item.is-past {
	opacity: 0.5;
}

.fjre-events__item.is-past::before {
	background-color: #a7a9ae;
}

.fjre-events__item.is-past .fjre-events__when {
	color: var(--fjre-muted);
}

/* Rendez-vous réguliers : épingle évidée */
.fjre-events__item.is-recurring:not(:last-child) {
	border-bottom-style: dotted;
}

.fjre-events__item.is-recurring::before {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 36'%3E%3Cpath fill-rule='evenodd' d='M14 0C6.3 0 0 6.3 0 14c0 9.8 14 22 14 22s14-12.2 14-22C28 6.3 21.7 0 14 0Zm0 3.2C8 3.2 3.2 8 3.2 14c0 6.6 8.2 15.2 10.8 17.7 2.6-2.5 10.8-11.1 10.8-17.7C24.8 8 20 3.2 14 3.2Zm0 7a3.8 3.8 0 1 1 0 7.6 3.8 3.8 0 0 1 0-7.6Z'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 28 36'%3E%3Cpath fill-rule='evenodd' d='M14 0C6.3 0 0 6.3 0 14c0 9.8 14 22 14 22s14-12.2 14-22C28 6.3 21.7 0 14 0Zm0 3.2C8 3.2 3.2 8 3.2 14c0 6.6 8.2 15.2 10.8 17.7 2.6-2.5 10.8-11.1 10.8-17.7C24.8 8 20 3.2 14 3.2Zm0 7a3.8 3.8 0 1 1 0 7.6 3.8 3.8 0 0 1 0-7.6Z'/%3E%3C/svg%3E");
}

.fjre-empty {
	color: var(--fjre-muted);
	font-style: italic;
	text-align: center;
}

/* ======================================================================
   Badges (liste + infobulles)
   ====================================================================== */

.fjre-tag {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 20px;
	font-size: 10.5px;
	font-weight: 700;
	line-height: 1.5;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	white-space: nowrap;
	vertical-align: middle;
}

.fjre-tag--next {
	background: var(--fjre-robin);
	color: #fff;
}

.fjre-tag--past {
	background: #ececec;
	color: #6f7177;
	font-weight: 600;
}

.fjre-tag--tbc {
	background: #fff;
	color: var(--fjre-robin-text);
	box-shadow: inset 0 0 0 1px var(--fjre-robin);
	font-weight: 600;
}

.fjre-tag--recurring {
	background: #fff;
	color: var(--fjre-robin-text);
	box-shadow: inset 0 0 0 1.5px var(--fjre-robin);
}

.fjre-tag--nursery {
	background: var(--fjre-graphite);
	color: #fff;
}

/* ======================================================================
   Carte — [fjr_carte]
   ====================================================================== */

.fjre-map-wrapper {
	width: 100%;
	border: 1px solid var(--fjre-border);
	border-radius: 14px;
	overflow: hidden;
	background: #fff;
	box-shadow: 0 4px 18px rgba(58, 58, 58, 0.08);

	/* Apparition en fondu au défilement (classe ajoutée par map.js) */
	opacity: 0;
	transform: translateY(20px);
	transition: opacity 0.7s ease, transform 0.7s ease;
}

.fjre-map-wrapper.is-visible {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	.fjre-map-wrapper {
		opacity: 1;
		transform: none;
		transition: none;
	}
}

/* Carte seule : centrée, deux tiers de la largeur sur ordinateur
   (une carte trop large montre surtout des zones hors Bretagne). */
.fjre-map-standalone {
	margin: 24px auto;
	max-width: 100%;
}

@media (min-width: 922px) {
	.fjre-map-standalone {
		width: 66%;
	}
}

.fjre-map {
	width: 100%;
	height: 430px; /* remplacé par l'attribut hauteur="" du shortcode */
	background: var(--fjre-bg-soft);
	z-index: 0; /* évite que la carte passe au-dessus du menu du thème */
}

/* Fond de carte adouci : un peu désaturé et éclairci, pour que les
   marqueurs rouges ressortent (le blanc et le rouge du site dominent). */
.fjre-map .leaflet-tile-pane {
	filter: saturate(55%) brightness(1.04) contrast(0.95);
}

.fjre-map .leaflet-control-zoom {
	border: 1px solid var(--fjre-border) !important;
	border-radius: 8px !important;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

.fjre-map .leaflet-control-zoom a {
	color: var(--fjre-graphite) !important;
	border-color: var(--fjre-border) !important;
}

.fjre-map .leaflet-control-zoom a:hover {
	color: var(--fjre-robin) !important;
}

.fjre-map .leaflet-control-attribution {
	font-size: 10px;
	background: rgba(255, 255, 255, 0.8) !important;
}

/* Le thème Astra ajoute une ombre/bordure aux images : on l'annule sur la carte */
.fjre-map img {
	max-width: none !important;
	box-shadow: none !important;
	border: 0 !important;
}

.fjre-marker {
	background: none !important;
	border: 0 !important;
	filter: drop-shadow(0 3px 3px rgba(0, 0, 0, 0.25));
}

.fjre-marker svg {
	display: block;
}

/* Légende sous la carte */
.fjre-map-legend {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px 16px;
	padding: 8px 12px;
	border-top: 1px solid var(--fjre-border);
	font-size: 12px;
	color: var(--fjre-muted);
	line-height: 1.4;
}

.fjre-map-legend span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	white-space: nowrap;
}

.fjre-dot {
	display: inline-block;
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--fjre-robin);
}

.fjre-dot--next {
	width: 12px;
	height: 12px;
	box-shadow: 0 0 0 3px rgba(251, 84, 84, 0.25);
}

.fjre-dot--recurring {
	background: #fff;
	box-shadow: inset 0 0 0 2px var(--fjre-robin);
}

.fjre-dot--past {
	background: #a7a9ae;
	width: 8px;
	height: 8px;
}

.fjre-dot--nursery {
	background: var(--fjre-graphite);
	border-radius: 3px;
}

/* Infobulles */
.fjre-map-popup .leaflet-popup-content-wrapper {
	border-radius: 12px;
	box-shadow: 0 8px 24px rgba(58, 58, 58, 0.2);
}

.fjre-map-popup .leaflet-popup-content {
	margin: 12px 16px;
}

.fjre-map-popup a.leaflet-popup-close-button {
	color: var(--fjre-muted);
}

.fjre-popup {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 2px;
	min-width: 180px;
	font-size: 13px;
	line-height: 1.4;
	color: var(--fjre-text);
}

.fjre-popup .fjre-tag {
	margin-bottom: 4px;
}

.fjre-popup__title {
	font-family: var(--fjre-sketch);
	font-size: 18px;
	font-weight: 700;
	line-height: 1.15;
	color: var(--fjre-robin);
	margin-bottom: 2px;
}

.fjre-popup__location {
	font-weight: 600;
	color: var(--fjre-graphite);
}

.fjre-popup__when {
	color: var(--fjre-text);
}

.fjre-popup__when em {
	color: var(--fjre-muted);
}

.fjre-popup__hours {
	color: var(--fjre-muted);
}

.fjre-map-popup a.fjre-popup__link {
	margin-top: 6px;
	padding: 4px 12px;
	border-radius: 20px;
	background: var(--fjre-robin);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	text-decoration: none;
}

.fjre-map-popup a.fjre-popup__link:hover,
.fjre-map-popup a.fjre-popup__link:focus {
	background: var(--fjre-robin-text);
	color: #fff;
}

/* ======================================================================
   Liste + carte côte à côte — [fjr_evenements_carte]
   ====================================================================== */

.fjre-combo {
	--fjre-map-height: 430px; /* remplacé par l'attribut hauteur="" */
	display: flex;
	flex-direction: column;
	gap: 24px;
	margin: 24px 0;
}

.fjre-combo .fjre-events-block {
	max-width: none;
	margin: 0;
}

@media (min-width: 922px) {

	.fjre-combo {
		flex-direction: row;
		align-items: flex-start;
	}

	.fjre-combo__list,
	.fjre-combo__map {
		flex: 1 1 50%;
		min-width: 0;
	}

	/* La liste défile dans son cadre, à la hauteur de la carte + légende */
	.fjre-combo__list {
		max-height: calc(var(--fjre-map-height) + 38px);
		overflow-y: auto;
		padding-right: 10px;
		scrollbar-width: thin;
		scrollbar-color: #d6d6d6 transparent;
	}

	.fjre-combo__list::-webkit-scrollbar {
		width: 6px;
	}

	.fjre-combo__list::-webkit-scrollbar-thumb {
		background: #d6d6d6;
		border-radius: 3px;
	}

	/* La carte reste visible pendant qu'on fait défiler la page */
	.fjre-combo__map {
		position: sticky;
		top: 20px;
	}

}
