/* ===========================================
   STYLES POUR UNIFORMISER LES IMAGES À LA UNE
   Thème OceanWP - Images Featured uniformes
   =========================================== */

/* ================================
   RÈGLES CSS POUR IMAGES ARTICLES
   ================================ */

/* 🎯 IMAGES ARTICLES - TAILLE RESPONSIVE ÉQUILIBRÉE */

/* DESKTOP - Images plus grandes pour meilleure visibilité */
@media (min-width: 769px) {
    body .thumbnail img, 
    body .post-thumbnail img, 
    body .has-post-thumbnail img, 
    body .wp-post-image {
        /* max-height: 220px !important; */ /* Supprimé pour autoriser la hauteur complète */
        height: auto !important;
        object-fit: contain !important; /* Modifié pour afficher l'image entière */
        width: 100% !important; /* L'image prend toute la largeur de son conteneur */
    }
    
    body article img, 
    body .blog-entry img, 
    body .entry-content img {
        /* max-height: 220px !important; */ /* Supprimé */
        height: auto !important;
        object-fit: contain !important; /* Modifié */
        max-width: 270px !important;
    }
    
    body .thumbnail, 
    body .post-thumbnail {
        width: 22% !important;
        max-width: 270px !important;
    }
}

/* MOBILE - Images plus compactes */
@media (max-width: 768px) {
    body .thumbnail img, 
    body .post-thumbnail img, 
    body .has-post-thumbnail img, 
    body .wp-post-image,
    body article img, 
    body .blog-entry img, 
    body .entry-content img {
        /* max-height: 150px !important; */ /* Supprimé */
        /* max-width: 200px !important; */ /* Supprimé */
        height: auto !important;
        object-fit: contain !important; /* Modifié */
        width: 100% !important;
    }
    
    body .thumbnail, 
    body .post-thumbnail {
        width: 18.75% !important;
        max-width: 200px !important;
    }
}

/* ================================
   FIN RÈGLES IMAGES ARTICLES
   ================================ */

/* 🚫 MASQUER L'IMAGE D'EN-TÊTE SPÉCIFIQUE PAR NOM - SEULEMENT AU SCROLL */
#site-header.scrolled img[src*="solidaires-finances-entete-2.png"] {
    display: none !important;
    visibility: hidden !important;
}

/* 🚫 MASQUER LA RECHERCHE DESKTOP SUR MOBILE - VERSION PROPRE */
@media screen and (max-width: 1024px) {
    
    /* MASQUER SEULEMENT LA RECHERCHE DU MENU PRINCIPAL DESKTOP */
    #site-navigation .search-toggle-li,
    #site-navigation .search-toggle,
    #site-navigation .search-icon,
    #site-navigation .search-form,
    #site-navigation .header-search-form,
    #searchform-dropdown {
        display: none !important;
        visibility: hidden !important;
    }
    
    /* MASQUER LA LOUPE À CÔTÉ DU HAMBURGER EN MODE MOBILE */
    .oceanwp-mobile-menu-icon .search-icon-overlay {
        display: none !important;
        visibility: hidden !important;
    }
    
    /* MASQUER AUSSI L'OVERLAY DE RECHERCHE MOBILE */
    #icon-searchform-overlay,
    #mobile-header-search {
        display: none !important;
        visibility: hidden !important;
    }
    
    /* GARDER SEULEMENT LA RECHERCHE DANS LE MENU MOBILE (SIDR) */
    .sidr #mobile-menu-search,
    .sidr .mobile-searchform,
    #mobile-menu-search {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* 🏷️ IMAGES GÉNÉRALES - TEXT WRAPPING AUTOUR DE L'IMAGE */
.thumbnail,
.post-thumbnail {
    width: 18.75% !important; /* Réduit à 75% (25% → 18.75%) */
    float: right !important;
    margin: 5px 0 15px 20px !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 8px !important;
    /* overflow: hidden !important; */ /* Supprimé pour ne pas tronquer l'image */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    transition: all 0.3s ease !important;
    shape-outside: margin-box !important; /* Permet au texte de s'enrouler */
    clear: none !important;
}

.thumbnail img,
.post-thumbnail img,
.has-post-thumbnail img,
.wp-post-image {
    width: 100% !important;
    height: auto !important; /* Hauteur automatique pour garder les proportions */
    object-fit: contain !important; /* Assure que l'image est complète */
    object-position: center !important;
    display: block !important;
    transition: transform 0.3s ease !important;
}

/* 📰 PAGES BLOG ET ARCHIVES - TEXT WRAPPING */
.blog .thumbnail,
.archive .thumbnail,
.category .thumbnail,
.tag .thumbnail,
.blog .post-thumbnail,
.archive .post-thumbnail,
.category .post-thumbnail,
.tag .post-thumbnail {
    width: 18.75% !important; /* Réduit à 75% (25% → 18.75%) */
    float: right !important;
    margin: 5px 0 10px 15px !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
    shape-outside: margin-box !important;
    clear: none !important;
}

.blog .thumbnail img,
.archive .thumbnail img,
.category .thumbnail img,
.tag .thumbnail img {
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important; /* Changé de cover à contain */
}

/* ===================================================
   CORRECTIF IMAGE ARTICLE INDIVIDUEL - v3.0.21 - Image au-dessus du texte
   =================================================== */

