/**
 * Override de mise en page du plan du site JSitemapPro (com_jmap)
 * Emplacement volontaire : templates/yootheme/css/com_jmap/js/jquery.treeview.css
 * Chargé automatiquement par le composant quand "Template override" (template_override) = Oui.
 * Ce fichier survit aux mises à jour du composant (rien n'est modifié dans /components).
 *
 * 100% autonome : aucune image externe (icônes en CSS pur), thème clair + sombre.
 * Auteur : maintenance Exoride.
 */

:root {
	--jmap-accent: #bd0732;          /* crimson thème Exoride */
	--jmap-accent-2: #f16f56;        /* corail secondaire */
	--jmap-ink: #1f2328;
	--jmap-muted: #6b7280;
	--jmap-line: #e6e8eb;
	--jmap-surface: #ffffff;
	--jmap-surface-2: #f7f8fa;
	--jmap-radius: 12px;
}

/* ============================ Conteneur ============================ */
#jmap_sitemap.sitemap,
#jmap_sitemap {
	max-width: 1100px;
	margin: 0 auto;
	padding: 4px 0 40px;
	color: var(--jmap-ink);
	font-size: 15px;
	line-height: 1.5;
	overflow: visible;
}

#jmap_sitemap > h1,
#jmap_sitemap > h2 {
	font-weight: 800;
	letter-spacing: -0.02em;
	margin: 0 0 6px;
	padding-bottom: 18px;
	position: relative;
}
#jmap_sitemap > h1::after,
#jmap_sitemap > h2::after {
	content: "";
	position: absolute;
	left: 0; bottom: 0;
	width: 64px; height: 4px;
	border-radius: 4px;
	background: linear-gradient(90deg, var(--jmap-accent), var(--jmap-accent-2));
}

/* ====================== Bascule tout ouvrir/fermer ================= */
#jmap_toggler {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin: 14px 0 22px;
	font-size: 13px;
	color: var(--jmap-muted);
}
#jmap_toggler span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 6px 14px;
	border: 1px solid var(--jmap-line);
	border-radius: 999px;
	background: var(--jmap-surface);
	font-weight: 600;
	color: var(--jmap-ink);
	cursor: pointer;
	transition: all .15s ease;
	user-select: none;
}
#jmap_toggler span:hover {
	border-color: var(--jmap-accent);
	color: var(--jmap-accent);
	box-shadow: 0 2px 8px rgba(189,7,50,.12);
}
#jmap_toggler_all::before  { content: "＋"; font-weight: 700; }
#jmap_toggler_none::before { content: "－"; font-weight: 700; }

/* ===================== Colonnes de sources ======================== */
#jmap_sitemap .jmapcolumn {
	display: flex;
	flex-direction: column;
	gap: 18px;
	float: none !important;
	width: 100% !important;
}

/* ================= Arbre : réinitialisation listes ================ */
#jmap_sitemap ul.jmap_filetree,
#jmap_sitemap ul.jmap_filetree ul,
#jmap_sitemap ul.treeview,
#jmap_sitemap ul.treeview ul {
	list-style: none;
	margin: 0 !important;
	padding: 0;
	background: transparent;
}

/* Arbre de premier niveau = "carte" par source de données */
#jmap_sitemap .jmapcolumn > ul.jmap_filetree {
	background: var(--jmap-surface);
	border: 1px solid var(--jmap-line);
	border-radius: var(--jmap-radius);
	padding: 10px 18px 14px;
	box-shadow: 0 1px 2px rgba(16,24,40,.04), 0 6px 20px rgba(16,24,40,.04);
}

#jmap_sitemap ul.jmap_filetree li {
	list-style: none;
	position: relative;
	margin: 0;
	padding: 2px 0 2px 22px;
	text-align: left;
	background: none;
}

/* Indentation des sous-niveaux */
#jmap_sitemap ul.jmap_filetree ul {
	padding-left: 14px;
	margin-left: 4px !important;
	border-left: 1px dashed var(--jmap-line);
}

/* ==================== Zone cliquable (chevron) ==================== */
#jmap_sitemap .hitarea {
	position: absolute;
	left: 0; top: 50%;
	width: 18px; height: 18px;
	margin: 0;
	transform: translateY(-50%);
	float: none;
	cursor: pointer;
	background: none;
	border-radius: 5px;
	transition: background .15s ease;
}
#jmap_sitemap .hitarea:hover { background: var(--jmap-surface-2); }
#jmap_sitemap .hitarea::before {
	content: "";
	position: absolute;
	left: 6px; top: 5px;
	width: 6px; height: 6px;
	border-right: 2px solid var(--jmap-accent);
	border-bottom: 2px solid var(--jmap-accent);
	transform: rotate(-45deg);      /* fermé : chevron vers la droite */
	transition: transform .18s ease;
}
/* Ouvert : chevron vers le bas */
#jmap_sitemap .collapsable-hitarea::before,
#jmap_sitemap .lastCollapsable-hitarea::before {
	transform: rotate(45deg);
	top: 4px; left: 5px;
}

