/* LiD Trainer site stylesheet. No JavaScript anywhere on this site.

   Brand: deep ink-blue + warm gold, a quiet nod to the app icon's
   black/red/gold without flag kitsch. Full palette and rationale in
   /docs/BRAND.md. Correct answers stay green, errors stay red; ink and
   gold are reserved for everything else. */

@font-face {
  font-family: "LT Sans";
  src: url("/fonts/inter-variable.b2a23cf4fe.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

:root {
  /* -- brand swatches (see docs/BRAND.md) -------------------------- */
  --ink-900: #0b1c33;
  --ink-700: #16314f;
  --ink-500: #2f5788;
  --gold-500: #8c6620;
  --gold-300: #e3c988;

  /* -- semantic tokens, light mode ---------------------------------- */
  --bg: #f7f8fa;
  --bg-alt: #eef1f6;
  --surface: #ffffff;
  --border: #d7dee6;
  --text: #142033;
  --text-muted: #51607a;
  --link: var(--ink-500);
  --link-visited: #6a4f97;
  --focus: var(--gold-500);
  --heading: var(--ink-900);
  --accent-text: var(--gold-500);

  --success: #185c34;
  --success-bg: #e5f4ea;
  --success-border: #2f7d43;
  --error: #8a1f18;
  --error-bg: #fbe9e8;
  --error-border: #b3261e;

  --badge-bg: var(--ink-900);
  --badge-text: #ffffff;
  --badge-icon: var(--gold-500);

  --max-width: 46rem;
  --radius: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: var(--ink-900);
    --bg-alt: #0e2138;
    --surface: var(--ink-700);
    --border: #2a4162;
    --text: #eef2f6;
    --text-muted: #a9b7c6;
    --link: #9dc0ec;
    --link-visited: #c6b3ea;
    --focus: var(--gold-300);
    --heading: var(--text);
    --accent-text: var(--gold-300);

    --success: #8fd6a4;
    --success-bg: #123a26;
    --success-border: #3f9a58;
    --error: #f0a39c;
    --error-bg: #3a1613;
    --error-border: #c0392b;

    --badge-bg: var(--gold-300);
    --badge-text: var(--ink-900);
    --badge-icon: var(--ink-900);
  }
}

/* An explicit theme choice (future toggle) always wins over prefers-color-scheme. */
:root[data-theme="dark"] {
  --bg: var(--ink-900);
  --bg-alt: #0e2138;
  --surface: var(--ink-700);
  --border: #2a4162;
  --text: #eef2f6;
  --text-muted: #a9b7c6;
  --link: #9dc0ec;
  --link-visited: #c6b3ea;
  --focus: var(--gold-300);
  --heading: var(--text);
  --accent-text: var(--gold-300);
  --success: #8fd6a4;
  --success-bg: #123a26;
  --success-border: #3f9a58;
  --error: #f0a39c;
  --error-bg: #3a1613;
  --error-border: #c0392b;
  --badge-bg: var(--gold-300);
  --badge-text: var(--ink-900);
  --badge-icon: var(--ink-900);
}
:root[data-theme="light"] {
  --bg: #f7f8fa;
  --bg-alt: #eef1f6;
  --surface: #ffffff;
  --border: #d7dee6;
  --text: #142033;
  --text-muted: #51607a;
  --link: var(--ink-500);
  --link-visited: #6a4f97;
  --focus: var(--gold-500);
  --heading: var(--ink-900);
  --accent-text: var(--gold-500);
  --success: #185c34;
  --success-bg: #e5f4ea;
  --success-border: #2f7d43;
  --error: #8a1f18;
  --error-bg: #fbe9e8;
  --error-border: #b3261e;
  --badge-bg: var(--ink-900);
  --badge-text: #ffffff;
  --badge-icon: var(--gold-500);
}

* { box-sizing: border-box; }

html { color-scheme: light dark; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "LT Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
}
@media (min-width: 480px) {
  body { font-size: 18px; }
}

a { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 0.12em; }
a:visited { color: var(--link-visited); }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
  border-radius: 3px;
}

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

