/* =========================================================
   INTELICONNECT AFRICA — BLOG
   Feuille de style dédiée au blog (préfixe .blog-)
   À inclure APRÈS css/styles.css sur toutes les pages du blog :
   <link href="css/styles.css" rel="stylesheet" />
   <link href="css/blog.css" rel="stylesheet" />
   ========================================================= */

:root {
    --blog-navy: #102a56;
    --blog-navy-deep: #0b1d3d;
    --blog-blue: #1557b0;
    --blog-blue-light: #2878e8;
    --blog-gold: #b8860b;
    --blog-bg: #f5f8fc;
    --blog-text: #344056;
    --blog-muted: #667085;

    /* Couleurs des catégories (fond clair + texte foncé) */
    --cat-formation-bg: #e5edfb;   --cat-formation-fg: #1557b0;
    --cat-certification-bg: #faf1d9; --cat-certification-fg: #8a5a00;
    --cat-agriculture-bg: #e6f4e6; --cat-agriculture-fg: #2f7d32;
    --cat-climat-bg: #e0f6fb;      --cat-climat-fg: #0e7c95;
    --cat-sante-bg: #fbe6ec;       --cat-sante-fg: #b1275a;
    --cat-environnement-bg: #e1f3ee; --cat-environnement-fg: #157a6e;
    --cat-business-bg: #eee8f7;    --cat-business-fg: #5b3d94;
}

.blog-body {
    background: var(--blog-bg);
}

/* ---------- EN-TÊTE DE PAGE (listing + article) ---------- */

.blog-hero {
    padding: 150px 20px 70px;
    text-align: center;
    background: linear-gradient(160deg, #0c1f3f 0%, #102a56 55%, #081428 100%);
}

.blog-hero-badge {
    display: inline-block;
    padding: 8px 20px;
    margin-bottom: 20px;
    border-radius: 50px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(143,184,255,0.5);
    color: #eaf1ff;
    font-size: 12.5px;
    font-weight: 800;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.blog-hero h1 {
    margin: 0 0 16px;
    color: #ffffff;
    font-size: clamp(28px, 4.2vw, 44px);
    font-weight: 800;
}

.blog-hero p {
    max-width: 700px;
    margin: 0 auto;
    color: #c6d6f5;
    font-size: 16.5px;
    line-height: 1.8;
}

/* ---------- FILTRES DE CATÉGORIE ---------- */

.blog-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: -30px auto 50px;
    max-width: 1000px;
    padding: 0 20px;
}

.blog-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 50px;
    background: #ffffff;
    border: 1px solid #e5eaf0;
    color: var(--blog-text);
    font-size: 13.5px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 3px 10px rgba(16,42,86,0.05);
}

.blog-filter-btn:hover {
    border-color: var(--blog-blue-light);
    color: var(--blog-blue-light);
}

.blog-filter-btn.active {
    background: var(--blog-navy);
    border-color: var(--blog-navy);
    color: #ffffff;
}

/* ---------- GRILLE D'ARTICLES (listing) ---------- */

.blog-grid-section {
    padding: 10px 20px 80px;
}

.blog-grid {
    max-width: 1200px;
    margin: 0 auto;
}

.blog-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #ffffff;
    border: 1px solid #e5eaf0;
    border-radius: 18px;
    overflow: hidden;
    text-decoration: none !important;
    color: inherit !important;
    box-shadow: 0 8px 22px rgba(16, 42, 86, 0.06);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.blog-card:hover {
    transform: translateY(-8px);
    border-color: var(--blog-blue-light);
    box-shadow: 0 18px 36px rgba(16, 42, 86, 0.14);
}

/* Emplacement image à la une (ratio 16:9) */
.blog-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background:
        repeating-linear-gradient(45deg, rgba(255,255,255,0.035) 0 12px, transparent 12px 24px),
        linear-gradient(160deg, #16305e 0%, #0c1f3f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 6px;
    color: #8fb8ff;
}

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

.blog-card-image svg {
    width: 36px;
    height: 36px;
    opacity: 0.85;
}

.blog-card-image span {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.4px;
    opacity: 0.85;
}

.blog-cat-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 13px;
    border-radius: 50px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.blog-cat-formation      { background: var(--cat-formation-bg);      color: var(--cat-formation-fg); }
.blog-cat-certification  { background: var(--cat-certification-bg); color: var(--cat-certification-fg); }
.blog-cat-agriculture    { background: var(--cat-agriculture-bg);   color: var(--cat-agriculture-fg); }
.blog-cat-climat         { background: var(--cat-climat-bg);        color: var(--cat-climat-fg); }
.blog-cat-sante          { background: var(--cat-sante-bg);         color: var(--cat-sante-fg); }
.blog-cat-environnement  { background: var(--cat-environnement-bg); color: var(--cat-environnement-fg); }
.blog-cat-business       { background: var(--cat-business-bg);      color: var(--cat-business-fg); }

.blog-card-body {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    padding: 24px 22px 22px;
}

