/* ==========================================================================
   lesson-content.css — visual component system for LMS lesson bodies
   --------------------------------------------------------------------------
   Every class is prefixed `lc-` so it cannot collide with player chrome.
   Authored lesson HTML (lms_lessons.content_html) uses these classes plus
   inline SVG. No JavaScript is required by anything in this file.

   Loaded by: learner/lesson-player, learner/microlearning-card,
              admin/lessons/form (preview pane).
   ========================================================================== */

.lc-scope {
    --lc-primary: #0d9488;
    --lc-primary-dark: #0f766e;
    --lc-primary-soft: #f0fdfa;
    --lc-ink: #0f172a;
    --lc-body: #334155;
    --lc-muted: #64748b;
    --lc-line: #e2e8f0;
    --lc-surface: #ffffff;
    --lc-surface-alt: #f8fafc;

    --lc-info: #0284c7;
    --lc-info-soft: #f0f9ff;
    --lc-warn: #d97706;
    --lc-warn-soft: #fffbeb;
    --lc-danger: #dc2626;
    --lc-danger-soft: #fef2f2;
    --lc-success: #16a34a;
    --lc-success-soft: #f0fdf4;
    --lc-legal: #7c3aed;
    --lc-legal-soft: #f5f3ff;

    --lc-radius: 14px;
    --lc-radius-sm: 10px;
    --lc-gap: 18px;
}

/* --------------------------------------------------------------------------
   1. Figures — the wrapper for every diagram / inline SVG
   -------------------------------------------------------------------------- */

.lc-scope .lc-figure {
    margin: 28px 0;
    padding: 20px 20px 16px;
    background: var(--lc-surface);
    border: 1px solid var(--lc-line);
    border-radius: var(--lc-radius);
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.lc-scope .lc-figure.is-flush {
    padding-left: 8px;
    padding-right: 8px;
}

.lc-scope .lc-figure.is-tinted {
    background: linear-gradient(160deg, #f8fafc 0%, #f0fdfa 100%);
}

.lc-scope .lc-figure > svg {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    overflow: visible;
}

.lc-scope .lc-figure__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--lc-primary-dark);
    margin: 0 0 14px;
}

.lc-scope .lc-figure__title::before {
    content: "";
    width: 18px;
    height: 3px;
    border-radius: 2px;
    background: var(--lc-primary);
    flex: none;
}

.lc-scope .lc-figure figcaption,
.lc-scope .lc-figure__caption {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--lc-line);
    font-size: 13px;
    line-height: 1.65;
    color: var(--lc-muted);
}

.lc-scope .lc-figure figcaption strong,
.lc-scope .lc-figure__caption strong {
    color: var(--lc-body);
}

/* Every diagram sits in this wrapper. On wide screens it is inert; the
   min-width that makes it scroll is applied only at narrow widths, where
   shrinking a dense diagram to fit would make its labels unreadable. */
.lc-scope .lc-scrollx {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.lc-scope .lc-scrollx > svg {
    display: block;
    width: 100%;
    height: auto;
}

/* --------------------------------------------------------------------------
   2. Callouts
   -------------------------------------------------------------------------- */

.lc-scope .lc-callout {
    position: relative;
    margin: 22px 0;
    padding: 16px 18px 16px 20px;
    border-radius: var(--lc-radius-sm);
    border: 1px solid var(--lc-line);
    border-left: 4px solid var(--lc-muted);
    background: var(--lc-surface-alt);
    font-size: 14.5px;
    line-height: 1.75;
    color: var(--lc-body);
}

.lc-scope .lc-callout > :last-child { margin-bottom: 0; }

.lc-scope .lc-callout__title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 8px;
    color: var(--lc-ink);
}

