/* ==========================================================================
   STYLES GLOBAUX & STRUCTURE
   ========================================================================== */
body { font-family: 'Poppins', sans-serif; background-color: #e9ecef; color: #333; }

.wrapper { 
    display: flex; 
    width: 100%; 
    max-width: 1900px; 
    margin: 0 auto; 
    align-items: flex-start; 
    background-color: #f8f9fa; 
    box-shadow: 0 0 25px rgba(0,0,0,0.05); 
    position: relative;
}

/* --- Barre Latérale Gauche (Menu) --- */
#sidebar { 
    min-width: 300px; 
    max-width: 300px; 
    background: linear-gradient(180deg, #ffffff 0%, #eef2f7 100%); 
    color: #333; 
    position: sticky; 
    top: 0;
    height: 100vh; 
    overflow-y: auto; 
    border-right: 1px solid #e1e6ec; 
    z-index: 999; 
    padding: 40px 20px; 
    text-align: center; 
    transition: left 0.3s ease; 
}

/* --- Design de la Photo (Effet Flip 3D) --- */
.sidebar-logo { 
    margin-bottom: 25px; 
    display: flex; 
    justify-content: center; 
}

.flip-container {
    background-color: transparent;
    width: 230px;
    height: 230px;
    perspective: 1000px; /* Donne la profondeur 3D */
}

.flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1); /* Animation fluide */
    transform-style: preserve-3d;
}

/* L'animation au survol : on tourne de 180° et on grossit un tout petit peu */
.flip-container:hover .flip-inner {
    transform: rotateY(180deg) scale(1.03);
}

.flip-front, .flip-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden; /* Cache le dos de l'image quand elle est retournée */
    border-radius: 50%;
    border: 5px solid #fff;
    box-shadow: 0 10px 30px rgba(0,0,0,0.12);
    background-color: #fff;
}

.flip-front img, .flip-back img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

/* L'image de dos est déjà retournée à 180° par défaut */
.flip-back {
    transform: rotateY(180deg);
}

