/* ---------------------------------------------------------------------------
   Blog ParrainPlus
   Reprend la charte existante : Bootstrap 4.5.2, accent #3742fa,
   boutons verts (.btn-custom / .btn-success), contenu centre.
   --------------------------------------------------------------------------- */

/* La largeur des pages blog est celle du reste du site : le .container
   de Bootstrap (1140px en xl, 960 en lg, 720 en md). Aucune valeur maison ici,
   sinon les pages blog seraient plus etroites que company_page.php. */

.main-content > .container {
    min-width: 0;
}

/* ----- En-tete de la page /blog ----- */

.blog-intro {
    margin-bottom: 2rem;
}

.blog-intro h1 {
    font-size: 2.2rem;
    margin-bottom: 0.75rem;
}

.blog-intro p {
    color: #444;
}

/* ----- Filtres par categorie ----- */

.blog-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 1.75rem;
    position: sticky;
    top: 0;
    z-index: 5;
    background: #fff;
    padding: 10px 0;
}

.blog-filters a {
    display: inline-block;
    min-width: 34px;
    text-align: center;
    padding: 3px 10px;
    border: 1px solid #dcdcdc;
    border-radius: 20px;
    color: #3742fa;
    font-size: 0.9rem;
    text-decoration: none;
    background: #fff;
}

.blog-filters a:hover {
    background: #f2f3ff;
    text-decoration: none;
}

.blog-filters a.active {
    background: #3742fa;
    border-color: #3742fa;
    color: #fff;
}

/* Recherche instantanee sur le sommaire */
.blog-recherche {
    position: relative;
    margin-bottom: 1.25rem;
}

.blog-recherche input {
    width: 100%;
    max-width: 380px;
    padding: 9px 16px;
    border: 1px solid #d5d5d5;
    border-radius: 22px;
    font-size: 0.95rem;
}

.blog-recherche input:focus {
    outline: none;
    border-color: #3742fa;
    box-shadow: 0 0 0 3px rgba(55, 66, 250, 0.12);
}

.blog-vide {
    padding: 1.5rem 0;
    color: #777;
}

/* Le filtrage masque des cartes : [hidden] doit primer sur display:flex/grid */
.blog-card[hidden],
.blog-cat-section[hidden] {
    display: none !important;
}

/* Section par categorie sur la page sommaire */
.blog-cat-section {
    margin-bottom: 2.75rem;
}

.blog-cat-section h2 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 2px solid #f0f0f0;
    scroll-margin-top: 16px;
}