.blog-card-body h3 {
    margin: 0 0 12px;
    color: var(--blog-navy);
    font-size: 19px;
    font-weight: 800;
    line-height: 1.35;
}

.blog-card-body p {
    margin: 0 0 18px;
    color: var(--blog-muted);
    font-size: 14px;
    line-height: 1.7;
    flex-grow: 1;
}

.blog-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
    margin-bottom: 14px;
    padding-bottom: 14px;
    border-bottom: 1px solid #eef1f6;
    color: #90a0b7;
    font-size: 12.5px;
    font-weight: 600;
}

.blog-meta span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.blog-card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    color: var(--blog-blue);
    font-size: 13.5px;
    font-weight: 800;
}

.blog-card:hover .blog-card-link {
    color: var(--blog-navy);
}

/* ---------- HERO D'ARTICLE (page article individuelle) ---------- */

.blog-article-hero {
    position: relative;
    padding: 190px 20px 90px;
    text-align: center;
    background:
        linear-gradient(160deg, rgba(8,20,40,0.88) 0%, rgba(16,42,86,0.86) 55%, rgba(8,20,40,0.92) 100%),
        repeating-linear-gradient(45deg, rgba(255,255,255,0.02) 0 14px, transparent 14px 28px);
    background-color: #0c1f3f;
}

.blog-article-hero .blog-cat-badge {
    position: static;
    display: inline-flex;
    margin-bottom: 18px;
}

.blog-article-hero h1 {
    max-width: 820px;
    margin: 0 auto 22px;
    color: #ffffff;
    font-size: clamp(26px, 4vw, 42px);
    font-weight: 800;
    line-height: 1.3;
}

.blog-article-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 22px;
    color: #c6d6f5;
    font-size: 14px;
    font-weight: 600;
}

.blog-article-meta span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.blog-article-meta i { color: var(--blog-gold); }

/* Emplacement image à la une pleine largeur, sous le hero */
.blog-featured-image {
    max-width: 980px;
    margin: -50px auto 0;
    padding: 0 20px;
    position: relative;
    z-index: 3;
}

.blog-featured-image-inner {
    width: 100%;
    aspect-ratio: 16 / 8;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 22px 50px rgba(8, 20, 40, 0.28);
    background:
        repeating-linear-gradient(45deg, rgba(255,255,255,0.04) 0 12px, transparent 12px 24px),
        linear-gradient(160deg, #16305e 0%, #0c1f3f 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    color: #8fb8ff;
}

.blog-featured-image-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-featured-image-inner svg {
    width: 48px;
    height: 48px;
    opacity: 0.85;
}

.blog-featured-image-inner span {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.4px;
    opacity: 0.85;
}

/* ---------- CORPS D'ARTICLE ---------- */

.blog-article-section {
    padding: 60px 20px 30px;
}

.blog-article-wrap {
    max-width: 780px;
    margin: 0 auto;
}

.blog-back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 30px;
    color: var(--blog-blue);
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
}

.blog-back-link:hover { color: var(--blog-navy); }

/* Barre de partage */
.blog-share-bar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 40px;
    padding-bottom: 28px;
    border-bottom: 1px solid #e5eaf0;
}

.blog-share-label {
    font-size: 13px;
    font-weight: 800;
    color: var(--blog-muted);
    letter-spacing: 0.4px;
    text-transform: uppercase;
    margin-right: 4px;
}

.blog-share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    text-decoration: none !important;
    color: #ffffff !important;
    font-size: 16px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blog-share-btn:hover {
    transform: translateY(-3px);
}

