/* Styles pour le bloc Posts Grid Filtres */

/* Variables spécifiques à l'off-canvas - centralisées dans assets/css/variables.css */

/* Bouton pour ouvrir l'off-canvas */
.off-canvas-toggle {
    display: inline-flex;
    background: var(--beige);
    padding: 1.75rem 2rem 1.75rem 4.5rem;
    gap: 8px;
    font-size: 0.675rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.btn.off-canvas-toggle:active,
.btn.off-canvas-toggle:focus,
.btn.off-canvas-toggle:hover {
    background: var(--beige);
    text-decoration: none;
    outline: none;
}

.btn.off-canvas-toggle::before {
    left: 10px;
    width: 2.375rem;
    height: 2.375rem;
    width: 2.75rem;
    height: 2.75rem;
    background-color: var(--artge-text);
    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;
    z-index: -1;
}


.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);
}
/*
.btn.off-canvas-toggle::before {
    content: '';
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='3' y1='6' x2='21' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='12' x2='21' y2='12'%3E%3C/line%3E%3Cline x1='3' y1='18' x2='21' y2='18'%3E%3C/line%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}
    */
.btn.off-canvas-toggle::before:hover {
    animation: animbtn .55s;
    animation-delay: 0.15s;
}

/* 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;
}

.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;
}

.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(--beige);
    border: 2px solid  var(--beige);
    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(--artge-text);
    border-color: var(--artge-text);
}

.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(--artge-text);
}


.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;
}

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

.off-canvas-close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--artge-text);
    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(--artge-text);
    transition: all 0.3s ease;
}

/* Message aucun résultat */
.no-results {
    text-align: center;
    padding: 40px 20px;
}

.no-results h3 {
    margin-bottom: 10px;
    color: #666;
}

.no-results p {
    color: #999;
    font-size: 16px;
}

/* Responsive */
@media (max-width: 767px) {
    .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;
    }
}

/* Styles pour l'éditeur Gutenberg */
.wp-block-acf-posts-grid-filters .off-canvas-toggle {
    display: inline-flex !important;
}

/* É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;
}