/* ---- header ------------------------------------------------------- */
header.site-header {
  background: var(--ink-900);
  border-bottom: 3px solid var(--gold-300);
}
header.site-header .wrap {
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.5rem;
  justify-content: space-between;
}
.site-name {
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: #ffffff;
  text-decoration: none;
}
.site-name:visited { color: #ffffff; }
nav.site-nav { display: flex; flex-wrap: wrap; gap: 0.3rem 0.3rem; font-size: 0.92rem; }
nav.site-nav a {
  color: #e7ecf5;
  text-decoration: none;
  padding: 0.35rem 0.6rem;
  border-radius: 7px;
}
nav.site-nav a:visited { color: #e7ecf5; }
nav.site-nav a:hover { background: rgba(255, 255, 255, 0.12); text-decoration: none; }
nav.site-nav a:focus-visible { outline-offset: -2px; }
@media (max-width: 480px) {
  header.site-header .wrap { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  nav.site-nav { width: 100%; gap: 0.2rem; }
  nav.site-nav a { padding: 0.4rem 0.5rem; margin-left: -0.5rem; }
}

/* ---- headings & type scale ----------------------------------------- */
h1 { font-size: clamp(1.5rem, 4.6vw, 1.9rem); line-height: 1.28; font-weight: 800; letter-spacing: -0.01em; margin: 0.2rem 0 1.1rem; color: var(--heading); }
h2 { font-size: 1.2rem; font-weight: 700; margin: 1.9rem 0 0.65rem; color: var(--heading); }
h3 { font-size: 1.02rem; font-weight: 700; margin: 1.3rem 0 0.5rem; }

.breadcrumbs { font-size: 0.85rem; color: var(--text-muted); margin: 0.9rem 0 0.4rem; }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs .sep { margin: 0 0.35rem; }

.eyebrow {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 0.35rem;
  font-variant-numeric: tabular-nums;
}

/* ---- generic surfaces ------------------------------------------------ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  margin: 1rem 0;
}
.card > .eyebrow:first-child { margin-top: 0; }

/* ---- answers: letter-in-a-circle rows -------------------------------- */
.answers { list-style: none; margin: 0.85rem 0; padding: 0; display: grid; gap: 0.55rem; }
.answers li {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.7rem 0.85rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  background: var(--surface);
}
.answers .label {
  flex: none;
  width: 1.9rem;
  height: 1.9rem;
  border-radius: 50%;
  border: 2px solid var(--link);
  color: var(--link);
  font-weight: 800;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.05rem;
}
/* The text column is at least as tall as the letter circle and centres
   its content in that height, so a one-line answer (and its "correct
   answer" mark) sits on the circle's axis while a multi-line answer still
   starts at the top next to the circle. */
.answers li > span:last-child {
  min-height: 1.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 0.45rem;
  row-gap: 0.1rem;
}
.answers li.is-correct {
  background: var(--success-bg);
  border-color: var(--success-border);
  border-width: 2px;
  padding: calc(0.7rem - 1px) calc(0.85rem - 1px);
}
.answers li.is-correct .label {
  background: var(--surface);
  border-color: var(--success-border);
  color: var(--success);
}
.correct-mark {
  color: var(--success);
  font-weight: 700;
  white-space: nowrap;
}

.correct-answer-banner {
  border: 1px solid var(--success-border);
  background: var(--success-bg);
  color: var(--success);
  border-radius: var(--radius);
  padding: 0.7rem 0.9rem;
  font-weight: 700;
  margin: 1rem 0;
}

/* ---- translation card: visually secondary to the German original ----- */
.translation-block {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg-alt);
  margin-top: 1.3rem;
  padding: 0.95rem 1.1rem;
}
.translation-block .eyebrow { color: var(--text-muted); }
.translation-block p, .translation-block .answers { font-size: 0.95em; }
.translation-block .answers li { background: transparent; }
.translation-block .answers li.is-correct { background: var(--success-bg); }

/* ---- explanation / tips: readable blocks with a left accent ---------- */
.accent-block {
  border-left: 3px solid var(--accent-text);
  padding: 0.15rem 0 0.15rem 1rem;
  margin: 0.75rem 0 1.25rem;
}
.accent-block p { margin: 0.6rem 0; }
[dir="rtl"] .accent-block { border-left: none; border-right: 3px solid var(--accent-text); padding: 0.15rem 1rem 0.15rem 0; }

figure.q-image { margin: 1rem 0; }
figure.q-image img { max-width: 100%; height: auto; border-radius: var(--radius); border: 1px solid var(--border); display: block; }
figure.q-image figcaption { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.35rem; }
.image-grid { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.image-grid figure { width: calc(50% - 0.4rem); margin: 0; }
@media (max-width: 480px) { .image-grid figure { width: 100%; } }

.tips-list { padding-left: 1.2rem; }
[dir="rtl"] .tips-list { padding-left: 0; padding-right: 1.2rem; }
.meta-row { display: flex; flex-wrap: wrap; gap: 0.9rem; font-size: 0.92rem; color: var(--text-muted); margin: 0.5rem 0 1.1rem; }

/* ---- previous/next as buttons ----------------------------------------- */
.pager { display: flex; justify-content: space-between; gap: 0.75rem; margin: 2rem 0; }
.pager a {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 0.55rem 1.05rem;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--text);
}
.pager a:visited { color: var(--text); }
.pager a:hover { border-color: var(--link); }
.pager .next { text-align: right; margin-left: auto; }
[dir="rtl"] .pager { flex-direction: row-reverse; }

/* ---- Play badge call-to-action ----------------------------------------- */
.app-cta {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  margin: 1.75rem 0;
  background: var(--bg-alt);
  text-align: center;
}
.app-cta p { margin: 0 0 0.75rem; color: var(--text-muted); }
/* Official Google Play badge, used unmodified per Google's badge
   guidelines: at least 40px high, with clear space around it. The PNG
   itself carries that clear space. */
.app-cta .badge-link { display: inline-block; line-height: 0; }
.app-cta .badge-link img { width: 186px; height: auto; max-width: 100%; }
.app-cta .badge-link:hover { opacity: 0.9; }

/* ---- plain / card-style link lists -------------------------------------- */
ul.plain-list, ol.plain-list { padding-left: 1.2rem; }
[dir="rtl"] ul.plain-list, [dir="rtl"] ol.plain-list { padding-left: 0; padding-right: 1.2rem; }
ul.link-list { list-style: none; padding: 0; margin: 0.6rem 0 1.5rem; display: grid; gap: 0.55rem; }
ul.link-list.grid-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 480px) { ul.link-list.grid-2 { grid-template-columns: 1fr; } }
ul.link-list a {
  display: block;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--text);
}
ul.link-list a:visited { color: var(--text); }
ul.link-list a:hover { border-color: var(--link); }
ul.link-list strong { font-variant-numeric: tabular-nums; color: var(--link); }