/* On positionne l'image au-dessus du contenu de l'article */
.single-post .thumbnail {
    float: none !important; /* On annule complètement le float */
    display: block !important;
    width: 100% !important;
    max-width: 720px !important; /* Une largeur maximale pour la lisibilité */
    margin: 0 auto 30px auto !important; /* Centre l'image horizontalement et ajoute de l'espace en dessous */
    border: 1px solid #e9e9e9 !important;
    border-radius: 8px !important;
    padding: 6px !important;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1) !important;
    box-sizing: border-box !important;
    /* overflow: hidden; a été retiré pour ne pas tronquer */
}

.single-post .thumbnail img {
    width: 100% !important;
    height: auto !important; /* La hauteur s'adapte pour garder les proportions */
    object-fit: contain !important; /* Assure que l'image est complète */
    display: block !important;
    border-radius: 4px !important;
}

/* On s'assure que le conteneur de l'article se comporte normalement et on supprime le clearfix */
.single-post #content > article::after {
    content: "";
    display: none;
    clear: none;
}

/* On annule les anciennes règles pour éviter les conflits */
.single-post #content > article > .entry-content,
.single-post #content > article > .thumbnail {
    width: auto !important;
    order: 0 !important;
}

/* 🎴 GRILLE D'ARTICLES */
.blog-entry-inner .thumbnail,
.blog-entry-inner .post-thumbnail {
    overflow: hidden !important;
    border-radius: 8px !important;
}

.blog-entry-inner .thumbnail img,
.blog-entry-inner .post-thumbnail img,
.uagb-post__inner-wrap .uagb-post__image img {
    width: 100% !important;
    height: auto !important; /* Hauteur automatique pour respecter les proportions */
    object-fit: contain !important; /* Assure que l'image est entièrement visible */
    transition: transform 0.3s ease !important;
}

.blog-entry-inner:hover .thumbnail img,
.blog-entry-inner:hover .post-thumbnail img {
    transform: scale(1.05) !important;
}

/* 🔲 WIDGETS SIDEBAR */
.widget .thumbnail img,
.widget .post-thumbnail img,
.widget img {
    width: 100% !important;
    height: 100px !important;
    object-fit: cover !important;
    border-radius: 6px !important;
}

/* 📱 RESPONSIVE DESIGN - ALIGNEMENT ADAPTATIF */

