/* ==========================================================================
   IELTS Lesson Content — rendered inside course player and catalogue views
   All classes match the v2.1 content specification.
   ========================================================================== */

.lesson-header {
    margin-bottom: 32px;
    padding-bottom: 20px;
    border-bottom: 2px solid var(--border);
}
.lesson-eyebrow {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 8px;
}
.lesson-header h1 {
    font-size: 1.8rem;
    color: var(--navy);
    margin-bottom: 8px;
    line-height: 1.25;
}
.lesson-rule-ref {
    font-size: 0.9rem;
    color: var(--muted);
    font-style: italic;
}

.lesson-part {
    font-size: 1.3rem;
    color: var(--navy);
    margin: 40px 0 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.instruction {
    font-style: italic;
    color: var(--muted);
    margin-bottom: 16px;
    font-size: 0.95rem;
}

.extract {
    background: var(--soft);
    border-left: 4px solid var(--blue);
    border-radius: 0 12px 12px 0;
    padding: 20px 24px;
    margin-bottom: 20px;
}
.extract-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 700;
    color: var(--blue);
    margin-bottom: 10px;
}
.extract p {
    margin-bottom: 12px;
    line-height: 1.7;
}
.extract p:last-child {
    margin-bottom: 0;
}

.think {
    background: #fffdf7;
    border: 1px solid rgba(247, 151, 2, 0.35);
    border-left: 4px solid var(--gold);
    border-radius: 0 12px 12px 0;
    padding: 20px 24px;
    margin-bottom: 16px;
}
.think-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
    color: #8a5200;
    margin-bottom: 12px;
}
.think p {
    margin-bottom: 12px;
}
.think-options {
    margin: 12px 0 0 24px;
    padding: 0;
    list-style: upper-alpha;
}
.think-options li {
    margin-bottom: 6px;
    padding-left: 4px;
    line-height: 1.5;
}

.task {
    background: #f5f8ff;
    border: 1px solid rgba(0, 44, 156, 0.2);
    border-left: 4px solid var(--blue);
    border-radius: 0 12px 12px 0;
    padding: 20px 24px;
    margin-bottom: 16px;
}
.task-label {
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--blue);
    margin-bottom: 12px;
}
.task ol {
    margin: 8px 0 0 24px;
    padding: 0;
}
.task ol li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.reveal {
    background: var(--soft);
    border: 1px solid var(--border);
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
    transition: 0.15s;
}
.reveal[open] {
    border-color: var(--gold);
}
.reveal summary {
    padding: 12px 20px;
    font-weight: 700;
    color: var(--blue);
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.15s;
}
.reveal summary::-webkit-details-marker {
    display: none;
}
.reveal summary::before {
    content: "▶";
    font-size: 0.7rem;
    transition: transform 0.15s;
    display: inline-block;
    color: var(--gold);
}
.reveal[open] summary::before {
    transform: rotate(90deg);
}
.reveal summary:hover {
    background: rgba(247, 151, 2, 0.08);
}
.reveal[open] summary {
    border-bottom: 1px solid var(--border);
}
.reveal > p,
.reveal > ul,
.reveal > ol {
    padding: 0 20px;
    margin-top: 16px;
}
.reveal > p:last-child,
.reveal > ul:last-child,
.reveal > ol:last-child {
    margin-bottom: 16px;
}

.callout {
    border-radius: 12px;
    padding: 20px 24px;
    margin: 24px 0;
    border: 1px solid var(--border);
}
.callout-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
    margin-bottom: 12px;
    display: block;
}
.callout h3 {
    font-size: 1.1rem;
    margin: 0 0 12px;
    color: var(--navy);
}
.callout p {
    margin-bottom: 10px;
}
.callout p:last-child {
    margin-bottom: 0;
}
.callout ul {
    margin: 8px 0 8px 24px;
}
.callout ul li {
    margin-bottom: 6px;
}
.callout.guideline {
    background: #f0f7ff;
    border-color: rgba(0, 44, 156, 0.25);
    border-left: 4px solid var(--blue);
}
.callout.guideline .callout-label {
    color: var(--blue);
}
.callout.remember {
    background: linear-gradient(135deg, #fff8e1 0%, #fff3d6 100%);
    border-color: rgba(247, 151, 2, 0.4);
    border-left: 4px solid var(--gold);
}
.callout.remember .callout-label {
    color: #8a5200;
}
.callout.check {
    background: #f4f9f4;
    border-color: rgba(40, 167, 69, 0.3);
    border-left: 4px solid #28a745;
}
.callout.check .callout-label {
    color: #155724;
}
.callout.example {
    background: #fafbfd;
    border-color: var(--border);
    border-left: 4px solid var(--muted);
}
.callout.example .callout-label {
    color: var(--muted);
}

.prompt {
    background: var(--soft);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    margin-bottom: 20px;
}
.prompt-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 800;
    color: var(--blue);
    margin-bottom: 12px;
}
.prompt p {
    margin-bottom: 12px;
}
.prompt p:last-child {
    margin-bottom: 0;
}

