/**
 * CATEGORY GENERATEPRESS OVERRIDES
 * Ce fichier force la pleine largeur sur les pages catégories
 * À charger AVANT category-modern.css
 */

/* --- NEUTRALISATION TOTALE DES CONTENEURS GENERATEPRESS --- */

/* Cibler spécifiquement les pages catégories */
body.category,
body.tax-sector {
    max-width: none !important;
}

/* Désactiver les conteneurs limitants du thème parent */
body.category .site-content,
body.category #primary,
body.category #content,
body.category .inside-article,
body.category .entry-content {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}

/* Forcer la grille à utiliser toute la largeur disponible */
body.category .grid-container {
    max-width: 100% !important;
}

/* Désactiver les marges automatiques qui centrent le contenu */
body.category .container {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Neutraliser la sidebar par défaut de GeneratePress sur les catégories */
body.category.right-sidebar #primary,
body.category.left-sidebar #primary,
body.category.both-sidebars #primary {
    width: 100% !important;
    max-width: 100% !important;
}

/* Cacher la sidebar WordPress par défaut sur les pages catégories modernes */
body.category #secondary {
    display: none !important;
}

/* Forcer l'article à prendre toute la largeur */
body.category article {
    max-width: 100% !important;
}

/* Désactiver les paddings par défaut */
body.category .site-content,
body.category .content-area {
    padding: 0 !important;
}

/* --- FIX POUR LE WRAPPER PRINCIPAL --- */
body.category .site {
    max-width: 100% !important;
}

body.category #page {
    max-width: 100% !important;
}

/* --- FIX POUR LES SECTIONS PLEINE LARGEUR --- */
.category-hero,
.category-controls,
.category-content {
    clear: both;
    display: block;
}

/* --- PROTECTION CONTRE LES MEDIA QUERIES DU THÈME PARENT --- */
@media (min-width: 769px) {
    body.category .site-content,
    body.category #primary,
    body.category #content {
        max-width: 100% !important;
        width: 100% !important;
    }
}

@media (min-width: 1025px) {
    body.category .site-content,
    body.category #primary,
    body.category #content {
        max-width: 100% !important;
        width: 100% !important;
    }
}

/* --- FIX SPÉCIFIQUE POUR LES IMAGES --- */
body.category img {
    max-width: 100%;
    height: auto;
}

/* --- DÉSACTIVER LES TRANSITIONS QUI CAUSENT DES PROBLÈMES --- */
body.category .site-content * {
    transition: none !important;
}

/* Réactiver les transitions seulement pour nos éléments */
.category-page-modern * {
    transition: all 0.3s ease !important;
}

.category-page-modern .article-card-modern,
.category-page-modern .filter-btn,
.category-page-modern .card-image {
    transition: all 0.4s ease !important;
}

/* --- FIX POUR LE FOOTER QUI POURRAIT DÉBORDER --- */
body.category .site-footer {
    clear: both;
}

/* --- ASSURER QUE LE CONTENU NE DÉBORDE PAS --- */
body.category {
    overflow-x: hidden !important;
}

/* --- FIX POUR LES GRILLES QUI SE COMPRESSENT --- */
.articles-grid {
    grid-auto-flow: dense;
}

/* Empêcher le collapse des colonnes sur desktop */
@media (min-width: 1025px) {
    .content-layout {
        display: grid !important;
        grid-template-columns: minmax(0, 1fr) 350px !important;
    }
}

/* --- FIX POUR LA LARGEUR DU VIEWPORT --- */
body.category {
    width: 100vw;
    max-width: 100vw;
    position: relative;
    overflow-x: hidden;
}

html {
    overflow-x: hidden;
}
