/* ============================================================
   Style partagé pour les leçons du cours en ligne TQNT
   ============================================================ */

* { box-sizing: border-box; }

body {
    margin: 0;
    background: linear-gradient(180deg, #0d1b2e 0%, #1a2e4a 100%);
    color: #e2e8f0;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    min-height: 100vh;
    line-height: 1.6;
}

/* ----- Header global ----- */
.lesson-header {
    background: linear-gradient(180deg, rgba(13,27,46,.95), rgba(26,46,74,.9));
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255,255,255,.08);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    height: 70px;
    display: flex;
    align-items: center;
}
.lesson-header nav {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.lesson-header .brand {
    display: flex;
    align-items: center;
    color: white;
    text-decoration: none;
    font-weight: 700;
    font-size: 1rem;
}
.lesson-header .brand img { height: 32px; margin-right: 0.6rem; }
.lesson-header .nav-links a {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 0.875rem;
    margin-left: 1.5rem;
    transition: color 0.15s;
}
.lesson-header .nav-links a:hover { color: #60a5fa; }

/* ----- Progress bar ----- */
.lesson-progress {
    position: fixed;
    top: 70px;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255,255,255,0.06);
    z-index: 9998;
}
.lesson-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #60a5fa, #34d399);
    width: 0%;
    transition: width 0.1s ease-out;
}

/* ----- Article wrapper ----- */
.lesson-article {
    max-width: 720px;
    margin: 0 auto;
    padding: 7rem 1.5rem 5rem;
}

/* ----- Breadcrumbs ----- */
.breadcrumbs {
    font-size: 0.85rem;
    color: rgba(255,255,255,0.55);
    margin-bottom: 1.5rem;
}
.breadcrumbs a {
    color: #60a5fa;
    text-decoration: none;
}
.breadcrumbs a:hover { text-decoration: underline; }

