/* Styles pour le bloc Posts Grid Filtres */
:root {
	--artge-border: rgba(0, 0, 0, 0.12);
	--orange: var(--global-palette-1, #ff6a00);

	/* Off-canvas */
	--off-canvas-width: 420px;
	--off-canvas-bg: #fff;
	--off-canvas-shadow: 20px 0 60px rgba(0, 0, 0, 0.15);
	--off-canvas-transition: transform 0.2s ease;

	/* Typo */
	--font-small-size: 0.875rem;
}

.moissons-archive-toolbar {
	max-width: var(--mxw-large);
	margin: 0 auto;
	padding: 0 var(--global-padding);
}

/* Bouton pour ouvrir l'off-canvas */
.off-canvas-toggle {
	position: relative;
	display: inline-flex;
	background: var(--light);
	padding: 1.75rem 2rem 1.75rem 4.5rem;
	box-shadow: none;
	color: var(--global-palette3);
	gap: 8px;
	font-size: 0.675rem;
	font-weight: 500;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	margin-bottom: 1.5rem;
}

.btn.off-canvas-toggle:active,
.btn.off-canvas-toggle:focus,
.btn.off-canvas-toggle:hover {
	background: var(--light);
	color: #fff;
	text-decoration: none;
	outline: none;
	box-shadow: none;
}

.btn.off-canvas-toggle::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 10px;
	width: 2.375rem;
	height: 2.375rem;
	width: 2.75rem;
	height: 2.75rem;
	transform: translateY(-50%);
	border-radius: 999px;
	background-color: var(--global-palette3);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='19' height='17' viewBox='0 0 19 17'%3E%3Cg transform='translate(-2.181 -1.194)'%3E%3Cline x1='7' transform='translate(13.681 3.694)' fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1'%3E%3C/line%3E%3Cline x1='7' transform='translate(2.681 3.694)' fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1'%3E%3C/line%3E%3Cline x1='9' transform='translate(11.681 9.694)' fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1'%3E%3C/line%3E%3Cline x1='5' transform='translate(2.681 9.694)' fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1'%3E%3C/line%3E%3Cline x1='5' transform='translate(15.681 15.694)' fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1'%3E%3C/line%3E%3Cline x1='9' transform='translate(2.681 15.694)' fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1'%3E%3C/line%3E%3Cline y2='4' transform='translate(13.681 1.694)' fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1'%3E%3C/line%3E%3Cline y2='4' transform='translate(7.681 7.694)' fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1'%3E%3C/line%3E%3Cline y2='4' transform='translate(15.681 13.694)' fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='1'%3E%3C/line%3E%3C/g%3E%3C/svg%3E");
	background-position: .75rem center;
	background-size: 1.25rem;
	background-repeat: no-repeat;
	z-index: -1;
	pointer-events: none;
	transition: all 0.3s ease;
}

.btn.off-canvas-toggle:active::before,
.btn.off-canvas-toggle:focus::before,
.btn.off-canvas-toggle:hover::before {
	width: 100%;
	width: calc(100% - 1.5rem);
	transition: all 0.3s ease;
}

.btn.off-canvas-toggle::before:hover {
	animation: animbtn .55s;
	animation-delay: 0.15s;
	transition: all 0.3s ease;
}

/* Overlay de l'off-canvas */
.off-canvas-overlay {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	z-index: 9998;
	transition: opacity 0.3s ease, visibility 0.3s ease;
	opacity: 0;
	visibility: hidden;
}

.off-canvas-overlay.is-active {
	opacity: 1;
	visibility: visible;
}

/* Container de l'off-canvas */
.off-canvas-container {
	position: fixed;
	top: 0;
	left: 0;
	width: var(--off-canvas-width);
	height: 100vh;
	background: var(--off-canvas-bg);
	box-shadow: var(--off-canvas-shadow);
	z-index: 9999;
	transform: translateX(-100%);
	transition: var(--off-canvas-transition), visibility 0.3s ease, opacity 0.3s ease;
	overflow-y: auto;
	overflow-x: hidden;
	visibility: hidden;
	opacity: 0;
}

.off-canvas-container.is-active {
	transform: translateX(0);
	visibility: visible;
	opacity: 1;
}

/* Styles spécifiques aux checkboxes de filtres */
.filter-checkbox,
.filter-checkbox-child {
	display: flex;
	align-items: center;
	margin-bottom: 12px;
	cursor: pointer;
	font-size: var(--font-small-size);
	line-height: 1.4;
}

.filter-checkbox input[type="checkbox"],
.filter-checkbox-child input[type="checkbox"] {
	position: absolute;
	opacity: 0;
	cursor: pointer;
	height: 0;
	width: 0;
}

