/* ================================
   PAGE ADRESSE - Sidebar simple
   ================================ */

.page-adresse-main {
	position: relative;
	min-height: 100vh;
}


/* ================================
   BOUTON TOGGLE SIDEBAR
   ================================ */

.toggle-sidebar-btn {
	position: fixed;
	left: 0;
	top: 80px;
	z-index: 2;
	background: var(--color-dark);
	color: var(--color-light);
	border: none;
	padding: 15px 10px;
	border-radius: 0 8px 8px 0;
	cursor: pointer;
	font-weight: 600;
	box-shadow: 2px 0 10px rgba(0, 0, 0, 0.2);
	transition: all 0.3s ease;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 50px;
	min-height: 50px;
	user-select: none;
}

.toggle-sidebar-btn::before {
	content: '';
	display: inline-block;
	width: 24px;
	height: 24px;
	background-color: currentColor;
	mask-image: url('../media/-icon/panel-left-open.svg');
	mask-size: contain;
	mask-repeat: no-repeat;
	mask-position: center;
	-webkit-mask-image: url('../media/-icon/panel-left-open.svg');
	-webkit-mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	-webkit-mask-position: center;
	transition: mask-image 0.3s ease, -webkit-mask-image 0.3s ease;
}

/* Changer l'icône quand la sidebar est ouverte */
.toggle-sidebar-btn.active::before,
.page-adresse-main.sidebar-open .toggle-sidebar-btn::before {
	mask-image: url('../media/-icon/panel-left-close.svg');
	-webkit-mask-image: url('../media/-icon/panel-left-close.svg');
}

.toggle-sidebar-btn:hover {
	background: var(--color-fresh);
	padding-left: 15px;
}

/* Déplacer le bouton quand la sidebar est ouverte */
.page-adresse-main.sidebar-open .toggle-sidebar-btn {
	left: 260px;
}

/* ================================
   SIDEBAR
   ================================ */

.adresse-sidebar {
	position: fixed;
	left: 0;
	top: 80px;
	width: 260px !important;
	max-width: 260px !important;
	height: calc(100vh - 80px);
	background: var(--color-light);
	z-index: 999;
	transform: translateX(-100%);
	transition: transform 0.3s ease;
	box-shadow: 2px 0 20px rgba(0, 0, 0, 0.15);
	overflow-y: auto;
	pointer-events: auto;
}

.adresse-sidebar.open {
	transform: translateX(0);
	pointer-events: auto;
	width: 260px !important;
	max-width: 260px !important;
}

.sidebar-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 20px;
	background: var(--color-dark);
	color: var(--color-light);
	border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h3 {
	margin: 0;
	font-size: 1.2rem;
}

.close-sidebar-btn {
	background: none;
	border: none;
	color: var(--color-light);
	font-size: 2rem;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	width: 30px;
	height: 30px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 0.2s ease;
}

.close-sidebar-btn:hover {
	transform: rotate(90deg);
}

.sidebar-content {
	padding: 20px;
	pointer-events: auto;
	position: relative;
	z-index: 1;
}

.taxonomy-group {
	margin-bottom: 30px;
}

.taxonomy-group.groupe-group {
	margin-bottom: 30px;
}

/* Menu dropdown pour les groupes */
.groupe-select-wrapper {
	position: relative;
	width: 100%;
}

.groupe-select {
	width: 100%;
	padding: 12px 15px 12px 40px;
	font-size: 0.95rem;
	font-family: inherit;
	border: 1px solid #d0d0d0;
	border-radius: 4px;
	background-color: #fff;
	color: var(--color-dark);
	cursor: pointer;
	transition: all 0.3s ease;
	appearance: none;
	padding-right: 35px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 12px;
}

.groupe-select:hover {
	border-color: #999;
}

.groupe-select:focus {
	outline: none;
	border-color: var(--color-fresh);
	box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.1);
}

.groupe-select option {
	padding: 10px;
	font-size: 0.95rem;
	background-color: #fff;
}

.groupe-select option:first-child {
	color: #999;
	font-style: italic;
}

.groupe-select-icon {
	position: absolute;
	left: 12px;
	top: 50%;
	transform: translateY(-50%);
	width: 16px;
	height: 16px;
	color: var(--color-fresh);
	pointer-events: none;
	opacity: 1;
}

.taxonomy-group h4 {
	margin: 0 0 15px 0;
	font-size: 1rem;
	font-weight: 600;
	color: var(--color-dark);
	padding-top: 10px;
	border-top: 2px solid var(--color-fresh);
}

.taxonomy-group-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	cursor: pointer;
	user-select: none;
	transition: opacity 0.2s ease;
}

