/*
 * Crack The UCAT - Learn (ln-), Maths trainer (mt-) and About (ab-).
 * Learn colours (dev note): dark blue text, mid blue for the selected tab,
 * links and small labels, bright teal for borders and big numbers, with dark
 * text on teal. All through css/theme.css tokens so dark mode works.
 */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

/* ---- Learn and About -------------------------------------------------------- */
.ln { max-width: 900px; }
.ln-eyebrow { color: var(--c-link); font-weight: 700; letter-spacing: .1em; }
.ln-lead { font-size: 18px; line-height: 1.6; color: var(--c-text-2); max-width: 640px; }
.ln-building { background: var(--c-card); border: 2px solid var(--c-teal); border-radius: 18px; padding: 18px 22px; display: flex; flex-direction: column; gap: 4px; }
.ln-building strong { font-size: 20px; }
.ln-building span { color: var(--c-text-2); line-height: 1.5; }

.ln-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.ln-facts > div { background: var(--c-card); border: 1px solid var(--c-border); border-radius: 18px; padding: 18px; display: flex; flex-direction: column; gap: 2px; }
.ln-facts strong { font-size: 30px; font-weight: 700; color: var(--c-teal); }
.ln-facts span { font-size: 14px; color: var(--c-text-2); }

.ln-card { background: var(--c-card); color: var(--c-text); border: 1px solid var(--c-border); border-radius: 24px; padding: clamp(20px, 3vw, 32px);
  display: flex; flex-direction: column; gap: 16px; font-size: 17px; line-height: 1.75; }
.ln-card--teal { border: 3px solid var(--c-teal); }
.ln-card--tips { border: 2px solid var(--c-btn); line-height: 1.65; }
.ln-card h2 { font-size: 26px; }
.ln-inset { background: var(--c-bg-reading); border-radius: 16px; padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; }
.ctu-page .ln-list { list-style: disc; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; }

