/* ═══════════════════════════════════════════════════════════════
   CEF DESIGN SYSTEM — Global Stylesheet v1.0.0
   cours-et-fiches.com
   All rules scoped under .cef to avoid conflicts with Avada/WP
   ═══════════════════════════════════════════════════════════════ */

/* ─── Root Scope ─── */
.cef {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #1a1a2e;
    line-height: 1.8;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ─── Typography ─── */
.cef h1 {
    font-size: 28px;
    font-weight: 800;
    text-align: center;
    margin: 32px 0 6px;
    color: #1a1a2e;
}

.cef .hero-sub {
    text-align: center;
    color: #64748b;
    font-size: 15px;
    margin-bottom: 28px;
}

.cef h2 {
    font-size: 22px;
    font-weight: 700;
    margin: 36px 0 14px;
    color: #1a1a2e;
    border-left: 4px solid #2563eb;
    padding-left: 12px;
}

.cef h3 {
    font-size: 17px;
    font-weight: 700;
    margin: 24px 0 10px;
    color: #2563eb;
}

.cef h4 {
    font-size: 16px;
    font-weight: 700;
    margin: 16px 0 8px;
    color: #1a1a2e;
}

.cef p {
    margin: 0 0 14px;
    font-size: 15px;
}

.cef ul, .cef ol {
    margin: 0 0 14px;
    padding-left: 24px;
    font-size: 15px;
}

.cef li {
    margin-bottom: 4px;
}

.cef strong {
    font-weight: 700;
}

.cef em {
    font-style: italic;
}

.cef a {
    color: #2563eb;
    text-decoration: none;
}

.cef a:hover {
    text-decoration: underline;
}

/* ─── ID Card (metadata grid) ─── */
.cef .id-card {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border: 2px solid #2563eb;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 28px;
    font-size: 14px;
}

.cef .id-card .id-row {
    display: contents;
}

.cef .id-card .id-label {
    background: #eff6ff;
    padding: 10px 14px;
    font-weight: 700;
    color: #2563eb;
    border-bottom: 1px solid #dbeafe;
}

.cef .id-card .id-value {
    padding: 10px 14px;
    border-bottom: 1px solid #e2e8f0;
}

/* ─── Intro Box ─── */
.cef .intro-box {
    background: linear-gradient(135deg, #eff6ff, #dbeafe);
    border: 1px solid #93c5fd;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 28px;
    font-size: 15px;
    line-height: 1.7;
}

/* ─── Table of Contents ─── */
.cef .toc {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 14px 18px;
    margin-bottom: 32px;
    font-size: 14px;
}

.cef .toc strong {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #2563eb;
}

.cef .toc a {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    margin-right: 14px;
    margin-bottom: 4px;
    white-space: nowrap;
}

.cef .toc a:hover {
    text-decoration: underline;
}

/* ─── Tables ─── */
.cef table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin: 12px 0 24px;
}

.cef th {
    background: #2563eb;
    color: #fff;
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
}

.cef td {
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
}

.cef tr:nth-child(even) {
    background: #f8fafc;
}

.cef tr:hover {
    background: #eff6ff;
}

/* ─── Highlight Box (tips, notes) ─── */
.cef .highlight-box {
    background: #eff6ff;
    border-left: 4px solid #2563eb;
    border-radius: 0 8px 8px 0;
    padding: 14px 18px;
    margin: 16px 0 24px;
    font-size: 14px;
    line-height: 1.7;
}

.cef .highlight-box strong {
    color: #2563eb;
}

/* ─── Warning Box ─── */
.cef .warn-box {
    background: #fef3c7;
    border-left: 4px solid #f59e0b;
    border-radius: 0 8px 8px 0;
    padding: 14px 18px;
    margin: 16px 0 24px;
    font-size: 14px;
    line-height: 1.7;
}

.cef .warn-box strong {
    color: #b45309;
}

/* ─── Exercise Cards ─── */
.cef .exercise-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px 18px;
    margin: 12px 0;
    transition: all 0.2s;
}

.cef .exercise-card:hover {
    border-color: #2563eb;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.1);
}

.cef .exercise-card h4 {
    margin: 0 0 8px;
    font-size: 16px;
    color: #1a1a2e;
}

.cef .exercise-card .ex-text {
    font-size: 14px;
    margin-bottom: 8px;
}

.cef .exercise-card .ex-answer {
    background: #eff6ff;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #2563eb;
    margin-top: 8px;
}

/* ─── FAQ Section ─── */
.cef .faq-section {
    margin: 32px 0;
}

.cef .faq-item {
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 8px;
    overflow: hidden;
}

.cef .faq-item summary {
    padding: 14px 18px;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #1a1a2e;
}

.cef .faq-item summary::-webkit-details-marker {
    display: none;
}

.cef .faq-item summary::after {
    content: "+";
    font-size: 18px;
    color: #2563eb;
    font-weight: 700;
    flex-shrink: 0;
    margin-left: 12px;
}

.cef .faq-item[open] summary::after {
    content: "−";
}

.cef .faq-item[open] summary {
    background: #eff6ff;
    border-bottom: 1px solid #93c5fd;
}

.cef .faq-answer {
    padding: 14px 18px;
    font-size: 14px;
    line-height: 1.7;
    color: #334155;
}

/* ─── Links Grid (footer) ─── */
.cef .links-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 16px 0 24px;
}

.cef .links-grid a {
    display: block;
    padding: 10px 14px;
    background: #eff6ff;
    border: 1px solid #93c5fd;
    border-radius: 7px;
    text-decoration: none;
    color: #2563eb;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
}

.cef .links-grid a:hover {
    background: #dbeafe;
    border-color: #2563eb;
    text-decoration: none;
}

/* ─── Formula/Code Inline ─── */
.cef .formula-code,
.cef code {
    font-family: 'Fira Code', 'Consolas', monospace;
    background: #f1f5f9;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: #1e40af;
}

/* ─── Horizontal Rule ─── */
.cef hr {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 32px 0;
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 600px) {
    .cef .id-card {
        grid-template-columns: 1fr;
    }

    .cef .links-grid {
        grid-template-columns: 1fr;
    }

    .cef h1 {
        font-size: 22px;
    }

    .cef h2 {
        font-size: 19px;
    }

    .cef table {
        font-size: 12px;
    }

    .cef th, .cef td {
        padding: 8px;
    }

    .cef .toc a {
        display: block;
        margin-right: 0;
        margin-bottom: 6px;
    }
}
