/* ==========================================================================
   Blog CSS — Odilon Hugonnot
   Cohérent avec le CV : Montserrat / Lato, #3aaa64, #778492, #dae3e7
   ========================================================================== */

/* --------------------------------------------------------------------------
   Base & sticky footer
   -------------------------------------------------------------------------- */

body {
    background-color: #dae3e7;
    font-family: 'Lato', sans-serif;
    color: #434343;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container.sections-wrapper {
    flex: 1;
}

/* --------------------------------------------------------------------------
   Nav
   -------------------------------------------------------------------------- */

/* Le .header de styles.css fournit déjà bg #f5f5f5 + border-top 10px #778492 */

.blog-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 0;
}

.blog-nav-brand {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 17px;
    color: #49515a;
    text-decoration: none;
    letter-spacing: -0.3px;
    transition: color 0.2s;
}

.blog-nav-brand:hover,
.blog-nav-brand:focus {
    color: #3aaa64;
    text-decoration: none;
}

.blog-nav-links {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.blog-nav-links li a {
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    color: #778492;
    text-decoration: none;
    padding: 5px 12px;
    border-radius: 4px;
    transition: color 0.2s, background-color 0.2s;
}

.blog-nav-links li a:hover {
    color: #3aaa64;
    background-color: rgba(58, 170, 100, 0.06);
    text-decoration: none;
}

.blog-nav-links li a .fa {
    margin-right: 4px;
    font-size: 12px;
}

/* --------------------------------------------------------------------------
   Breadcrumb
   -------------------------------------------------------------------------- */

.blog-breadcrumb-bar {
    background-color: #cfd8dc;
    border-bottom: 1px solid #bbc5ca;
    padding: 7px 0;
}

.blog-breadcrumb-bar .breadcrumb {
    background: transparent;
    padding: 0;
    margin: 0;
    border-radius: 0;
    font-size: 12px;
    color: #778492;
}

.blog-breadcrumb-bar .breadcrumb > li + li::before {
    content: "›";
    color: #aab5bc;
    padding: 0 7px;
    font-size: 14px;
    line-height: 1;
}

.blog-breadcrumb-bar .breadcrumb a {
    color: #778492;
    text-decoration: none;
}

.blog-breadcrumb-bar .breadcrumb a:hover {
    color: #3aaa64;
}

.blog-breadcrumb-bar .breadcrumb > .active {
    color: #545e69;
    font-weight: 600;
    /* Tronquer si trop long */
    max-width: 400px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
    vertical-align: bottom;
}

/* --------------------------------------------------------------------------
   Page listing — en-tête
   -------------------------------------------------------------------------- */

.blog-listing-section {
    padding: 8px 0 12px;
}

.blog-listing-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 30px;
    color: #49515a;
    margin: 0 0 4px;
    letter-spacing: -0.5px;
    /* Soulignement vert discret */
    display: inline-block;
    border-bottom: 3px solid #3aaa64;
    padding-bottom: 4px;
}

.blog-listing-subtitle {
    color: #8e99a4;
    font-size: 15px;
    margin: 10px 0 28px;
}

/* --------------------------------------------------------------------------
   Recherche
   -------------------------------------------------------------------------- */

.blog-search-bar {
    position: relative;
    margin-bottom: 20px;
}

.blog-search-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #b0b8bf;
    font-size: 14px;
    pointer-events: none;
    transition: color 0.2s;
}

.blog-search-input {
    width: 100%;
    padding: 11px 16px 11px 40px;
    border: 1.5px solid #d0d8de;
    border-radius: 8px;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    color: #434343;
    background-color: #fafcfd;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    box-sizing: border-box;
}

.blog-search-input:focus {
    border-color: #3aaa64;
    box-shadow: 0 0 0 3px rgba(58, 170, 100, 0.1);
    background-color: #fff;
}

.blog-search-bar:focus-within .blog-search-icon {
    color: #3aaa64;
}

/* --------------------------------------------------------------------------
   Filtres catégories
   -------------------------------------------------------------------------- */

.blog-category-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 28px;
}

.btn-category {
    display: inline-block;
    padding: 5px 14px;
    border-radius: 20px;
    font-family: 'Lato', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #778492;
    background-color: transparent;
    border: 1.5px solid #c8d0d6;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.18s ease;
    line-height: 1.5;
}