.blog-outro {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.blog-outro h2 {
    font-size: 1.5rem;
    margin-bottom: 0.9rem;
}

.blog-outro img {
    max-width: 100%;
    height: auto;
}

/* ----- Grille des articles ----- */

.blog-grid {
    display: block;
    margin-bottom: 2rem;
}

.blog-card {
    display: block;
    overflow: hidden;          /* contient l'image flottante */
    border: none;
    background: transparent;
    padding: 18px 0 22px;
    min-height: 170px;
}

.blog-card:hover h3 a {
    color: #3742fa;
    text-decoration: underline;
}

.blog-card-logo {
    float: left;
    display: block;
    width: 300px;
    margin: 0 28px 14px 0;
    background: transparent;
}

.blog-card-logo img {
    display: block;
    width: 300px;
    height: 170px;
    object-fit: contain;
    object-position: center;
}

.blog-card-body {
    padding: 0;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}

.blog-card h3 {
    font-size: 1.2rem;
    line-height: 1.35;
    margin-bottom: 0.6rem;
}

.blog-card h3 a {
    color: #212529;
    text-decoration: none;
}

.blog-card h3 a:hover {
    color: #3742fa;
    text-decoration: underline;
}

.blog-card-chapo {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #444;
    margin-bottom: 1rem;
    text-align: justify;
}

.blog-card-meta {
    font-size: 0.8rem;
    color: #888;
    margin-bottom: 0.6rem;
}

.blog-card-meta .blog-cat {
    color: #3742fa;
}

.blog-card-cta {
    align-self: flex-start;
    white-space: normal;
    text-align: left;
    line-height: 1.3;
}

.blog-breadcrumb .breadcrumb {
    padding-left: 15px;
    padding-right: 15px;
}

/* ----- Page article ----- */

.blog-article {
    max-width: none;
}

.blog-article h1 {
    font-size: 2.1rem;
    line-height: 1.25;
    margin-bottom: 0.75rem;
}

.blog-article-meta {
    font-size: 0.88rem;
    color: #777;
    margin-bottom: 1.5rem;
}

.blog-article-header {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 16px;
    border: 1px solid #eee;
    border-radius: 6px;
    background: #fafafa;
    margin-bottom: 1.75rem;
}

.blog-article-header img {
    flex: 0 0 auto;
    max-height: 110px;
    max-width: 200px;
    width: auto;
    height: auto;
    object-fit: contain;
}

.blog-article-header .blog-chapo {
    margin: 0;
    font-size: 1.02rem;
    color: #333;
}

/* Sommaire genere depuis les H2 de l'article */
.blog-toc {
    border-left: 3px solid #3742fa;
    background: #f7f8ff;
    padding: 14px 18px;
    margin-bottom: 2rem;
    border-radius: 0 4px 4px 0;
}

.blog-toc p {
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.blog-toc ol {
    margin: 0;
    padding-left: 1.2rem;
}

.blog-toc a {
    color: #3742fa;
    text-decoration: none;
}

.blog-toc a:hover {
    text-decoration: underline;
}

/* Corps de l'article */
.blog-body h2 {
    font-size: 1.55rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    scroll-margin-top: 20px;
}

.blog-body h3 {
    font-size: 1.25rem;
    margin-top: 1.5rem;
    margin-bottom: 0.6rem;
}

.blog-body h4 {
    font-size: 1.08rem;
    margin-top: 1.2rem;
}

.blog-body p,
.blog-body li {
    line-height: 1.65;
}

.blog-body img {
    display: block;
    margin: 1.5rem auto;
    max-width: 100%;
    max-height: 220px;
    width: auto;
    height: auto;
}

/* Encart d'appel a l'action vers la fiche entreprise */
.blog-cta {
    border: 1px solid #90ee90;
    background: #f4fff4;
    border-radius: 6px;
    padding: 18px 20px;
    margin: 2rem 0;
    text-align: center;
}

.blog-cta p {
    margin-bottom: 0.9rem;
}

/* FAQ */
.blog-faq {
    margin-top: 2.5rem;
}

.blog-faq-item {
    border-bottom: 1px solid #eee;
    padding: 12px 0;
}

.blog-faq-item h3 {
    font-size: 1.05rem;
    margin-bottom: 0.4rem;
}

.blog-faq-item p {
    margin-bottom: 0;
    color: #444;
}

/* Articles lies */
.blog-related {
    margin-top: 3rem;
}

.blog-related ul {
    list-style: none;
    padding: 0;
}

.blog-related li {
    padding: 8px 0;
    border-bottom: 1px dotted #ddd;
}

.blog-related a {
    color: #3742fa;
    text-decoration: none;
}

.blog-related a:hover {
    text-decoration: underline;
}

/* Pagination : meme rendu que company_page.css */
.pagination .page-item.active .page-link {
    font-weight: bold;
    background-color: #3742fa;
    color: white;
}

/* ----- Responsive ----- */

@media (max-width: 991px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .blog-grid {
        grid-template-columns: 1fr;
    }

    .blog-card-logo {
        float: none;
        width: auto;
        margin: 0 0 14px 0;
    }

    .blog-card-logo img {
        width: 100%;
        max-width: 300px;
        margin: 0 auto;
    }

    .blog-card-chapo {
        text-align: left;
    }

    .blog-article-header {
        flex-direction: column;
        text-align: center;
    }

    .blog-intro h1 {
        font-size: 1.7rem;
    }

    .blog-article h1 {
        font-size: 1.6rem;
    }
}
