/* Practice pages: /spanish-listening-practice (lp-) and /spanish-reading-practice (rp-),
   shared bits (pp-). Built by scripts/site/build_practice_pages.py. Colors come from site.css
   variables only, so dark mode follows the rest of the site. */

/* ---------- shared ---------- */
.pp-from { margin: 0; background: var(--card); border: 1px solid var(--rule); border-radius: 18px; overflow: hidden; align-self: start; }
.pp-from img { aspect-ratio: 2 / 1; object-fit: cover; width: 100%; }
.pp-from figcaption { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 2px; }
.pp-from .eyebrow { margin: 0 0 6px; }
.pp-from-t { font: 700 22px/1.15 var(--display); color: var(--ink); }
.pp-from-s { font-size: 14.5px; color: var(--muted); }

.pp-transcript { margin-top: 28px; }
.pp-transcript ol { margin: 4px 0 0; padding-left: 1.4em; }
.pp-transcript li { margin: 0 0 12px; }
.pp-transcript .es { display: block; font: 400 18px/1.45 var(--story); color: var(--ink); }
.pp-transcript .en { display: block; font-size: 15px; color: var(--muted); }

.pp-next-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.pp-next-card { display: flex; flex-direction: column; text-decoration: none; color: inherit; background: var(--card); border: 1px solid var(--rule); border-radius: 18px; overflow: hidden; transition: transform .15s, box-shadow .15s; }
.pp-next-card:hover { transform: translateY(-2px); box-shadow: 0 18px 36px -28px rgba(30,42,51,.6); }
.pp-next-card img { aspect-ratio: 2 / 1; object-fit: cover; width: 100%; }
.pp-next-body { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px 20px; }
.pp-next-k { font: 600 12px/1 var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.pp-next-t { font: 700 20px/1.2 var(--display); color: var(--ink); }
.pp-next-t::after { content: " →"; }
.pp-next-card:hover .pp-next-t { text-decoration: underline; }
.pp-next-s { font-size: 15px; color: var(--ink-soft); }
.pp-next h2 { margin-bottom: 24px; }

/* option buttons used by both pages */
.lp-opt, .rp-opt { display: block; width: 100%; text-align: left; min-height: 52px; padding: 12px 44px 12px 16px; border: 1.5px solid var(--rule); border-radius: 14px; background: var(--paper); color: var(--ink); cursor: pointer; position: relative; transition: border-color .15s; }
.lp-opt:hover:not(:disabled), .rp-opt:hover:not(:disabled) { border-color: var(--ink); }
.lp-opt:disabled, .rp-opt:disabled { cursor: default; opacity: 1; }
.lp-opt.right, .rp-opt.right { border: 2px solid var(--ink); font-weight: 600; }
.lp-opt.right::after, .rp-opt.right::after { content: "✓"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: var(--paper); font: 700 14px/24px var(--ui); text-align: center; }
.lp-opt.wrong, .rp-opt.wrong { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1.5px; border-style: dashed; }
.lp-opt.wrong::after, .rp-opt.wrong::after { content: "✕"; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; border-radius: 50%; border: 1.5px solid var(--muted); color: var(--muted); font: 700 12px/21px var(--ui); text-align: center; text-decoration: none; }

/* ---------- listening ---------- */
.lp-board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 28px; max-width: 640px; }
.lp-meter { display: flex; flex-direction: column; gap: 4px; text-decoration: none; border: 1px solid rgba(252, 245, 231, .28); border-radius: 14px; padding: 12px 14px; min-height: 44px; }
.lp-meter:hover { border-color: var(--on-slate); }
.lp-meter-n { font: 700 28px/1 var(--display); color: var(--on-slate); font-variant-numeric: tabular-nums; }
.lp-meter-l { font-size: 13.5px; color: var(--on-slate-muted); line-height: 1.3; }

.lp-intro-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, .8fr); gap: 48px; align-items: start; }
.lp-intro h2 { font-size: clamp(26px, 3.4vw, 34px); }
.lp-intro p { color: var(--ink-soft); }
.lp-howto { background: var(--card); border: 1px solid var(--rule); border-radius: 18px; padding: 22px 24px 8px; }
.lp-howto ol { padding-left: 1.2em; margin: 10px 0 0; }
.lp-howto li { margin: 0 0 14px; color: var(--ink-soft); }

