/* ==================== */
/* RELATED CARDS (shared) */
/* ==================== */

.related-section {
    margin-bottom: 80px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.related-card {
    display: block;
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    padding: 32px 28px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-primary);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.related-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--accent-color);
    transform: scaleX(0);
    transition: var(--transition);
}

.related-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow);
    border-color: transparent;
}

.related-card:hover::before {
    transform: scaleX(1);
}

.related-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(233, 69, 96, 0.1);
    color: var(--accent-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 18px;
}

.related-card h3 {
    font-size: 1.15rem;
    margin-bottom: 10px;
}

.related-card p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 16px;
}

.related-link {
    color: var(--accent-color);
    font-weight: 600;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* ==================== */
/* CONTENT PAGES (guides) */
/* ==================== */

.page-hero {
    padding: 48px 0 24px;
}

.page-hero h1 {
    font-size: 2.4rem;
    margin-bottom: 16px;
    letter-spacing: -0.03em;
}

.page-hero p.lead {
    font-size: 1.15rem;
    color: var(--text-secondary);
    max-width: 720px;
    line-height: 1.7;
}

.content-page {
    padding: 24px 0 0;
}

.content-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    align-items: start;
}

/* Table des matières */
.toc {
    position: sticky;
    top: 24px;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 24px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.toc h2 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-muted);
    margin-bottom: 16px;
    font-weight: 600;
}

.toc ol {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc li {
    margin-bottom: 8px;
}

.toc a {
    display: block;
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.toc a:hover {
    color: var(--accent-color);
    background: var(--bg-tertiary);
    border-left-color: var(--accent-color);
}

/* Contenu principal */
.article-content {
    background: var(--bg-primary);
    border-radius: var(--border-radius-lg);
    padding: 48px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-color);
}

.article-content h2 {
    font-size: 1.6rem;
    margin: 40px 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--bg-tertiary);
    scroll-margin-top: 24px;
}

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

.article-content h3 {
    font-size: 1.2rem;
    margin: 28px 0 12px;
    color: var(--text-primary);
}

.article-content p {
    color: var(--text-secondary);
    line-height: 1.75;
    margin-bottom: 16px;
}

.article-content strong {
    color: var(--text-primary);
}

.article-content ul, .article-content ol {
    margin: 0 0 20px 20px;
    padding: 0;
}

.article-content li {
    margin-bottom: 10px;
    color: var(--text-secondary);
    line-height: 1.65;
}

.article-content li strong {
    color: var(--text-primary);
}

.article-content a {
    color: var(--accent-color);
    font-weight: 500;
}

/* Empêche .article-content a d'écraser la couleur des boutons CTA */
.article-content .cta-banner .cta-button,
.cta-banner a.cta-button {
    color: #ffffff;
}

.article-content .cta-banner .cta-button:hover,
.cta-banner a.cta-button:hover {
    color: #ffffff;
}

/* Encadrés */
.callout {
    background: var(--bg-tertiary);
    border-left: 4px solid var(--accent-color);
    padding: 20px 24px;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    margin: 24px 0;
}

.callout p:last-child {
    margin-bottom: 0;
}

.callout.success {
    border-left-color: var(--success-color);
    background: rgba(16, 185, 129, 0.06);
}

.callout.warning {
    border-left-color: var(--warning-color);
    background: rgba(245, 158, 11, 0.06);
}

/* Tableaux */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 0.95rem;
}

.article-content th {
    background: var(--text-primary);
    color: #fff;
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
}

.article-content td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

.article-content tr:nth-child(even) td {
    background: var(--bg-secondary);
}

/* Grille d'infos (ex : stats de l'examen) */
.stats-grid-page {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 20px;
    margin: 28px 0;
}

.stat-card-page {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 24px 20px;
    text-align: center;
}

.stat-card-page .stat-num {
    font-size: 2.25rem;
    font-weight: 700;
    color: var(--accent-color);
    line-height: 1;
    display: block;
    margin-bottom: 8px;
}

.stat-card-page .stat-lbl {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* ==================== */
/* RESPONSIVE CONTENT PAGES */
/* ==================== */

@media (max-width: 992px) {
    .content-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .toc {
        position: static;
    }

    .toc ol {
        display: flex;
        flex-wrap: wrap;
        gap: 8px;
    }

    .toc li {
        margin-bottom: 0;
    }
}

@media (max-width: 768px) {
    .page-hero h1 {
        font-size: 1.9rem;
    }

    .page-hero p.lead {
        font-size: 1.05rem;
    }

    .article-content {
        padding: 28px 20px;
    }

    .article-content h2 {
        font-size: 1.35rem;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }
}
