/* WideSprout Español — Exercises (Listening, Reading, Writing). Builds on styles.css (.lp-* practice styles). */

/* ---------- one exercise ---------- */
.ex-wrap { display: flex; flex-direction: column; gap: 24px; max-width: 920px; }
.ex-card { padding: clamp(18px, 3vw, 32px); display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.ex-bar { display: flex; flex-direction: column; gap: 12px; }
.ex-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.ex-progress { font-size: 14px; font-weight: 800; color: var(--ink-soft); }
.ex-progress:empty { display: none; }
.ex-panel { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.ex-panel[hidden] { display: none; }

/* "Show English" switch */
.ex-switch { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; font-weight: 800; font-size: 15px; color: var(--navy); cursor: pointer; user-select: none; }
.ex-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ex-switch-ui { position: relative; flex: none; width: 46px; height: 28px; border-radius: 999px; background: #EADCBF; border: 2px solid var(--navy); transition: background .15s; }
.ex-switch-ui::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--navy); transition: transform .15s; }
.ex-switch input:checked + .ex-switch-ui { background: var(--ochre); }
.ex-switch input:checked + .ex-switch-ui::after { transform: translateX(18px); }
.ex-switch input:focus-visible + .ex-switch-ui { outline: 3px solid var(--tile); outline-offset: 3px; }

.ex-en { display: none; color: var(--ink-soft); font-size: 15px; font-weight: 600; }
.show-en .ex-en { display: block; }
.show-en span.ex-en { display: inline; }
.lp-q + .ex-en, p.ex-en { margin: 4px 0 0; }

/* Before you start */
.ex-notes { border-radius: 18px; background: var(--paper); border: 1.5px solid var(--line); }
.ex-notes summary { cursor: pointer; padding: 12px 18px; font-family: var(--display); font-weight: 600; font-size: 18px; color: var(--navy); }
.ex-notes-body { display: grid; gap: 14px; padding: 0 18px 16px; }
.ex-note b { font-family: var(--display); font-weight: 600; font-size: 17px; color: var(--terracotta-deep); }
.ex-note p { margin: 4px 0 0; font-size: 16px; line-height: 1.55; }
.ex-note .lp-examples { margin-top: 8px; padding-top: 8px; }

/* Listening player */
.ex-player { display: flex; align-items: center; gap: 16px; padding: clamp(14px, 3vw, 20px); border-radius: 22px; background: var(--navy); color: var(--cream); }
.ex-play { flex: none; display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--ochre); color: var(--navy); cursor: pointer; box-shadow: 0 6px 0 rgba(0, 0, 0, .2); }
.ex-play:hover { background: #F6C25C; }
.ex-play:active { transform: translateY(2px); box-shadow: 0 4px 0 rgba(0, 0, 0, .2); }
.ex-play:focus-visible { outline-color: var(--ochre); }
.ex-player-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ex-player-title { font-family: var(--display); font-weight: 600; font-size: 20px; line-height: 1.2; }
.ex-player-sub { font-size: 14px; opacity: .85; }
.ex-bar-track { display: flex; gap: 3px; margin-top: 4px; }
.ex-bar-track i { flex: 1; height: 8px; border-radius: 999px; background: rgba(251, 243, 226, .2); transition: background .2s; }
.ex-bar-track i.is-done { background: var(--ochre); }
.ex-bar-track i.is-now { background: #FFE3A0; animation: ex-pulse 1s ease-in-out infinite alternate; }
@keyframes ex-pulse { from { opacity: .55; } to { opacity: 1; } }
.ex-player-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.ex-now { font-size: 14px; font-weight: 700; }
.ex-player-btns { display: inline-flex; gap: 6px; }
.ex-mini { min-height: 36px; padding: 4px 12px; font: inherit; font-size: 13px; font-weight: 800; color: var(--cream); background: transparent; border: 1.5px solid rgba(251, 243, 226, .6); border-radius: 999px; cursor: pointer; }
.ex-mini[aria-pressed="true"] { background: var(--cream); color: var(--navy); border-color: var(--cream); }
.ex-mini:focus-visible { outline-color: var(--ochre); }

/* Transcript */
.ex-script { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ex-sline { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; border-radius: 16px; background: var(--paper); border-left: 4px solid var(--terracotta); }
.ex-sline.who-1 { border-left-color: var(--tile); background: #EEF3FA; }
.ex-sline.who-2 { border-left-color: var(--olive); }
.ex-sline p { margin: 2px 0 0; }
.ex-sline p[lang="es"] { font-weight: 700; color: var(--navy); line-height: 1.45; }
.ex-sname { display: block; font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.ex-script.is-solo .ex-sname { display: none; }

/* Words */
.ex-wgroup { display: flex; flex-direction: column; gap: 10px; }
.ex-wgroup h3 { margin: 6px 0 0; color: var(--terracotta-deep); }

/* Reading: the document */
.ex-doc { border-radius: 20px; background: var(--paper); border: 1.5px solid var(--line); padding: clamp(16px, 3vw, 26px); display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 90px; }
.ex-doc-head { display: flex; flex-direction: column; gap: 4px; }
.ex-doc-meta { font-size: 14px; font-weight: 700; color: var(--ink-soft); white-space: pre-line; }
.ex-doc-title { font-family: var(--display); font-weight: 600; font-size: clamp(20px, 3vw, 24px); color: var(--navy); line-height: 1.2; }
.ex-doc-body { display: flex; flex-direction: column; gap: 12px; }
.ex-doc-h { margin: 8px 0 0; font-family: var(--display); font-weight: 600; font-size: 18px; color: var(--terracotta-deep); }
.ex-doc-h .ex-en { font-family: var(--body); }
.ex-para { display: flex; align-items: flex-start; gap: 10px; border-radius: 12px; }
.ex-para > div { min-width: 0; }
.ex-para p[lang="es"] { font-size: 17px; line-height: 1.75; }
.ex-doc-email .ex-doc-head { padding-bottom: 12px; border-bottom: 1.5px dashed var(--line); }
.ex-doc-menu .ex-doc-title, .ex-doc-notice .ex-doc-title { text-align: center; }
.ex-menu-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px dotted var(--line); font-weight: 700; color: var(--navy); }
.ex-price { flex: none; font-family: var(--display); font-weight: 600; color: var(--terracotta-deep); }
.ex-doc-ads .ex-para { padding: 12px; background: #fff; border: 1.5px dashed var(--line); }
.ex-doc-chat { background: #EFE7D6; }
.ex-msg { max-width: 86%; padding: 8px 12px; border-radius: 16px 16px 16px 4px; background: #fff; box-shadow: 0 1px 0 rgba(22, 50, 79, .08); }
.ex-msg.who-1 { margin-left: auto; border-radius: 16px 16px 4px 16px; background: #DCF3D0; }
.ex-msg-name { display: block; font-size: 12px; font-weight: 800; color: var(--terracotta-deep); }
.ex-msg.who-1 .ex-msg-name { color: var(--shutter); }
.ex-msg p { margin: 2px 0 0; line-height: 1.5; }
[data-b].is-ref { animation: ex-ref 2.2s ease; }
@keyframes ex-ref { 0%, 60% { background: #FFE9A8; box-shadow: 0 0 0 6px #FFE9A8; } 100% { background: transparent; box-shadow: 0 0 0 6px transparent; } }
.ex-doc-tip { margin: 0; font-size: 14px; color: var(--ink-soft); }
.ex-gl-demo { border-bottom: 2px dotted var(--ochre-deep); font-weight: 700; }

/* Words in the text */
.ex-gl { display: inline; padding: 0; margin: 0; font: inherit; color: inherit; background: transparent; border: 0; border-bottom: 2px dotted var(--ochre-deep); border-radius: 0; cursor: pointer; text-align: inherit; }
.ex-gl:hover, .ex-gl[aria-expanded="true"] { background: #FFF1C9; }
.ex-gl-pop { display: none; margin-left: 4px; padding: 0 6px; border-radius: 6px; background: var(--navy); color: var(--cream); font-size: 13px; font-weight: 700; white-space: normal; }
.ex-gl[aria-expanded="true"] .ex-gl-pop { display: inline; }
.is-finding .ex-doc { border-color: var(--terracotta); box-shadow: 0 0 0 3px #F8DCD0; }
.is-finding .ex-tok { cursor: pointer; border-radius: 4px; }
.is-finding .ex-tok:hover { background: #F8DCD0; }
.ex-tok.is-bad { animation: lp-shake .35s; background: #F8DCD0; }
.ex-tok.is-found { background: #DDEBD4; box-shadow: 0 0 0 2px #DDEBD4; border-radius: 4px; }
.ex-tok.is-shown { background: #FFE9A8; box-shadow: 0 0 0 2px #FFE9A8; border-radius: 4px; }

/* Tasks */
.ex-task.is-complete .lp-block-num { background: #4E7F35; }
.ex-why { display: block; flex-basis: 100%; color: var(--ink); font-size: 15px; }
.ex-ref { padding: 2px 10px; font: inherit; font-size: 14px; font-weight: 800; color: var(--tile); background: #fff; border: 1.5px solid var(--tile); border-radius: 999px; cursor: pointer; }
.ex-input { font: inherit; font-weight: 800; color: var(--navy); background: #fff; border: 2px solid var(--line); border-radius: 10px; padding: 6px 10px; max-width: 100%; }
.ex-input:focus { outline: none; border-color: var(--tile); box-shadow: 0 0 0 3px rgba(43, 91, 168, .2); }
.ex-input:disabled { background: var(--cream); }
.ex-gap { width: 9em; margin: 0 4px; padding: 2px 8px; color: var(--terracotta-deep); }
.ex-wide { display: block; width: 100%; margin-top: 10px; font-weight: 700; resize: vertical; }
textarea.ex-input { line-height: 1.5; }
.lp-item.is-right .ex-input { border-color: #4E7F35; }
.lp-item.is-wrong .ex-input { border-color: var(--terracotta); }
.ex-gap-row { display: flex; align-items: flex-start; gap: 10px; }
.ex-gap-row .icon-btn { margin-top: 2px; }
.ex-hint { margin: 4px 0 0; font-size: 14px; color: var(--ink-soft); }
.ex-fb { font-weight: 800; color: var(--navy); }
.lp-item.is-wrong .ex-fb { color: var(--terracotta-deep); }
.lp-item.is-right .ex-fb { color: #1F4A36; }
.ex-src { font-weight: 700; }
.ex-yours { flex-basis: 100%; }
.ex-yours:empty { display: none; }
.ex-yours-l { font-weight: 800; color: var(--ink-soft); }
.ex-x { color: var(--terracotta-deep); text-decoration: line-through; text-decoration-thickness: 2px; }
.ex-model { display: inline-flex; align-items: center; gap: 8px; }
.ex-find-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.ex-find-row .btn[aria-pressed="true"] { background: var(--terracotta); color: #fff; border-color: var(--terracotta); }

/* Put in order */
.ex-order { display: flex; flex-direction: column; gap: 10px; }
.ex-order ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ex-order-picked { counter-reset: ex; min-height: 54px; padding: 8px !important; border-radius: 16px; border: 2px dashed var(--line); }
.ex-order-picked li { counter-increment: ex; display: flex; align-items: center; gap: 8px; }
.ex-order-picked li::before { content: counter(ex); flex: none; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--navy); color: var(--paper); font-weight: 800; font-size: 14px; }
.ex-order-picked li.is-right::before { background: #4E7F35; }
.ex-order-picked li.is-wrong::before { background: var(--terracotta-deep); }
.ex-order-label { margin: 4px 0 0; font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); }
.ex-card-btn { width: 100%; text-align: left; padding: 10px 14px; font: inherit; font-weight: 700; font-size: 16px; line-height: 1.4; color: var(--navy); background: #fff; border: 2px solid var(--navy); border-radius: 14px; cursor: pointer; }
.ex-card-btn:hover:not(:disabled) { background: #FFF1C9; }
.ex-card-btn .ex-en { font-size: 14px; }
li.is-right > .ex-card-btn { border-color: #4E7F35; background: #DDEBD4; }
li.is-wrong > .ex-card-btn { border-color: var(--terracotta-deep); background: #F8DCD0; }
.ex-order-key { counter-reset: k; }
.ex-order-key li { counter-increment: k; padding: 8px 12px; border-radius: 12px; background: var(--paper); font-weight: 700; color: var(--navy); }
.ex-order-key li::before { content: counter(k) ". "; }

/* Sentences made of tappable words (find the mistake, proofreading) */
.ex-sent { margin: 0; font-size: 18px; line-height: 2.1; }
.ex-wtok { display: inline; padding: 2px 4px; margin: 0 -2px; font: inherit; font-weight: 700; color: var(--navy); background: transparent; border: 0; border-radius: 6px; cursor: pointer; }
.ex-wtok:hover:not(:disabled) { background: #FFF1C9; }
.ex-wtok:disabled { cursor: default; }
.ex-wtok.is-flag { background: #FFE3A0; box-shadow: inset 0 -3px 0 var(--ochre-deep); }
.ex-wtok.is-bad { animation: lp-shake .35s; background: #F8DCD0; }
.ex-wtok.is-fixed { background: #DDEBD4; color: #1F4A36; box-shadow: inset 0 -3px 0 #4E7F35; }
.ex-wtok.is-missed { background: #F8DCD0; color: var(--terracotta-deep); box-shadow: inset 0 -3px 0 var(--terracotta-deep); }
.ex-wtok.is-false { text-decoration: line-through; color: var(--ink-soft); background: transparent; box-shadow: none; }
.ex-fix-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 8px; }
.ex-fix-row[hidden] { display: none; }
.ex-fix-row label { font-weight: 700; color: var(--navy); }
.ex-fix-in { width: 10em; margin-left: 6px; }
.ex-proof { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 16px; background: var(--paper); }
.ex-proof-count { margin: 0; font-size: 14px; font-weight: 800; color: var(--ink-soft); }
.ex-proof-key { margin: 0; padding-left: 22px; display: grid; gap: 6px; }
.ex-proof-key li { padding: 6px 10px; border-radius: 10px; border-left: 4px solid var(--line); background: #fff; }
.ex-proof-key li.is-right { border-left-color: #4E7F35; }
.ex-proof-key li.is-wrong { border-left-color: var(--terracotta-deep); }
.ex-proof-pair s { color: var(--terracotta-deep); }
.ex-proof-pair b { color: #1F4A36; }
.ex-proof-key .ex-why { display: inline; font-size: 14px; color: var(--ink-soft); }
.ex-proof-fixed p[lang="es"] { margin: 4px 0 0; line-height: 1.7; }

/* Build the sentence */
.ex-build-line { display: flex; flex-wrap: wrap; gap: 6px; min-height: 52px; margin-top: 10px; padding: 6px; border-radius: 14px; border: 2px dashed var(--line); background: #fff; }
.ex-build-pool { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ex-wtile { min-height: 40px; padding: 6px 12px; font: inherit; font-weight: 800; font-size: 16px; color: var(--navy); background: #fff; border: 2px solid var(--navy); border-radius: 10px; cursor: pointer; box-shadow: 0 3px 0 var(--navy); }
.ex-build-line .ex-wtile { background: #FFF1C9; }
.ex-wtile:disabled { cursor: default; box-shadow: none; }
.lp-item.is-right .ex-build-line .ex-wtile { background: #DDEBD4; border-color: #4E7F35; }
.lp-item.is-wrong .ex-build-line .ex-wtile { background: #F8DCD0; border-color: var(--terracotta-deep); }
.ex-build-foot { display: flex; justify-content: flex-end; margin-top: 10px; }

/* Guided writing */
.ex-write { display: flex; flex-direction: column; gap: 12px; }
.ex-prompt { padding: 12px 16px; border-radius: 14px; background: var(--paper); border-left: 5px solid var(--tile); }
.ex-prompt p[lang="es"] { font-weight: 700; color: var(--navy); line-height: 1.5; }
.ex-write-box { width: 100%; min-height: 180px; font-weight: 600; line-height: 1.6; resize: vertical; }
.ex-write-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 800; color: var(--ink-soft); }
[data-wc].is-ok { color: #1F4A36; }
[data-wc].is-ok::before { content: "✓ "; }
.ex-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ex-checks li { display: flex; align-items: flex-start; gap: 10px; padding: 8px 12px; border-radius: 12px; background: var(--paper); font-size: 15px; font-weight: 700; color: var(--ink-soft); transition: background .2s, color .2s; }
.ex-tick { flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 6px; border: 2px solid var(--line); background: #fff; }
.ex-checks li.is-on { background: #DDEBD4; color: #1F4A36; }
.ex-checks li.is-on .ex-tick { border-color: #4E7F35; background: #4E7F35 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 16px no-repeat; }
.ex-write-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.ex-model-box { padding: 12px 16px; border-radius: 14px; background: #FFF6DF; }
.ex-model-box[hidden] { display: none; }
.ex-model-box p[lang="es"] { margin: 4px 0 0; font-weight: 700; color: var(--navy); line-height: 1.6; white-space: pre-line; }

/* Finished */
.ex-finish { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: 20px; background: #DDEBD4; color: #1F4A36; }
.ex-finish[hidden] { display: none; }
.ex-finish b { font-family: var(--display); font-weight: 600; font-size: 20px; }
.ex-finish p { margin: 4px 0 0; font-size: 15px; }
.ex-finish-badge { flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: #4E7F35; color: #fff; font-family: var(--display); font-weight: 700; font-size: 18px; }
.ex-finish-badge:empty { display: none; }

.ex-pager { margin: 0; }

/* ---------- the list at /exercises/ ---------- */
.ex-skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.ex-skill { display: flex; gap: 14px; padding: 18px; border-radius: 22px; background: var(--paper); border: 2px solid var(--line); color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s; }
.ex-skill:hover { border-color: var(--navy); transform: translateY(-2px); color: var(--ink); }
.ex-skill.is-on { border-color: var(--navy); background: #FFF6DF; box-shadow: var(--shadow); }
.ex-skill-icon { flex: none; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--cream); font-size: 26px; }
.ex-skill-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ex-skill-body b { font-family: var(--display); font-weight: 600; font-size: 21px; color: var(--navy); }
.ex-skill-body small { font-size: 14px; line-height: 1.45; color: var(--ink-soft); }
.ex-skill-count { margin-top: 4px; font-size: 13px; font-weight: 800; color: var(--terracotta-deep); }
.ex-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.ex-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ex-chip { min-height: 40px; padding: 6px 14px; font: inherit; font-weight: 800; font-size: 14px; color: var(--navy); background: #fff; border: 2px solid var(--navy); border-radius: 999px; cursor: pointer; }
.ex-chip[aria-pressed="true"] { background: var(--navy); color: var(--cream); }
.ex-select select { min-height: 42px; padding: 6px 12px; font: inherit; font-weight: 700; color: var(--navy); background: #fff; border: 2px solid var(--navy); border-radius: 999px; max-width: 100%; }
.ex-summary { margin: 0 0 0 auto; font-size: 14px; font-weight: 800; color: var(--ink-soft); }
.ex-groups { display: flex; flex-direction: column; gap: 32px; }
.ex-group { display: flex; flex-direction: column; gap: 14px; }
.ex-group[hidden] { display: none; }
.ex-group-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-size: clamp(22px, 3vw, 28px); color: var(--navy); }
.ex-group-head small { font-family: var(--body); font-size: 14px; font-weight: 800; color: var(--ink-soft); }
.ex-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.ex-item { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px; border-radius: 20px; background: var(--paper); border: 2px solid var(--line); color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s; }
.ex-item[hidden] { display: none; }
.ex-item:hover { border-color: var(--navy); transform: translateY(-2px); color: var(--ink); }
.ex-item-top { display: flex; align-items: center; gap: 8px; }
.ex-item-skill { font-size: 14px; font-weight: 800; color: var(--ink-soft); }
.ex-item-state { margin-left: auto; font-size: 13px; font-weight: 800; color: var(--terracotta-deep); }
.ex-item.is-done { border-color: #A9C79A; }
.ex-item.is-done .ex-item-state { color: #1F4A36; }
.ex-item.is-locked .ex-item-state::before { content: "🔒 "; }
.ex-item-title { font-family: var(--display); font-weight: 600; font-size: 19px; line-height: 1.2; color: var(--navy); }
.ex-item-lead { font-size: 15px; line-height: 1.45; color: var(--ink); }
.ex-item-meta { margin-top: auto; font-size: 13px; font-weight: 700; color: var(--ink-soft); }
.ex-empty { margin: 0; font-weight: 700; color: var(--ink-soft); }

@media (max-width: 560px) {
  .ex-player { flex-direction: column; align-items: stretch; text-align: left; }
  .ex-play { width: 64px; height: 64px; align-self: center; }
  .ex-tabs .tab { padding: 8px 10px; font-size: 15px; }
  .ex-sent { font-size: 17px; }
  .ex-msg { max-width: 94%; }
  .ex-summary { margin-left: 0; flex-basis: 100%; }
  .ex-gap { width: 7em; }
  .ex-para .icon-btn { width: 30px; height: 30px; }
}
@media (prefers-reduced-motion: reduce) {
  .ex-bar-track i.is-now, [data-b].is-ref, .ex-tok.is-bad, .ex-wtok.is-bad { animation: none; }
}