.btn-category:hover {
    border-color: #3aaa64;
    color: #3aaa64;
    background-color: rgba(58, 170, 100, 0.05);
}

.btn-category.active {
    background-color: #3aaa64;
    color: #fff;
    border-color: #3aaa64;
    box-shadow: 0 2px 6px rgba(58, 170, 100, 0.3);
}

.btn-category:focus {
    outline: none;
}

/* --------------------------------------------------------------------------
   Cards articles
   -------------------------------------------------------------------------- */

.blog-card {
    padding: 22px 0;
    border-bottom: 1px solid #e8edf0;
    position: relative;
    /* Barre verte à gauche, cachée par défaut */
    padding-left: 0;
    border-left: 3px solid transparent;
    margin-left: -3px;
    transition: border-left-color 0.2s ease, padding-left 0.2s ease;
}

.blog-card:last-child {
    border-bottom: none;
}

.blog-card:hover {
    border-left-color: #3aaa64;
    padding-left: 16px;
}

/* Méta : badge + date */
.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}

.blog-category-badge {
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    background-color: #3aaa64;
    color: #fff;
    padding: 3px 9px;
    border-radius: 10px;
}

.blog-date {
    color: #a0acb5;
    font-size: 13px;
}

/* Titre */
.blog-card-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 19px;
    line-height: 1.35;
    margin: 0 0 9px;
    color: #49515a;
}

.blog-card-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.18s;
}

.blog-card-title a:hover {
    color: #3aaa64;
}

/* Extrait */
.blog-card-excerpt {
    color: #6b7785;
    font-size: 14px;
    line-height: 1.65;
    margin: 0 0 12px;
}

/* Footer card : tags + lien */
.blog-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 4px;
}

.blog-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.blog-tag,
.article-tags .tag {
    display: inline-block;
    background-color: #edf0f2;
    color: #778492;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    font-family: 'Lato', sans-serif;
    transition: background-color 0.15s, color 0.15s;
}

.blog-tag:hover,
.article-tags .tag:hover {
    background-color: #3aaa64;
    color: #fff;
}

.blog-card-read {
    font-family: 'Montserrat', sans-serif;
    font-size: 12px;
    font-weight: 700;
    color: #3aaa64;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: 0.2px;
    transition: gap 0.15s;
}

.blog-card-read:hover {
    color: #2d8a50;
    text-decoration: none;
}

.blog-card-read span {
    display: inline-block;
    transition: transform 0.18s;
}

.blog-card-read:hover span {
    transform: translateX(3px);
}

/* No results */
.blog-no-results {
    text-align: center;
    color: #9aa5ae;
    padding: 50px 0;
    font-size: 15px;
}

/* Evite que section-inner coupe les blocs de code */
.section .section-inner {
    overflow: visible;
}

/* --------------------------------------------------------------------------
   Article
   -------------------------------------------------------------------------- */

.blog-article {
    padding: 0;
}

.blog-article h1 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 26px;
    color: #49515a;
    line-height: 1.3;
    margin: 0 0 16px;
    letter-spacing: -0.4px;
}

/* Ligne verte sous le titre */
.blog-article h1::after {
    content: '';
    display: block;
    width: 48px;
    height: 3px;
    background-color: #3aaa64;
    margin-top: 12px;
    border-radius: 2px;
}

.article-meta {
    color: #9aa5ae;
    font-size: 13px;
    margin-bottom: 14px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.article-meta .fa {
    color: #c5cdd3;
    margin-right: 3px;
}

.meta-separator {
    color: #d0d8de;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 28px;
    padding-bottom: 24px;
    border-bottom: 1px solid #eaeef1;
}

/* --------------------------------------------------------------------------
   Contenu article
   -------------------------------------------------------------------------- */

.article-content {
    line-height: 1.8;
    color: #3f4a54;
    font-size: 15px;
}

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

.article-content h2 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 20px;
    color: #49515a;
    margin-top: 38px;
    margin-bottom: 14px;
    padding-bottom: 9px;
    border-bottom: 2px solid #e8edf0;
    position: relative;
}

/* Petit trait vert à gauche des h2 */
.article-content h2::before {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 36px;
    height: 2px;
    background-color: #3aaa64;
}

.article-content h3 {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 17px;
    color: #5d6b77;
    margin-top: 26px;
    margin-bottom: 10px;
}

.article-content a {
    color: #3aaa64;
    text-decoration: none;
    border-bottom: 1px solid rgba(58, 170, 100, 0.3);
    transition: border-color 0.15s;
}