/* Style personnalisé pour les checkboxes */
.checkbox-label {
	position: relative;
	padding-left: 35px;
	cursor: pointer;
	flex: 1;
	display: flex;
	align-items: center;
}

.checkbox-label::before {
	content: '';
	position: absolute;
	left: 0;
	top: 50%;
	transform: translateY(-50%);
	width: 16px;
	height: 16px;
	background-color: var(--light);
	border: 2px solid var(--light);
	border-radius: 4px;
	transition: all 0.3s ease;
}

.checkbox-label::after {
	content: '';
	position: absolute;
	left: 6px;
	top: 50%;
	transform: translateY(calc(-50% - 3px)) rotate(45deg);
	width: 6px;
	height: 10px;
	border: solid white;
	border-width: 0 2px 2px 0;
	opacity: 0;
	transition: opacity 0.3s ease;
}

/* État cochée */
.filter-checkbox input[type="checkbox"]:checked + .checkbox-label::before,
.filter-checkbox-child input[type="checkbox"]:checked + .checkbox-label::before {
	background-color: var(--global-palette3);
	border-color: var(--global-palette3);
}

.filter-checkbox input[type="checkbox"]:checked + .checkbox-label::after,
.filter-checkbox-child input[type="checkbox"]:checked + .checkbox-label::after {
	opacity: 1;
}

/* Hover effect */
.filter-checkbox:hover .checkbox-label::before,
.filter-checkbox-child:hover .checkbox-label::before {
	border-color: var(--global-palette3);
}

.filter-checkbox-child::before {
	left: 15px;
	top: -6px;
	width: 1px;
	height: calc(100% + 12px);
}

.off-canvas-section .filter-checkbox-child:last-child::before {
	height: 50%;
}

/* Labels des sections de filtres (remplace search-filter-label) */
.off-canvas-section p {
	font-size: var(--font-small-size);
	font-weight: 600;
	border-top: 1px solid var(--artge-border);
	padding-top: 20px;
	margin: 20px 0 20px;
}

.off-canvas-section:first-of-type p {
	border-top: none;
	padding-top: 0;
	margin-top: 0;
}

/* Header de l'off-canvas */
.off-canvas-header {
	text-align: right;
	padding: 20px;
	position: sticky;
	top: 0;
	z-index: 10;
	background: var(--off-canvas-bg);
}

.off-canvas-title {
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--global-palette3);
	margin: 0;
}

.off-canvas-close {
	background: none;
	border: none;
	padding: 8px;
	cursor: pointer;
	color: var(--global-palette3);
	font-size: 1.5rem;
	line-height: 1;
	transition: color 0.3s ease;
}

.off-canvas-close:hover {
	color: var(--orange);
}

/* Contenu de l'off-canvas */
.off-canvas-content {
	padding: 20px;
}

/* Sections de filtres */
.off-canvas-section {
	margin-bottom: 30px;
}

/* Boutons d'action */
.off-canvas-actions {
	display: flex;
	justify-content: space-between;
	gap: 15px;
	margin-top: 30px;
	padding-top: 20px;
	border-top: 1px solid var(--artge-border);
}

.btn-reset {
	background: transparent;
	color: var(--global-palette3);
	transition: all 0.3s ease;
}

/* Responsive */
@media (max-width: 767px) {
	:root {	
		--off-canvas-width: 90%;
	}

	/*
	.off-canvas-container {
		width: 100%;
	}
	*/

	.off-canvas-header {
		padding: 15px 20px;
	}

	.off-canvas-content {
		padding: 15px 20px;
	}

	.off-canvas-actions {
		flex-direction: column-reverse;
		padding-bottom: 40px;
	}
	.off-canvas-actions .btn {
		margin: 0;
	}

	.btn-reset,
	.btn-search {
		width: 100%;
		text-align: center;
	}
}

/* États de chargement AJAX */
.masonry-grid.is-loading {
	position: relative;
	min-height: 200px;
}

.masonry-grid.is-loading::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 40px;
	height: 40px;
	border: 3px solid #f3f3f3;
	border-top: 3px solid var(--orange);
	border-radius: 50%;
	animation: spin 1s linear infinite;
	z-index: 10;
}

.masonry-grid.is-loading::after {
	content: 'Chargement...';
	position: absolute;
	top: calc(50% + 30px);
	left: 50%;
	transform: translateX(-50%);
	color: #666;
	font-size: 14px;
	z-index: 10;
}

@keyframes spin {
	0% { transform: translate(-50%, -50%) rotate(0deg); }
	100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Transition douce pour les résultats */
.masonry-grid {
	transition: opacity 0.3s ease;
}

.masonry-grid.is-loading {
	opacity: 0.6;
}