@media (max-width: 640px) {
    .lesson-header h1 { font-size: 1.4rem; }
    .lesson-part { font-size: 1.15rem; }
    .extract,
    .think,
    .task,
    .callout,
    .prompt,
    .reveal summary {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* ============================================================
   Syllabus lesson list — used in the catalogue view
   ============================================================ */

.syllabus-lessons {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
}

.syllabus-topic {
    margin-bottom: 20px;
}

.syllabus-topic:last-child {
    margin-bottom: 0;
}

.syllabus-topic-title {
    font-weight: 700;
    color: var(--navy);
    margin-bottom: 8px;
    font-size: 0.92rem;
}

.syllabus-lesson-list {
    list-style: none;
    padding: 0 0 0 14px;
    margin: 0;
    border-left: 2px solid var(--border);
}

.syllabus-lesson {
    margin-bottom: 4px;
}

.syllabus-lesson:last-child {
    margin-bottom: 0;
}

.syllabus-lesson-link,
.syllabus-lesson-locked {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    color: var(--text);
    font-size: 0.88rem;
    transition: 0.15s;
}

.syllabus-lesson-link::before {
    content: "→";
    color: var(--gold);
    font-weight: 700;
    flex-shrink: 0;
}

.syllabus-lesson-link:hover {
    background: var(--soft);
    color: var(--blue);
}

.syllabus-lesson-locked {
    color: var(--muted);
    cursor: not-allowed;
}

.syllabus-lesson-locked::before {
    content: "🔒";
    font-size: 0.85rem;
    flex-shrink: 0;
}

.syllabus-lesson-title {
    flex: 1;
}

/* ============================================================
   Lesson practice call-to-action
   ============================================================ */

.lesson-practice-cta {
    margin-top: 40px;
    padding: 24px;
    background: linear-gradient(135deg, #eef4fd 0%, #dbe7f8 100%);
    border: 1px solid rgba(0, 44, 156, 0.22);
    border-left: 4px solid var(--blue);
    border-radius: 0 12px 12px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.lesson-practice-cta::before {
    content: "Ready to test yourself?";
    font-weight: 600;
    color: var(--blue);
    flex: 1;
    min-width: 200px;
}

@media (max-width: 640px) {
    .lesson-practice-cta {
        flex-direction: column;
        align-items: stretch;
    }
    .lesson-practice-cta .btn {
        width: 100%;
    }
}

/* ============================================================
   Quiz passage — rendered above a question on the take view
   ============================================================ */

.quiz-passage {
    background: var(--soft);
    border-left: 4px solid var(--blue);
    border-radius: 0 12px 12px 0;
    padding: 20px 24px;
    margin: 0 0 20px;
    line-height: 1.7;
    color: var(--text);
}
.quiz-passage p {
    margin-bottom: 12px;
}
.quiz-passage p:last-child {
    margin-bottom: 0;
}
@media (max-width: 640px) {
    .quiz-passage {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* ============================================================
   Tables — used by Writing lessons and any lesson with tabular data
   ============================================================ */

.rich-text-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 0.95rem;
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
}

.rich-text-content thead {
    background: var(--soft);
}

.rich-text-content th {
    text-align: left;
    font-weight: 700;
    color: var(--navy);
    padding: 12px 16px;
    border-bottom: 2px solid var(--border);
    font-size: 0.9rem;
    line-height: 1.35;
}

.rich-text-content td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    line-height: 1.5;
    vertical-align: top;
}

.rich-text-content tbody tr:last-child td {
    border-bottom: none;
}

.rich-text-content tbody tr:nth-child(even) {
    background: rgba(0, 0, 25, 0.02);
}

@media (max-width: 640px) {
    .rich-text-content th,
    .rich-text-content td {
        padding: 8px 10px;
        font-size: 0.85rem;
    }
}

/* ============================================================
   Images — lesson figures and captioned diagrams
   ============================================================ */

.rich-text-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 8px;
}

.rich-text-content img.lesson-figure {
    border: 1px solid var(--border);
    background: var(--white);
    padding: 12px;
    max-width: 100%;
    height: auto;
    box-sizing: border-box;
}

.rich-text-content .figure-caption {
    font-size: 0.85rem;
    color: var(--muted);
    font-style: italic;
    text-align: center;
    margin-top: -8px;
    margin-bottom: 20px;
}