/* 🖥️ HEADER STICKY POUR GRANDS ÉCRANS DESKTOP UNIQUEMENT */
@media (min-width: 1025px) {
    /* 🎯 HEADER NORMAL AU DÉPART - PERMET L'AFFICHAGE DE L'IMAGE */
    #site-header {
        position: relative !important;
        width: 100% !important;
        z-index: 9999 !important;
        transition: all 0.4s ease !important;
        box-shadow: 0 0 0 rgba(0, 0, 0, 0) !important;
    }
    
    /* 🎯 HEADER FIXE ET COMPACT AU SCROLL */
    #site-header.scrolled {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        background-image: none !important;
        min-height: auto !important;
        height: auto !important;
        max-height: 60px !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15) !important;
    }
    
    #site-header.scrolled #site-header-inner {
        padding-top: 8px !important;
        padding-bottom: 8px !important;
        min-height: auto !important;
        height: auto !important;
    }
    
    /* 🎯 LOGO ET MENU RÉDUITS AU SCROLL */
    #site-header.scrolled .site-branding img,
    #site-header.scrolled #site-logo img {
        max-height: 40px !important;
        width: auto !important;
        transition: all 0.3s ease !important;
    }
    
    /* 🎯 MENU PRINCIPAL RÉDUIT - SIMPLIFIÉ ET ALIGNÉ À DROITE */
    #site-header.scrolled #site-navigation-wrap,
    #site-header.scrolled .navigation {
        height: 44px !important;
        line-height: 44px !important;
        display: flex !important;
        align-items: center !important;
        margin-left: auto !important;
        flex: 0 0 auto !important;
    }
    
    /* 🎯 ÉLÉMENTS DE MENU INDIVIDUELS - EN LIGNE */
    #site-header.scrolled .main-menu,
    #site-header.scrolled .dropdown-menu,
    #site-header.scrolled .sf-menu {
        height: 44px !important;
        line-height: 44px !important;
        margin: 0 !important;
        padding: 0 !important;
        display: flex !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
    }
    
    #site-header.scrolled .main-menu > li,
    #site-header.scrolled .dropdown-menu > li,
    #site-header.scrolled .sf-menu > li {
        height: 44px !important;
        line-height: 44px !important;
        margin: 0 5px !important;
        padding: 0 !important;
        display: inline-flex !important;
        align-items: center !important;
        white-space: nowrap !important;
        flex: 0 0 auto !important;
    }
    
    #site-header.scrolled .main-menu > li > a,
    #site-header.scrolled .dropdown-menu > li > a,
    #site-header.scrolled .sf-menu > li > a {
        height: 44px !important;
        line-height: 44px !important;
        padding: 0 10px !important;
        font-size: 14px !important;
        display: flex !important;
        align-items: center !important;
        white-space: nowrap !important;
    }
    
    /* 🎯 FORCER LA HAUTEUR PRÉCISE DES CONTENEURS - SIMPLIFIÉ */
    #site-header.scrolled {
        height: 60px !important;
        overflow: visible !important;
        display: flex !important;
        align-items: center !important;
    }
    
    #site-header.scrolled #site-header-inner {
        height: 60px !important;
        display: flex !important;
        align-items: center !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
    }
    
    /* 📱 COMPENSATION DE L'ESPACE POUR LE HEADER FIXE DESKTOP */
    body {
        padding-top: 0 !important; /* Pas de padding fixe, header normal au départ */
    }
    
    /* 🎯 AJUSTEMENT DYNAMIQUE DU CONTENU SELON L'ÉTAT DU HEADER */
    body.scrolled {
        padding-top: 60px !important; /* Seulement quand le header devient fixe */
    }
    
    /* 🎯 RÉDUCTION SUPPLÉMENTAIRE POUR ÉLÉMENTS OCEANWP - SEULEMENT AU SCROLL */
    #site-header.scrolled .header-media,
    #site-header.scrolled .page-header-media,
    #site-header.scrolled .oceanwp-page-header,
    #site-header.scrolled .custom-header-media {
        display: none !important;
        height: 0 !important;
    }
    
    /* 🎯 CORRECTIONS SPÉCIFIQUES CONTENEUR - AMÉLIORÉ */
    #site-header.scrolled .container,
    #site-header.scrolled .clr {
        height: 60px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        margin: 0 auto !important;
        padding: 0 20px !important;
        width: 100% !important;
        max-width: 1200px !important;
        box-sizing: border-box !important;
    }
    
    /* 🎯 LOGO À GAUCHE - FLEXIBLE */
    #site-header.scrolled .site-branding,
    #site-header.scrolled #site-logo {
        flex: 0 0 auto !important;
        margin-right: 20px !important;
        max-width: 300px !important;
    }
    
    /* 🎯 MENU À DROITE - AVEC LIMITE */
    #site-header.scrolled #site-navigation-wrap {
        flex: 1 1 auto !important;
        display: flex !important;
        justify-content: flex-end !important;
        max-width: 70% !important;
        overflow: visible !important;
        white-space: nowrap !important;
    }
    
    #site-header.scrolled .main-menu,
    #site-header.scrolled .dropdown-menu,
    #site-header.scrolled .sf-menu {
        display: flex !important;
        flex-wrap: nowrap !important;
        margin: 0 !important;
        padding: 0 !important;
        white-space: nowrap !important;
        justify-content: flex-end !important;
        width: 100% !important;
    }
    
    #site-header.scrolled .main-menu > li,
    #site-header.scrolled .dropdown-menu > li,
    #site-header.scrolled .sf-menu > li {
        display: inline-flex !important;
        flex: 0 0 auto !important;
        white-space: nowrap !important;
        margin: 0 2px !important;
    }
    
    #site-header.scrolled .main-menu > li > a,
    #site-header.scrolled .dropdown-menu > li > a,
    #site-header.scrolled .sf-menu > li > a {
        padding: 0 10px !important;
        font-size: 13px !important;
        display: flex !important;
        align-items: center !important;
        white-space: nowrap !important;
        min-width: auto !important;
        max-width: none !important;
        overflow: visible !important;
    }
    
    /* 🚫 MASQUER LE MENU MOBILE SUR DESKTOP */
    #site-header.scrolled .oceanwp-mobile-menu-icon,
    #site-header.scrolled .mobile-menu,
    #site-header.scrolled .sidr,
    #site-header.scrolled .hamburger-menu {
        display: none !important;
    }
    
    /* 🎯 BOUTONS ET ÉLÉMENTS SUPPLÉMENTAIRES */
    #site-header.scrolled .oceanwp-cart-info,
    #site-header.scrolled .search-toggle-li,
    #site-header.scrolled .search-style,
    #site-header.scrolled .oceanwp-social-menu {
        height: 44px !important;
        line-height: 44px !important;
        display: flex !important;
        align-items: center !important;
    }
}

