/*
   BLOG : page liste (page-blog.php) et article (single-post.php).
   Chargé uniquement sur ces pages (cf. tinwin_blog_assets dans functions.php).
*/

/* ============================================================================
   BANDEAU DE TITRE (page d'un article)
   Même dégradé que la section Fonctionnalités ; le menu est en position fixe,
   d'où le grand espace en haut.
   ============================================================================ */
.blog-hero {
    background: linear-gradient(180deg, rgba(0, 121, 50, 0) 0%, rgba(1, 79, 33, 0.8) 100%),
        linear-gradient(156.74deg, #007932 17.18%, #FFBE3C 70.82%);
    padding-top: 9rem;
    padding-bottom: 4rem;
    color: #ffffff;
}

.blog-hero-titre {
    font-family: Lexend, sans-serif;
    color: #ffffff;
    line-height: 1.2;
    margin-bottom: 1rem;
}

.blog-retour {
    display: inline-block;
    margin-bottom: 1.5rem;
    font-family: Outfit, sans-serif;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
}

.blog-retour:hover {
    color: #FABC3C;
}

/* Bandeau d'un article : titre centré, sur l'image de couverture (image mise
   en avant, passée en --blog-cover) assombrie pour garder le texte lisible. */
.blog-hero--centre {
    text-align: center;
}

.blog-hero--centre .blog-meta {
    justify-content: center;
}

/* Le titre est centré, mais « Retour au blog » reste en haut à gauche. */
.blog-hero--centre .blog-retour {
    display: block;
    width: fit-content;
    margin-right: auto;
}

/* L'image reste fixe (effet parallaxe) : la page glisse par-dessus en défilant.
   Le voile sombre suit le bandeau, seule l'image est fixée à l'écran. */
.blog-hero--cover {
    background: linear-gradient(rgba(0, 0, 0, 0.55), rgba(0, 0, 0, 0.55)),
        var(--blog-cover) center / cover no-repeat;
    background-attachment: scroll, fixed;
    padding-top: 11rem;
    padding-bottom: 6rem;
}

.blog-hero--cover .blog-hero-titre {
    font-size: clamp(2rem, 4.5vw, 3.25rem);
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);
}

/* ============================================================================
   META (catégorie + date), commune aux cartes et à l'article
   ============================================================================ */
.blog-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    /* même hauteur avec ou sans pastille de catégorie */
    min-height: 1.65rem;
    font-family: Outfit, sans-serif;
    font-size: 0.9rem;
}

.blog-cat {
    background-color: #FABC3C;
    color: #000000;
    font-weight: 700;
    border-radius: 1670px;
    padding: 0.15rem 0.85rem;
}

/* ============================================================================
   LISTE DES ARTICLES
   ============================================================================ */
/* Pas de bandeau sur cette page : le haut de page doit dégager le menu fixe
   (68 à 85 px de haut selon la largeur d'écran). */
.blog-liste {
    padding-top: 7.5rem;
    padding-bottom: 5rem;
}

/* Texte d'introduction éventuel, saisi dans la page « Blog » de l'admin. */
.blog-intro {
    max-width: 720px;
    margin-bottom: 2rem;
    font-family: Lexend, sans-serif;
    font-size: 1.15rem;
    line-height: 28px;
    color: #243A2D;
}

.blog-intro > :last-child {
    margin-bottom: 0;
}

/* ============================================================================
   RECHERCHE ET FILTRE PAR CATÉGORIE
   ============================================================================ */
.blog-filtres {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2.5rem;
}

.blog-recherche {
    position: relative;
    flex: 1 1 280px;
    max-width: 460px;
}

.blog-recherche input[type="search"],
.blog-filtre-categorie {
    height: 3.25rem;
    border: 2px solid #cfe8d8;
    border-radius: 10px;
    background-color: #ffffff;
    font-family: Outfit, sans-serif;
    font-size: 1rem;
    color: #243A2D;
}

.blog-recherche input[type="search"] {
    width: 100%;
    padding: 0 1rem 0 3rem;
}

.blog-recherche input[type="search"]::placeholder {
    color: #6b8574;
}

.blog-filtre-categorie {
    flex: 0 0 auto;
    width: auto;
    min-width: 200px;
    padding-left: 1rem;
    font-weight: 700;
}

