/*
Theme Name: Deux Mille Vingt-Six
Theme URI: http://localhost/denez/
Author: Denis
Description: Un thème WordPress classique sur mesure, ultra-épuré, rapide et responsive. Doté d'un moteur de recherche croisé avancé et d'une persistance d'état globale.
Version: 1.0.0
License: GNU General Public License v2 or later
Text Domain: deuxmillevingtsix
*/

/* ==========================================================================
   1. STRUCTURATION ET TYPOGRAPHIE GLOBALE (Ordinateur par défaut)
   ========================================================================== */

body {
    background-color: #f8fafc;
    color: #333;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    box-sizing: border-box;
}

/* ==========================================================================
   2. BARRE DE RECHERCHE ET FILTRES MULTICRITÈRES
   ========================================================================== */

.search-filter-bar {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    margin-bottom: 30px;
}

.search-filter-form {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 20px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 150px;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: bold;
    color: #666;
    margin-bottom: 5px;
}

.filter-group input,
.filter-group select {
    width: 100%;
    height: 42px;
    padding: 0 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
    box-sizing: border-box;
    background-color: #fff;
}

.filter-submit {
    padding: 0 25px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    height: 42px;
    transition: background 0.2s ease;
}

.filter-submit:hover {
    background: #005177;
}

/* ==========================================================================
   3. LE MENU DE NAVIGATION PRINCIPAL & PAGES ENFANTS (Dropdown)
   ========================================================================== */

.menu-toggle-button {
    padding: 0 20px;
    background: #222;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    height: 42px;
    transition: background 0.2s ease;
}

.menu-toggle-button:hover {
    background: #444;
}

.menu-toggle-button.active {
    background: #d9534f;
}

.main-navigation-dropdown {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 30px;
}

.nav-menu-list {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    gap: 25px;
}

.nav-menu-list li {
    position: relative;
    margin: 0 !important;
    padding: 0 !important;
}

.nav-menu-list a {
    color: #333;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.05rem;
    display: inline-block;
    transition: color 0.2s;
}

.nav-menu-list a:hover {
    color: #0073aa;
}

/* --- GESTION DES COUCHES ENFANTS (SOUS-MENUS) --- */
.nav-menu-list ul.sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    min-width: 200px;
    padding: 10px 0 !important;
    margin: 0 !important;
    list-style: none !important;
    border-radius: 4px;
    z-index: 9999;
    
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.25s ease;
}

.nav-menu-list ul.sub-menu li {
    display: block !important;
    width: 100%;
}

.nav-menu-list ul.sub-menu a {
    display: block;
    padding: 8px 20px;
    font-size: 0.95rem;
    font-weight: normal;
    color: #555;
    white-space: nowrap;
}

.nav-menu-list ul.sub-menu a:hover {
    background-color: #f4f7f9;
    color: #0073aa;
}

.nav-menu-list li:hover > ul.sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-menu-list .menu-item-has-children > a::after {
    content: " ▾";
    font-size: 0.8rem;
    color: #888;
}

/* ==========================================================================
   4. LA GRILLE D'ARTICLES PRINCIPALE (3 Colonnes Fixes sur PC)
   ========================================================================== */

.blog-grid {
    display: grid !important;
    grid-template-columns: repeat(3, 1fr) !important; /* Force STRICTEMENT les 3 colonnes */
    gap: 30px;
    align-items: stretch;
    margin-top: 30px;
}

.blog-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blog-card-image {
    background: #f0f0f0; 
    line-height: 0;
    height: 200px;
    overflow: hidden;
}

.blog-card-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    background-color: #f0f0f0;
}

.blog-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.blog-card-meta {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 8px;
}

.blog-card-content h2 {
    font-size: 1.4rem;
    margin: 0 0 10px 0;
}

.blog-card-content p {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #555;
    margin: 0;
}

/* ==========================================================================
   5. PAGE ARTICLE SEUL (single.php) & HAUTEUR DES LIGNES
   ========================================================================== */

.post-entry-content {
    font-family: 'Geneva', 'Lucida Sans', 'Lucida Grande', Verdana, sans-serif;
    font-size: 1.05rem;
    color: #2c3e50;
}

.post-entry-content p {
    line-height: 1.45;
    margin-top: 0;
    margin-bottom: 1.5rem;
}

/* --------------------------------------------------------------------------
   AJOUT ICI : STYLES ÉDITORIAUX COMPLÉMENTAIRES (Légendes, Citations, Liens)
   -------------------------------------------------------------------------- */

/* 1. L'habillage des légendes sous les images */
.wp-caption {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 8px;
    margin-bottom: 20px;
    max-width: 100%;
    border-radius: 4px;
}
.wp-caption-text {
    font-size: 0.85rem;
    color: #64748b;
    text-align: center;
    margin: 5px 0 0 0;
}

/* 2. Le style des citations (Blockquote) */
.post-entry-content blockquote {
    margin: 20px 0;
    padding-left: 20px;
    border-left: 4px solid #0073aa;
    font-style: italic;
    color: #475569;
}