.lc-scope .lc-callout.is-info { border-left-color: var(--lc-info); background: var(--lc-info-soft); }
.lc-scope .lc-callout.is-info .lc-callout__title { color: #075985; }

.lc-scope .lc-callout.is-warn { border-left-color: var(--lc-warn); background: var(--lc-warn-soft); }
.lc-scope .lc-callout.is-warn .lc-callout__title { color: #92400e; }

.lc-scope .lc-callout.is-danger { border-left-color: var(--lc-danger); background: var(--lc-danger-soft); }
.lc-scope .lc-callout.is-danger .lc-callout__title { color: #991b1b; }

.lc-scope .lc-callout.is-success { border-left-color: var(--lc-success); background: var(--lc-success-soft); }
.lc-scope .lc-callout.is-success .lc-callout__title { color: #14532d; }

.lc-scope .lc-callout.is-tip { border-left-color: var(--lc-primary); background: var(--lc-primary-soft); }
.lc-scope .lc-callout.is-tip .lc-callout__title { color: var(--lc-primary-dark); }

/* Statute / clause citation callout */
.lc-scope .lc-callout.is-legal {
    border-left-color: var(--lc-legal);
    background: var(--lc-legal-soft);
    font-family: 'Inter', system-ui, sans-serif;
}
.lc-scope .lc-callout.is-legal .lc-callout__title { color: #5b21b6; }
.lc-scope .lc-callout.is-legal cite {
    display: block;
    margin-top: 8px;
    font-size: 12.5px;
    font-style: normal;
    color: #6d28d9;
    font-weight: 600;
}

/* --------------------------------------------------------------------------
   3. Key takeaways / exam-focus summary
   -------------------------------------------------------------------------- */

.lc-scope .lc-takeaways {
    margin: 30px 0 8px;
    padding: 20px 22px;
    border-radius: var(--lc-radius);
    background: linear-gradient(135deg, #0f766e 0%, #115e59 100%);
    color: #ccfbf1;
    box-shadow: 0 10px 24px -14px rgba(13, 148, 136, 0.7);
}

.lc-scope .lc-takeaways h3,
.lc-scope .lc-takeaways .lc-takeaways__title {
    margin: 0 0 12px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #5eead4;
}

.lc-scope .lc-takeaways ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.lc-scope .lc-takeaways li {
    position: relative;
    padding-left: 26px;
    margin-bottom: 10px;
    font-size: 14.5px;
    line-height: 1.7;
    color: #e2f5f2;
}

.lc-scope .lc-takeaways li:last-child { margin-bottom: 0; }

.lc-scope .lc-takeaways li::before {
    content: "";
    position: absolute;
    left: 2px;
    top: 8px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #2dd4bf;
    box-shadow: 0 0 0 3px rgba(45, 212, 191, 0.22);
}

.lc-scope .lc-takeaways strong { color: #ffffff; }

/* --------------------------------------------------------------------------
   4. Card grids
   -------------------------------------------------------------------------- */

.lc-scope .lc-grid {
    display: grid;
    gap: var(--lc-gap);
    margin: 22px 0;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.lc-scope .lc-grid.is-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.lc-scope .lc-grid.is-3 { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.lc-scope .lc-grid.is-4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

.lc-scope .lc-card {
    padding: 16px 18px;
    background: var(--lc-surface);
    border: 1px solid var(--lc-line);
    border-radius: var(--lc-radius-sm);
    border-top: 3px solid var(--lc-primary);
}

.lc-scope .lc-card > :last-child { margin-bottom: 0; }

.lc-scope .lc-card__title {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--lc-ink);
    margin: 0 0 8px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.lc-scope .lc-card__kicker {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--lc-muted);
    margin-bottom: 6px;
}

.lc-scope .lc-card p,
.lc-scope .lc-card li { font-size: 13.5px; line-height: 1.7; }

.lc-scope .lc-card.is-info { border-top-color: var(--lc-info); }
.lc-scope .lc-card.is-warn { border-top-color: var(--lc-warn); }
.lc-scope .lc-card.is-danger { border-top-color: var(--lc-danger); }
.lc-scope .lc-card.is-success { border-top-color: var(--lc-success); }
.lc-scope .lc-card.is-legal { border-top-color: var(--lc-legal); }

/* --------------------------------------------------------------------------
   5. Stat tiles
   -------------------------------------------------------------------------- */

.lc-scope .lc-stats {
    display: grid;
    gap: 14px;
    margin: 24px 0;
    grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
}

.lc-scope .lc-stat {
    padding: 16px 14px;
    text-align: center;
    background: var(--lc-surface-alt);
    border: 1px solid var(--lc-line);
    border-radius: var(--lc-radius-sm);
}

.lc-scope .lc-stat__num {
    display: block;
    font-size: 26px;
    font-weight: 800;
    line-height: 1.15;
    color: var(--lc-primary-dark);
    font-variant-numeric: tabular-nums;
}

.lc-scope .lc-stat__label {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--lc-muted);
}

.lc-scope .lc-stat.is-danger .lc-stat__num { color: var(--lc-danger); }
.lc-scope .lc-stat.is-warn .lc-stat__num { color: var(--lc-warn); }
.lc-scope .lc-stat.is-info .lc-stat__num { color: var(--lc-info); }

/* --------------------------------------------------------------------------
   6. Step flows
   -------------------------------------------------------------------------- */

.lc-scope .lc-steps {
    position: relative;
    margin: 24px 0;
    padding: 0;
    list-style: none;
}

.lc-scope .lc-steps::before {
    content: "";
    position: absolute;
    left: 15px;
    top: 10px;
    bottom: 10px;
    width: 2px;
    background: linear-gradient(180deg, var(--lc-primary) 0%, #99f6e4 100%);
}

.lc-scope .lc-step {
    position: relative;
    padding: 0 0 20px 46px;
    margin: 0;
}

.lc-scope .lc-step:last-child { padding-bottom: 0; }

.lc-scope .lc-step__n {
    position: absolute;
    left: 0;
    top: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--lc-primary);
    color: #fff;
    font-size: 13px;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 4px var(--lc-surface), 0 0 0 5px var(--lc-line);
}

.lc-scope .lc-step__title {
    font-size: 15px;
    font-weight: 700;
    color: var(--lc-ink);
    margin: 5px 0 6px;
}

.lc-scope .lc-step p,
.lc-scope .lc-step li { font-size: 14px; line-height: 1.72; }
.lc-scope .lc-step > :last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   7. Timeline
   -------------------------------------------------------------------------- */

.lc-scope .lc-timeline {
    margin: 24px 0;
    padding: 0;
    list-style: none;
    border-left: 2px solid var(--lc-line);
}

.lc-scope .lc-timeline li {
    position: relative;
    margin: 0 0 18px;
    padding: 0 0 0 22px;
}

.lc-scope .lc-timeline li:last-child { margin-bottom: 0; }

.lc-scope .lc-timeline li::before {
    content: "";
    position: absolute;
    left: -7px;
    top: 6px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--lc-surface);
    border: 3px solid var(--lc-primary);
}

.lc-scope .lc-timeline__when {
    display: block;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--lc-primary-dark);
    margin-bottom: 3px;
}

.lc-scope .lc-timeline__what { font-size: 14px; line-height: 1.7; color: var(--lc-body); }

/* --------------------------------------------------------------------------
   8. Do / Don't comparison
   -------------------------------------------------------------------------- */

.lc-scope .lc-compare {
    display: grid;
    gap: 16px;
    margin: 24px 0;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.lc-scope .lc-compare__col {
    padding: 16px 18px;
    border-radius: var(--lc-radius-sm);
    border: 1px solid var(--lc-line);
}

.lc-scope .lc-compare__col h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.lc-scope .lc-compare__col ul { margin: 0; padding-left: 18px; }
.lc-scope .lc-compare__col li { font-size: 13.5px; line-height: 1.7; margin-bottom: 7px; }

.lc-scope .lc-compare__col.is-do {
    background: var(--lc-success-soft);
    border-color: #bbf7d0;
}
.lc-scope .lc-compare__col.is-do h4 { color: #14532d; }
.lc-scope .lc-compare__col.is-do h4::before { content: "\2713"; font-size: 15px; color: var(--lc-success); }

.lc-scope .lc-compare__col.is-dont {
    background: var(--lc-danger-soft);
    border-color: #fecaca;
}
.lc-scope .lc-compare__col.is-dont h4 { color: #991b1b; }
.lc-scope .lc-compare__col.is-dont h4::before { content: "\2715"; font-size: 15px; color: var(--lc-danger); }

/* --------------------------------------------------------------------------
   9. Tables
   -------------------------------------------------------------------------- */

.lc-scope .lc-tablewrap {
    margin: 24px 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--lc-line);
    border-radius: var(--lc-radius-sm);
}

.lc-scope .lc-tablewrap > table {
    margin: 0 !important;
    border: 0 !important;
    min-width: 480px;
}

.lc-scope .lc-tablewrap > table th {
    background: #0f766e !important;
    color: #fff !important;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.03em;
    border-color: #115e59 !important;
    white-space: nowrap;
}

.lc-scope .lc-tablewrap > table tbody tr:nth-child(even) { background: var(--lc-surface-alt); }
.lc-scope .lc-tablewrap > table td { font-size: 13.5px; line-height: 1.65; vertical-align: top; }

/* --------------------------------------------------------------------------
   10. Pills / badges
   -------------------------------------------------------------------------- */

.lc-scope .lc-pill {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    line-height: 1.7;
    background: #e2e8f0;
    color: #334155;
    vertical-align: middle;
    white-space: nowrap;
}

.lc-scope .lc-pill.is-required { background: #fee2e2; color: #991b1b; }
.lc-scope .lc-pill.is-addressable { background: #fef3c7; color: #92400e; }
.lc-scope .lc-pill.is-new { background: #ccfbf1; color: #0f766e; }
.lc-scope .lc-pill.is-info { background: #e0f2fe; color: #075985; }
.lc-scope .lc-pill.is-legal { background: #ede9fe; color: #5b21b6; }
.lc-scope .lc-pill.is-success { background: #dcfce7; color: #14532d; }

/* --------------------------------------------------------------------------
   11. Definition blocks
   -------------------------------------------------------------------------- */

.lc-scope .lc-def {
    margin: 22px 0;
    padding: 16px 18px;
    background: var(--lc-surface-alt);
    border: 1px solid var(--lc-line);
    border-radius: var(--lc-radius-sm);
}

.lc-scope .lc-def__term {
    font-size: 15px;
    font-weight: 800;
    color: var(--lc-primary-dark);
    margin-bottom: 6px;
}

.lc-scope .lc-def__body { font-size: 14px; line-height: 1.75; color: var(--lc-body); }
.lc-scope .lc-def__body > :last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   12. Scenario / case study
   -------------------------------------------------------------------------- */

.lc-scope .lc-scenario {
    margin: 26px 0;
    border: 1px solid #c7d2fe;
    border-radius: var(--lc-radius);
    background: #eef2ff;
    overflow: hidden;
}

.lc-scope .lc-scenario__head {
    padding: 11px 18px;
    background: #4338ca;
    color: #e0e7ff;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.lc-scope .lc-scenario__body { padding: 16px 18px; font-size: 14px; line-height: 1.78; color: #312e81; }
.lc-scope .lc-scenario__body > :last-child { margin-bottom: 0; }
.lc-scope .lc-scenario__body strong { color: #1e1b4b; }

.lc-scope .lc-scenario__answer {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed #a5b4fc;
    font-size: 13.5px;
}

/* --------------------------------------------------------------------------
   13. Checklists
   -------------------------------------------------------------------------- */

.lc-scope .lc-check {
    margin: 22px 0;
    padding: 0;
    list-style: none;
}

.lc-scope .lc-check li {
    position: relative;
    padding: 0 0 0 30px;
    margin-bottom: 10px;
    font-size: 14px;
    line-height: 1.72;
    color: var(--lc-body);
}

.lc-scope .lc-check li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 3px;
    width: 18px;
    height: 18px;
    border-radius: 5px;
    border: 2px solid var(--lc-primary);
    background: var(--lc-primary-soft);
}

.lc-scope .lc-check li::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 6px;
    width: 5px;
    height: 9px;
    border-right: 2px solid var(--lc-primary-dark);
    border-bottom: 2px solid var(--lc-primary-dark);
    transform: rotate(42deg);
}

/* --------------------------------------------------------------------------
   14. Inline SVG helpers (classes used *inside* authored <svg> markup)
   -------------------------------------------------------------------------- */

.lc-scope svg text { font-family: 'Inter', system-ui, -apple-system, sans-serif; }
.lc-scope svg .lc-t { font-size: 13px; fill: #0f172a; }
.lc-scope svg .lc-t-sm { font-size: 11px; fill: #475569; }
.lc-scope svg .lc-t-xs { font-size: 9.5px; fill: #64748b; }
.lc-scope svg .lc-t-b { font-weight: 700; }
.lc-scope svg .lc-t-inv { fill: #ffffff; }
.lc-scope svg .lc-t-cap {
    font-size: 9.5px;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    fill: #64748b;
}

/* Motion — every animated diagram must sit inside .lc-anim so it can be
   disabled wholesale for reduced-motion users. */
@media (prefers-reduced-motion: reduce) {
    .lc-scope .lc-anim * {
        animation: none !important;
        transition: none !important;
    }
    /* SMIL: freeze at the final frame rather than looping */
    .lc-scope .lc-anim animate,
    .lc-scope .lc-anim animateTransform,
    .lc-scope .lc-anim animateMotion {
        display: none;
    }
}

/* --------------------------------------------------------------------------
   15. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 640px) {
    /* Keep diagrams legible rather than letting them shrink to fit. */
    .lc-scope .lc-scrollx > svg { min-width: 460px; }

    .lc-scope .lc-figure { padding: 14px 12px 12px; margin: 22px 0; }
    .lc-scope .lc-takeaways { padding: 16px 16px; }
    .lc-scope .lc-stat__num { font-size: 22px; }
    .lc-scope .lc-step { padding-left: 40px; }
    .lc-scope .lc-steps::before { left: 13px; }
    .lc-scope .lc-step__n { width: 28px; height: 28px; font-size: 12px; }
    .lc-scope .lc-scenario__body { padding: 14px; }
}

/* --------------------------------------------------------------------------
   16. Print
   -------------------------------------------------------------------------- */

@media print {
    .lc-scope .lc-figure,
    .lc-scope .lc-callout,
    .lc-scope .lc-card,
    .lc-scope .lc-scenario,
    .lc-scope .lc-takeaways {
        break-inside: avoid;
        page-break-inside: avoid;
        box-shadow: none;
    }
    .lc-scope .lc-takeaways {
        background: #f1f5f9 !important;
        color: #0f172a !important;
        border: 1px solid #cbd5e1;
    }
    .lc-scope .lc-takeaways h3,
    .lc-scope .lc-takeaways li,
    .lc-scope .lc-takeaways strong { color: #0f172a !important; }
    .lc-scope .lc-scrollx { overflow: visible; }
    .lc-scope .lc-scrollx > svg { min-width: 0; }
}
