/*
Theme Name: Mon Thème Blog Sur Mesure
Author: Votre Nom
Version: 1.0
Description: Thème classique en PHP avec grille 3 colonnes et filtres de recherche.
*/

body {
    font-family: Arial, sans-serif;
    background-color: #f9f9f9;
    color: #333;
    margin: 0;
    padding: 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Barre de recherche et filtres */
.search-filter-bar {
    background: #fff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    margin-bottom: 40px;
}

.search-filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: flex-end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    font-size: 0.85rem;
    font-weight: bold;
    margin-bottom: 5px;
    color: #666;
}

.filter-group input, .filter-group select {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
}

.filter-submit {
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    height: 42px;
}

.filter-submit:hover {
    background: #005177;
}

/* Grille de 3 Colonnes */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 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;
}

.blog-card-content {
    padding: 20px;
}

.blog-card-meta {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 10px;
}

@media (max-width: 900px) {
    .blog-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .blog-grid { grid-template-columns: 1fr; }
}

/* Style de la pagination */
.blog-pagination .nav-links {
    display: flex;
    justify-content: center;
    gap: 10px;
}
.blog-pagination .page-numbers {
    padding: 8px 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
}
.blog-pagination .page-numbers.current {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}
/* Style du pied de page */
.site-footer {
    background-color: #222;
    color: #bbb;
    margin-top: 60px;
    padding: 40px 0;
    font-size: 0.9rem;
}

.site-footer a {
    color: #fff;
    text-decoration: none;
}

.site-footer a:hover {
    text-decoration: underline;
}

/* Grille automatique pour les widgets du footer */
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.widget-title {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 20px;
    border-bottom: 2px solid #0073aa;
    padding-bottom: 5px;
}

.footer-default {
    text-align: center;
    color: #888;
}

/* ==========================================================================
   TYPOGRAPHIE & STYLE DE L'ARTICLE COMPLET (single.php)
   ========================================================================== */

/* Conteneur principal de l'article */
.post-entry-content {
    font-family: 'Georgia', serif; /* Police à empattement idéale pour la lecture de longs textes */
    font-size: 1.15rem;
    line-height: 1.8;
    color: #2c3e50;
}

/* Espacement des paragraphes */
.post-entry-content p {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

/* Titres à l'intérieur de l'article (H2, H3, H4) */
.post-entry-content h2,
.post-entry-content h3,
.post-entry-content h4 {
    font-family: Arial, sans-serif; /* Retour à une police sans empattement pour les titres */
    color: #1a1a1a;
    font-weight: 700;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.post-entry-content h2 { font-size: 1.8rem; }
.post-entry-content h3 { font-size: 1.45rem; }
.post-entry-content h4 { font-size: 1.2rem; }

/* Liens hypertexte dans le texte */
.post-entry-content a {
    color: #0073aa;
    text-decoration: underline;
    text-underline-offset: 4px;
    transition: color 0.2s ease;
}

.post-entry-content a:hover {
    color: #005177;
}

/* Listes à puces et ordonnées */
.post-entry-content ul,
.post-entry-content ol {
    margin-top: 0;
    margin-bottom: 1.5rem;
    padding-left: 2rem;
}

.post-entry-content li {
    margin-bottom: 0.5rem;
}

/* Citations (Blockquotes) */
.post-entry-content blockquote {
    margin: 2rem 0;
    padding: 1rem 1.5rem;
    background-color: #f4f7f9;
    border-left: 4px solid #0073aa;
    font-style: italic;
    color: #555;
}

.post-entry-content blockquote p:last-child {
    margin-bottom: 0;
}

/* Images et médias insérés au milieu du texte */
.post-entry-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2rem auto;
    border-radius: 4px;
}

/* Légendes des images insérées */
.wp-caption-text {
    text-align: center;
    font-size: 0.85rem;
    color: #666;
    margin-top: -1.5rem;
    margin-bottom: 2rem;
    font-style: italic;
}

/* Code en ligne et blocs de code (si vous écrivez des articles techniques) */
.post-entry-content code {
    font-family: Consolas, Monaco, monospace;
    background-color: #f0f0f0;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 0.9em;
}

.post-entry-content pre {
    background-color: #2d3748;
    color: #f7fafc;
    padding: 1.5rem;
    overflow-x: auto;
    border-radius: 6px;
    margin-bottom: 1.5rem;
}

.post-entry-content pre code {
    background-color: transparent;
    padding: 0;
    color: inherit;
    font-size: 0.85rem;
}

/* ==========================================================================
   ESPACE COMMENTAIRES (single.php)
   ========================================================================== */

/* Conteneur global de la section commentaires */
#comments {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #eee;
}