@media (max-width: 1024px) {
    .thumbnail,
    .post-thumbnail {
        width: 30% !important;
        margin: 0 0 15px 15px !important;
    }
    
    /* 🚫 MASQUER L'IMAGE D'EN-TÊTE + HEADER STICKY POUR TOUS LES MOBILES/TABLETTES */
    #site-header {
        background-image: none !important;
        min-height: auto !important;
        height: auto !important;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        z-index: 9999 !important;
        box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1) !important;
        transition: all 0.3s ease !important;
    }
    
    #site-header-inner {
        padding-top: 10px !important;
        padding-bottom: 10px !important;
    }
    
    /* 📱 COMPENSATION DE L'ESPACE POUR LE HEADER FIXE */
    body {
        padding-top: 70px !important;
    }
    
    /* 🚫 FORCER LE MENU MOBILE ET MASQUER LE MENU DESKTOP */
    #site-navigation-wrap,
    .main-menu,
    .dropdown-menu,
    .sf-menu {
        display: none !important;
    }
    
    /* 📱 AFFICHER SEULEMENT LE MENU MOBILE */
    .oceanwp-mobile-menu-icon,
    .mobile-menu,
    .mobile-menu-toggle {
        display: block !important;
    }
    
    /* 🚫 MASQUER SEULEMENT LES IMAGES D'EN-TÊTE, PAS LES TITRES */
    .page-header-media,
    .page-header-overlay,
    .oceanwp-page-header-media,
    .page-header .page-header-media,
    .single-post-media,
    .page-header-title .page-header-media {
        display: none !important;
    }
    
    /* ✅ FORCER L'AFFICHAGE DES TITRES DE PAGE - TOUS MOBILES/TABLETTES - COULEURS THÈME PRÉSERVÉES */
    .page-header-title,
    .page-header-title h1,
    .page-header h1,
    .entry-title,
    .page-title,
    .ocean-page-header .page-header-title,
    .oceanwp-page-header .page-header-title,
    .entry-header .entry-title,
    .blog-entry-title,
    h1.page-title,
    h1.entry-title,
    .page-header .page-header-title,
    .page-header-inner .page-header-title,
    #main .page-header .page-header-title {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: #de0a79 !important; /* Couleur d'origine du thème */
        font-size: 24px !important;
        line-height: 1.4 !important;
        margin: 5px 0 !important; /* Marge réduite */
        padding: 3px 0 !important; /* Padding réduit */
        font-weight: 600 !important;
        text-decoration: none !important;
    }
    
    /* 🚫 S'ASSURER QUE RIEN NE MASQUE LES TITRES - RÈGLES RENFORCÉES */
    .page-header-title *,
    .entry-header *,
    .page-header *,
    .page-header-inner * {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: inherit !important;
    }
    
    /* ✅ FORCER LA VISIBILITÉ DU CONTENEUR PAGE HEADER - COULEUR FOND CORRIGÉE */
    .page-header,
    .page-header-inner,
    #main .page-header {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: auto !important;
        min-height: auto !important;
        background-color: #333941 !important; /* Couleur d'origine du thème pour le fond */
        padding: 5px 0 !important; /* Padding réduit comme desktop */
    }
}

/* 📱 AJUSTEMENTS SPÉCIFIQUES MOBILES PORTRAIT ET PAYSAGE */
@media (max-width: 768px) {
    .thumbnail,
    .post-thumbnail {
        width: 100% !important;
        float: none !important;
        margin: 0 auto 15px auto !important;
    }
    
    .widget .thumbnail,
    .widget .post-thumbnail {
        width: 80% !important;
        margin: 0 auto 10px auto !important;
    }
    
    /* � AJUSTEMENT HEADER MOBILE SPÉCIFIQUE */
    #site-header-inner {
        padding-top: 8px !important;
        padding-bottom: 8px !important;
    }
    
    /* 📱 COMPENSATION AJUSTÉE POUR MOBILE */
    body {
        padding-top: 65px !important;
    }
}

/* 📱 MOBILES TRÈS PETITS ÉCRANS - RÈGLES ADDITIONNELLES */
@media (max-width: 480px) {
    /* 📱 COMPENSATION SPÉCIFIQUE PETITS ÉCRANS */
    body {
        padding-top: 60px !important;
    }
    
    /* ✅ FORCER ENCORE PLUS LES TITRES SUR PETITS ÉCRANS - COULEURS THÈME PRÉSERVÉES */
    .page-header-title,
    .page-header-title h1,
    .page-header h1,
    .entry-title,
    .page-title,
    .page-header .page-header-title,
    .page-header-inner .page-header-title,
    #main .page-header .page-header-title {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        color: #de0a79 !important; /* Couleur d'origine du thème */
        font-size: 20px !important;
        line-height: 1.3 !important;
        margin: 10px 0 !important;
        padding: 10px 0 !important;
        font-weight: 600 !important;
        text-decoration: none !important;
        text-align: center !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* ✅ FORCER LA VISIBILITÉ DU CONTENEUR SUR PETITS ÉCRANS - COULEUR FOND CORRIGÉE */
    .page-header,
    .page-header-inner,
    #main .page-header,
    .container .page-header-inner {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: auto !important;
        min-height: auto !important;
        padding: 8px 0 !important; /* Padding réduit pour petits écrans */
        background-color: #333941 !important; /* Couleur d'origine du thème pour le fond */
    }
}

/* 🎯 CORRECTIONS SPÉCIFIQUES OCEANWP */
.oceanwp-row .thumbnail img,
.oceanwp-row .post-thumbnail img {
    width: 100% !important;
    height: auto !important;
    max-height: 250px !important;
    object-fit: cover !important;
}

/* 🔧 CORRECTIONS SPÉCIFIQUES POUR SURMONTER LES STYLES DU THÈME */
@media (max-width: 1024px) {
    /* ✅ SURMONTER LES STYLES OCEANWP POUR LES TITRES - COULEURS THÈME PRÉSERVÉES */
    .page-header .page-header-title.clr[itemprop="headline"],
    .page-header-inner .page-header-title.clr,
    h1.page-header-title,
    h2.page-header-title,
    h3.page-header-title {
        color: #de0a79 !important; /* Couleur d'origine du thème */
        font-size: 24px !important;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        margin: 8px auto !important; /* Marge réduite */
        padding: 5px 15px !important; /* Padding réduit */
        text-align: center !important;
        line-height: 1.4 !important;
        font-weight: 600 !important;
        text-decoration: none !important;
        background: transparent !important; /* Fond transparent pour voir le fond du thème */
        border-radius: 0 !important;
        box-shadow: none !important;
        width: auto !important;
        max-width: 90% !important;
    }
    
    /* ✅ SURMONTER LES STYLES POUR LE CONTENEUR PAGE HEADER - COULEUR FOND CORRIGÉE */
    .page-header.hide-tablet-mobile,
    .page-header,
    .page-header-inner {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        height: auto !important;
        min-height: auto !important;
        padding: 5px 0 !important; /* Padding réduit comme desktop */
        background-color: #333941 !important; /* Couleur d'origine du thème pour le fond */
    }
}