.ln-subtests { display: flex; flex-direction: column; gap: 14px; }
.ln-subtests > h2 { font-size: 26px; }
.ln-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; }
.ln-tab {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left; cursor: pointer; font-family: inherit;
  padding: 16px 18px; min-height: 76px; border-radius: 16px; color: var(--c-text); background: var(--c-card); border: 2px solid var(--c-border);
}
.ln-tab[aria-pressed="true"] { background: var(--c-link); border-color: var(--c-link); color: #FFFFFF; }
html.ctu-theme[data-theme="dark"] .ln-tab[aria-pressed="true"] { color: #0B1424; }
@media (prefers-color-scheme: dark) { html.ctu-theme:not([data-theme="light"]) .ln-tab[aria-pressed="true"] { color: #0B1424; } }
.ln-tab:focus-visible { outline: 3px solid var(--c-teal); outline-offset: 2px; }
.ln-tab__name { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 700; }
.ln-tab__facts { font-size: 13px; opacity: .85; }
.ln-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--sub); flex: none; display: inline-block; }
.ln-tab[aria-pressed="true"] .ln-dot { box-shadow: 0 0 0 2px #FFFFFF; }
.ln-tab--vr, .ln-sub--vr { --sub: var(--c-vr); }
.ln-tab--dm, .ln-sub--dm { --sub: var(--c-dm); }
.ln-tab--qr, .ln-sub--qr { --sub: var(--c-qr); }
.ln-tab--sjt, .ln-sub--sjt { --sub: var(--c-sjt); }

.ln-sub { gap: 18px; }
.ln-sub__head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 10px; border-bottom: 1px solid var(--c-border); padding-bottom: 14px; }
.ln-sub__head h3 { margin: 0; font-size: 28px; display: flex; align-items: center; gap: 10px; }
.ln-sub__head .ln-dot { width: 14px; height: 14px; }
.ln-sub__facts { font-size: 14px; font-weight: 600; color: var(--c-link); }
.ln-callout { background: var(--c-teal-tint, var(--c-sel-fill)); border: 2px solid var(--c-btn); border-radius: 16px; padding: 18px 22px; font-weight: 600; }
a.ln-maths, html.ctu-theme a.ln-maths {
  text-decoration: none; color: var(--c-text); background: var(--c-bg-reading); border: 2px solid var(--c-qr); border-radius: 16px; padding: 16px 20px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; line-height: 1.4;
}
.ln-maths > span:first-child { display: flex; flex-direction: column; gap: 2px; }
.ln-maths > span:first-child span { font-size: 15px; color: var(--c-text-2); }
.ln-maths__go { background: var(--c-qr); color: #FFFFFF; font-weight: 700; font-size: 15px; padding: 12px 18px; border-radius: 12px; }
.ln-keys { border: 2px solid var(--c-link); border-radius: 16px; padding: 18px 22px; display: flex; flex-direction: column; gap: 10px; line-height: 1.5; }
.ln-keys > div { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 16px; }
.ln-keys kbd { font-family: inherit; background: var(--c-bg-reading); border: 1px solid var(--c-border); border-bottom-width: 3px; border-radius: 8px;
  padding: 4px 10px; font-weight: 700; font-size: 14px; min-width: 64px; text-align: center; }
.ln-types { display: flex; flex-direction: column; gap: 10px; }
.ln-type { border: 1px solid var(--c-border); border-radius: 16px; padding: 4px 20px; background: var(--c-card-reading); }
.ln-type summary { font-size: 18px; font-weight: 700; min-height: 52px; display: flex; align-items: center; cursor: pointer; }
.ln-type summary:focus-visible { outline: 3px solid var(--c-teal); outline-offset: 2px; border-radius: 8px; }
.ln-type__body { display: flex; flex-direction: column; gap: 10px; padding: 0 0 18px; }
.ln-rubric { border-collapse: collapse; font-size: 16px; max-width: 420px; }
.ln-rubric td, .ln-rubric th { padding: 10px 14px; border: 1px solid var(--c-border); text-align: left; }
.ln-rubric th { font-weight: 700; }
a.ln-try, html.ctu-theme a.ln-try { align-self: flex-start; }

.ab-diff { display: flex; flex-direction: column; gap: 14px; }
.ab-diff > h2 { font-size: 24px; }
.ab-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.ab-grid h3 { margin: 0; font-size: 17px; }
.ab-grid p { line-height: 1.6; }
.ab-beta p { line-height: 1.6; }
.ab-partner { background: var(--c-menu); color: #FFFFFF; border-radius: 20px; padding: 22px 26px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; }
.ab-partner h2 { font-size: 20px; }
.ab-partner p { color: #D5DCEA; margin-top: 4px; }
html.ctu-theme a.ab-partner__btn { color: #FFFFFF; border-color: #FFFFFF; }

/* ---- Maths trainer ---------------------------------------------------------- */
.mt-types { display: flex; flex-wrap: wrap; gap: 8px; }
.mt-types .ctu-choice { min-height: 44px; justify-content: center; }
.mt-types .ctu-choice:has(input:disabled) { opacity: .6; cursor: not-allowed; }
.mt-drill { gap: 16px; }
.mt-hud { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; }
.mt-hud__title { font-size: 15px !important; color: var(--c-text-2); text-transform: uppercase; letter-spacing: .06em; margin-right: auto !important; }
.mt-hud__time { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mt-hud__score { color: var(--c-text-2); font-weight: 600; }
.mt-start { display: flex; flex-direction: column; gap: 10px; }
.mt-start h3 { margin: 0; font-size: 24px; }
.mt-play { display: flex; flex-direction: column; gap: 12px; max-width: 460px; }
.mt-sum { font-size: clamp(34px, 6vw, 48px); font-weight: 700; font-variant-numeric: tabular-nums; margin: 0; }
.mt-label { font-weight: 600; }
.mt-answer { font-size: 26px !important; min-height: 60px !important; font-variant-numeric: tabular-nums; }
.mt-answer.is-wrong { border-color: var(--c-incorrect) !important; }
.mt-answer.is-shake { animation: mt-shake .3s; }
@keyframes mt-shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
@media (prefers-reduced-motion: reduce) { .mt-answer.is-shake { animation: none; } }
.mt-feedback { min-height: 1.4em; margin: 0; font-weight: 600; }
.mt-feedback--ok { color: var(--c-correct); }
.mt-feedback--wrong { color: var(--c-incorrect); }
.mt-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.mt-key { min-height: 52px; font: 700 20px var(--font-body); border-radius: 10px; border: 2px solid var(--c-border); background: var(--c-card); color: var(--c-text); cursor: pointer; }
.mt-key:active { background: var(--c-sel-fill); }
.mt-key:focus-visible { outline: 3px solid var(--c-teal); outline-offset: 2px; }
@media (hover: hover) and (pointer: fine) { .mt-keypad { display: none; } }
.mt-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.mt-round { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mt-bars { display: flex; align-items: flex-end; gap: 10px; height: 140px; padding-top: 18px; }
.mt-bar { flex: 1; max-width: 48px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.mt-bar__val { font-size: 13px; font-weight: 700; }
.mt-bar__fill { width: 100%; background: var(--c-qr); border-radius: 6px 6px 0 0; }
.mt-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.mt-table th, .mt-table td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--c-border); background: transparent; color: inherit; }
.mt-table thead th { font-size: 13px; color: var(--c-text-2); }
