/* One real course question to try, then an example dialogue. Load after editorial.css. */
.learning-preview {
    --preview-surface: var(--bg-alt, #171718);
    --try-card: var(--surface, #1C1C1E);
    --try-ok: #5FCE7C;
    --try-no: #FF7B7B;
    color: var(--ed-ink, #FFFAF5);
}

:root[data-theme='light'] .learning-preview {
    --preview-surface: #EEE3D3;
    --try-card: #FFFCF7;
    --try-ok: #1F7A3D;
    --try-no: #B3261E;
}

.learning-preview [hidden] { display: none !important; }

.learning-try__grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    grid-template-areas: 'intro card' 'steps card' 'bottom card';
    grid-template-rows: auto auto 1fr;
    column-gap: clamp(32px, 5vw, 64px);
    align-items: start;
}
.learning-try__intro { grid-area: intro; margin-bottom: 32px; }
.learning-try__intro h2 { margin: 0 0 16px; font-size: clamp(34px, 4.4vw, 52px); line-height: 1.12; }
.learning-try__intro p { max-width: 44ch; margin: 0; color: var(--ed-copy, #CCC9C4); font-size: 17px; line-height: 1.6; }
.learning-try__intro .learning-try__language-note { margin-top: 10px; color: var(--ed-muted, #ADAAA5); font-size: 13px; }

.learning-try__steps { grid-area: steps; margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--ed-line, #323234); }
.learning-try__steps li {
    position: relative;
    display: grid;
    gap: 2px;
    padding: 16px 0 16px 40px;
    border-bottom: 1px solid var(--ed-line, #323234);
}
.learning-try__steps li::before {
    content: '';
    position: absolute;
    top: 22px;
    left: 0;
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--ed-line, #323234);
    border-radius: 50%;
    box-sizing: border-box;
}
.learning-try__steps li.is-current::before { border-color: var(--ed-accent, #FF65BE); background: radial-gradient(circle, var(--ed-accent, #FF65BE) 0 4px, transparent 4.5px); }
.learning-try__steps li.is-done::before {
    content: '✓';
    display: grid;
    place-items: center;
    border-color: var(--ed-accent, #FF65BE);
    background: var(--ed-accent, #FF65BE);
    color: var(--ed-on-accent, #101011);
    font: 700 11px/1 var(--ed-font, sans-serif);
}
.learning-try__steps strong { font-family: var(--font-display, Georgia, serif); font-size: 21px; font-weight: 400; line-height: 1.3; }
.learning-try__steps span { color: var(--ed-muted, #ADAAA5); font-size: 14px; line-height: 1.5; }

.learning-try__card { grid-area: card; min-width: 0; padding: 28px; border: 1px solid var(--ed-line, #323234); background: var(--try-card); }
.learning-try__lecture { display: flex; align-items: center; gap: 16px; padding-bottom: 22px; margin-bottom: 24px; border-bottom: 1px solid var(--ed-line, #323234); }
.learning-try__lecture img { flex: 0 0 auto; display: block; width: 132px; height: auto; border: 1px solid var(--ed-line, #323234); }
.learning-try__lecture p { display: grid; gap: 2px; margin: 0; min-width: 0; }
.learning-try__lecture span { color: var(--ed-muted, #ADAAA5); font-size: 13px; line-height: 1.5; }
.learning-try__lecture strong { font-size: 15px; font-weight: 500; line-height: 1.4; }
.learning-try__question { margin: 0 0 20px; font-family: var(--font-display, Georgia, serif); font-size: 25px; font-weight: 400; line-height: 1.3; text-wrap: pretty; }
.learning-try__options { display: grid; gap: 10px; }
.learning-try__option {
    display: grid;
    grid-template-columns: 34px minmax(0, 1fr);
    align-items: center;
    gap: 14px;
    width: 100%;
    min-height: 60px;
    padding: 12px 16px;
    border: 1px solid var(--ed-line, #323234);
    border-radius: 0;
    background: transparent;
    color: var(--ed-ink, #FFFAF5);
    font: 400 16px/1.45 var(--ed-font, sans-serif);
    text-align: left;
    cursor: pointer;
    transition: border-color .16s ease, background-color .16s ease, opacity .16s ease;
}
.learning-try__letter { display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--ed-line, #323234); color: var(--ed-muted, #ADAAA5); font-size: 13px; }
/* Without the script the options are a plain list of choices, not controls. */
.learning-try__card:not(.is-try-enhanced) .learning-try__option { cursor: default; }
.learning-try__card.is-try-enhanced:not(.is-answered) .learning-try__option:hover { border-color: var(--ed-accent, #FF65BE); }
.learning-try__card.is-answered .learning-try__option { cursor: default; }
.learning-try__option.is-correct { border-color: var(--try-ok); background: color-mix(in srgb, var(--try-ok) 9%, transparent); }
.learning-try__option.is-correct .learning-try__letter { border-color: var(--try-ok); color: var(--try-ok); }
.learning-try__option.is-wrong { border-color: var(--try-no); background: color-mix(in srgb, var(--try-no) 8%, transparent); }
.learning-try__option.is-wrong .learning-try__letter { border-color: var(--try-no); color: var(--try-no); }
.learning-try__option.is-dim { opacity: .55; }
.learning-try__result { display: grid; gap: 14px; margin-top: 22px; }
.learning-try__result p { margin: 0; padding: 2px 0 2px 18px; border-left: 3px solid var(--ed-accent, #FF65BE); color: var(--ed-copy, #CCC9C4); font-size: 15px; line-height: 1.6; }
.learning-try__result strong { display: block; margin-bottom: 4px; color: var(--ed-ink, #FFFAF5); font-weight: 600; }
.learning-try__kai { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--ed-line, #323234); }
.learning-try__kai h3 { margin: 0 0 14px; font-family: var(--font-display, Georgia, serif); font-size: 21px; font-weight: 400; line-height: 1.3; }
.learning-try__kai p { margin: 0; font-size: 15px; line-height: 1.6; }
.learning-try__ask { width: fit-content; max-width: 80%; margin-left: auto !important; padding: 12px 16px; background: var(--ed-accent, #FF65BE); color: var(--ed-on-accent, #101011); }
.learning-try__answer { max-width: 90%; margin-top: 12px !important; padding: 14px 16px; border-left: 3px solid var(--ed-accent, #FF65BE); background: var(--preview-surface); color: var(--ed-copy, #CCC9C4); }
.learning-try__note { margin-top: 10px !important; color: var(--ed-muted, #ADAAA5); font-size: 13px !important; }

.learning-try__bottom { grid-area: bottom; display: grid; gap: 24px; margin-top: 36px; }
.learning-preview__voice { width: min(100%, 450px); min-width: 0; }
.learning-preview__voice-title { margin: 0 0 10px; color: var(--ed-ink, #FFFAF5); font-size: 14px; line-height: 1.5; font-weight: 500; }
.learning-preview__audio-controls { display: flex; align-items: center; gap: 12px; width: 100%; }
.learning-preview__play {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--ed-accent, #FF65BE);
    border-radius: 50%;
    background: var(--ed-accent, #FF65BE);
    color: var(--ed-on-accent, #101011);
    font: 15px/1 var(--ed-font, sans-serif);
    cursor: pointer;
}
.learning-preview__play:hover { border-color: var(--ed-ink, #FFFAF5); }
.learning-preview__progress { flex: 1 1 auto; min-width: 40px; width: 100%; min-height: 44px; margin: 0; padding: 0; border: 0; accent-color: var(--ed-accent, #FF65BE); cursor: pointer; }
.learning-preview__progress:disabled { cursor: default; opacity: .65; }
.learning-preview__time { flex: 0 0 auto; color: var(--ed-muted, #ADAAA5); font-size: 12px; line-height: 1.5; font-variant-numeric: tabular-nums; white-space: nowrap; }
.learning-preview__voice-note,
.learning-preview__audio-status { margin: 8px 0 0; color: var(--ed-muted, #ADAAA5); font-size: 12px; line-height: 1.55; }
.learning-preview__audio-status:empty { display: none; }
.learning-preview__audio-status:not(:empty) { color: var(--ed-copy, #CCC9C4); }
.learning-preview :is(button, input, audio):focus-visible { outline: 2px solid var(--ed-accent, #FF65BE); outline-offset: 3px; }

@media (max-width: 860px) {
    .learning-try__grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'intro' 'steps' 'card' 'bottom'; grid-template-rows: none; }
    .learning-try__intro { margin-bottom: 20px; }
    .learning-try__intro p { font-size: 16px; }
    /* On a phone the three steps are a compact line above the question. */
    .learning-try__steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-bottom: 20px; border-top: 0; }
    .learning-try__steps li { padding: 30px 0 0; border-bottom: 0; border-top: 2px solid var(--ed-line, #323234); }
    .learning-try__steps li:is(.is-done, .is-current) { border-top-color: var(--ed-accent, #FF65BE); }
    .learning-try__steps li::before { top: 8px; width: 16px; height: 16px; }
    .learning-try__steps strong { font-size: 16px; }
    .learning-try__steps span { display: none; }
    .learning-try__card { padding: 20px 16px; }
    .learning-try__lecture img { width: 104px; }
    .learning-try__question { font-size: 22px; }
    .learning-try__ask { max-width: 88%; }
    .learning-try__answer { max-width: 100%; }
    .learning-try__bottom { margin-top: 28px; }
    .learning-preview__voice { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    .learning-try__option { transition: none; }
}