@media (max-width: 480px) {
    /* ✅ STYLES SPÉCIFIQUES PETITS ÉCRANS - COULEURS THÈME PRÉSERVÉES */
    .page-header .page-header-title.clr[itemprop="headline"],
    .page-header-inner .page-header-title.clr,
    h1.page-header-title,
    h2.page-header-title,
    h3.page-header-title {
        color: #de0a79 !important; /* Couleur d'origine du thème */
        font-size: 18px !important;
        margin: 10px auto !important;
        padding: 8px 12px !important;
        max-width: 95% !important;
        background: transparent !important; /* Fond transparent pour voir le fond du thème */
        border-radius: 0 !important;
        box-shadow: none !important;
    }
}

/* 📑 PAGES ET EXTRAITS */
.page .thumbnail img,
.excerpt .thumbnail img {
    width: 100% !important;
    height: 200px !important;
    object-fit: cover !important;
}

/* 🔄 ANIMATIONS - HOVER EFFECTS */
.thumbnail:hover,
.post-thumbnail:hover {
    transform: scale(1.02) !important;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15) !important;
    border-color: #ccc !important;
}

.thumbnail img:hover,
.post-thumbnail img:hover {
    transform: scale(1.05) !important;
}

/* 🧹 CLEARFIX POUR LE TEXTE - ADAPTÉ AU TEXT WRAPPING */
.blog-entry-content::after,
.entry-content::after,
.post-content::after {
    content: "" !important;
    display: table !important;
    clear: both !important;
}

/* 🎯 OPTIMISATIONS SUPPLÉMENTAIRES POUR LE TEXT WRAPPING */
.entry-header {
    margin-bottom: 15px !important;
    clear: none !important; /* Permet au titre de coexister avec l'image */
}

.entry-title,
.blog-entry-title {
    clear: none !important;
    margin-bottom: 10px !important;
}

/* 📱 AJUSTEMENTS POUR UN MEILLEUR TEXT FLOW */
.entry-content img,
.post-content img {
    margin: 10px 0 !important;
}

/* 🎨 STYLE POUR LES LIENS DANS LE TEXTE QUI ENTOURE L'IMAGE */
.entry-content a,
.post-content a {
    word-break: break-word !important;
}

/* 🏠 PAGE D'ACCUEIL SPÉCIFIQUE - TEXT WRAPPING */
.home .blog-entry .thumbnail,
.home .blog-entry .post-thumbnail {
    width: 18.75% !important; /* Réduit à 75% (25% → 18.75%) */
    float: right !important;
    margin: 5px 0 10px 15px !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    shape-outside: margin-box !important;
    clear: none !important;
}

.home .blog-entry .thumbnail img {
    width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
}

/* 📝 AMÉLIORATION DE LA LECTURE */
.home .blog-entry .entry-content,
.home .blog-entry .blog-entry-content {
    text-align: justify !important;
    line-height: 1.7 !important;
}

/* 🎨 STYLE CARDS */
.blog-entry {
    overflow: visible !important; /* Important pour le text wrapping */
    border-radius: 10px !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
    transition: box-shadow 0.3s ease !important;
    padding: 15px !important; /* Ajoute de l'espace intérieur */
}

.blog-entry:hover {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;
}

/* 💡 CORRECTION POUR GUTENBERG */
.wp-block-image img {
    height: auto !important;
    object-fit: initial !important;
}

/* 🔧 FORCER L'ASPECT RATIO 16:9 AVEC ALIGNEMENT DROITE */
.force-aspect-ratio {
    position: relative !important;
    width: 18.75% !important; /* Réduit à 75% (25% → 18.75%) */
    float: right !important;
    margin: 0 0 20px 20px !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    padding-bottom: 10.55% !important; /* 18.75% * 56.25% (16:9) */
}

