/* Blog detail — alignement design dashboard, typographie longue lecture. */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #ffffff;
    --bg-soft: #f8fafc;
    --border: #e5e7eb;
    --border-hover: #cbd5e1;
    --text: #0f172a;
    --text-muted: #64748b;
    --text-dim: #94a3b8;
    --accent: #000000;
    --accent-hover: #1f1f1f;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow-md: 0 2px 4px rgba(15,23,42,.06), 0 6px 16px rgba(15,23,42,.05);
    --reading-w: 720px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    padding-top: 64px;  /* compense le nav fixed */
}

a { color: inherit; text-decoration: none; }

/* ───────────── Barre de progression lecture ───────────── */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2px;
    width: 0;
    background: var(--accent);
    z-index: 200;
    transition: width .1s linear;
}

/* ───────────── Nav (style home_v2) ───────────── */
.blog-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    background: transparent;
    padding: 12px 16px;
    pointer-events: none;
}
.blog-nav-inner { pointer-events: auto; }
.blog-nav-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 28px;
    display: flex;
    align-items: center;
    gap: 32px;
    background: rgba(255,255,255,.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 999px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}
.blog-logo {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
    color: var(--text);
}
.blog-nav-links { display: flex; gap: 24px; flex: 1; }
.blog-nav-links a {
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    transition: color .15s;
}
.blog-nav-links a:hover,
.blog-nav-links a.is-active { color: var(--text); }
.blog-nav-actions { display: flex; align-items: center; gap: 16px; }
.blog-link-muted { color: var(--text-muted); font-size: 13px; font-weight: 500; }
.blog-link-muted:hover { color: var(--text); }
.blog-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    background: var(--accent);
    color: #fff;
    transition: background .15s;
}
.blog-btn:hover { background: var(--accent-hover); }
@media (max-width: 768px) {
    .blog-nav-links, .blog-nav-actions { display: none; }
}

/* ───────────── Header article ───────────── */
.article-head {
    max-width: var(--reading-w);
    margin: 0 auto;
    padding: 48px 24px 36px;
}
.article-breadcrumb {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 24px;
    transition: color .15s;
}
.article-breadcrumb:hover { color: var(--text); }
.article-breadcrumb svg { width: 12px; height: 12px; }

.article-category {
    display: inline-block;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text);
    background: var(--bg-soft);
    border: 1px solid var(--border);
    padding: 4px 12px;
    border-radius: 4px;
    margin-bottom: 18px;
}
.article-title {
    font-size: clamp(28px, 4.5vw, 44px);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.15;
    color: var(--text);
    margin-bottom: 20px;
}
.article-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-muted);
    flex-wrap: wrap;
}
.article-meta-sep { color: #d1d5db; }
.article-meta-author { font-weight: 600; color: var(--text); }

/* ───────────── Image en-tête ───────────── */
.featured-image-wrap {
    max-width: 960px;
    margin: 0 auto 48px;
    padding: 0 24px;
}
.featured-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    display: block;
}

/* ───────────── Corps de l'article — typographie ───────────── */
.article-wrap {
    max-width: var(--reading-w);
    margin: 0 auto;
    padding: 0 24px 60px;
}

.article-body {
    font-size: 17px;
    line-height: 1.75;
    color: #1f2937;  /* un cran plus chaud que --text pure */
}

/* Espacement vertical des blocs */
.article-body > * + * { margin-top: 1.2em; }

.article-body p {
    margin-bottom: 0;  /* géré par > * + * */
}

.article-body h2 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.25;
    color: var(--text);
    margin-top: 2em;
    margin-bottom: -0.2em;  /* compense > * + * */
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}
.article-body h3 {
    font-size: 21px;
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.3;
    color: var(--text);
    margin-top: 1.6em;
}
.article-body h4 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
    margin-top: 1.4em;
}

.article-body strong { font-weight: 600; color: var(--text); }
.article-body em { font-style: italic; }
.article-body a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: opacity .15s;
}
.article-body a:hover { opacity: .7; }

.article-body ul,
.article-body ol {
    padding-left: 28px;
}
.article-body li { margin-top: 6px; }
.article-body li::marker { color: var(--text-dim); }

.article-body blockquote {
    border-left: 3px solid var(--accent);
    padding: 8px 0 8px 24px;
    color: var(--text);
    font-style: italic;
    font-size: 18px;
    line-height: 1.6;
    background: var(--bg-soft);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: 16px 22px;
}

.article-body code {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 0.88em;
}
.article-body pre {
    background: #0f172a;
    color: #f1f5f9;
    border-radius: var(--radius);
    padding: 18px 22px;
    overflow-x: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 13px;
    line-height: 1.55;
}
.article-body pre code {
    background: none;
    border: none;
    padding: 0;
    color: inherit;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    margin: 1.2em auto;
    display: block;
}
.article-body figure {
    margin: 1.6em 0;
}
.article-body figcaption {
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
    margin-top: 8px;
}

.article-body hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 2.4em 0;
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}
.article-body th,
.article-body td {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}
.article-body th {
    background: var(--bg-soft);
    font-weight: 600;
    color: var(--text);
}

/* ───────────── Tags ───────────── */
.article-tags {
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    font-size: 13px;
    color: var(--text-muted);
}
.article-tag {
    display: inline-block;
    padding: 5px 12px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 12px;
    color: var(--text);
    transition: background .15s, border-color .15s;
}
.article-tag:hover { background: #f1f5f9; border-color: var(--border-hover); }

/* ───────────── Related ───────────── */
.related-section {
    background: var(--bg-soft);
    border-top: 1px solid var(--border);
    padding: 56px 24px 80px;
}
.related-inner {
    max-width: 1200px;
    margin: 0 auto;
}
.related-title {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.015em;
    margin-bottom: 24px;
    color: var(--text);
}
.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
@media (max-width: 920px) { .related-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .related-grid { grid-template-columns: 1fr; } }

.related-card {
    display: flex;
    flex-direction: column;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: transform .15s, border-color .15s, box-shadow .15s;
}
.related-card:hover {
    transform: translateY(-2px);
    border-color: var(--border-hover);
    box-shadow: var(--shadow-md);
}
.related-card-img-wrap {
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, #f1f5f9, #e2e8f0);
    overflow: hidden;
}
.related-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.related-card-placeholder {
    width: 100%; height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-dim);
}
.related-card-placeholder svg { width: 32px; height: 32px; opacity: .5; }
.related-card-body {
    padding: 16px 18px 20px;
}
.related-card-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    color: var(--text);
    margin-bottom: 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.related-card-excerpt {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