/* Titre "Laisser un commentaire" */
.comment-reply-title {
    font-size: 1.5rem;
    font-weight: bold;
    color: #111;
    margin-bottom: 20px;
}

/* --- SÉPARATION & NETTOYAGE DE LA LIGNE DE STATUT D'AUTEUR --- */
/* Cible le paragraphe "Connexion en tant que... Se déconnecter" */
.comment-form-logged-in {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px; /* Espace régulier entre chaque élément de texte */
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #ddd;
}

/* Ajoute une séparation visuelle (un point médian •) entre les liens */
.comment-form-logged-in a {
    color: #0073aa;
    text-decoration: none;
}

.comment-form-logged-in a:hover {
    text-decoration: underline;
}

/* Insère une puce de séparation automatique après "Denis" et après "Modifier votre profil" */
.comment-form-logged-in a::after {
    content: " •";
    color: #ccc;
    margin-left: 8px;
    display: inline-block;
}

/* Retire la puce après le dernier lien (Se déconnecter) */
.comment-form-logged-in a:last-of-type::after {
    content: "";
}

/* Ligne "Les champs obligatoires sont indiqués avec *" */
.comment-notes, .required-field-message {
    display: block;
    width: 100%;
    font-size: 0.85rem;
    color: #666;
    font-style: italic;
    margin-top: 5px;
    margin-bottom: 20px;
}

/* --- STYLISATION DU FORMULAIRE DE COMMENTAIRE --- */

/* Zone de saisie du texte (Textarea) */
.comment-form textarea {
    width: 100%;
    max-width: 100%;
    min-height: 120px;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-family: Arial, sans-serif;
    font-size: 1rem;
    box-sizing: border-box;
    margin-bottom: 20px;
    background-color: #fafafa;
}

.comment-form textarea:focus {
    border-color: #0073aa;
    background-color: #fff;
    outline: none;
    box-shadow: 0 0 4px rgba(0, 115, 170, 0.2);
}

/* Bouton Soumettre le commentaire */
.comment-form .submit {
    padding: 12px 24px;
    background-color: #0073aa;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    transition: background-color 0.2s ease;
}

.comment-form .submit:hover {
    background-color: #005177;
}

/* ==========================================================================
   ALIGNEMENT DES IMAGES DANS LE TEXTE (Classes WordPress Natives)
   ========================================================================== */

/* Image alignée à gauche : le texte l'enveloppe par la droite */
.post-entry-content .alignleft,
.post-entry-content img.alignleft {
    float: left;
    margin: 0.5rem 1.5rem 1.5rem 0;
    max-width: 50%;
}

/* Image alignée à droite : le texte l'enveloppe par la gauche */
.post-entry-content .alignright,
.post-entry-content img.alignright {
    float: right;
    margin: 0.5rem 0 1.5rem 1.5rem;
    max-width: 50%;
}

/* Image centrée : pas d'enveloppement, elle s'isole proprement */
.post-entry-content .aligncenter,
.post-entry-content img.aligncenter {
    display: block;
    clear: both;
    margin: 2rem auto;
}

/* Nettoyage des flux (Clearfix) pour éviter que les images flottantes 
   ne débordent en dehors du conteneur de l'article ou sur les commentaires */
.post-entry-content::after {
    content: "";
    display: table;
    clear: both;
}

/* Gestion du responsive : on annule le flottement sur petit écran */
@media (max-width: 600px) {
    .post-entry-content .alignleft,
    .post-entry-content .alignright {
        float: none;
        margin: 1.5rem auto;
        display: block;
        max-width: 100%;
    }
}