.force-aspect-ratio img {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

/* 📋 STYLES SUPPLÉMENTAIRES POUR TEXT WRAPPING */
.blog-entry-inner,
.entry-content,
.post-content,
.blog-entry-content {
    overflow: visible !important; /* Permet au texte de s'enrouler */
    text-align: justify !important; /* Justifie le texte pour un meilleur rendu */
    line-height: 1.6 !important; /* Améliore la lisibilité */
}

/* 🎯 OPTIMISATION DU TEXT WRAPPING */
.entry-content p,
.post-content p,
.blog-entry-content p {
    text-indent: 0 !important;
    margin-bottom: 1em !important;
    hyphens: auto !important; /* Césure automatique */
    word-wrap: break-word !important;
}

/* 🔤 ESPACEMENT ENTRE LIGNES PRÈS DE L'IMAGE */
.entry-content p:first-of-type,
.post-content p:first-of-type {
    margin-top: 0 !important;
}

/* 🎯 CORRECTIONS POUR EVITER LES CONFLITS */
.thumbnail img[style],
.post-thumbnail img[style] {
    width: 100% !important;
    height: auto !important;
}

/* 🎨 STYLE SPÉCIAL POUR LES EXTRAITS - TEXT WRAPPING */
.excerpt .thumbnail,
.excerpt .post-thumbnail {
    width: 18.75% !important; /* Réduit à 75% (25% → 18.75%) */
    float: right !important;
    margin: 5px 0 10px 15px !important;
    border: 1px solid #ddd !important;
    shape-outside: margin-box !important;
    clear: none !important;
}

/* 🔄 GESTION DES PARAGRAPHES DANS LES CARDS */
.blog-entry .entry-content,
.blog-entry .blog-entry-content {
    overflow: visible !important;
    text-align: justify !important;
}

.blog-entry .entry-content p:first-child {
    margin-top: 0 !important;
}

/* 🚀 SCRIPT JAVASCRIPT POUR L'EFFET SCROLL HEADER */
/*
Ajoute ce JavaScript dans ton thème (functions.php ou via plugin) :

<script>
document.addEventListener('DOMContentLoaded', function() {
    // Effet sticky header avec réduction au scroll (desktop uniquement)
    if (window.innerWidth > 768) {
        const header = document.getElementById('site-header');
        const body = document.body;
        let scrolled = false;
        
        window.addEventListener('scroll', function() {
            const shouldBeScrolled = window.scrollY > 100;
            
            if (shouldBeScrolled && !scrolled) {
                header.classList.add('scrolled');
                body.classList.add('scrolled');
                scrolled = true;
            } else if (!shouldBeScrolled && scrolled) {
                header.classList.remove('scrolled');
                body.classList.remove('scrolled');
                scrolled = false;
            }
        });
    }
});
</script>
*/



/* ===========================================
   CORRECTIF MOBILE MENU SEARCH - v3.0.1
   =========================================== */

/* 🚫 MASQUER LE SEARCH PARASITAIRE EN BAS DE PAGE MOBILE */
@media screen and (max-width: 1024px) {
    #mobile-menu-search:not(.sidr #mobile-menu-search) {
        display: none !important;
        visibility: hidden !important;
    }
    
    /* S'ASSURER QUE SEULE LA RECHERCHE SIDR RESTE VISIBLE */
    .sidr #mobile-menu-search {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
}

/* ===================================================
   CORRECTIF #4 - ANNULATION FLOAT SUR RECHERCHE
   =================================================== */
.search-results .thumbnail,
.search-results .post-thumbnail {
    float: none !important;
    margin: 0 !important;
    width: auto !important;
    shape-outside: none !important;
}

/* ===========================================
   FORÇAGE TAILLE IMAGES - SPÉCIFICITÉ MAXIMALE
   =========================================== */

/* 🔧 FORÇAGE BRUTAL DE LA TAILLE DES IMAGES */
html body .thumbnail,
html body .post-thumbnail,
html body .has-post-thumbnail {
    width: 18.75% !important;
    max-width: 200px !important;
    float: right !important;
    margin: 5px 0 15px 20px !important;
    border: 2px solid #e0e0e0 !important;
    border-radius: 8px !important;
    overflow: hidden !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1) !important;
}

/* ===================================================
   CORRECTIF AFFICHAGE RÉSULTATS DE RECHERCHE - v3.0.8
   =================================================== */

/* 🎯 Approche agressive : Forcer tous les conteneurs parents potentiels à un layout de type "bloc" */
.search-results #main,
.search-results #primary,
.search-results #content,
.search-results .content-area,
.search-results #blog-entries {
    display: block !important;
    width: 100% !important;
}

/* 🎯 Cible les articles sur la page de résultats de recherche */
.search-results article.entry {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    margin-bottom: 2em !important;
    border-bottom: 1px solid #eee;
    padding-bottom: 2em !important;
    width: 100% !important; /* Force l'article à prendre toute la largeur */
    max-width: 100% !important; /* Empêche le rétrécissement */
    box-sizing: border-box !important;
    background-color: transparent !important;
    border: none !important;
    float: none !important; /* Annulation de tout flottant résiduel */
}

/* 🎯 Image à la une (thumbnail) */
.search-results article.entry .thumbnail {
    float: none !important;
    shape-outside: none !important;
    margin: 0 20px 0 0 !important;
    width: 150px !important;
    max-width: 150px !important;
    flex-shrink: 0 !important;
}

.search-results article.entry .thumbnail a,
.search-results article.entry .thumbnail img {
    display: block !important;
    width: 150px !important;
    height: 150px !important;
    object-fit: cover !important;
    border-radius: 5px !important;
}

/* 🎯 Contenu textuel (titre, résumé) */
.search-results article.entry .search-entry-content {
    flex-grow: 1 !important;
    text-align: left !important;
    width: auto !important; /* Permet au contenu de prendre l'espace restant */
}

.search-results article.entry .search-entry-title a {
    font-size: 1.2em;
    color: #333;
}

.search-results article.entry .search-entry-summary {
    margin-top: 10px;
}

