/* ========================================
   ARTICLES - MISE EN FORME PROFESSIONNELLE
   MovementBuilding Theme v2.1.0
   ======================================== */

/* === VARIABLES ARTICLES === */
:root {
    --article-max-width: 780px;
    --article-font-size: 1.125rem;
    --article-line-height: 1.85;
    --article-color: #374151;
    --article-heading-color: #111827;
    --article-accent: #ec4899;
    --article-accent-light: #fdf2f8;
    --article-accent-border: #f9a8d4;
    --article-bg-light: #f9fafb;
    --article-border: #e5e7eb;
    --article-muted: #6b7280;
    --article-spacing: 1.75rem;
}

/* === CONTAINER PRINCIPAL === */
.mb-single__content {
    max-width: var(--article-max-width);
    margin: 0 auto;
    font-size: var(--article-font-size);
    line-height: var(--article-line-height);
    color: var(--article-color);
    padding: 0 1.5rem;
}

/* === PREMIER PARAGRAPHE (META) === */
.mb-single__content > p:first-child {
    margin-bottom: 2.5rem;
}

.mb-single__content > p:first-child em {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
    align-items: center;
    background: linear-gradient(135deg, var(--article-accent-light) 0%, #fce7f3 100%);
    padding: 1.25rem 1.75rem;
    border-radius: 12px;
    font-style: normal;
    font-size: 0.9rem;
    color: var(--article-muted);
    border-left: 4px solid var(--article-accent);
}

/* === BOX POINTS CLÉS === */
.mb-single__content > h2:first-of-type {
    background: linear-gradient(135deg, var(--article-accent-light) 0%, #fce7f3 100%);
    margin: 0 0 0 0;
    padding: 1.5rem 2rem 0.75rem;
    border-radius: 16px 16px 0 0;
    border: 2px solid var(--article-accent-border);
    border-bottom: none;
    font-size: 1.25rem;
    color: var(--article-accent);
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.mb-single__content > h2:first-of-type::before {
    content: "📌";
    font-size: 1.3rem;
}

.mb-single__content > h2:first-of-type::after {
    display: none !important;
}

.mb-single__content > h2:first-of-type + ul {
    background: linear-gradient(180deg, #fce7f3 0%, var(--article-accent-light) 100%);
    border: 2px solid var(--article-accent-border);
    border-top: none;
    border-radius: 0 0 16px 16px;
    padding: 1.25rem 2rem 1.75rem;
    margin: 0 0 3rem 0;
    list-style: none;
}

.mb-single__content > h2:first-of-type + ul li {
    position: relative;
    padding-left: 2.25rem;
    margin-bottom: 1rem;
    line-height: 1.7;
    font-size: 1.05rem;
}

.mb-single__content > h2:first-of-type + ul li:last-child {
    margin-bottom: 0;
}

.mb-single__content > h2:first-of-type + ul li::before {
    content: "✓";
    position: absolute;
    left: 0;
    top: 0.1em;
    width: 1.6rem;
    height: 1.6rem;
    background: var(--article-accent);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: bold;
}

.mb-single__content > h2:first-of-type + ul li strong {
    color: #be185d;
    background: rgba(236, 72, 153, 0.12);
    padding: 0.15em 0.4em;
    border-radius: 4px;
}

/* === PARAGRAPHES === */
.mb-single__content p {
    margin-bottom: var(--article-spacing);
    text-align: left;
}

/* Introduction (premiers paragraphes après points clés) */
.mb-single__content > h2:first-of-type + ul + p,
.mb-single__content > h2:first-of-type + ul + p + p,
.mb-single__content > h2:first-of-type + ul + p + p + p {
    font-size: 1.2rem;
    color: #4b5563;
    line-height: 1.9;
}

/* === TITRES H2 === */
.mb-single__content h2 {
    font-family: var(--mb-font-heading, 'Playfair Display', Georgia, serif);
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--article-heading-color);
    margin: 3.5rem 0 1.5rem;
    padding-bottom: 1rem;
    position: relative;
    line-height: 1.35;
    border-bottom: 2px solid var(--article-border);
}

.mb-single__content h2::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100px;
    height: 4px;
    background: linear-gradient(90deg, var(--article-accent) 0%, #f472b6 100%);
    border-radius: 2px;
}

/* === TITRES H3 === */
.mb-single__content h3 {
    font-family: var(--mb-font-heading, 'Playfair Display', Georgia, serif);
    font-size: 1.5rem;
    font-weight: 600;
    color: #1f2937;
    margin: 2.75rem 0 1.25rem;
    padding-left: 1.25rem;
    border-left: 4px solid var(--article-accent);
    line-height: 1.4;
}

/* === TITRES H4 === */
.mb-single__content h4 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #374151;
    margin: 2rem 0 1rem;
    letter-spacing: 0.02em;
}

/* === TEXTE IMPORTANT (STRONG) === */
.mb-single__content strong {
    font-weight: 700;
    color: var(--article-heading-color);
}

/* Strong au début d'un paragraphe = titre inline */
.mb-single__content p > strong:first-child {
    display: inline;
    color: #be185d;
    background: linear-gradient(120deg, rgba(236, 72, 153, 0.1) 0%, rgba(244, 114, 182, 0.08) 100%);
    padding: 0.15em 0.5em;
    border-radius: 4px;
    margin-right: 0.25em;
}

/* === TEXTE ITALIQUE === */
.mb-single__content em {
    font-style: italic;
    color: #4b5563;
}

/* Noms scientifiques */
.mb-single__content p em {
    background: #f3f4f6;
    padding: 0.1em 0.35em;
    border-radius: 3px;
    font-size: 0.95em;
}

/* === LIENS === */
.mb-single__content a {
    color: var(--article-accent);
    text-decoration: none;
    border-bottom: 1px dashed var(--article-accent-border);
    transition: all 0.2s ease;
}

.mb-single__content a:hover {
    color: #be185d;
    border-bottom-style: solid;
    border-bottom-color: #be185d;
}

/* === LISTES UL === */
.mb-single__content ul {
    list-style: none;
    padding: 0;
    margin: 1.75rem 0 2rem;
}

.mb-single__content ul li {
    position: relative;
    padding-left: 2rem;
    margin-bottom: 1rem;
    line-height: 1.75;
}

.mb-single__content ul li::before {
    content: "";
    position: absolute;
    left: 0.5rem;
    top: 0.65rem;
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, var(--article-accent) 0%, #f472b6 100%);
    border-radius: 50%;
}

/* Listes imbriquées */
.mb-single__content ul ul {
    margin: 0.75rem 0 0.5rem;
}

.mb-single__content ul ul li::before {
    width: 7px;
    height: 7px;
    background: #d1d5db;
    top: 0.7rem;
}

/* === LISTES OL === */
.mb-single__content ol {
    list-style: none;
    padding: 0;
    margin: 1.75rem 0 2rem;
    counter-reset: article-ol;
}

.mb-single__content ol li {
    position: relative;
    padding-left: 3.25rem;
    margin-bottom: 1.25rem;
    line-height: 1.75;
    counter-increment: article-ol;
}

.mb-single__content ol li::before {
    content: counter(article-ol);
    position: absolute;
    left: 0;
    top: 0;
    width: 2.25rem;
    height: 2.25rem;
    background: linear-gradient(135deg, var(--article-accent) 0%, #f472b6 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    font-weight: 700;
}

/* === TABLEAUX === */
.mb-single__content table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin: 2.5rem 0;
    font-size: 0.95rem;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--article-border);
}

.mb-single__content table thead {
    background: linear-gradient(135deg, #111827 0%, #1f2937 100%);
}

.mb-single__content table th {
    padding: 1.1rem 1.25rem;
    text-align: left;
    font-weight: 600;
    color: white;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mb-single__content table td {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--article-border);
    color: #4b5563;
    vertical-align: top;
    line-height: 1.6;
}

.mb-single__content table tbody tr {
    background: white;
    transition: background 0.2s ease;
}

.mb-single__content table tbody tr:nth-child(even) {
    background: var(--article-bg-light);
}

.mb-single__content table tbody tr:hover {
    background: var(--article-accent-light);
}

.mb-single__content table tbody tr:last-child td {
    border-bottom: none;
}

/* Première colonne en gras */
.mb-single__content table td:first-child {
    font-weight: 600;
    color: var(--article-heading-color);
}

/* === BLOCKQUOTES === */
.mb-single__content blockquote {
    position: relative;
    margin: 2.5rem 0;
    padding: 2rem 2.5rem 2rem 4rem;
    background: linear-gradient(135deg, var(--article-bg-light) 0%, #f3f4f6 100%);
    border-radius: 12px;
    border-left: 5px solid var(--article-accent);
    font-style: italic;
    color: #4b5563;
}

.mb-single__content blockquote::before {
    content: """;
    position: absolute;
    top: 0.5rem;
    left: 1rem;
    font-size: 4rem;
    font-family: Georgia, serif;
    color: var(--article-accent);
    opacity: 0.25;
    line-height: 1;
}

.mb-single__content blockquote p {
    margin: 0;
    font-size: 1.1rem;
    line-height: 1.8;
}

.mb-single__content blockquote p + p {
    margin-top: 1rem;
}

/* === CODE INLINE === */
.mb-single__content code {
    background: #f3f4f6;
    padding: 0.2em 0.5em;
    border-radius: 4px;
    font-family: 'Fira Code', 'Consolas', 'Monaco', monospace;
    font-size: 0.88em;
    color: #be185d;
    border: 1px solid var(--article-border);
}

/* === BLOCS CODE === */
.mb-single__content pre {
    background: #111827;
    border-radius: 12px;
    padding: 1.5rem 2rem;
    overflow-x: auto;
    margin: 2rem 0;
    border: 1px solid #374151;
}

.mb-single__content pre code {
    background: transparent;
    padding: 0;
    color: #e5e7eb;
    font-size: 0.9rem;
    line-height: 1.7;
    border: none;
}

/* === IMAGES === */
.mb-single__content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 2.5rem auto;
    display: block;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
}

.mb-single__content figure {
    margin: 3rem 0;
}

.mb-single__content figcaption {
    text-align: center;
    font-size: 0.9rem;
    color: var(--article-muted);
    margin-top: 1rem;
    font-style: italic;
}

/* === SÉPARATEUR === */
.mb-single__content hr {
    border: none;
    height: 3px;
    background: linear-gradient(90deg, transparent 0%, var(--article-accent) 50%, transparent 100%);
    margin: 3.5rem 0;
    border-radius: 2px;
}

/* === SECTION FAQ === */
/* Détection du titre FAQ */
.mb-single__content h2[id*="faq"],
.mb-single__content h2:contains("FAQ"),
.mb-single__content h2:contains("Questions") {
    margin-top: 4rem;
    padding-top: 2.5rem;
    border-top: 3px solid var(--article-border);
}

/* === SECTION SOURCES === */
.mb-single__content > h2:last-of-type {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 3px solid var(--article-border);
}

.mb-single__content > h2:last-of-type + ol,
.mb-single__content > h2:last-of-type + p + ol {
    background: var(--article-bg-light);
    border-radius: 12px;
    padding: 1.5rem 2rem 1.5rem 3rem;
    border: 1px solid var(--article-border);
}

.mb-single__content > h2:last-of-type + ol li,
.mb-single__content > h2:last-of-type + p + ol li {
    font-size: 0.9rem;
    color: var(--article-muted);
    padding-left: 2rem;
    margin-bottom: 0.75rem;
}

.mb-single__content > h2:last-of-type + ol li::before,
.mb-single__content > h2:last-of-type + p + ol li::before {
    width: 1.5rem;
    height: 1.5rem;
    font-size: 0.7rem;
    background: #9ca3af;
}

/* === RESPONSIVE MOBILE === */
@media (max-width: 768px) {
    :root {
        --article-font-size: 1rem;
        --article-spacing: 1.5rem;
    }
    
    .mb-single__content {
        padding: 0 1rem;
    }
    
    .mb-single__content > p:first-child em {
        padding: 1rem 1.25rem;
        font-size: 0.85rem;
        gap: 0.25rem 1rem;
    }
    
    .mb-single__content > h2:first-of-type {
        padding: 1.25rem 1.5rem 0.5rem;
        font-size: 1.1rem;
        border-radius: 12px 12px 0 0;
    }
    
    .mb-single__content > h2:first-of-type + ul {
        padding: 1rem 1.5rem 1.5rem;
        border-radius: 0 0 12px 12px;
    }
    
    .mb-single__content > h2:first-of-type + ul li {
        padding-left: 2rem;
        font-size: 0.95rem;
    }
    
    .mb-single__content > h2:first-of-type + ul li::before {
        width: 1.4rem;
        height: 1.4rem;
    }
    
    .mb-single__content h2 {
        font-size: 1.5rem;
        margin: 2.75rem 0 1.25rem;
    }
    
    .mb-single__content h2::after {
        width: 70px;
    }
    
    .mb-single__content h3 {
        font-size: 1.25rem;
        margin: 2.25rem 0 1rem;
        padding-left: 1rem;
    }
    
    .mb-single__content h4 {
        font-size: 1.1rem;
    }
    
    .mb-single__content > h2:first-of-type + ul + p,
    .mb-single__content > h2:first-of-type + ul + p + p,
    .mb-single__content > h2:first-of-type + ul + p + p + p {
        font-size: 1.05rem;
    }
    
    .mb-single__content table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        font-size: 0.875rem;
        margin: 2rem -1rem;
        width: calc(100% + 2rem);
        border-radius: 0;
    }
    
    .mb-single__content table th,
    .mb-single__content table td {
        padding: 0.85rem 1rem;
        min-width: 120px;
    }
    
    .mb-single__content blockquote {
        padding: 1.5rem 1.5rem 1.5rem 2.5rem;
        margin: 2rem 0;
    }
    
    .mb-single__content blockquote::before {
        font-size: 3rem;
        left: 0.5rem;
    }
    
    .mb-single__content ol li {
        padding-left: 2.75rem;
    }
    
    .mb-single__content ol li::before {
        width: 2rem;
        height: 2rem;
        font-size: 0.85rem;
    }
}

/* === TABLETTE === */
@media (min-width: 769px) and (max-width: 1024px) {
    .mb-single__content {
        padding: 0 2rem;
    }
    
    .mb-single__content h2 {
        font-size: 1.7rem;
    }
    
    .mb-single__content h3 {
        font-size: 1.35rem;
    }
}

/* === PRINT === */
@media print {
    .mb-single__content {
        font-size: 11pt;
        line-height: 1.5;
        color: black;
        max-width: none;
        padding: 0;
    }
    
    .mb-single__content h2,
    .mb-single__content h3 {
        page-break-after: avoid;
        color: black;
    }
    
    .mb-single__content > h2:first-of-type,
    .mb-single__content > h2:first-of-type + ul {
        background: #f5f5f5 !important;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .mb-single__content table {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .mb-single__content a {
        color: black;
        text-decoration: underline;
    }
    
    .mb-single__content blockquote {
        border-left: 3px solid #999;
        background: #f5f5f5;
    }
}