/* --- Textes (Titre, Sous-titre, Description) --- */
.sidebar-title { font-size: 26px; font-weight: 700; margin-bottom: 5px; }
.sidebar-title a { color: #222; text-decoration: none; transition: color 0.3s; }
.sidebar-title a:hover { color: #fdb155; }

.sidebar-subtitle {
    font-size: 13px;
    font-weight: 600;
    color: #fdb155;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 15px;
}

.sidebar-desc { 
    font-size: 13px; 
    color: #666; 
    margin-bottom: 35px; 
    line-height: 1.6; 
    padding: 0 10px;
}

/* --- Menu Dynamique --- */
.main-menu { list-style: none; padding: 0; margin-bottom: 40px; text-align: left; padding-left: 20px; }
.main-menu li { margin-bottom: 12px; }
.main-menu li a { color: #333; text-decoration: none; font-size: 14px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; transition: color 0.3s; display: block; }
.main-menu li a:hover { color: #fdb155; }
.submenu { margin-top: 10px; border-left: 2px solid #e1e6ec; padding-left: 15px !important; margin-left: 5px; }
.submenu li { margin-bottom: 8px; }
.submenu li a { font-size: 13px; text-transform: none; font-weight: 500; color: #666; }
.submenu li a:hover { color: #fdb155; }
.toggle-icon { font-size: 10px; transition: transform 0.3s ease; color: #aaa; }
.dropdown-toggle-custom[aria-expanded="true"] .toggle-icon { transform: rotate(180deg); color: #fdb155; }
.sidebar-social { margin-top: 30px; text-align: center; }
.sidebar-social a { color: #aab2bd; margin: 0 10px; font-size: 20px; transition: 0.3s; }
.sidebar-social a:hover { color: #0077b5; }

/* --- Contenu Principal --- */
#content { width: calc(100% - 300px); min-height: 100vh; padding: 50px; }

/* --- Cartes des articles (Page d'accueil / Catégories) --- */
.article-card { 
    background: #fff; 
    margin-bottom: 40px; 
    border: none; 
    border-radius: 10px; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.05); 
    transition: transform 0.3s ease, box-shadow 0.3s ease; 
    height: 100%; 
    display: flex;
    flex-direction: column;
}
.article-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 10px 25px rgba(0,0,0,0.1); 
}

.article-img { 
    overflow: hidden; 
    display: block; 
    border-radius: 10px 10px 0 0; 
}
.article-img img { 
    width: 100%; 
    height: 240px; 
    object-fit: cover; 
    display: block;
    transition: transform 0.5s ease; 
}
.article-card:hover .article-img img { 
    transform: scale(1.05); 
}

.article-body { 
    padding: 30px; 
    text-align: center; 
    flex-grow: 1; 
    display: flex;
    flex-direction: column;
}
.article-category { color: #fdb155; font-size: 12px; text-transform: uppercase; letter-spacing: 2px; font-weight: 600; margin-bottom: 10px; display: inline-block; text-decoration: none; }
.article-title { font-size: 20px; font-weight: 600; line-height: 1.4; margin-bottom: 15px; }
.article-title a { color: #000; text-decoration: none; transition: color 0.3s; }
.article-title a:hover { color: #fdb155; }
.article-meta { font-size: 13px; color: #999; margin-bottom: 20px; }
.article-excerpt { color: #666; font-size: 15px; line-height: 1.8; margin-bottom: 25px; flex-grow: 1; }
.btn-read-more { display: inline-block; align-self: center; font-size: 13px; text-transform: uppercase; letter-spacing: 1px; font-weight: 600; color: #000; text-decoration: none; border-bottom: 2px solid #fdb155; padding-bottom: 3px; transition: all 0.3s; margin-top: auto; }
.btn-read-more:hover { color: #fdb155; border-color: #000; }

/* --- Mode Mobile (Menu) --- */
@media (max-width: 991px) {
    #sidebar { position: fixed; left: -300px; text-align: center; }
    .main-menu { text-align: center; padding-left: 0; }
    .submenu { border-left: none; }
    #sidebar.active { left: 0; box-shadow: 5px 0 15px rgba(0,0,0,0.1); }
    #content { width: 100%; padding: 20px; }
    .mobile-nav-toggle { display: inline-block !important; margin-bottom: 30px; }
}
.mobile-nav-toggle { display: none; background: #000; color: #fff; border: none; padding: 10px 15px; font-size: 16px; cursor: pointer; text-transform: uppercase; letter-spacing: 1px; }

/* ==========================================================================
   BARRE LATÉRALE DROITE
   ========================================================================== */
.sidebar-right .widget { margin-bottom: 40px; }
.sidebar-right .widget-title { font-family: Georgia, 'Times New Roman', Times, serif; font-size: 20px; font-style: italic; color: #333; margin-bottom: 25px; font-weight: normal; }

/* Recherche */
.sidebar-right .search-form .input-group { border: 1px solid #e1e1e1; }
.sidebar-right .search-form input { border: none; box-shadow: none; font-size: 13px; padding: 10px 12px; width: 100%; }
.sidebar-right .search-form input:focus { outline: none; box-shadow: none; }
.sidebar-right .search-form button { background: #fff; border: none; color: #333; padding: 0 12px; }

/* Encarts Images SAS */
.sidebar-right .promo-banner { display: block; overflow: hidden; border-radius: 4px; box-shadow: 0 2px 8px rgba(0,0,0,0.05); transition: transform 0.3s ease, box-shadow 0.3s ease; margin-bottom: 20px; }
.sidebar-right .promo-banner:hover { transform: translateY(-3px); box-shadow: 0 6px 15px rgba(0,0,0,0.1); }
.sidebar-right .promo-banner img { width: 100%; height: auto; display: block; }

/* Listes (Catégories & Archives) */
.sidebar-right .list-widget { list-style: none; padding: 0; margin: 0; }
.sidebar-right .list-widget li { border-bottom: 1px solid #f0f0f0; padding: 10px 0; }
.sidebar-right .list-widget li:last-child { border-bottom: none; }
.sidebar-right .list-widget a { display: flex; justify-content: space-between; color: #333; font-size: 14px; text-decoration: none; transition: color 0.3s; }
.sidebar-right .list-widget a:hover { color: #fdb155; }
.sidebar-right .list-widget .count { color: #b3b3b3; font-family: 'Poppins', sans-serif; font-size: 13px; }

/* Articles Populaires */
.sidebar-right .popular-post { display: flex; margin-bottom: 20px; align-items: center; }
.sidebar-right .popular-post img { width: 60px; height: 60px; object-fit: cover; margin-right: 12px; }
.sidebar-right .popular-post-info h5 { font-size: 13px; line-height: 1.4; margin: 0 0 5px 0; font-weight: 500; }
.sidebar-right .popular-post-info h5 a { color: #333; text-decoration: none; transition: color 0.3s; }
.sidebar-right .popular-post-info h5 a:hover { color: #fdb155; }
.sidebar-right .popular-post-meta { font-size: 11px; color: #999; display: flex; gap: 8px; }

/* Tag Cloud */
.sidebar-right .tag-cloud { display: flex; flex-wrap: wrap; gap: 6px; }
.sidebar-right .tag-cloud a { display: inline-block; padding: 4px 10px; font-size: 11px; border: 1px solid #e1e1e1; color: #333; text-decoration: none; text-transform: uppercase; letter-spacing: 1px; transition: all 0.3s; }
.sidebar-right .tag-cloud a:hover { border-color: #333; background-color: #333; color: #fff; }

/* ==========================================================================
   PAGES & ARTICLES DÉTAILLÉS
   ========================================================================== */
.page-title-block { margin-bottom: 30px; padding-bottom: 15px; border-bottom: 1px solid #eaeaea; }
.page-title-block h1 { font-size: 32px; font-weight: 600; color: #333; line-height: 1.3; margin: 0; }

.post-title-block { margin-bottom: 25px; padding-bottom: 15px; border-bottom: 1px solid #eaeaea; }
.post-title-block h1 { font-size: 32px; font-weight: 600; color: #333; line-height: 1.3; margin-bottom: 10px; }
.post-meta { font-size: 13px; color: #888; text-transform: uppercase; letter-spacing: 1px; }
.post-meta i { color: #fdb155; margin-right: 5px; }

.entry-content { font-size: 16px; line-height: 1.8; color: #444; background: #fff; padding: 0; }
.entry-content h2 { font-size: 26px; font-weight: 600; color: #333; margin-top: 40px; margin-bottom: 20px; }
.entry-content h3 { font-size: 22px; font-weight: 600; color: #333; margin-top: 35px; margin-bottom: 15px; }

.entry-content a { color: #294887; text-decoration: none; font-weight: 600; }
.entry-content a:hover { text-decoration: underline; color: #1a2e56; }

.entry-content p { margin-bottom: 20px; }
.entry-content ul { margin-bottom: 25px; padding-left: 20px; }
.entry-content li { margin-bottom: 10px; }

/* Style des images dans les articles */
.entry-content img { 
    max-width: 100%; 
    height: auto; 
    border-radius: 8px; 
    margin-bottom: 25px; 
    box-shadow: 0 5px 15px rgba(0,0,0,0.08); 
    transition: transform 0.3s ease, box-shadow 0.3s ease; 
}
.entry-content img:hover {
    transform: translateY(-3px); 
    box-shadow: 0 8px 25px rgba(0,0,0,0.15); 
}

.wp-block-image { margin-bottom: 20px; }
.wp-block-image .alignleft { float: left; margin-right: 20px; margin-bottom: 10px; }
.wp-block-image .aligncenter { display: block; margin: 0 auto; text-align: center; }

.wp-block-separator { border: 0; border-top: 1px solid #eaeaea; margin: 40px 0; }

/* ==========================================================================
   BLOCS AUTEUR & ARTICLES SIMILAIRES
   ========================================================================== */
.author-box { border-left: 4px solid #fdb155; }
.related-card { transition: transform 0.3s ease, box-shadow 0.3s ease; }
.related-card:hover { transform: translateY(-3px); box-shadow: 0 6px 15px rgba(0,0,0,0.1) !important; }
.related-card a { transition: color 0.3s; }
.related-card a:hover { color: #294887 !important; }

/* ==========================================================================
   BARRE D'ADMINISTRATION (Type WordPress)
   ========================================================================== */
#admin-top-bar {
    background: #23282d;
    color: #eee;
    height: 32px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 99999;
    font-size: 13px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

#admin-top-bar .admin-bar-content {
    display: flex;
    justify-content: space-between;
    height: 100%;
    padding: 0 20px;
}

#admin-top-bar .admin-bar-left,
#admin-top-bar .admin-bar-right {
    display: flex;
    align-items: center;
}

#admin-top-bar a {
    color: #eee;
    text-decoration: none;
    padding: 0 10px;
    height: 32px;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
}

#admin-top-bar a:hover {
    background: #32373c;
    color: #00b9eb;
}

#admin-top-bar i { margin-right: 6px; font-size: 14px; }
#admin-top-bar .admin-bar-right span { color: #aaa; margin-right: 15px; font-style: italic; }

body.has-admin-bar {
    padding-top: 32px;
}
body.has-admin-bar #sidebar {
    top: 32px;
    height: calc(100vh - 32px);
}


/* --- Styles personnalisés pour la boîte auteur --- */
.author-box-custom {
    position: relative;
    overflow: hidden;
    
    /* Modernisation de la boîte */
    border-radius: 16px; /* Bords bien arrondis, très tendance */
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08); /* Ombre douce et large pour un effet "flottant" */
    border: 1px solid #f0f2f5; /* Bordure presque invisible pour structurer */
    
    /* L'astuce magique du dégradé : 
       1. 100% blanc opaque de 0% à 45% (pour que le texte soit parfaitement lisible)
       2. Un fondu progressif qui disparaît totalement à 100% (à droite)
    */
    background-image: 
        linear-gradient(90deg, rgba(255,255,255,1) 0%, rgba(255,255,255,1) 45%, rgba(255,255,255,0.7) 65%, rgba(255,255,255,0) 100%),
        url('/wp-content/uploads/nicolas_housset_vignette_3.png');
        
    background-repeat: no-repeat, no-repeat;
	
	/* MODIFICATION 2 : On aligne bien à droite et au centre verticalement */
    /* Astuce : Si la photo est encore trop à gauche, vous pouvez mettre "calc(100% + 50px) center" au lieu de "right center" */
    background-position: left center, right -90px;
    
    /* MODIFICATION 3 : On remplace "cover" par "auto 120%". 
       L'image garde ses proportions sans envahir la gauche ! */
    background-size: 100% 100%, auto 200%;
    
    display: flex;
    align-items: center;
    min-height: 280px; /* Donne de la hauteur pour bien profiter de la photo */
    margin-top: 50px !important;
}

/* Le conteneur du texte */
.author-box-custom .author-content {
    position: relative;
    z-index: 2;
    max-width: 55%; /* Réserve presque la moitié droite pour la photo */
    padding: 40px; /* Laisse l'espace respirer */
}

/* --- Adaptabilité mobile (pour les écrans de moins de 991px) --- */
@media (max-width: 991px) {
    .author-box-custom {
        /* Sur mobile ou tablette, on désactive ce fond pour tout empiler proprement */
        background-image: none;
        background-color: #fff;
        flex-direction: column;
        text-align: center;
        padding: 40px 20px;
        min-height: auto;
    }
    
    /* On recrée votre photo en cercle classique en haut pour le mobile */
    .author-box-custom::before {
        content: '';
        display: block;
        width: 140px;
        height: 140px;
        background-image: url('/wp-content/uploads/nicolas_housset_vignette_3.png');
        background-size: cover;
        background-position: center;
        border-radius: 50%;
        border: 4px solid #fff;
        box-shadow: 0 8px 25px rgba(0,0,0,0.1);
        margin: 0 auto 25px auto;
    }
    
    .author-box-custom .author-content {
        max-width: 100%;
        padding: 0;
    }
}