/* 📱 Pour les écrans plus petits, passer à une disposition en colonne */
@media (max-width: 600px) {
    .search-results article.entry {
        flex-direction: column !important;
        align-items: center !important;
    }

    .search-results article.entry .thumbnail {
        margin-right: 0 !important;
        margin-bottom: 15px !important;
        width: 100% !important;
        max-width: 300px !important;
    }

    .search-results article.entry .thumbnail a,
    .search-results article.entry .thumbnail img {
        width: 100% !important;
        height: auto !important;
        max-height: 200px !important;
    }

    .search-results article.entry .search-entry-content {
        text-align: center !important;
    }
}

/* ===================================================
   LISIBILITÉ ARTICLE - FOND BLANC & POLICE
   =================================================== */
.single-post .entry-content {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.single-post .entry-content p {
    font-size: 17px;
    line-height: 1.7;
}

.single-post .single-post-title {
    text-align: left !important;
}

/* ===================================================
   STYLE PAGE 404 - v3.0.22
   =================================================== */

/* Conteneur principal de la page 404 */
.error404 #primary {
    padding: 40px 20px;
    text-align: center;
    background-color: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    margin: 40px auto;
    max-width: 800px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Titre "Oops! Page Introuvable" - Aligné sur les titres de page */
.error404 .error404-title {
    font-size: 2.5em; /* Taille de police augmentée */
    font-family: inherit; /* Hérite de la police */
    font-weight: 700;
    color: #ff007f; /* Couleur rose du thème */
    margin-bottom: 20px;
}

/* Paragraphe de description */
.error404 .error404-text {
    font-size: 1.2em;
    color: #666;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* Formulaire de recherche amélioré */
.error404 .search-form {
    margin-bottom: 30px;
    max-width: 600px; /* Largeur augmentée */
    margin-left: auto;
    margin-right: auto;
    position: relative;
    border: 2px solid #ff007f; /* Bordure rose */
    border-radius: 35px; /* Coins plus arrondis */
    padding: 5px; /* Espace intérieur */
    background-color: #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.error404 .search-form input[type="search"] {
    width: 100%;
    padding: 15px 25px;
    border: none; /* Suppression de la bordure intérieure */
    border-radius: 30px;
    font-size: 1.1em; /* Police légèrement plus grande */
    color: #333;
    background-color: transparent;
}

.error404 .search-form input[type="search"]:focus {
    outline: none;
}

.error404 .search-form input[type="submit"] {
    position: absolute;
    top: 50%;
    right: 8px; /* Ajustement de la position */
    transform: translateY(-50%);
    background-color: #ff007f;
    color: #fff;
    border: none;
    border-radius: 25px; /* Coins arrondis */
    padding: 12px 25px; /* Bouton plus grand */
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease;
    text-transform: uppercase;
}

.error404 .search-form input[type="submit"]:hover {
    background-color: #e60072;
}

/* Bouton de retour à l'accueil - Style unifié */
.error404 .error404-button {
    display: inline-block;
    padding: 12px 28px;
    background-color: #ff007f;
    color: #fff !important;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    border: 2px solid transparent;
    border-radius: 25px;
    transition: all 0.3s ease;
}

.error404 .error404-button:hover {
    background-color: #fff;
    color: #ff007f !important;
    border-color: #ff007f;
    transform: translateY(-2px);
}

/* ===================================================
   CORRECTIF ICÔNE RECHERCHE HEADER - v3.0.23
   =================================================== */

/* Force l'affichage de l'icône de loupe (Font Awesome) */
#site-navigation .search-toggle-li a.search-link::before {
    content: "\f002" !important; /* Code unicode pour la loupe dans Font Awesome */
    font-family: "Font Awesome 5 Free" !important;
    font-weight: 900 !important;
    font-style: normal !important;
    display: inline-block !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Cache le texte "Search" qui pourrait apparaître */
#site-navigation .search-toggle-li a.search-link span.screen-reader-text {
    display: none !important;
}

/* Ajuste la position du sélecteur de langue pour ne pas chevaucher */
#site-navigation .pll-parent-menu-item {
    margin-left: 15px; /* Ajoute un peu d'espace à gauche */
}



/* ==========================================================
   PAGE 404 - MASQUER L'ICÔNE RECHERCHE DU MENU HEADER
   ========================================================== */
body.error404 #site-navigation .search-toggle-li {
    display: none !important;
}

/* ==========================================================
   CORRECTIF CENTRAGE IMAGES GALERIE UAGB - PAGE D'ACCUEIL
   ========================================================== */
.wp-block-uagb-image-gallery .spectra-image-gallery__media-thumbnail {
    margin-left: auto !important;
    margin-right: auto !important;
    display: block !important;
}

/* ==========================================================
   ÉLÉMENTS D'IMPRESSION - MASQUÉS SUR L'ÉCRAN
   ========================================================== */
#page-header-print, #page-footer-print {
    display: none !important;
    visibility: hidden !important;
}

/* Impression: gérée via print.css uniquement */

/* ==========================================================
    BOUTONS D'ACTION (IMPRIMER, VIGNETTE)
    ========================================================== */
.print-button-container {
    margin-bottom: 20px;
    text-align: right;
}

