/* The site's recipe quiz, `/receptkviz/` (QZ2).
 *
 * Shared by every theme, like portal.css, and bound by the same contract
 * (themes/TOKENS.md, rule 3): no `:root` block and no literal colour or font family. Every
 * colour, space, radius and font comes from the theme's tokens, so the quiz wears whichever
 * theme the site wears, in the tenant's own colours. The buttons are the theme's `.btn`.
 *
 * Loaded by publicsite/_head.html only on the quiz page (`quiz_page`), after the theme's
 * stylesheet. The states are the script's (`site.js`, `quiz`): `data-result` on the box,
 * `is-correct` / `is-wrong` on an answer.
 */

/* --------------------------------------------------------------------- frame */

.quiz-page {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
}

.quiz {
  padding-block: var(--space-lg) var(--space-xl);
  overflow-wrap: anywhere;
}

/* The quiz's title, the same size on every theme — the portal's rule (2026-11-10): a page
 * of questions is not an archive's headline. */
.quiz .page-title {
  margin: 0 0 var(--space-md);
  font-size: clamp(1.75rem, 1.45rem + 1vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.quiz-hero {
  margin: 0 0 var(--space-md);
}
.quiz-hero img {
  display: block;
  width: 100%;
  max-width: 20rem;
  height: auto;
  border-radius: var(--radius-md);
}

.quiz-intro { margin-bottom: var(--space-md); }

/* --------------------------------------------------------------------- the result */

.quiz-result {
  margin: 0 0 var(--space-lg);
  padding: var(--space-md);
  background: var(--color-surface);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-md);
}
/* The script focuses the box after "Eredmény"; the ring shows when the keyboard did it. */
.quiz-result:focus { outline: none; }
.quiz-result:focus-visible { outline: 2px solid var(--color-primary-ink); outline-offset: 2px; }
/* Passed or not, without a colour that means "good" or "bad": the tokens have none, and a
 * theme's secondary may well be red (gastro's is). The texts, when written, say it in words. */
.quiz-result[data-result="pass"] { border-color: var(--color-primary-ink); }
.quiz-result[data-result="fail"] { border-style: dashed; border-color: var(--color-muted); }

.quiz-score {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
}
.quiz-verdict { margin-top: var(--space-sm); }

.quiz-share { margin-top: var(--space-md); }
.quiz-share-title { margin: 0 0 var(--space-sm); color: var(--color-muted); }
.quiz-share-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ------------------------------------------------------------------ the questions */

.quiz-questions {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* The question's card is the list item, and the fieldset inside it has no frame: a legend
 * on a fieldset's border is cut by the line once it wraps, which a long question on a phone
 * does. */
.quiz-question {
  margin: 0 0 var(--space-md);
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.quiz-question fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.quiz-question legend {
  width: 100%;
  padding: 0;
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.35;
  color: var(--color-text);
}
.quiz-number { color: var(--color-primary-ink); }

.quiz-answers {
  display: grid;
  gap: var(--space-xs);
  margin: var(--space-sm) 0 0;
  padding: 0;
  list-style: none;
}
.quiz-answer {
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
}
/* The whole row is the label, so a thumb on a phone hits the answer, not a 16 px circle. */
.quiz-answer label {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 2.75rem;
  padding: var(--space-xs) var(--space-sm);
  cursor: pointer;
}
.quiz-answer input {
  flex: none;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: var(--color-primary-ink);
}
.quiz-answer:hover { background: var(--color-primary-soft); }

/* After "Eredmény" (`show_correct_answers`): the right answer and a wrong choice, each with
 * its words under it. No "green" and "red": the right one is the solid, filled frame, the
 * wrong choice the dashed one, in every theme's own colours. */
.quiz-answer.is-correct { border-color: var(--color-text); background: var(--color-primary-soft); }
.quiz-answer.is-wrong { border-style: dashed; border-color: var(--color-muted); }
.quiz-mark {
  display: block;
  padding: 0 var(--space-sm) var(--space-xs) calc(1.15rem + var(--space-md));
  font-size: 0.875rem;
  font-weight: 700;
}
.quiz-answer.is-correct .quiz-mark { color: var(--color-text); }
.quiz-answer.is-wrong .quiz-mark { color: var(--color-muted); }
.quiz-mark[hidden] { display: none; }

.quiz-actions { margin: var(--space-lg) 0 0; }