.taxonomy-group-toggle:hover {
	opacity: 0.8;
}

.taxonomy-title {
	flex: 1;
}

.taxonomy-toggle-icon {
	width: 16px;
	height: 16px;
	color: var(--color-fresh);
	transition: transform 0.3s ease;
	flex-shrink: 0;
	margin-left: 10px;
}

.taxonomy-group:not(.open) .taxonomy-toggle-icon {
	transform: rotate(-90deg);
}

.taxonomy-list {
	max-height: 1000px;
	overflow: hidden;
	opacity: 1;
	transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
				opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
				margin-top 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	margin-top: 0;
}

.taxonomy-group:not(.open) .taxonomy-list {
	max-height: 0;
	opacity: 0;
	margin-top: -10px;
}

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

.taxonomy-list li {
	margin-bottom: 2px;
	font-size: smaller;
}

.taxonomy-link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 2px 12px;
	color: var(--color-dark);
	text-decoration: none;
	border-radius: 4px;
	transition: all 0.2s ease;
	cursor: pointer !important;
	pointer-events: auto !important;
	position: relative;
	z-index: 1;
}

.taxonomy-link:hover {
	background: #f0f0f0;
	color: var(--color-fresh);
}

.taxonomy-link.active {
	background: var(--color-dark);
	color: var(--color-light);
}

.taxonomy-link.active:hover {
	background: var(--color-dark);
	color: var(--color-light);
}


/* Bouton clear dans une pill */
.taxonomy-link .clear-filter-btn {
	display: none;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.2);
	border: none;
	color: var(--color-light);
	cursor: pointer;
	font-size: 12px;
	line-height: 1;
	padding: 0;
	margin-left: 8px;
	flex-shrink: 0;
	transition: all 0.2s ease;
}

.taxonomy-link.active .clear-filter-btn {
	display: flex;
}

.taxonomy-link .clear-filter-btn:hover {
	background: rgba(255, 255, 255, 0.3);
	transform: scale(1.1);
}

.taxonomy-link .taxonomy-content {
	display: flex;
	align-items: center;
	flex: 1;
	min-width: 0;
	overflow: visible;
}

.taxonomy-link .count {
	opacity: 0.5;
	font-size: 0.6rem;
	padding-left: 5px;
}

.taxonomy-link .taxonomy-icon,
.taxonomy-icon {
	height: 24px !important;
	width: 24px !important;
	display: inline-table;
	margin-right: 8px !important;
	text-align: center !important;
	border-radius: 4px !important;
	padding: 5px;
}

.taxonomy-icon svg {
	width: 14px;
	height: 14px;
	display: block;
	flex-shrink: 0;
}

/* Forcer fill transparent et stroke-width sur les éléments qui dessinent */
.taxonomy-icon svg path,
.taxonomy-icon svg circle,
.taxonomy-icon svg rect,
.taxonomy-icon svg polygon,
.taxonomy-icon svg polyline,
.taxonomy-icon svg line,
.taxonomy-icon svg ellipse {
	fill: transparent !important;
	stroke-width: 3px !important;
}

/* Appliquer la couleur du filtre au stroke */
.taxonomy-link[style*="--taxonomy-color"] .taxonomy-icon svg path,
.taxonomy-link[style*="--taxonomy-color"] .taxonomy-icon svg circle,
.taxonomy-link[style*="--taxonomy-color"] .taxonomy-icon svg rect,
.taxonomy-link[style*="--taxonomy-color"] .taxonomy-icon svg polygon,
.taxonomy-link[style*="--taxonomy-color"] .taxonomy-icon svg polyline,
.taxonomy-link[style*="--taxonomy-color"] .taxonomy-icon svg line,
.taxonomy-link[style*="--taxonomy-color"] .taxonomy-icon svg ellipse,
.taxonomy-icon[data-color] svg path,
.taxonomy-icon[data-color] svg circle,
.taxonomy-icon[data-color] svg rect,
.taxonomy-icon[data-color] svg polygon,
.taxonomy-icon[data-color] svg polyline,
.taxonomy-icon[data-color] svg line,
.taxonomy-icon[data-color] svg ellipse {
	stroke: var(--taxonomy-color) !important;
	fill: transparent !important;
}