#print-post-button,
#generer-vignette-bouton {
    background-color: #DE0A79 !important;
    color: #ffffff !important;
    border: 2px solid #DE0A79 !important;
    border-radius: 50px !important; /* Rend les boutons ovales */
    padding: 10px 25px !important;
    text-decoration: none !important;
    cursor: pointer;
    transition: background-color 0.3s ease, color 0.3s ease !important;
    font-family: inherit;
    font-size: 14px;
    font-weight: bold;
}

#print-post-button:hover,
#generer-vignette-bouton:hover {
    background-color: #ffffff !important;
    color: #DE0A79 !important;
    border-color: #DE0A79 !important;
    text-decoration: none !important;
}

#generer-vignette-bouton:disabled {
    background-color: #cccccc !important;
    border-color: #cccccc !important;
    color: #666666 !important;
    cursor: not-allowed;
}

/* Masquer la barre latérale sur les pages de catégories */
@media (min-width: 769px) {
    .category #right-sidebar {
        display: none;
    }

    .category #primary {
        width: 100%;
    }
}

/* ==========================================================
   GÉNÉRATEUR DE VIGNETTE D'ARTICLE - FORMAT PORTRAIT
   ========================================================== */
#vignette-generateur-scene {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1080px;
    height: 1350px;
    background-color: #ffffff;
    background-size: cover;
    background-position: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-start; /* Aligner en haut */
    align-items: center;
    padding: 90px;
    box-sizing: border-box;
    font-family: 'Montserrat', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

.vignette-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 80px; /* Espace sous l'en-tête */
}

#vignette-generateur-scene .vignette-logo {
    max-width: 300px; /* Taille ajustée */
    height: auto;
}

#vignette-generateur-scene .vignette-date {
    font-family: "Roboto", sans-serif;
    font-size: 36px;
    color: #333333;
    font-weight: bold;
}

#vignette-generateur-scene .vignette-titre {
    font-family: "Poppins", sans-serif;
    color: #e80d8c;
    font-size: 68px;
    font-weight: 800;
    text-align: center;
    line-height: 1.2;
    margin: 0 0 40px 0;
    text-shadow: none;
}

#vignette-generateur-scene .vignette-extrait {
    font-family: "Roboto", sans-serif;
    color: #000000;
    font-size: 38px;
    line-height: 1.5;
    text-align: left;
    max-width: 100%; /* Utiliser toute la largeur */
}


/* ==========================================================
   STYLES D'IMPRESSION - SÛRS (CONTENU FORCÉ VISIBLE)
   ========================================================== */
@media printx {
  /* Rendre visibles les zones de contenu principales */
    /* Intentionnellement vide: bloc neutralisé (impression gérée via print.css) */
  /* Laisser header/footer/sidebars masqués, mais pas le contenu */
  #top-bar-wrap, #site-header, .page-header, #right-sidebar, #left-sidebar,
  .related-posts, #related-posts, .ocean-related-posts, #comments, .comment-form,
  #footer-widgets, #footer-bottom, .scroll-top, .ow-mini-cart,
  .cookie-notice-container, .admin-bar, .print-button-container { display: none !important; visibility: hidden !important; }
}
/* EOF MARKER REMOVED */

/* ==========================================================
   PRINT SAFETY CANONIQUE - Gutenberg (Prod) - 2025-11-03
   ========================================================== */
@media printx {
  /* Whitelist explicite des conteneurs de contenu Gutenberg */
  #main, #content, #primary, .site-content, .content-wrap, .entry-content,
  article, .wp-block-group, .wp-block-columns, .wp-block-column,
  .wp-block-image, .wp-block-paragraph, .wp-block-heading {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* Masquer les éléments non essentiels */
  #top-bar-wrap, #site-header, .page-header, #right-sidebar, #left-sidebar,
  .related-posts, #related-posts, .ocean-related-posts, #comments, .comment-form,
  #footer-widgets, #footer-bottom, .scroll-top, .ow-mini-cart,
  .cookie-notice-container, .print-button-container, nav, aside,
  .author-box, .post-navigation { 
    display: none !important; visibility: hidden !important; 
  }

  /* Règles liens compatibles (sans :has) */
  a { color: #000 !important; text-decoration: underline !important; }
  a[href^='http']::after {
    content: " (" attr(href) ")";
    font-size: 8pt !important; font-style: italic; color: #444; word-break: break-all;
  }
}
/* ===== Fin PRINT SAFETY CANONIQUE ===== */

/* ==========================================================
   PRINT GLOBAL VISIBILITY SAFETY - 2025-11-03
   ========================================================== */
@media printx {
  html, body { display: block !important; visibility: visible !important; color: #000 !important; }
  body * { visibility: visible !important; }
  /* Re-masquer les éléments non essentiels (après visibilité globale) */
  #top-bar-wrap, #site-header, .page-header, #right-sidebar, #left-sidebar,
  .related-posts, #related-posts, .ocean-related-posts, #comments, .comment-form,
  #footer-widgets, #footer-bottom, .scroll-top, .ow-mini-cart,
  .cookie-notice-container, .print-button-container, nav, aside,
  .author-box, .post-navigation { display: none !important; visibility: hidden !important; }
}
/* ===== Fin PRINT GLOBAL VISIBILITY SAFETY ===== */