.blog-recherche input[type="search"]:focus,
.blog-filtre-categorie:focus {
    outline: 0;
    border-color: #057126;
    box-shadow: 0 0 0 3px rgba(5, 113, 38, 0.15);
}

/* La loupe est aussi le bouton d'envoi (Entrée fonctionne dans le champ). */
.blog-recherche-btn {
    position: absolute;
    top: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 100%;
    padding: 0;
    border: 0;
    background: none;
    color: #057126;
    cursor: pointer;
}

.blog-recherche-btn:hover {
    color: #E6A400;
}

.blog-resultats {
    margin-bottom: 1.5rem;
    font-family: Outfit, sans-serif;
    color: #1A5633;
}

.blog-resultats a,
.blog-vide a {
    margin-left: 0.5rem;
    font-weight: 700;
    color: #057126;
}

.blog-card {
    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    background-color: #EAFFF3;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 24px rgba(5, 113, 38, 0.18);
}

.blog-card-img {
    aspect-ratio: 16 / 10;
    overflow: hidden;
}

.blog-card-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Article sans image mise en avant */
.blog-card-img--vide {
    background: linear-gradient(156.74deg, #007932 17.18%, #FFBE3C 70.82%);
}

.blog-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 1.5rem;
}

.blog-card .blog-meta {
    color: #1A5633;
    margin-bottom: 0.75rem;
}

.blog-card-titre {
    font-family: Outfit, sans-serif;
    font-weight: 700;
    font-size: 1.35rem;
    line-height: 1.3;
    margin-bottom: 0.75rem;
}

.blog-card-titre a {
    color: #006F2E;
    text-decoration: none;
}

.blog-card-extrait {
    font-family: Outfit, sans-serif;
    font-weight: 400;
    font-size: 1rem;
    line-height: 26px;
    color: #243A2D;
    margin-bottom: 1rem;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}

.blog-lire {
    margin-top: auto;
    font-family: Outfit, sans-serif;
    font-weight: 700;
    font-size: 0.93rem;
    color: #1A5633;
}

.blog-card:hover .blog-lire {
    color: #057126;
    text-decoration: underline;
}

.blog-vide {
    font-family: Outfit, sans-serif;
    font-size: 1.2rem;
    text-align: center;
    color: #243A2D;
    padding: 3rem 0;
}

/* ============================================================================
   PAGINATION (sortie de paginate_links en liste)
   ============================================================================ */
.blog-pagination {
    margin-top: 3rem;
}

.blog-pagination ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* a/span uniquement : le <ul> porte lui aussi la classe page-numbers */
.blog-pagination a.page-numbers,
.blog-pagination span.page-numbers {
    display: inline-block;
    min-width: 2.75rem;
    padding: 0.6rem 1rem;
    border: 2px solid #057126;
    border-radius: 1670px;
    font-family: Outfit, sans-serif;
    font-weight: 700;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    color: #057126;
}

.blog-pagination a.page-numbers:hover {
    background-color: #FABC3C;
    border-color: #FABC3C;
    color: #000000;
}

.blog-pagination span.page-numbers.current {
    background-color: #057126;
    color: #ffffff;
}

.blog-pagination span.page-numbers.dots {
    border-color: transparent;
}

/* ============================================================================
   ARTICLE
   ============================================================================ */
.blog-article-corps {
    padding-top: 3rem;
    padding-bottom: 5rem;
}

.blog-hero .blog-meta {
    color: #ffffff;
}

.blog-article-image {
    margin-bottom: 2.5rem;
}

.blog-article-image img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
}

.blog-content {
    font-family: Outfit, sans-serif;
    font-size: 1.15rem;
    line-height: 1.8;
    color: #243A2D;
    overflow-wrap: break-word;
}

.blog-content h2,
.blog-content h3,
.blog-content h4 {
    font-family: Lexend, sans-serif;
    font-weight: 800;
    line-height: 1.3;
    color: #057126;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.blog-content h2 {
    font-size: 1.75rem;
}

.blog-content h3 {
    font-size: 1.4rem;
}

.blog-content a {
    color: #057126;
    text-decoration: underline;
}

.blog-content a:hover {
    color: #E6A400;
}