/* 3. La couleur des liens au cœur de vos textes */
.post-entry-content a {
    color: #0073aa;
    text-decoration: underline;
}
.post-entry-content a:hover {
    color: #005177;
}

/* -------------------------------------------------------------------------- */

/* Le reste de vos styles existants de la Partie 2 continue ici... */

.post-navigation-links {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-top: 50px;
    padding-top: 30px;
    border-top: 1px solid #eee;
}

.nav-box {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.nav-next {
    text-align: right;
    align-items: flex-end;
}

.nav-label {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: #888;
    letter-spacing: 1px;
    margin-bottom: 5px;
}

.post-navigation-links a {
    font-size: 1rem;
    font-weight: bold;
    color: #333;
    text-decoration: none;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.post-navigation-links a:hover {
    color: #0073aa;
}

.comments-toggle-button {
    padding: 12px 24px;
    background: #222;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: all 0.2s ease;
}

.comments-toggle-button.active {
    background: #0073aa;
}

/* ==========================================================================
   6. BOUTON RETOUR EN HAUT FLOUTÉ (Fichier footer.php)
   ========================================================================== */

.scroll-top-button {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background-color: #0073aa;
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.3rem;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
}

.scroll-top-button.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ==========================================================================
   7. LE PIED DE PAGE PERSONNALISABLE (footer.php)
   ========================================================================== */

.site-footer {
    background-color: #1a252f; 
    color: #ecf0f1;            
    margin-top: 60px;
    padding: 40px 0;
    font-size: 0.9rem;
}

.site-footer .widget-title {
    color: #ffffff;            
    font-size: 1.1rem;
    margin-bottom: 20px;
    border-bottom: 2px solid #3498db; 
    padding-bottom: 5px;
}

.site-footer a {
    color: #3498db;            
    text-decoration: none;
    transition: color 0.2s ease;
}

.site-footer a:hover {
    color: #1abc9c;
    text-decoration: underline;
}

.footer-default {
    text-align: center;
    color: #7f8c8d;            
}

/* ==========================================================================
   8. INTERCEPTIONS DE RUPTURES ADAPTATIVES (Media Queries Étanches)
   ========================================================================== */

/* --- A. TABLETTES (Écrans de taille moyenne inférieurs à 1024px) --- */
@media (max-width: 1024px) {
    .container {
        max-width: 100%;
        padding-left: 20px;
        padding-right: 20px;
    }

    .blog-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px;
    }

    .search-filter-form {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .filter-submit, 
    .menu-toggle-button {
        width: 100%;
        height: 44px;
    }
}

/* --- B. SMARTPHONES (Petits écrans inférieurs à 600px - RESSÉRRÉ) --- */
@media (max-width: 600px) {
    
    .container, 
    main.container, 
    .site-footer .container {
        padding-left: 12px !important;  
        padding-right: 12px !important; 
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    main.container {
        padding: 20px 12px !important; 
    }

    .blog-grid {
        grid-template-columns: 1fr !important;
        gap: 15px !important;
    }

    .blog-card {
        border-radius: 6px;
    }

    .blog-card-image {
        height: 180px; 
    }

    .blog-card-content {
        padding: 12px !important;
    }

    .blog-card-content h2 {
        font-size: 1.25rem !important;
        margin-top: 5px;
        margin-bottom: 8px;
    }

    .search-filter-form {
        grid-template-columns: 1fr;
    }

    .container h1, 
    main h1 {
        font-size: 1.8rem !important; 
        line-height: 1.25;
    }

    .nav-menu-list {
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .nav-menu-list ul.sub-menu {
        position: static; 
        display: none; 
        background: #f8fafc;
        padding: 0 0 0 20px !important;
        margin: 0 !important;
        box-shadow: none;
    }

    .nav-menu-list li:hover > ul.sub-menu,
    .nav-menu-list li:focus-within > ul.sub-menu {
        display: block; 
    }

    .post-navigation-links {
        flex-direction: column;
        gap: 20px;
    }

    .nav-next {
        text-align: left;
        align-items: flex-start;
    }

    .scroll-top-button {
        bottom: 20px;
        right: 20px;
        width: 42px;
        height: 42px;
    }
}

/* ==========================================================================
   ALIGNEMENT DES IMAGES ET HABILLAGE DU TEXTE (single.php)
   ========================================================================== */

/* Image à gauche, le texte s'enroule à droite */
.post-entry-content .alignleft,
.alignleft {
    float: left;
    margin: 5px 20px 20px 0;
    max-width: 100%;
    height: auto;
}

/* Image à droite, le texte s'enroule à gauche */
.post-entry-content .alignright,
.alignright {
    float: right;
    margin: 5px 0 20px 20px;
    max-width: 100%;
    height: auto;
}

/* Image centrée, le texte va en dessous (sans habillage) */
.post-entry-content .aligncenter,
.aligncenter {
    display: block;
    margin: 10px auto 25px auto;
    clear: both;
    max-width: 100%;
    height: auto;
}

/* Sécurité pour empêcher le texte suivant de déborder si l'image est plus haute */
.post-entry-content::after {
    content: "";
    display: table;
    clear: both;
}

/* Optimisation mobile : on retire le flottement pour que l'image prenne toute la largeur */
@media (max-width: 600px) {
    .post-entry-content .alignleft,
    .post-entry-content .alignright,
    .post-entry-content .aligncenter {
        float: none !important;
        display: block !important;
        margin: 15px auto !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}


/* ==========================================================================
   9. CONFIGURATION IMPRESSION PAPIER / EXPORT PDF
   ========================================================================== */
@media print {
    header, 
    .site-header-bar,
    .main-navigation-dropdown,
    .post-top-actions, 
    .post-navigation-links, 
    .comments-toggle-button, 
    .comments-dropdown-zone, 
    #comments, 
    .scroll-top-button, 
    footer, 
    .site-footer {
        display: none !important;
    }

    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 12pt;
    }

    main.container {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        box-shadow: none !important;
    }

    .post-entry-content {
        line-height: 1.5;
        color: #000 !important;
    }

    h1, h2, h3, img, blockquote {
        page-break-inside: avoid;
    }
}

/* ==========================================================================
   REMISE EN FORME DE LA PAGINATION EN BAS DE PAGE (.blog-pagination)
   ========================================================================== */

/* Centre le bloc complet et supprime les puces par défaut de WordPress */
.blog-pagination {
    margin-top: 50px;
    margin-bottom: 30px;
    text-align: center;
    width: 100%;
}

/* Force les numéros et liens à s'aligner horizontalement sur une seule ligne */
.blog-pagination .nav-links,
.blog-pagination ul,
.navigation .nav-links {
    display: flex !important;
    flex-direction: row !important;
    justify-content: center;
    align-items: center;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 !important;
    gap: 10px; /* Espace régulier entre chaque numéro */
}

.blog-pagination li {
    margin: 0 !important;
    padding: 0 !important;
    list-style-type: none !important;
}

/* Style de base des boutons de chiffres et des mots Précédent/Suivant */
.blog-pagination .page-numbers,
.navigation .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    background: #fff;
    color: #333;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.95rem;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    box-sizing: border-box;
    transition: all 0.2s ease;
}

/* Effet au survol des numéros */
.blog-pagination a.page-numbers:hover,
.navigation a.page-numbers:hover {
    background: #0073aa;
    color: #fff !important;
    border-color: #0073aa;
}

/* Style exclusif pour le numéro de la page ACTUELLE (Bouton actif) */
.blog-pagination .page-numbers.current,
.navigation .page-numbers.current {
    background: #0073aa !important;
    color: #fff !important;
    border-color: #0073aa !important;
    cursor: default;
}

/* Style pour les points de suspension si vous avez beaucoup de pages (...) */
.blog-pagination .page-numbers.dots,
.navigation .page-numbers.dots {
    background: transparent;
    border: none;
    color: #aaa;
    cursor: default;
}

/* Adaptation fluide pour l'écran tactile des smartphones */
@media (max-width: 600px) {
    .blog-pagination .nav-links {
        gap: 6px;
    }
    .blog-pagination .page-numbers {
        min-width: 36px;
        height: 36px;
        padding: 0 8px;
        font-size: 0.85rem;
    }
}

/* Style pour les flèches de pagination désactivées */
.blog-pagination .page-numbers.disabled {
    background: #f1f5f9 !important;
    color: #cbd5e1 !important;
    border-color: #e2e8f0 !important;
    cursor: default;
}

/* ==========================================================================
   FORMULAIRE DE RECHERCHE DANS LE MENU DU HEADER (Version Fixe & Alignée)
   ========================================================================== */

/* Aligne l'élément de recherche à la suite des liens */
.nav-menu-list .menu-search-item {
    display: inline-flex !important;
    align-items: center !important;
    margin-left: auto !important; /* Pousse de force la recherche tout à droite sur PC */
    padding: 0 !important;
    height: 100%;
}

.menu-search-form {
    display: flex !important;
    align-items: center !important;
    border: 1px solid #ddd;
    border-radius: 20px; /* Bel arrondi moderne */
    background: #fff;
    padding: 2px 10px 2px 15px;
    height: 34px; /* Hauteur calibrée pour s'aligner sur la hauteur du texte */
    box-sizing: border-box;
}

.menu-search-form input {
    border: none !important;
    outline: none !important;
    font-size: 0.9rem;
    width: 130px !important; /* LARGEUR FIXE : Supprime définitivement l'agitation */
    padding: 0 !important;
    height: 100% !important;
    background: transparent !important;
}

.menu-search-form button {
    background: transparent !important;
    border: none !important;
    cursor: pointer !important;
    font-size: 1rem;
    padding: 0 0 0 5px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
}

/* --- AJUSTEMENT POUR SMARTPHONE --- */
@media (max-width: 600px) {
    .nav-menu-list .menu-search-item {
        margin-left: 0 !important;
        width: 100% !important;
        margin-top: 15px !important; /* Donne de l'espace sous le menu mobile */
    }
    
    .menu-search-form {
        width: 100% !important;
        height: 40px;
    }
    
    .menu-search-form input {
        width: 100% !important;
    }
}