.article-content a:hover {
    color: #2d8a50;
    border-bottom-color: #2d8a50;
    text-decoration: none;
}

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 22px 0;
    display: block;
    box-shadow: 0 2px 12px rgba(0,0,0,0.08);
}

.article-content blockquote {
    border-left: 3px solid #3aaa64;
    padding: 12px 20px;
    margin: 22px 0;
    background-color: #f4f8f6;
    border-radius: 0 6px 6px 0;
    color: #5a6a74;
    font-style: italic;
}

.article-content blockquote p:last-child {
    margin-bottom: 0;
}

.article-content ul,
.article-content ol {
    padding-left: 22px;
    margin-bottom: 18px;
}

.article-content li {
    margin-bottom: 7px;
    line-height: 1.7;
}

.article-content ul li {
    list-style-type: disc;
}

.article-content ol li {
    list-style-type: decimal;
}

/* Inline code */
.article-content code:not([class]) {
    background-color: #f0f3f5;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: #c0392b;
    font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', monospace;
    border: 1px solid #e2e8ec;
}

/* --------------------------------------------------------------------------
   Blocs de code (Prism.js)
   -------------------------------------------------------------------------- */

/* Blocs de code Prism.js */
pre[class*="language-"] {
    border-radius: 6px !important;
    padding: 16px 18px !important;
    margin: 20px 0 !important;
    font-size: 13px !important;
    line-height: 1.6 !important;
    overflow-x: auto !important;
    max-height: 480px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    position: relative;
    max-width: 100%;
    box-sizing: border-box;
    /* Label discret dans le coin haut-droit */
}

/* Label du langage — position absolute dans le coin */
pre[class*="language-"]::after {
    position: absolute;
    top: 8px;
    right: 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: #5a7080;
    content: 'code';
    pointer-events: none;
}

/* Labels par langage */
pre.language-go::after         { content: 'Go'; }
pre.language-php::after        { content: 'PHP'; }
pre.language-javascript::after,
pre.language-js::after         { content: 'JS'; }
pre.language-typescript::after,
pre.language-ts::after         { content: 'TS'; }
pre.language-python::after     { content: 'Python'; }
pre.language-bash::after,
pre.language-shell::after      { content: 'Bash'; }
pre.language-sql::after        { content: 'SQL'; }
pre.language-json::after       { content: 'JSON'; }
pre.language-yaml::after       { content: 'YAML'; }
pre.language-css::after        { content: 'CSS'; }
pre.language-html::after       { content: 'HTML'; }
pre.language-apacheconf::after { content: 'Apache'; }
pre.language-dockerfile::after { content: 'Docker'; }
pre.language-text::after       { content: ''; }

code[class*="language-"] {
    font-size: 13px;
    font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', monospace !important;
    white-space: pre;
    word-break: normal;
    word-wrap: normal;
}