.lp-ex-head { display: flex; gap: 20px; align-items: flex-start; margin-bottom: 28px; max-width: 760px; }
.lp-num { flex: none; width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; font: 700 26px/1 var(--display); margin: 0; }
.lp-ex-head h2 { margin-bottom: 8px; }
.lp-lede { margin: 0; color: var(--ink-soft); font-size: 18px; }
.lp-ex-grid { display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr); gap: 32px; align-items: start; }
.lp-flip .pp-from { order: 2; }

.lp-console { background: var(--card); border: 1px solid var(--rule); border-radius: 22px; padding: 22px 24px 24px; box-shadow: 0 24px 50px -36px rgba(30,42,51,.45); min-width: 0; }
.lp-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.lp-count { font: 600 13px/1 var(--ui); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.lp-dots { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.lp-dots li { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid var(--muted); }
.lp-dots li.now { border-color: var(--ink); box-shadow: 0 0 0 2px var(--tint); transform: scale(1.2); }
.lp-dots li.ok { background: var(--ink); border-color: var(--ink); }
.lp-dots li.no { border-style: dashed; background: linear-gradient(135deg, transparent 44%, var(--muted) 44%, var(--muted) 56%, transparent 56%); }

.lp-player { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.lp-player-side { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.lp-hint { margin: 0; color: var(--ink-soft); font-size: 15.5px; }
.lp-play { flex: none; width: 80px; height: 80px; border-radius: 50%; border: 0; background: var(--ink); color: var(--paper); cursor: pointer; display: grid; place-items: center; box-shadow: 0 10px 24px -12px rgba(30,42,51,.7); transition: transform .12s; }
.lp-play:hover { transform: scale(1.04); }
.lp-play:active { transform: scale(.97); }
.lp-play-i { width: 0; height: 0; border-style: solid; border-width: 14px 0 14px 23px; border-color: transparent transparent transparent currentColor; margin-left: 6px; }
.lp-play.is-playing .lp-play-i { width: 22px; height: 22px; border: 0; background: currentColor; border-radius: 4px; margin-left: 0; }
@media (prefers-reduced-motion: no-preference) {
  .lp-play.is-playing { animation: lp-pulse 1.4s ease-in-out infinite; }
  @keyframes lp-pulse { 0%, 100% { box-shadow: 0 0 0 0 var(--rule); } 50% { box-shadow: 0 0 0 10px var(--tint); } }
}
.lp-speed { display: inline-flex; border: 1.5px solid var(--ink); border-radius: 12px; overflow: hidden; align-self: flex-start; }
.lp-speed button { min-height: 44px; min-width: 76px; padding: 0 14px; border: 0; background: transparent; color: var(--ink); font: 600 15px/1 var(--ui); cursor: pointer; }
.lp-speed button + button { border-left: 1.5px solid var(--ink); }
.lp-speed button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.lp-opts { display: grid; gap: 10px; }
.lp-opt { font: 400 19px/1.4 var(--story); }
.lp-opts-en .lp-opt { font: 400 17px/1.4 var(--ui); }
.lp-msg { min-height: 1.5em; margin: 14px 0 0; font-weight: 600; color: var(--ink); }
.lp-after .en-text { margin-top: 6px; }
.lp-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; align-items: center; }
.lp-actions [hidden] { display: none; }
.lp-link-btn { display: inline-flex; align-items: center; text-decoration: none; }
.lp-result { text-align: center; padding: 8px 0 4px; }
.lp-result p { color: var(--ink-soft); margin: 0 auto; max-width: 30em; }
.lp-result .lp-big { font: 700 56px/1 var(--display); color: var(--ink); margin: 6px 0 12px; font-variant-numeric: tabular-nums; }
.lp-result .lp-actions { justify-content: center; margin-top: 20px; }

.lp-gap-line { color: var(--ink); margin: 0 0 4px; }
.gap-in.shown { background: transparent; border-bottom: 2px dashed var(--muted); border-radius: 0; }

.lp-scene { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 32px; align-items: start; }
.lp-scene-pic img { border-radius: 18px; aspect-ratio: 2 / 1; object-fit: cover; width: 100%; }
.lp-scene-cap { font-size: 14.5px; color: var(--muted); margin: 10px 2px 0; }
.lp-scene-cap span { font-weight: 600; color: var(--ink); }
.lp-setup { background: var(--card); border: 1px solid var(--rule); border-left: 4px solid var(--ink); border-radius: 12px; padding: 14px 18px; margin: 0 0 18px; color: var(--ink-soft); }
.lp-track { list-style: none; margin: -4px 0 22px; padding: 0; display: flex; gap: 4px; }
.lp-track li { flex: 1; height: 6px; border-radius: 3px; background: var(--rule); }
.lp-track li.past { background: var(--ink); }
.lp-track li.now { background: var(--ink); opacity: .55; }
.lp-qs-h { margin: 0 0 10px; }
.lp-qs { list-style: none; margin: 0; padding: 0; counter-reset: q; }
.lp-q { counter-increment: q; padding: 16px 0; border-top: 1px solid var(--rule); }
.lp-q-t { font-weight: 600; margin: 0 0 10px; color: var(--ink); }
.lp-q-t::before { content: counter(q) ". "; color: var(--muted); }
.lp-q .lp-msg { margin-top: 10px; }
.lp-why-l { font-size: 14px; color: var(--muted); margin: 8px 0 6px; }
.lp-quote { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 8px; }
.lp-quote .again { flex: none; width: 44px; height: 44px; vertical-align: 0; }
.lp-quote p { margin: 0; }
.lp-quote [lang="es"] { display: block; font: 400 18px/1.4 var(--story); color: var(--ink); }
.lp-quote .en { display: block; font-size: 15px; color: var(--muted); }
.lp-scene-score { font-weight: 600; margin: 8px 0 0; min-height: 1.5em; }

.lp-total { font: 700 clamp(56px, 9vw, 80px)/1 var(--display); color: var(--ink) !important; margin: 0 0 10px; font-variant-numeric: tabular-nums; }
.lp-done h2:first-child { margin-top: 0; }

/* ---------- reading ---------- */
.rp-flow { list-style: none; margin: 26px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px 22px; color: var(--on-slate); font-size: 16px; }
.rp-flow li { display: flex; align-items: center; gap: 10px; }
.rp-flow span { width: 30px; height: 30px; border-radius: 50%; border: 1.5px solid var(--on-slate-muted); display: grid; place-items: center; font: 700 14px/1 var(--display); }

.rp-scenes { padding-top: 0; }
.rp-bar { position: sticky; top: 0; z-index: 5; background: var(--paper); border-bottom: 1px solid var(--rule); margin-bottom: 48px; }
.rp-bar-in { display: flex; align-items: center; gap: 10px 18px; flex-wrap: wrap; min-height: 56px; padding-top: 8px; padding-bottom: 8px; }
.rp-bar-score { font: 600 16px/1 var(--ui); }
.rp-bar-score strong { font: 700 22px/1 var(--display); font-variant-numeric: tabular-nums; }
.rp-squares { display: inline-flex; gap: 5px; flex-wrap: wrap; }
.rp-squares i { width: 16px; height: 16px; border-radius: 4px; border: 1.5px solid var(--muted); }
.rp-squares i.ok { background: var(--ink); border-color: var(--ink); }
.rp-squares i.no { border-style: dashed; background: linear-gradient(135deg, transparent 44%, var(--muted) 44%, var(--muted) 56%, transparent 56%); }
.rp-bar-left { font-size: 14.5px; color: var(--muted); margin-left: auto; }

.rp-list { display: grid; gap: 56px; }
.rp-card { max-width: 820px; width: 100%; margin: 0 auto; background: var(--card); border: 1px solid var(--rule); border-radius: 24px; overflow: hidden; box-shadow: 0 24px 50px -38px rgba(30,42,51,.5); scroll-margin-top: 72px; }
.rp-pic { position: relative; }
.rp-pic img { aspect-ratio: 2 / 1; object-fit: cover; width: 100%; }
.rp-badge { position: absolute; left: 28px; bottom: -26px; width: 56px; height: 56px; border-radius: 50%; background: var(--card); border: 2px solid var(--ink); display: grid; place-items: center; font: 700 26px/1 var(--display); color: var(--ink); }
.rp-card-body { padding: 40px 36px 32px; }
.rp-level { font-size: 14.5px; color: var(--muted); margin: 0 0 8px; }
.rp-level .tag { margin-right: 4px; }
.rp-title { font: 700 clamp(26px, 3.4vw, 32px)/1.15 var(--display); margin: 0 0 10px; }
.rp-title-en { display: block; font: 400 17px/1.4 var(--ui); color: var(--muted); margin-top: 4px; }
.rp-setup { font-style: italic; color: var(--ink-soft); margin: 0 0 20px; }
.rp-tools { display: flex; justify-content: space-between; align-items: center; gap: 10px 16px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); margin-bottom: 20px; }
.rp-tip { font-size: 15px; color: var(--muted); }
.rp-all { min-height: 44px; font-size: 15px; padding: 0 16px; }
.rp-all[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.rp-text .rp-p { font: 400 21px/1.65 var(--story); color: var(--ink); margin: 0 0 16px; }
.rp-s { cursor: pointer; border-radius: 6px; padding: 1px 2px; margin: 0 -2px; transition: background .15s; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.rp-s:hover { background: var(--tint); }
.rp-s.open { background: var(--tint); }
.rp-en { display: block; font: 15.5px/1.45 var(--ui); color: var(--muted); border-left: 3px solid var(--rule); padding: 2px 0 2px 12px; margin: 6px 0 10px; }
.rp-en[hidden] { display: none; }

.rp-check { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--rule); }
.rp-check h3 { margin: 0 0 6px; }
.rp-qs { list-style: none; margin: 0; padding: 0; counter-reset: q; }
.rp-q { counter-increment: q; padding: 16px 0 6px; }
.rp-q + .rp-q { border-top: 1px dashed var(--rule); }
.rp-q-t { font-weight: 600; margin: 0 0 10px; color: var(--ink); }
.rp-q-t::before { content: counter(q) ". "; color: var(--muted); }
.rp-opts { display: grid; gap: 8px; }
.rp-opt { font: 400 17px/1.4 var(--ui); }
.rp-msg { min-height: 1.5em; margin: 10px 0 0; font-weight: 600; color: var(--ink); }
.rp-why { margin: 4px 0 8px; }
.rp-why[hidden] { display: none; }
.rp-why-l { font-size: 14px; color: var(--muted); margin: 0 0 6px; }
.rp-why blockquote { margin: 0 0 8px; background: var(--paper-2); border-left: 4px solid var(--ink); border-radius: 0 10px 10px 0; padding: 10px 14px; }
.rp-why blockquote p { margin: 0; }
.rp-why blockquote [lang="es"] { font: 400 18px/1.45 var(--story); color: var(--ink); }
.rp-why blockquote .en { font-size: 15px; color: var(--muted); }

.rp-result { background: var(--card); border: 1px solid var(--rule); border-radius: 20px; padding: 26px 28px; text-align: center; margin-bottom: 8px; }
.rp-result h2 { font: 700 clamp(44px, 7vw, 64px)/1 var(--display) !important; margin: 0 0 10px !important; font-variant-numeric: tabular-nums; }
.rp-result p:last-child { margin: 0; }
.rp-steps { margin-top: 8px; }
.rp-steps li { color: var(--ink-soft); }

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  .lp-intro-grid, .lp-ex-grid, .lp-scene { grid-template-columns: 1fr; gap: 24px; }
  .lp-flip .pp-from { order: 0; }
  .lp-ex-grid .pp-from { display: grid; grid-template-columns: 120px 1fr; }
  .lp-ex-grid .pp-from img { height: 100%; aspect-ratio: auto; }
  .lp-ex-grid .pp-from figcaption { padding: 12px 14px; }
  .pp-next-grid { grid-template-columns: 1fr; }
  .pp-next-card { flex-direction: row; }
  .pp-next-card img { width: 38%; aspect-ratio: auto; height: auto; min-height: 100%; }
}
@media (max-width: 600px) {
  .lp-board { gap: 8px; }
  .lp-meter { padding: 10px; }
  .lp-meter-n { font-size: 22px; }
  .lp-meter-l { font-size: 12.5px; }
  .lp-ex-head { gap: 14px; }
  .lp-num { width: 44px; height: 44px; font-size: 21px; }
  .lp-lede { font-size: 16.5px; }
  .lp-console { padding: 18px 16px 20px; border-radius: 18px; }
  .lp-player { gap: 14px; }
  .lp-play { width: 68px; height: 68px; }
  .lp-opt { font-size: 18px; }
  .pp-from-t { font-size: 19px; }
  .rp-card-body { padding: 36px 18px 24px; }
  .rp-badge { left: 18px; width: 48px; height: 48px; font-size: 22px; bottom: -22px; }
  .rp-text .rp-p { font-size: 19px; }
  .rp-bar-left { margin-left: 0; width: 100%; display: none; }
  .rp-card { border-radius: 18px; }
  .pp-next-card img { width: 34%; }
  .pp-next-t { font-size: 18px; }
}
.lp-head .eyebrow, .rp-head .eyebrow { line-height: 1.6; }
.pp-next-k { line-height: 1.3; }