/* Nom de la taxonomie */
.taxonomy-name {
	flex: 1;
	min-width: 0;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* Contenu principal */
.adresse-content {
	margin-left: 0;
	transition: margin-left 0.3s ease;
	min-height: 100vh;
}

.page-adresse-main.sidebar-open .adresse-content {
	margin-left: 260px;
}

/* Classes pour le filtrage de la sidebar (compatible avec le système de recherche) */
.sidebar-filtered-out {
	display: none !important;
	opacity: 0 !important;
	visibility: hidden !important;
	width: 0 !important;
	height: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	overflow: hidden !important;
}

.sidebar-filtered-in {
	display: block !important;
	opacity: 1 !important;
	visibility: visible !important;
}

/* Un post doit être visible par les deux systèmes pour être affiché */
.post.mario.sidebar-filtered-out,
.post.mario.searchbar-hidden {
	display: none !important;
}

.post.mario.sidebar-filtered-in.searchbar-show {
	display: block !important;
}

/* La card édition est toujours visible et exclue du filtrage */
.post.edition-card,
.post.always-visible {
	display: block !important;
	visibility: visible !important;
	opacity: 1 !important;
}

/* ================================
   FIL D'ARIANE
   ================================ */
.breadcrumb {
	padding: 0;
	margin: 0;
	font-size: small;
	flex: 0 0 auto;
}

.breadcrumb-list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	list-style: none;
	margin: 0;
	padding: 0;
	gap: 0.5rem;
}

.breadcrumb-list li {
	display: inline-block;
}

.breadcrumb-item {
	display: inline-block;
	align-items: center;
}

.breadcrumb-separator {
	color: rgba(255, 255, 255, 0.5);
	margin: 0 0.25rem;
	user-select: none;
}

.breadcrumb-link {
	color: rgba(255, 255, 255, 0.7);
	text-decoration: none;
	transition: color 0.2s ease;
	cursor: pointer;
}

.breadcrumb-link:hover {
	color: var(--color-fresh);
}

.breadcrumb-text {
	color: rgba(255, 255, 255, 0.9);
}

.breadcrumb-current .breadcrumb-text,
.breadcrumb-current .breadcrumb-link {
	color: var(--color-light);
	font-weight: 500;
}

.breadcrumb-current .breadcrumb-link:hover {
	color: var(--color-fresh);
}

.breadcrumb-dynamic {
	display: inline-block;
}

.breadcrumb-count .breadcrumb-text {
	color: rgba(255, 255, 255, 0.7);
	font-weight: normal;
}

/* Filtres dans le breadcrumb avec croix de fermeture */
.breadcrumb-filter-item {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
}

.breadcrumb-filter-link {
	color: rgba(255, 255, 255, 0.7);
	text-decoration: none;
	transition: color 0.2s ease;
	cursor: pointer;
}

.breadcrumb-filter-link:hover {
	color: var(--color-fresh);
}

.breadcrumb-filter-close {
	background: none;
	border: none;
	color: rgba(255, 255, 255, 0.5);
	cursor: pointer;
	font-size: 1.2em;
	line-height: 1;
	padding: 0;
	margin: 0;
	width: 16px;
	height: 16px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	transition: all 0.2s ease;
}

.breadcrumb-filter-close:hover {
	color: rgba(255, 255, 255, 0.9);
	background-color: rgba(255, 255, 255, 0.1);
}

/* Thème light : breadcrumb discret mais visible */
body.theme-light .breadcrumb-separator {
	color: rgba(0, 0, 0, 0.3);
}

body.theme-light .breadcrumb-link {
	color: rgba(0, 0, 0, 0.5);
}

body.theme-light .breadcrumb-link:hover {
	color: var(--color-fresh);
}

body.theme-light .breadcrumb-text {
	color: rgba(0, 0, 0, 0.6);
}

body.theme-light .breadcrumb-current .breadcrumb-text,
body.theme-light .breadcrumb-current .breadcrumb-link {
	color: rgba(0, 0, 0, 0.7);
	font-weight: 500;
}

body.theme-light .breadcrumb-current .breadcrumb-link:hover {
	color: var(--color-fresh);
}

body.theme-light .breadcrumb-count .breadcrumb-text {
	color: rgba(0, 0, 0, 0.5);
}

body.theme-light .breadcrumb-filter-link {
	color: rgba(0, 0, 0, 0.5);
}

body.theme-light .breadcrumb-filter-link:hover {
	color: var(--color-fresh);
}

body.theme-light .breadcrumb-filter-close {
	color: rgba(0, 0, 0, 0.3);
}

body.theme-light .breadcrumb-filter-close:hover {
	color: rgba(0, 0, 0, 0.6);
	background-color: rgba(0, 0, 0, 0.05);
}

/* Responsive */
@media (max-width: 768px) {
	.adresse-sidebar {
		width: 280px;
	}
	
	.page-adresse-main.sidebar-open .adresse-content {
		margin-left: 0;
	}
}