/* Fallback sans Prism */
pre:not([class*="language-"]) {
    background-color: #1e2d38;
    color: #cdd3d8;
    border-radius: 6px;
    padding: 16px 18px;
    margin: 20px 0;
    font-size: 13px;
    overflow-x: auto;
    max-width: 100%;
    box-sizing: border-box;
    font-family: 'SFMono-Regular', 'Consolas', 'Liberation Mono', monospace;
    line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Articles similaires
   -------------------------------------------------------------------------- */

.related-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-posts-list li {
    padding: 10px 0;
    border-bottom: 1px solid #eaeef1;
}

.related-posts-list li:last-child {
    border-bottom: none;
}

.related-posts-list li a {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #778492;
    text-decoration: none;
    transition: color 0.18s;
}

.related-posts-list li a:hover {
    color: #3aaa64;
}

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

@media (max-width: 767px) {
    .blog-listing-section .section-inner {
        padding: 24px 20px 28px;
    }

    .blog-listing-title {
        font-size: 24px;
    }

    .blog-card:hover {
        padding-left: 12px;
    }

    .blog-card-title {
        font-size: 17px;
    }

    .blog-card-footer {
        flex-direction: column;
        align-items: flex-start;
    }

    .blog-article h1 {
        font-size: 21px;
    }

    .article-content h2 {
        font-size: 18px;
    }

    .article-content h3 {
        font-size: 16px;
    }

    pre[class*="language-"] {
        font-size: 12.5px !important;
        padding: 14px !important;
    }

    pre[class*="language-"]::before {
        left: -14px;
        width: calc(100% + 28px);
        top: -14px;
    }

    .comment-header {
        flex-direction: column;
        gap: 2px;
    }
}

/* --------------------------------------------------------------------------
   Commentaires
   -------------------------------------------------------------------------- */

.blog-comments {
    margin-bottom: 30px;
}

.comment-item {
    border-left: 3px solid #e8edf0;
    padding: 12px 0 12px 16px;
    margin-bottom: 16px;
}

.comment-item:last-child {
    margin-bottom: 0;
}

.comment-header {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 6px;
}

.comment-author {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: #49515a;
}

.comment-date {
    font-size: 12px;
    color: #9aa5ae;
}

.comment-body {
    font-size: 14px;
    line-height: 1.7;
    color: #3f4a54;
}

/* Comment form */
.comment-form {
    margin-top: 24px;
}

.comment-form label {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #5d6b77;
    margin-bottom: 5px;
    display: block;
}

.comment-form input[type="text"],
.comment-form textarea {
    width: 100%;
    padding: 11px 16px;
    border: 1.5px solid #d0d8de;
    border-radius: 8px;
    font-family: 'Lato', sans-serif;
    font-size: 14px;
    color: #434343;
    background-color: #fafcfd;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
    box-sizing: border-box;
    margin-bottom: 14px;
}

.comment-form input[type="text"]:focus,
.comment-form textarea:focus {
    border-color: #3aaa64;
    box-shadow: 0 0 0 3px rgba(58, 170, 100, 0.1);
    background-color: #fff;
}

.comment-form textarea {
    resize: vertical;
    min-height: 100px;
}

.comment-form .btn-cta-primary {
    background-color: #3aaa64;
    color: #fff;
    border: none;
    padding: 10px 28px;
    border-radius: 8px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
}

.comment-form .btn-cta-primary:hover {
    background-color: #2d8a50;
}

/* Honeypot */
.hp-field {
    display: none !important;
}

/* Flash messages */
.comment-success {
    background-color: #eaf7ef;
    color: #2d8a50;
    border: 1px solid #b8e6c8;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
}

.comment-error {
    background-color: #fdf0f0;
    color: #c0392b;
    border: 1px solid #f0c4c1;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
}

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */

#blog-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 28px 0 8px;
}

.btn-page {
    font-family: 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 700;
    color: #3aaa64;
    background: #fff;
    border: 1.5px solid #c8d0d6;
    border-radius: 6px;
    padding: 8px 18px;
    cursor: pointer;
    transition: all 0.18s ease;
    text-decoration: none;
}

.btn-page:hover:not(:disabled) {
    border-color: #3aaa64;
    background-color: rgba(58, 170, 100, 0.05);
}

.btn-page:disabled {
    color: #b0b8bf;
    cursor: default;
    opacity: 0.5;
}

.page-info {
    font-family: 'Lato', sans-serif;
    font-size: 13px;
    color: #778492;
    white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Tableaux dans les articles
   -------------------------------------------------------------------------- */

.article-content .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 24px 0;
    border-radius: 6px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}

.article-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    background-color: #fff;
}

.article-content table thead {
    background-color: #49515a;
    color: #fff;
}

.article-content table thead th {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 12px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 12px 16px;
    text-align: left;
    white-space: nowrap;
}

.article-content table tbody td {
    padding: 11px 16px;
    border-bottom: 1px solid #eaeef1;
    color: #3f4a54;
    line-height: 1.6;
    vertical-align: top;
}

.article-content table tbody tr:last-child td {
    border-bottom: none;
}

.article-content table tbody tr:hover td {
    background-color: #f7f9fb;
}

/* Première colonne en semi-gras */
.article-content table tbody td:first-child {
    font-weight: 600;
    color: #49515a;
    white-space: nowrap;
}

/* Trait vert sur la gauche au hover */
.article-content table tbody tr {
    border-left: 3px solid transparent;
    transition: border-left-color 0.15s;
}

.article-content table tbody tr:hover {
    border-left-color: #3aaa64;
}

@media (max-width: 991px) {
    .blog-article h1 {
        font-size: 23px;
    }
}

@media (max-width: 767px) {
    .article-content table thead th,
    .article-content table tbody td {
        padding: 9px 12px;
        font-size: 13px;
    }
}