.blog-content img,
.blog-content video,
.blog-content iframe {
    max-width: 100%;
}

.blog-content img {
    height: auto;
    border-radius: 10px;
}

.blog-content figure {
    margin: 2rem 0;
}

.blog-content figcaption,
.blog-content .wp-caption-text {
    margin-top: 0.5rem;
    font-size: 0.9rem;
    text-align: center;
    color: #1A5633;
}

.blog-content blockquote {
    margin: 2rem 0;
    padding: 1rem 1.5rem;
    border-left: 4px solid #FABC3C;
    background-color: #EAFFF3;
    border-radius: 0 10px 10px 0;
    font-style: italic;
}

.blog-content blockquote > :last-child {
    margin-bottom: 0;
}

.blog-content pre {
    overflow-x: auto;
    padding: 1rem;
    border-radius: 10px;
    background-color: #f4f4f4;
    font-size: 0.95rem;
}

.blog-content table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}

/* Alignements générés par l'éditeur WordPress */
.blog-content .aligncenter {
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.blog-content .alignleft {
    float: left;
    margin: 0.5rem 1.5rem 1rem 0;
}

.blog-content .alignright {
    float: right;
    margin: 0.5rem 0 1rem 1.5rem;
}

.blog-content::after {
    content: "";
    display: block;
    clear: both;
}

.blog-pages {
    font-weight: 700;
}

/* Article précédent / suivant */
.blog-articles-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 3.5rem;
    padding-top: 2rem;
    border-top: 2px solid #EAFFF3;
}

.blog-articles-nav-lien {
    flex: 1 1 14rem;
    max-width: 100%;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    background-color: #EAFFF3;
    font-family: Outfit, sans-serif;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
    color: #006F2E;
}

.blog-articles-nav-lien span {
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.85rem;
    color: #1A5633;
}

.blog-articles-nav-lien--suivant {
    text-align: right;
}

.blog-articles-nav-lien:hover {
    background-color: #FABC3C;
    color: #000000;
}

.blog-articles-nav-lien:hover span {
    color: #000000;
}

/* ============================================================================
   COLONNE « ARTICLES RÉCENTS » (à droite du contenu, sous lui sur mobile)
   ============================================================================ */
.blog-sidebar-titre {
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
    border-bottom: 3px solid #057126;
    font-family: Lexend, sans-serif;
    font-weight: 800;
    font-size: 1.5rem;
    line-height: 1.2;
    text-transform: uppercase;
    color: #243A2D;
}

.blog-recents {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.blog-recent {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.blog-recent-img {
    flex: 0 0 120px;
    height: 96px;
    border-radius: 8px;
    overflow: hidden;
}

.blog-recent-img img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Article sans image mise en avant */
.blog-recent-img--vide {
    background: linear-gradient(156.74deg, #007932 17.18%, #FFBE3C 70.82%);
}

.blog-recent-titre {
    display: block;
    font-family: Outfit, sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.35;
    text-decoration: none;
    color: #243A2D;
}

.blog-recent-titre:hover {
    color: #057126;
}

.blog-recent time {
    display: block;
    margin-top: 0.35rem;
    font-family: Outfit, sans-serif;
    font-size: 0.85rem;
    color: #1A5633;
}

/* ============================================================================
   RESPONSIVE / ACCESSIBILITÉ
   ============================================================================ */
@media (max-width: 767px) {
    .blog-hero {
        padding-top: 7rem;
        padding-bottom: 3rem;
    }

    .blog-hero--cover {
        padding-top: 8rem;
        padding-bottom: 4rem;
    }

    .blog-recent-img {
        flex-basis: 96px;
        height: 80px;
    }

    .blog-liste {
        padding-top: 7rem;
        padding-bottom: 3.5rem;
    }

    .blog-recherche {
        flex-basis: 100%;
        max-width: none;
    }

    .blog-filtre-categorie {
        flex: 1 1 100%;
    }

    .blog-content {
        font-size: 1.05rem;
    }

    .blog-content .alignleft,
    .blog-content .alignright {
        float: none;
        display: block;
        margin: 1rem auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .blog-hero--cover {
        background-attachment: scroll;
    }

    .blog-card {
        transition: none;
    }

    .blog-card:hover {
        transform: none;
    }
}