/* ========================= Dossiers ============================== */
#jmap_sitemap span.folder {
	display: inline-block;
	padding: 5px 6px 5px 26px;
	position: relative;
	font-weight: 600;
	color: var(--jmap-ink);
	cursor: pointer;
	border-radius: 7px;
	background: none;
	transition: color .15s ease, background .15s ease;
}
#jmap_sitemap span.folder::before {
	content: "";
	position: absolute;
	left: 2px; top: 50%;
	transform: translateY(-50%);
	width: 17px; height: 13px;
	border-radius: 2px 3px 3px 3px;
	background: var(--jmap-accent-2);
	box-shadow: inset 0 6px 0 rgba(255,255,255,.22);
}
#jmap_sitemap span.folder::after {   /* languette du dossier */
	content: "";
	position: absolute;
	left: 3px; top: calc(50% - 8px);
	width: 8px; height: 4px;
	border-radius: 2px 2px 0 0;
	background: var(--jmap-accent-2);
}
#jmap_sitemap span.folder:hover {
	color: var(--jmap-accent);
	background: var(--jmap-surface-2);
}

/* Dossier de tête de chaque carte (source) : plus grand */
#jmap_sitemap .jmapcolumn > ul.jmap_filetree > li > span.folder {
	font-size: 18px;
	font-weight: 800;
	letter-spacing: -0.01em;
	padding-top: 8px;
	padding-bottom: 8px;
}
#jmap_sitemap .jmapcolumn > ul.jmap_filetree > li > span.folder::before {
	width: 20px; height: 15px;
	background: var(--jmap-accent);
}
#jmap_sitemap .jmapcolumn > ul.jmap_filetree > li > span.folder::after {
	background: var(--jmap-accent);
	top: calc(50% - 9px);
}

/* Catégorie vide non dépliable : aspect discret */
#jmap_sitemap li.noexpandable > span.folder { cursor: default; }
#jmap_sitemap li.noexpandable > span.folder:hover {
	color: var(--jmap-ink);
	background: none;
}

/* =========================== Liens =============================== */
#jmap_sitemap ul.jmap_filetree li a {
	display: inline-block;
	padding: 4px 8px 4px 24px;
	position: relative;
	color: var(--jmap-ink);
	text-decoration: none;
	border-radius: 7px;
	transition: color .12s ease, background .12s ease;
}
#jmap_sitemap ul.jmap_filetree li a::before {
	content: "";
	position: absolute;
	left: 8px; top: 50%;
	width: 6px; height: 6px;
	margin-top: -3px;
	border-radius: 50%;
	background: var(--jmap-line);
	transition: background .12s ease, transform .12s ease;
}
#jmap_sitemap ul.jmap_filetree li a:hover {
	color: var(--jmap-accent);
	background: var(--jmap-surface-2);
	text-decoration: none;
}
#jmap_sitemap ul.jmap_filetree li a:hover::before {
	background: var(--jmap-accent);
	transform: scale(1.25);
}
#jmap_sitemap ul.jmap_filetree li a.selected {
	background: rgba(189,7,50,.08);
	color: var(--jmap-accent);
	font-weight: 600;
}

/* Liens système (séparateurs / titres de menu) : non cliquables visuellement */
#jmap_sitemap li.systemlink > a {
	color: var(--jmap-muted);
	pointer-events: none;
	font-style: italic;
}
#jmap_sitemap li.systemlink > a::before { display: none; }

/* Masquer les <li> vides résiduels */
#jmap_sitemap ul.jmap_filetree li a:empty { display: none; }

/* ====================== Confort / responsive ===================== */
@media (max-width: 640px) {
	#jmap_sitemap { font-size: 14px; }
	#jmap_sitemap .jmapcolumn > ul.jmap_filetree { padding: 8px 12px 12px; }
	#jmap_sitemap ul.jmap_filetree ul { padding-left: 10px; }
}

/* ========================== Thème sombre ========================= */
@media (prefers-color-scheme: dark) {
	:root {
		--jmap-ink: #e7e9ee;
		--jmap-muted: #9aa3b2;
		--jmap-line: #2a2f3a;
		--jmap-surface: #171a21;
		--jmap-surface-2: #1f232c;
	}
	#jmap_sitemap ul.jmap_filetree li a.selected { background: rgba(241,111,86,.14); }
}
