/*
 * blog.css - UN SEUL fichier de styles pour tout le blog (Creative Flyers)
 *   1. Page du blog et pages de catégories (home.php / archive.php)
 *   2. Cartes d'articles (template-parts/post-card.php)
 *   3. Article (single.php)
 *   4. Guides : encadrés, étapes, tableau, FAQ, bloc final, cartes produit
 *   5. Fil d'Ariane, bloc d'articles « Latest articles / Keep reading », carte de secours de la barre latérale
 * À déposer dans le dossier du thème : wp-content/themes/creativeflyers-theme/blog.css
 */

/* ==========================================================================
   1. PAGE DU BLOG ET PAGES DE CATÉGORIES
   ========================================================================== */
.cfh-main {
    width: 100%;
    max-width: 1230px;
    margin: 0 auto 80px;
    padding: 0 20px;
    box-sizing: border-box;
}

.cfh-main .cfh-grid {
    margin-top: 35px;
}

/* En-tête */
.cfh-header {
    text-align: center;
    margin-bottom: 10px;
}

.cfh-title {
    font-size: 3.2rem;
    line-height: 1.2;
    font-weight: 700;
    color: #222222;
    margin: 35px 0 10px;
}

.cfh-title.is-blog {
    font-size: clamp(2.8rem, 8vw, 4.5rem);
}

.cfh-subtitle {
    font-size: 1.4rem;
    font-weight: 700;
    color: #444444;
    margin: 0 0 15px;
}

.cfh-desc {
    max-width: 560px;
    margin: 0 auto;
    font-size: 0.95rem;
    line-height: 1.6;
    color: #666666;
}

.cfh-desc.is-blog {
    max-width: 880px;
}

.cfh-desc p {
    margin: 0 0 10px;
}

/* Pastilles de catégories */
.cfh-cats {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 26px;
}

.cfh-pill {
    display: inline-block;
    padding: 7px 16px;
    border: 1px solid #d4d4d4;
    border-radius: 980px;
    background-color: #ffffff;
    color: #323232;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none;
    transition: all 0.2s ease;
}

.cfh-pill:hover {
    border-color: #41b2c1;
    color: #41b2c1;
}

.cfh-pill.is-active {
    background-color: #323232;
    border-color: #323232;
    color: #ffffff;
}

/* Pagination */
.cfh-pagination {
    margin-top: 45px;
}

.cfh-pagination .screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.cfh-pagination .nav-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.cfh-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 14px;
    box-sizing: border-box;
    border: 1px solid #d4d4d4;
    border-radius: 8px;
    background-color: #ffffff;
    color: #323232;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
}

.cfh-pagination a.page-numbers:hover {
    background-color: #41b2c1;
    border-color: #41b2c1;
    color: #ffffff;
}

.cfh-pagination .page-numbers.current {
    background-color: #323232;
    border-color: #323232;
    color: #ffffff;
}

.cfh-pagination .page-numbers.dots {
    border-color: transparent;
    background-color: transparent;
}

.cfh-empty {
    text-align: center;
    color: #777777;
    padding: 40px 0;
}