/* ---- hub "about the test" stat tiles ------------------------------------ */
.about-box { display: flex; flex-wrap: wrap; gap: 0.85rem; margin: 1.1rem 0 1.6rem; }
.about-box .stat {
  flex: 1 1 8rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  text-align: center;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  padding: 1rem 0.75rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.about-box .stat svg { width: 1.6rem; height: 1.6rem; stroke: var(--accent-text); fill: none; stroke-width: 1.8; }

footer.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg-alt);
  margin-top: 2.5rem;
  color: var(--text-muted);
  font-size: 0.88rem;
}
footer.site-footer .wrap { padding-top: 1.5rem; padding-bottom: 1.75rem; }
footer.site-footer .footer-name { font-weight: 800; color: var(--text); margin: 0 0 0.2rem; }
footer.site-footer .footer-tagline { margin: 0 0 0.9rem; }
footer.site-footer p { margin: 0.4rem 0; }
footer.site-footer a { color: var(--text-muted); }
footer.site-footer nav { margin-top: 0.6rem; display: flex; gap: 1rem; flex-wrap: wrap; }

.lang-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin: 1.25rem 0; }
@media (max-width: 480px) { .lang-grid { grid-template-columns: repeat(2, 1fr); } }
.lang-grid a {
  display: block; text-align: center; padding: 1rem 0.5rem;
  border: 1px solid var(--border); background: var(--surface);
  border-radius: var(--radius); text-decoration: none; font-weight: 700; color: var(--text);
}
.lang-grid a:hover { border-color: var(--link); }

/* ---- hand-authored content pages (site/content/) ------------------------ */
.content-slot { max-width: 40rem; }
.content-slot dl { margin: 0.5rem 0 1.5rem; }
.content-slot dt {
  font-weight: 700;
  margin-top: 1.2rem;
  padding-left: 0.75rem;
  border-left: 3px solid var(--accent-text);
  color: var(--heading);
}
[dir="rtl"] .content-slot dt { border-left: none; border-right: 3px solid var(--accent-text); padding-left: 0; padding-right: 0.75rem; }
.content-slot dt:first-child { margin-top: 0; }
.content-slot dd { margin: 0.3rem 0 0 0.75rem; }
[dir="rtl"] .content-slot dd { margin: 0.3rem 0.75rem 0 0; }
.content-slot ul, .content-slot ol { padding-left: 1.2rem; }
[dir="rtl"] .content-slot ul, [dir="rtl"] .content-slot ol { padding-left: 0; padding-right: 1.2rem; }
.content-slot li { margin: 0.25rem 0; }
.content-slot figure { margin: 1.6rem 0; }
.content-slot figcaption { font-size: 0.85rem; color: var(--text-muted); text-align: center; margin-top: 0.5rem; }
.content-slot .diagram { display: block; max-width: 600px; width: 100%; height: auto; margin: 0 auto; color: var(--text); }
.content-slot .diagram text { fill: currentColor; }
.content-slot .diagram .muted { color: var(--text-muted); }
.content-slot .step-list { list-style: none; padding: 0; counter-reset: step; }
.content-slot .step-list li { counter-increment: step; padding-left: 2.1rem; position: relative; margin: 0.6rem 0; }
.content-slot .step-list li::before {
  content: counter(step);
  position: absolute; left: 0; top: 0;
  width: 1.5rem; height: 1.5rem; border-radius: 50%;
  background: var(--gold-300); color: var(--ink-900); border: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.8rem; font-weight: 800;
}

/* German original block on RTL pages stays left-to-right and left-aligned. */
[dir="rtl"] [dir="ltr"] { text-align: left; }
[dir="rtl"] [dir="ltr"] .answers li { flex-direction: row; text-align: left; }

.site-footer .footer-legal { font-size: 0.85em; color: var(--text-muted); }

/* Diagrams: SVG text-anchor is computed from the inherited direction, so an
   RTL page would place every label on the other side of its x coordinate
   and over the shapes. Keep the coordinate system LTR, Arabic glyph runs
   inside a label still shape right-to-left on their own. */
[dir="rtl"] svg { direction: ltr; }
