/* style1.css */
body {
    font-family: 'verdana', 'Avenir', sans-serif;
    line-height: 1.3;
    margin: 0;
    padding: 0;
    background-color: #f4f4f4;
    color: #333;
}

p {
    font-size: 13px;
    line-height: 1.6;
    margin-bottom: 10px;
    margin-top: 0px;
}

h2 {
    color: #333;
}

h1 {
    font-size: 32px;
}

/* Fond d'écran pour la page d'accueil seulement */
body.accueil {
    background-image: url('fondseigneurie.png');
}

/* Fond d'écran pour les pages d'articles seulement */
body.page-article {
    background-image: url('fondseigneurie.png');
}

/* =========================================== */
/* === SECTION POUR LES BANNIÈRES DU HAUT === */
/* =========================================== */

header {
    background-image: url('bandeseigneurie.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: #fff;
    text-align: center;
    height: 8vh;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

.header-article {
    background-image: url('bandeseigneurie.png');
}

header h1 {
    margin: 0;
    font-size: 1.4rem;
}

main {
    width: 80%;
    max-width: 700px;
    margin: 2rem auto;
    padding: 1rem;
    background-color: #fff;
}

/* Style pour le titre de l'accueil et son lien externe */
.titre-accueil {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid #eee;
    margin-bottom: 1rem;
}

.titre-accueil h3 {
    margin: 0;
}

.image-de-fin img {
    width: 100%;
    height: auto;
    display: block;
}


/* ================================================================== */
/* ========= SECTION CORRIGÉE POUR L'APERÇU DE L'ARTICLE ========= */
/* ================================================================== */

/* Style pour chaque résumé d'article sur la page d'accueil */
.apercu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding: 0.2rem 0;
    margin-bottom: 0.1rem;
    gap: 1rem; /* Ajoute un petit espace de sécurité entre les éléments */
}

/* Réduit la taille de TOUS les titres dans les aperçus */
.apercu h3 {
    font-size: 0.85rem;
    margin: 0; 
    /* Important pour un bon alignement */
}

/* Cible le paragraphe avec la classe .date */
.apercu p.date {
    margin: 0; /* Important pour un bon alignement */
    text-align: right; /* Aligne le texte de la date à droite de son bloc */
    flex-shrink: 0; /* LIGNE CRUCIALE : Empêche ce bloc de se réduire et de passer à la ligne */
}


/* --- Styles pour la ligne spéciale CENTRÉE --- */

/* Conteneur pour le texte qui sera centré */
.texte-apercu {
    flex-grow: 1;
    text-align: center;
}

/* Cible le titre DANS le conteneur centré pour ajouter une marge */
.texte-apercu h3 {
    margin-bottom: 5px;
    margin-top: 0;
}

/* Cible le paragraphe DANS le conteneur centré pour enlever ses marges */
.texte-apercu p {
    margin: 0;
}

/* Style pour le rectangle du titre spécial */
.titre-special {
    background-color: #4a5a6a;  /* Un gris-bleu foncé */
    border-radius: 5px;
    padding-left: 1rem;
    padding-right: 1rem;
}

/* Cible le texte UNIQUEMENT à l'intérieur du rectangle spécial pour le rendre blanc */
.titre-special h3, .titre-special p {
    color: white; 
}

/* ================================================================== */
/* ======================= FIN DE LA SECTION CORRIGÉE =============== */
/* ================================================================== */


.date {
    color: #777;
    font-size: 0.9em;
    font-style: italic;
}

a {
    color: #0056b3;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.pied-de-page {
    padding: 1rem 0;
    margin-top: 2rem;
    font-size: 0.8em;
    color: #777;
    display: flex;
    justify-content: space-between;
    align-items: center;
    
}

.image-article {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 2rem auto;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

/* Style pour les articles complets */
.article-complet .article-header {
    text-align: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
}

.article-complet .article-header h1 {
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
}

/* --- Style pour le Pop-up (Lightbox) --- */
.lightbox {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    overflow: auto;
}

.lightbox:target {
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox img {
    max-width: 90%;
    max-height: 80%;
    border: 3px solid white;
    box-shadow: 0 0 25px rgba(0,0,0,0.5);
}

.lightbox .close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    text-decoration: none;
    transition: 0.3s;
}

.lightbox .close:hover {
    color: #bbb;
}

/* Pour une image alignée à gauche avec le texte qui l'entoure */
.image-gauche {
    float: left;
    margin-right: 15px;
    margin-bottom: 5px;
    max-width: 25%;
}

/* Pour une image alignée à droite avec le texte qui l'entoure */
.image-droite {
    float: right;
    margin-left: 15px;
    margin-bottom: 5px;
    max-width: 25%;
}

/* --- CLASSES OPTIONNELLES POUR LA TAILLE DES IMAGES --- */
.image-petite {
    max-width: 14%;
}

.image-moyenne {
    max-width: 40%;
}

.image-grande {
    max-width: 60%;
}


/* Quand l'écran fait 768px de large ou moins (la taille d'un iPad) */
@media (max-width: 768px) {
    
    .conteneur {
        display: block; /* Enlève le mode "côte à côte" */
    }

    .contenu-principal,
    .barre-laterale {
        width: 100%; /* Les deux prennent toute la largeur */
    }
}