.blog-share-whatsapp { background: #25D366; box-shadow: 0 6px 16px rgba(37,211,102,0.35); }
.blog-share-facebook { background: #1877F2; box-shadow: 0 6px 16px rgba(24,119,242,0.35); }

/* Typographie de l'article */
.blog-content {
    color: var(--blog-text);
    font-size: 17px;
    line-height: 1.9;
}

.blog-content p { margin: 0 0 22px; }

.blog-content h2 {
    margin: 42px 0 18px;
    color: var(--blog-navy);
    font-size: 25px;
    font-weight: 800;
    line-height: 1.35;
}

.blog-content h2:first-child { margin-top: 0; }

.blog-content ul, .blog-content ol {
    margin: 0 0 24px;
    padding-left: 22px;
}

.blog-content li {
    margin-bottom: 10px;
    line-height: 1.8;
}

.blog-content blockquote {
    margin: 32px 0;
    padding: 22px 26px;
    border-left: 4px solid var(--blog-gold);
    background: #faf6ea;
    border-radius: 8px;
    color: var(--blog-navy);
    font-size: 17.5px;
    font-style: italic;
    font-weight: 600;
    line-height: 1.7;
}

.blog-content strong { color: var(--blog-navy); }

/* Bloc "call to action" interne à l'article */
.blog-inline-cta {
    margin: 36px 0;
    padding: 26px 28px;
    border-radius: 16px;
    background: linear-gradient(135deg, #eaf1ff 0%, #f5f8fc 100%);
    border: 1px solid #dce8fb;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.blog-inline-cta p {
    margin: 0;
    color: var(--blog-navy);
    font-weight: 700;
    font-size: 15.5px;
    flex: 1 1 260px;
}

.blog-inline-cta a {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 50px;
    background: var(--blog-navy);
    color: #ffffff !important;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none !important;
    white-space: nowrap;
    transition: background 0.2s ease, transform 0.2s ease;
}

.blog-inline-cta a:hover {
    background: var(--blog-blue-light);
    transform: translateX(3px);
}

/* Bloc auteur */
.blog-author-box {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 50px 0 20px;
    padding: 26px;
    border-radius: 18px;
    background: #ffffff;
    border: 1px solid #e5eaf0;
}

.blog-author-avatar {
    flex: 0 0 auto;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--blog-navy);
    color: #ffc94d;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Georgia, serif;
    font-weight: 700;
    font-size: 22px;
}

.blog-author-info h4 {
    margin: 0 0 4px;
    color: var(--blog-navy);
    font-size: 16.5px;
    font-weight: 800;
}

.blog-author-info p {
    margin: 0;
    color: var(--blog-muted);
    font-size: 13.5px;
    line-height: 1.6;
}

/* Partage bas de page */
.blog-share-bar-bottom {
    justify-content: center;
    border-top: 1px solid #e5eaf0;
    border-bottom: none;
    padding-top: 28px;
    padding-bottom: 0;
    margin-top: 10px;
    margin-bottom: 50px;
}

/* ---------- ARTICLES SIMILAIRES ---------- */

.blog-related-section {
    padding: 20px 20px 80px;
}

.blog-related-wrap {
    max-width: 1000px;
    margin: 0 auto;
}

.blog-related-wrap h3 {
    text-align: center;
    color: var(--blog-navy);
    font-size: 24px;
    font-weight: 800;
    margin-bottom: 34px;
}

/* ---------- SECTION WHATSAPP (partagée listing + article) ---------- */

.blog-whatsapp-section {
    padding: 10px 20px 90px;
}

.blog-whatsapp-box {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 36px;
    padding: 46px 42px;
    border-radius: 26px;
    background: linear-gradient(135deg, #0d3b28 0%, #10502f 100%);
    box-shadow: 0 18px 40px rgba(16, 80, 47, 0.22);
}

.blog-whatsapp-icon {
    flex: 0 0 auto;
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: #25D366;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 34px;
    color: #ffffff;
}

.blog-whatsapp-text { flex: 1 1 380px; }

.blog-whatsapp-text h2 {
    margin: 0 0 10px;
    color: #ffffff;
    font-size: clamp(21px, 2.6vw, 28px);
    font-weight: 800;
}

.blog-whatsapp-text p {
    margin: 0;
    color: #cdeedd;
    font-size: 15px;
    line-height: 1.75;
}

.blog-whatsapp-text p strong { color: #ffffff; }

.blog-whatsapp-cta {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 28px;
    border-radius: 50px;
    background: #25D366;
    color: #073a20 !important;
    font-size: 15px;
    font-weight: 800;
    text-decoration: none !important;
    box-shadow: 0 10px 22px rgba(37, 211, 102, 0.35);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
}

.blog-whatsapp-cta:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 28px rgba(37, 211, 102, 0.45);
}

@media (max-width: 600px) {
    .blog-whatsapp-box { padding: 34px 26px; text-align: center; justify-content: center; }
    .blog-whatsapp-cta { width: 100%; justify-content: center; }
}

/* ---------- BOUTON RETOUR EN HAUT ---------- */

.blog-to-top {
    position: fixed;
    bottom: 26px;
    right: 26px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--blog-navy);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    box-shadow: 0 8px 20px rgba(16, 42, 86, 0.35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease, background 0.25s ease;
    z-index: 1000;
    border: none;
    cursor: pointer;
    font-size: 18px;
}

.blog-to-top.blog-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.blog-to-top:hover { background: var(--blog-blue-light); }

/* ---------- RESPONSIVE ---------- */

@media (max-width: 991px) {
    .blog-hero { padding: 130px 20px 55px; }
    .blog-article-hero { padding: 150px 20px 70px; }
}

@media (max-width: 575px) {
    .blog-hero { padding: 115px 16px 45px; }
    .blog-hero p { font-size: 15px; }
    .blog-article-hero { padding: 130px 16px 60px; }
    .blog-article-meta { gap: 12px 18px; font-size: 13px; }
    .blog-featured-image { margin-top: -34px; }
    .blog-content { font-size: 16px; }
    .blog-content h2 { font-size: 21px; }
    .blog-author-box { flex-direction: column; text-align: center; }
    .blog-inline-cta { flex-direction: column; align-items: flex-start; }
    .blog-inline-cta a { width: 100%; justify-content: center; }
}
