/* Kids Love Math — the public pages' text, under the practice screen or on its own.
   Same ink on paper as the app (css/style.css holds the colour tokens). */

.site { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  .site { scroll-behavior: auto; }
}

/* ── Header (pages without a practice screen) ───────────────────────────── */

.site-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  padding: 14px 20px;
  border-bottom: var(--rule) solid var(--ink);
}

.site-brand {
  color: var(--ink);
  font: 700 24px/1.1 var(--font-ui);
  text-decoration: none;
}

.site-nav {
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}

.site-nav a {
  color: var(--ink);
  font-size: 18px;
  text-underline-offset: 3px;
}

.site-head .lang-menu > summary { width: 56px; min-height: 44px; padding: 0; }

/* ── Text ───────────────────────────────────────────────────────────────── */

.page {
  padding: 48px 20px 40px;
  font: 400 19px/1.55 var(--font-ui);
}

/* Under the practice screen, a rule marks where the app ends. */
.app + .page { border-top: var(--rule) solid var(--ink); }

.page-text { max-width: 44rem; margin: 0 auto; }

.page h1 {
  margin: 0 0 20px;
  font: 700 clamp(30px, 5vw, 42px)/1.15 var(--font-ui);
  letter-spacing: -0.01em;
}

.page h2 {
  margin: 44px 0 12px;
  font: 700 26px/1.2 var(--font-ui);
}

.page p, .page ul, .page ol { margin: 0 0 16px; }
.page li + li { margin-top: 6px; }

.page .lead { font-size: 22px; line-height: 1.5; }
.page .updated { color: var(--muted); font-size: 16px; }

.page a { color: var(--ink); text-underline-offset: 3px; }
.page a:focus-visible, .site-nav a:focus-visible, .site-brand:focus-visible, .site-foot a:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

.page code { font-size: 0.9em; }

.page table {
  width: 100%;
  margin: 0 0 16px;
  border-collapse: collapse;
  font-size: 17px;
  /* Long words (Mindestschwierigkeit, Familienkonto) break rather than widen the page. */
  hyphens: auto;
  overflow-wrap: break-word;
}

@media (max-width: 599px) {
  .page table { font-size: 15px; }
  .page th, .page td { padding: 8px 6px; }
}

.page th, .page td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--grid);
  text-align: left;
  vertical-align: top;
}

.page thead th { border-bottom: var(--rule) solid var(--ink); }

/* Questions open one at a time. */
.page details {
  margin: 0 0 10px;
  border: var(--rule) solid var(--ink);
  border-radius: var(--radius);
}

.page summary {
  padding: 14px 16px;
  font-weight: 700;
  cursor: pointer;
}

.page summary:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.page details > p { margin: 0; padding: 0 16px 16px; }

/* ── Operation cards (home page) ────────────────────────────────────────── */

.op-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  gap: 12px;
  margin: 0 0 16px;
  padding: 0;
  list-style: none;
}

.page .op-cards li + li { margin-top: 0; }

.op-cards a {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "sign name" "sign note";
  align-items: center;
  gap: 2px 16px;
  height: 100%;
  padding: 16px;
  border: var(--rule) solid var(--ink);
  border-radius: var(--radius);
  text-decoration: none;
}

.op-cards a:hover { box-shadow: inset 0 0 0 2px var(--ink); }

.op-sign { grid-area: sign; width: 1.1em; font: 700 52px/1 var(--font-num); text-align: center; }
.op-name { grid-area: name; font: 700 22px/1.2 var(--font-ui); }
.op-note { grid-area: note; color: var(--muted); font-size: 16px; line-height: 1.35; }

/* ── A worked problem, as on the practice screen ────────────────────────── */

.example { margin: 0 0 16px; }

.page .example table {
  width: auto;
  border-collapse: collapse;
  font: 700 40px/1 var(--font-num);
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 52px 52px;
}

.page .example td {
  width: 52px;
  height: 52px;
  padding: 0;
  border: 0;
  text-align: center;
  vertical-align: middle;
}

.page .example .ex-bottom td { border-bottom: 4px solid var(--ink); }
.page .example .ex-answer td { color: var(--right); }

/* ── Free and family accounts ───────────────────────────────────────────── */

.page .compare { table-layout: fixed; }
.page .compare td { text-align: center; }
.page .compare th[scope="row"] { width: 44%; font-weight: 400; }
.page .compare thead th { text-align: center; }
.page .compare .soon { display: block; color: var(--muted); font-size: 14px; font-weight: 400; }

/* ── Footer ─────────────────────────────────────────────────────────────── */

.site-foot {
  padding: 28px 20px 36px;
  border-top: var(--rule) solid var(--ink);
  color: var(--muted);
  font-size: 16px;
}

.site-foot ul {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  max-width: 44rem;
  margin: 0 auto 14px;
  padding: 0;
  list-style: none;
}

.site-foot p { max-width: 44rem; margin: 0 auto; }
.site-foot a { color: var(--ink); text-underline-offset: 3px; }
.site-foot a[aria-current="true"] { font-weight: 700; text-decoration: none; }
