/**
 * Blocs ContentForge — rendu front.
 * Chargé uniquement sur les articles contenant des blocs .cf-block.
 * Faire évoluer la charte ici ne demande pas de retoucher les articles publiés.
 */

.cf-block {
    --cf-navy: #0B1F3D;
    --cf-cyan: #22D3EE;
    --cf-ink: #1a2433;
    --cf-muted: #5b6b7f;
    --cf-surface: #f5f8fb;
    --cf-border: #dbe4ee;

    margin: 2rem 0;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--cf-ink);
}

@media (prefers-color-scheme: dark) {
    .cf-block {
        --cf-ink: #e7eef7;
        --cf-muted: #a3b3c6;
        --cf-surface: #101a28;
        --cf-border: #24344a;
    }
}

.cf-block a {
    color: var(--cf-navy);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.cf-block a:hover {
    color: var(--cf-cyan);
}

@media (prefers-color-scheme: dark) {
    .cf-block a { color: var(--cf-cyan); }
}

.cf-block p:last-child,
.cf-block ul:last-child { margin-bottom: 0; }

/* Étiquettes de section — communes à tous les encadrés */
.cf-tldr-label,
.cf-methodology-label,
.cf-sources-label,
.cf-internal-links-label,
.cf-related-label,
.cf-callout-title {
    margin: 0 0 .5rem;
    font-size: .75rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--cf-muted);
}

/* ---------------------------------------------------------------- TL;DR */

.cf-tldr {
    padding: 1.25rem 1.5rem;
    background: var(--cf-navy);
    border-left: 4px solid var(--cf-cyan);
    border-radius: 6px;
    color: #fff;
}

.cf-tldr .cf-tldr-label { color: var(--cf-cyan); }

.cf-tldr-text {
    margin: 0;
    font-size: 1.0625rem;
    font-weight: 500;
}

/* -------------------------------------------------------- Méthodologie */

.cf-methodology {
    padding: 1.25rem 1.5rem;
    background: var(--cf-surface);
    border: 1px solid var(--cf-border);
    border-radius: 6px;
}

/* -------------------------------------------------------------- Vidéo */

.cf-video {
    position: relative;
    aspect-ratio: 16 / 9;
    border-radius: 6px;
    overflow: hidden;
}

.cf-video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* -------------------------------------------------- Tableau comparatif */

.cf-comparison {
    overflow-x: auto;
}

.cf-comparison table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9375rem;
}

.cf-comparison th,
.cf-comparison td {
    padding: .75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--cf-border);
}

.cf-comparison th {
    background: var(--cf-navy);
    color: #fff;
    font-weight: 600;
    white-space: nowrap;
}

.cf-comparison tbody tr:nth-child(even) { background: var(--cf-surface); }

/* ------------------------------------------------------------ Encadrés */

.cf-callout {
    padding: 1rem 1.25rem;
    background: var(--cf-surface);
    border-left: 4px solid var(--cf-cyan);
    border-radius: 6px;
}

.cf-callout p:last-child { margin: 0; }
.cf-callout-warning { border-left-color: #e0603a; }
.cf-callout-tip     { border-left-color: #2fa36b; }

/* ------------------------------------------- Sources / liens / auteur */

.cf-sources,
.cf-internal-links,
.cf-related {
    padding: 1.25rem 1.5rem;
    background: var(--cf-surface);
    border: 1px solid var(--cf-border);
    border-radius: 6px;
}

.cf-sources ul,
.cf-internal-links ul,
.cf-related ul {
    margin: 0;
    padding-left: 1.15rem;
}

.cf-sources li,
.cf-internal-links li,
.cf-related li { margin: .35rem 0; }

.cf-author {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    padding: 1.5rem;
    background: var(--cf-surface);
    border-top: 3px solid var(--cf-cyan);
    border-radius: 6px;
}

.cf-author-avatar {
    flex: 0 0 auto;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
}

.cf-author-body { flex: 1 1 auto; min-width: 0; }

.cf-author-name {
    margin: 0 0 .25rem;
    font-size: 1.0625rem;
    font-weight: 700;
    color: var(--cf-navy);
}

@media (prefers-color-scheme: dark) {
    .cf-author-name { color: var(--cf-cyan); }
}

.cf-author-bio {
    margin: 0 0 .5rem;
    font-size: .9375rem;
    color: var(--cf-muted);
}

.cf-author-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 0;
    font-size: .875rem;
}

@media (max-width: 600px) {
    .cf-tldr,
    .cf-methodology,
    .cf-sources,
    .cf-internal-links,
    .cf-related { padding: 1rem 1.15rem; }

    .cf-author {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 1.25rem;
    }

    .cf-author-links { justify-content: center; }
}