/* ----- Lesson meta ----- */
.lesson-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    color: rgba(255,255,255,0.65);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}
.lesson-badge {
    display: inline-block;
    padding: 0.3rem 0.75rem;
    background: linear-gradient(135deg, #34d399, #10b981);
    color: white;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.lesson-meta .dot { color: rgba(255,255,255,0.3); }

/* ----- Titres ----- */
h1.lesson-title {
    font-size: clamp(1.875rem, 4.5vw, 2.75rem);
    font-weight: 800;
    color: white;
    margin: 0 0 1rem;
    line-height: 1.15;
}
.lesson-subtitle {
    color: rgba(255,255,255,0.75);
    font-size: 1.125rem;
    font-style: italic;
    margin-bottom: 2.5rem;
    line-height: 1.55;
}

h2 {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2.5rem 0 1rem;
    line-height: 1.3;
}
h3 {
    color: #cbd5e1;
    font-size: 1.18rem;
    font-weight: 700;
    margin: 1.75rem 0 0.75rem;
}

/* ----- Texte du corps ----- */
.lesson-article p,
.lesson-article ul,
.lesson-article ol {
    color: rgba(255,255,255,0.88);
    font-size: 1.0625rem;
    line-height: 1.75;
    margin: 0 0 1.2rem;
}
.lesson-article ul,
.lesson-article ol { padding-left: 1.5rem; }
.lesson-article li { margin-bottom: 0.5rem; }
.lesson-article strong { color: white; font-weight: 700; }
.lesson-article em { color: #93c5fd; font-style: italic; }
.lesson-article a {
    color: #60a5fa;
    text-decoration: underline;
    text-decoration-color: rgba(96,165,250,0.4);
    text-underline-offset: 3px;
}
.lesson-article a:hover { text-decoration-color: #60a5fa; }

/* ----- Encadrés (callouts) ----- */
.callout {
    background: rgba(96,165,250,0.06);
    border-left: 3px solid #60a5fa;
    border-radius: 6px;
    padding: 1.25rem 1.5rem;
    margin: 2rem 0;
}
.callout-title {
    color: #60a5fa;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.callout p { margin: 0; font-size: 1rem; line-height: 1.65; }
.callout.note { background: rgba(96,165,250,0.06); border-color: #60a5fa; }
.callout.note .callout-title { color: #60a5fa; }
.callout.warn { background: rgba(245,158,11,0.06); border-color: #f59e0b; }
.callout.warn .callout-title { color: #f59e0b; }
.callout.idea { background: rgba(52,211,153,0.06); border-color: #34d399; }
.callout.idea .callout-title { color: #34d399; }
.callout.history { background: rgba(168,85,247,0.06); border-color: #a855f7; }
.callout.history .callout-title { color: #a855f7; }

/* ----- Tableaux ----- */
.lesson-article table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}
.lesson-article th,
.lesson-article td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.lesson-article th {
    color: #60a5fa;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid rgba(96,165,250,0.3);
}
.lesson-article td { color: rgba(255,255,255,0.85); }

/* ----- Citations ----- */
blockquote {
    border-left: 3px solid rgba(255,255,255,0.2);
    margin: 2rem 0;
    padding: 0.5rem 0 0.5rem 1.5rem;
    color: rgba(255,255,255,0.78);
    font-style: italic;
}

/* ----- Quiz ----- */
.quiz-section {
    background: rgba(0,0,0,0.25);
    border-radius: 14px;
    padding: 2rem;
    margin: 3rem 0;
}
.quiz-section h2 {
    margin-top: 0;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}
.quiz-section h2::before {
    content: '?';
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: white;
    width: 36px; height: 36px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
}
.quiz-section .quiz-intro {
    color: rgba(255,255,255,0.78);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

.quiz-question {
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}
.quiz-question p { margin: 0 0 0.75rem; font-weight: 600; color: white; }
.quiz-options { display: flex; flex-direction: column; gap: 0.5rem; }
.quiz-option {
    display: block;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 8px;
    background: transparent;
    color: rgba(255,255,255,0.85);
    cursor: pointer;
    transition: all 0.15s;
    text-align: left;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.5;
}
.quiz-option:hover {
    background: rgba(96,165,250,0.08);
    border-color: rgba(96,165,250,0.3);
}
.quiz-option.correct {
    background: rgba(52,211,153,0.15);
    border-color: #34d399;
    color: white;
}
.quiz-option.wrong {
    background: rgba(239,68,68,0.15);
    border-color: #ef4444;
    color: white;
}
.quiz-option:disabled { cursor: default; opacity: 0.85; }
.quiz-feedback {
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    display: none;
}
.quiz-feedback.correct {
    background: rgba(52,211,153,0.12);
    color: #6ee7b7;
    display: block;
}
.quiz-feedback.wrong {
    background: rgba(239,68,68,0.12);
    color: #fca5a5;
    display: block;
}

.quiz-score {
    margin-top: 1.5rem;
    padding: 1.25rem;
    background: linear-gradient(135deg, rgba(96,165,250,0.1), rgba(168,85,247,0.1));
    border-radius: 10px;
    text-align: center;
    font-size: 1.05rem;
    color: white;
}
.quiz-score-num {
    font-size: 1.5rem;
    font-weight: 800;
    color: #60a5fa;
}

/* ----- Navigation entre leçons ----- */
.lesson-nav {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255,255,255,0.08);
}
.lesson-nav a {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    flex: 1;
    max-width: 48%;
    transition: all 0.15s;
}
.lesson-nav a:hover {
    background: rgba(96,165,250,0.06);
    border-color: rgba(96,165,250,0.3);
}
.lesson-nav .nav-direction {
    color: #60a5fa;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.3rem;
}
.lesson-nav .nav-title {
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
}
.lesson-nav a.next { text-align: right; margin-left: auto; }
.lesson-nav a.disabled {
    opacity: 0.3;
    pointer-events: none;
}

/* ----- CTA Zenodo en bas ----- */
.lesson-cta {
    margin-top: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(59,130,246,0.1), rgba(168,85,247,0.1));
    border: 1px solid rgba(96,165,250,0.2);
    border-radius: 14px;
    text-align: center;
}
.lesson-cta h3 {
    color: white;
    margin: 0 0 0.6rem;
    font-size: 1.2rem;
}
.lesson-cta p {
    color: rgba(255,255,255,0.78);
    margin: 0 0 1rem;
    font-size: 0.95rem;
}
.lesson-cta-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}
.lesson-cta-button:hover { filter: brightness(1.1); }

/* ----- Footer ----- */
.lesson-footer {
    background: #0a1525;
    color: rgba(255,255,255,0.55);
    padding: 2rem 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    margin-top: 4rem;
}
.lesson-footer a { color: #60a5fa; text-decoration: none; }

/* ----- Image illustrations (SVG inline) ----- */
.lesson-illustration {
    background: rgba(0,0,0,0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    text-align: center;
}
.lesson-illustration svg {
    max-width: 100%;
    height: auto;
}
.lesson-illustration figcaption {
    color: rgba(255,255,255,0.6);
    font-size: 0.85rem;
    margin-top: 0.75rem;
    font-style: italic;
}

@media (max-width: 700px) {
    .lesson-header { height: 60px; }
    .lesson-header nav { padding: 0 1rem; }
    .lesson-header .nav-links a { margin-left: 0.75rem; font-size: 0.8rem; }
    .lesson-progress { top: 60px; }
    .lesson-article { padding: 6rem 1rem 3rem; }
    h1.lesson-title { font-size: 1.75rem; }
    .lesson-nav { flex-direction: column; }
    .lesson-nav a { max-width: 100%; }
}


/* Sélecteur de langue.
   Le build remplace les anciens <button> par des <a> — de vrais liens, pour que
   les moteurs et les IA découvrent l'autre langue. Les règles historiques
   visaient « .lang-toggle button » et ne s'appliquent donc plus : sans celles-ci
   les deux libellés se touchent et rien n'indique la langue active.
   L'état actif suit aria-current, que le build pose sur la langue courante. */
.lang-toggle a,
.lang-sw a {
    display: inline-block;
    text-decoration: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.375rem 0.625rem;
    border-radius: 6px;
    line-height: 1;
    transition: color 0.15s, background 0.15s;
}
.lang-toggle a:hover,
.lang-sw a:hover {
    color: rgba(255, 255, 255, 0.8);
}
.lang-toggle a[aria-current],
.lang-sw a[aria-current] {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Conteneur du sélecteur. Sur les pages rédigées à la main, la pilule venait
   d'attributs style en ligne, présents côté français mais absents côté anglais.
   La régler ici rend les deux versions identiques. */
.lang-toggle,
.lang-sw {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    padding: 2px;
}