@media (max-width: 520px) {
    /* Pastilles sur une seule ligne, défilement horizontal au doigt */
    .cfh-cats {
        flex-wrap: nowrap;
        justify-content: flex-start;
        overflow-x: auto;
        padding-bottom: 6px;
    }
    .cfh-pill {
        flex-shrink: 0;
        white-space: nowrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cfh-pill, .cfh-pagination .page-numbers {
        transition: none;
    }
}
/* ==========================================================================
   2. CARTES D'ARTICLES
   ========================================================================== */
.cfh-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 45px; }
.cfh-card { margin: 0; padding: 0; min-width: 0; }
.cfh-link { display: flex; flex-direction: column; height: 100%; background: #fff; border: 1px solid #eaeaea; border-radius: 10px; overflow: hidden; text-decoration: none; color: inherit; transition: transform .25s ease, box-shadow .25s ease; }
.cfh-link:hover { transform: translateY(-4px); box-shadow: 0 10px 25px rgba(0, 0, 0, .08); }
.cfh-thumb { aspect-ratio: 3 / 2; background: #f5f5f5; overflow: hidden; }
.cfh-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cfh-thumb-empty { width: 100%; height: 100%; background: #eee; }
.cfh-info { display: flex; flex-direction: column; gap: 6px; flex: 1; padding: 14px 16px; }
.cfh-card-title { margin: 0; font-size: 15px !important; line-height: 1.35; font-weight: 700; color: #222; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cfh-card-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: auto; padding-top: 10px; font-size: 12px; color: #8a8a8a; }
.cfh-card-cat { min-width: 0; font-size: 12px; line-height: 1.2; text-transform: uppercase; letter-spacing: .6px; color: #9a9a9a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cfh-card-date { flex-shrink: 0; margin-left: auto; font-size: 12px; color: #8a8a8a; }
@media (max-width: 1100px) { .cfh-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 800px)  { .cfh-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px)  { .cfh-grid { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .cfh-link { transition: none; } .cfh-link:hover { transform: none; } }
/* ==========================================================================
   3. ARTICLE
   ========================================================================== */
.single-container {
    width: 100%;
    max-width: 1020px;
    margin: 40px auto 60px;
    padding: 0 20px;
    box-sizing: border-box;
}

.single-post-title {
    font-size: 38px;
    line-height: 41px;
    color: #333333;
    margin-bottom: 15px;
    font-weight: 700;
    max-width: 70%;
}

.post-meta-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #eaeaea;
    margin-bottom: 30px;
}

.post-meta-info {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 8px;
    color: #666666;
    font-size: 14px;
}

.post-meta-info .meta-sep {
    color: #b5b5b5;
}

.post-meta-info .meta-categories a {
    color: #666666;
    text-decoration: underline;
}

.post-meta-info .meta-categories a:hover {
    color: #000000;
}

.single-main-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.single-left-content {
    width: 70%;
}

.single-featured-image {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 30px;
    border: 1px solid #eaeaea;
}

.single-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.single-featured-image picture {
    display: block;
}

.single-entry-content {
    color: #444444;
    font-size: 16px;
    line-height: 1.75;
    margin-bottom: 48px;
}

/* Titres : le CSS général du thème impose h2 / h3 en !important ; ces règles, plus précises et aussi en !important, l'emportent dans les articles. */
.single-entry-content h2 {
    font-size: 30px !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
    letter-spacing: -0.02em;
    color: #111111;
    margin: 56px 0 18px !important;
}

.single-entry-content h3 {
    font-size: 21px !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    color: #1c1c1c;
    margin: 34px 0 12px !important;
}

.single-entry-content p {
    margin-bottom: 18px;
}

.single-entry-content ul,
.single-entry-content ol {
    margin-bottom: 24px;
}

.single-entry-content li {
    margin-bottom: 8px;
}

@media (max-width: 600px) {
    .single-entry-content h2 {
        font-size: 25px !important;
        margin: 44px 0 14px !important;
    }
    .single-entry-content h3 {
        font-size: 19px !important;
        margin: 28px 0 10px !important;
    }
}

.action-buttons-row {
    display: flex;
    gap: 15px;
    align-items: center;
    margin-bottom: 20px;
    padding-top: 10px;
}

.btn-product {
    width: 100%;
    background-color: #323232;
    color: #ffffff;
    text-align: center;
    padding: 16px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background-color 0.3s ease, transform 0.2s ease;
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    box-sizing: border-box;
}

.btn-product:hover {
    background-color: #323232;
    color: #adff00;
    transform: translateY(-2px);
}

.single-sidebar {
    width: 30%;
    background-color: #f9f9fb;
    border: 1px solid #eaeaea;
    border-radius: 8px;
    padding: 20px;
    box-sizing: border-box;
}

/* bannieres newsletter : sous l'article, et en haut de la barre laterale (les blocs de la barre laterale sont les memes cartes : [cf_newsletter size="card"] et [cf_promo]) */
.cfsd-news-bottom {
    margin-top: 40px;
}

.cfsd-news-side {
    margin-bottom: 16px;
}

@media (max-width: 850px) {
    .single-main-layout {
        flex-direction: column;
    }
    .single-left-content,
    .single-sidebar {
        width: 100%;
    }
    .single-post-title {
        font-size: 26px;
        line-height: 34px;
        max-width: 100%;
    }
    .action-buttons-row {
        flex-direction: column;
    }
    .btn-product {
        width: 100%;
    }
    /* sur mobile la barre laterale passe sous l'article : une seule banniere suffit (celle du bas) */
    .cfsd-news-side {
        display: none;
    }
}
/* ==========================================================================
   4. GUIDES (encadrés, étapes, tableau, FAQ, bloc final) ET CARTES PRODUIT
   ========================================================================== */
.single-entry-content h2[id] { scroll-margin-top: 24px; }
.single-entry-content .cf-guide-summary { background: #f5f5f7; border-left: 4px solid #b9fb00; border-radius: 12px; padding: 20px 24px; margin: 0 0 18px; }
.single-entry-content .cf-guide-summary p { margin: 0; font-size: 16px; line-height: 1.65; color: #222222; }
.single-entry-content .cf-guide-meta { margin: 0 0 26px; font-size: 13px; color: #6e6e73; }
.single-entry-content .cf-toc { background: #ffffff; border: 1px solid #e5e5ea; border-radius: 12px; padding: 18px 24px; margin: 0 0 40px; }
.single-entry-content .cf-toc-title { margin: 0 0 6px; font-size: 15px; font-weight: 700; color: #111111; }
.single-entry-content .cf-toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 32px; }
.single-entry-content .cf-toc li { margin: 0 0 6px; break-inside: avoid; }
.single-entry-content .cf-toc a { color: #222222; text-decoration: none; border-bottom: 1px solid #c9c9cf; }
.single-entry-content .cf-toc a:hover { color: #111111; border-bottom-color: #111111; }
.single-entry-content ol.cf-steps { counter-reset: cfs; list-style: none; margin: 0 0 32px; padding: 0; }
.single-entry-content ol.cf-steps > li { counter-increment: cfs; position: relative; min-height: 30px; margin: 0 0 18px; padding-left: 44px; }
.single-entry-content ol.cf-steps > li::before { content: counter(cfs); position: absolute; left: 0; top: 0; width: 28px; height: 28px; border-radius: 50%; background: #b9fb00; color: #111111; font-size: 14px; font-weight: 700; line-height: 28px; text-align: center; }
.single-entry-content kbd { padding: 1px 6px; border: 1px solid #d9d9de; border-bottom-width: 2px; border-radius: 5px; background: #f1f1f4; font-family: inherit; font-size: 0.9em; color: #222222; white-space: nowrap; }
.single-entry-content code { padding: 1px 5px; border-radius: 5px; background: #f1f1f4; font-size: 0.9em; }
.single-entry-content .cf-guide-tip { margin: 32px 0; padding: 20px 24px; border-radius: 12px; background: #1c1c1c; color: #f5f5f5; }
.single-entry-content .cf-guide-tip p { margin: 0; color: inherit; }
.single-entry-content .cf-guide-tip strong { color: #b9fb00; }
.single-entry-content .cf-guide-note { margin: 28px 0; padding: 18px 22px; border-left: 4px solid #1c1c1c; border-radius: 8px; background: #f5f5f7; }
.single-entry-content .cf-guide-note p { margin: 0; }
.single-entry-content .cf-guide-figure { margin: 28px 0; }
.single-entry-content .cf-guide-figure img { display: block; max-width: 100%; height: auto; border-radius: 12px; }
.single-entry-content .cf-table-wrap { margin: 26px 0 38px; overflow-x: auto; }
.single-entry-content table.cf-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.single-entry-content table.cf-table th { padding: 12px 14px; background: #1c1c1c; color: #f5f5f5; font-weight: 600; text-align: left; }
.single-entry-content table.cf-table td { padding: 12px 14px; border-bottom: 1px solid #e5e5ea; vertical-align: top; }
.single-entry-content table.cf-table td:first-child { font-weight: 700; white-space: nowrap; }
.single-entry-content table.cf-table tbody tr:nth-child(even) { background: #fafafb; }
.single-entry-content .wp-block-rank-math-faq-block { margin: 0 0 10px; }
.single-entry-content .rank-math-faq-item { padding: 20px 0; border-bottom: 1px solid #e5e5ea; }
.single-entry-content .rank-math-question { margin: 0 0 8px !important; font-size: 17px !important; line-height: 1.4 !important; font-weight: 700 !important; color: #111111; }
.single-entry-content .rank-math-answer { font-size: 15.5px; line-height: 1.7; }
.single-entry-content .cf-guide-cta { margin: 56px 0 16px; padding: 34px 32px; border-radius: 18px; background: #0b0b0c; color: #f5f5f5; }
.single-entry-content .cf-guide-cta p { margin: 0 0 12px; color: #f5f5f5; }
.single-entry-content .cf-guide-cta .cf-cta-title { font-size: 20px; font-weight: 700; color: #ffffff; }
.single-entry-content .cf-guide-cta .cf-cta-links { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 0; }
.single-entry-content .cf-guide-cta .cf-cta-links a { display: inline-block; padding: 9px 16px; border: 1px solid #b9fb00; border-radius: 999px; color: #f5f5f5; font-size: 14px; font-weight: 600; text-decoration: none; }
.single-entry-content .cf-guide-cta .cf-cta-links a:hover { background: #b9fb00; color: #111111; }
.single-entry-content .cf-guide-cta p a { color: #b9fb00; }
@media (max-width: 600px) {
    .single-entry-content .cf-toc ol { columns: 1; }
    .single-entry-content .cf-guide-cta { padding: 22px 20px; }
}

/* Cartes « sélection » (articles de type « Best … flyers ») : image carrée cliquable, titre, texte, bouton */
.single-entry-content .cf-picks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 44px 28px; margin: 28px 0 36px; }
.single-entry-content .cf-pick { min-width: 0; margin: 0; }
.single-entry-content .cf-pick-img { position: relative; display: block; box-sizing: border-box; aspect-ratio: 1 / 1; overflow: hidden; padding: 14px; border-radius: 16px; background: #f1f1f4; transition: background-color 0.2s ease; }
.single-entry-content .cf-pick-img:hover { background: #e9e9ee; }
.single-entry-content .cf-pick-img img { display: block; width: 100%; height: 100%; margin: 0; border-radius: 0; object-fit: contain; filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.22)); pointer-events: none; -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none; transition: transform 0.25s ease; }
.single-entry-content .cf-pick-img:hover img { transform: scale(1.03); }
.single-entry-content .cf-pick-body { padding: 16px 2px 0; }
.single-entry-content .cf-pick-body h3 { margin: 0 0 6px !important; font-size: 18px !important; line-height: 1.3 !important; }
.single-entry-content .cf-pick-body h3 a { color: #111111; text-decoration: none; }
.single-entry-content .cf-pick-body h3 a:hover { color: #111111; text-decoration: underline; }
.single-entry-content .cf-pick-meta { margin: 0 0 6px; font-size: 12.5px; font-weight: 600; color: #6e6e73; }
.single-entry-content .cf-pick-body p { margin: 0 0 14px; font-size: 15px; line-height: 1.65; }
.single-entry-content .cf-pick-body .cf-pick-meta { margin: 0 0 6px; font-size: 12.5px; }
.single-entry-content .cf-pick-btn { display: inline-block; padding: 8px 18px; border-radius: 999px; background: #111111; color: #ffffff; font-size: 13.5px; font-weight: 600; text-decoration: none; transition: background-color 0.2s ease, color 0.2s ease; }
.single-entry-content .cf-pick-btn:hover { background: #b9fb00; color: #111111; }
.single-entry-content .cf-pick-missing { grid-column: 1 / -1; margin: 0; padding: 10px 14px; border: 1px dashed #d33838; border-radius: 8px; color: #d33838; font-size: 13px; }
@media (max-width: 560px) {
    .single-entry-content .cf-picks { grid-template-columns: 1fr; }
}

/* ==========================================================================
   FIL D'ARIANE EN HAUT D'UN ARTICLE (fil d'Ariane Rank Math)
   ========================================================================== */
.single-container nav.rank-math-breadcrumb {
    max-width: none;
    margin: 0 !important;
    padding: 0 0 22px !important;
    font-size: 13.5px !important;
}

/* ==========================================================================
   BLOC D'ARTICLES (template-parts/latest-posts.php) : « Latest articles » sur la home, « Keep reading » sous l'article
   ========================================================================== */
.cfh-more {
    width: 100%;
    max-width: 1230px;
    margin: 0 auto 80px;
    padding: 0 20px;
    box-sizing: border-box;
}

.cfh-more-inner {
    border-top: 1px solid #eaeaea;
    padding-top: 40px;
}

.cfh-more .cfh-more-title {
    margin: 0 0 26px !important;
    font-size: 28px !important;
    line-height: 1.25 !important;
    font-weight: 700 !important;
    color: #222222;
}

.cfh-more .cfh-grid {
    gap: 30px;
}

.cfh-more-link {
    margin: 36px 0 0;
    text-align: center;
}

/* Si l'extension « CF Free Download » est désactivée : l'ancienne carte « Unlock Premium Designs » de la barre latérale */
a.ssp-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .65rem;
    box-sizing: border-box;
    max-width: 320px;
    aspect-ratio: 1 / 1;
    padding: 1.5rem 1.25rem;
    text-align: center;
    text-decoration: none;
    border-radius: 14px;
    background-color: #323232;
}
.ssp-title { display: block; font-size: 1.3rem; line-height: 1.15; font-weight: 600; letter-spacing: -.02em; color: #adff00; text-wrap: balance; }
.ssp-text { display: block; font-size: .85rem; line-height: 1.4; color: #f3f3f3; text-wrap: balance; }
.ssp-btn { display: inline-block; margin-top: .35rem; padding: .6rem 1.25rem; border-radius: 980px; font-size: .9rem; font-weight: 600; line-height: 1.2; color: #333333; background: #adff00; }

@media (max-width: 850px) {
    .cfh-more { margin-bottom: 60px; }
    .cfh-more .cfh-more-title { font-size: 24px !important; }
}
