/* Test page (T1-T14). Engine markup, styled from scratch (the engine's own
   frontend.css is dequeued on this page):
   #quiz-engine-app > form.quiz-engine-form > fieldset.quiz-engine-question
     > legend + label.quiz-engine-answer > input[type=radio] + text
   assets/js/test.js wraps the labels of each question in div.stk (the answer
   sticker) and follows .is-active. Without JS every question is listed and the
   engine's button submits. */

/* The engine scrolls to the next question after each answer. The whole story
   is the first screen, so its target is always the top: an offset larger than
   any page makes every engine scroll land at 0. */
:root { --quiz-engine-scroll-offset: 100000px; }

.sr { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- first screen: one story ---------- */
.ask { position: relative; display: flex; flex-direction: column; }
.js .ask:not(.is-done) { height: 100vh; height: 100svh; min-height: 540px; overflow: hidden; }
.ask #quiz-engine-app { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.quiz-engine-form { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.quiz-engine-progress, .quiz-engine-timer { display: none !important; }

/* questions */
.quiz-engine-question { margin: 0; padding: 0; border: 0; min-width: 0; }
/* A floated legend is not the fieldset's "rendered legend", so it lays out as
   an ordinary flex item (the fieldset keeps it as its accessible name). */
.quiz-engine-question legend {
  float: left; width: 100%; padding: 0;
  font-weight: 900; line-height: 1.08; letter-spacing: -.012em;
  text-align: center; text-wrap: balance; overflow-wrap: normal;
}
.quiz-engine-question:focus { outline: none; }

/* without JS (and before the script runs): a plain list of questions */
.quiz-engine-form > .quiz-engine-question { padding: 22px var(--gut) 0; }
.quiz-engine-form > .quiz-engine-question legend { margin-bottom: 14px; font-size: 26px; }

/* with JS: one question per screen, the active one fills the story */
.js .quiz-engine-form:not(.is-completed) > .quiz-engine-question:not(.is-active):not(.is-leaving) { display: none; }
.js .quiz-engine-form.is-hold > .quiz-engine-question.is-active:not(.is-leaving) { display: none; }
.js .quiz-engine-form > .quiz-engine-question.is-active,
.js .quiz-engine-form > .quiz-engine-question.is-leaving {
  flex: 1; min-height: 0; display: flex; flex-direction: column; justify-content: flex-end; padding: 0;
}
/* R6: a question that does not fit even at 26 px (large system text, landscape) scrolls inside
   the legend itself - never the whole question: a scrolling question box made iOS Safari scroll
   it to the tapped answer's radio, the question went out of view and the sticker jumped (fix
   2026-11-14). The legend holds no focusable element, so nothing scrolls it by itself. */
/* V1 (Lex, 2026-11-14): one size per width - 28 / 32 / 34 px, a step smaller over 100 characters
   (.long, test.js); no fitting to the free space any more */
.js .quiz-engine-question legend { flex: 0 1 auto; min-height: 0; overflow-y: auto; margin: 0; padding: 10px 22px 22px; font-size: 28px; }
.js .quiz-engine-question legend.long { font-size: 26px; }
@media (min-width: 600px) { .js .quiz-engine-question legend { font-size: 32px; } .js .quiz-engine-question legend.long { font-size: 30px; } }
@media (min-width: 1000px) { .js .quiz-engine-question legend { font-size: 34px; } .js .quiz-engine-question legend.long { font-size: 32px; } }
/* no visible scrollbar: one appearing on a 1 px overflow would narrow the text and rewrap it */
.js .quiz-engine-question legend { scrollbar-width: none; }
.js .quiz-engine-question legend::-webkit-scrollbar { display: none; }
.js .quiz-engine-question.in { animation: omq-swipe .22s var(--ease) both; }
.js .quiz-engine-question.back { animation: omq-swipeb .22s var(--ease) both; }
@keyframes omq-swipe { from { opacity: 0; transform: translateX(44px) scale(.98); } }
@keyframes omq-swipeb { from { opacity: 0; transform: translateX(-44px) scale(.98); } }

/* T7: the friend's line over the first question */
.mention {
  align-self: center; max-width: calc(100% - 44px); margin: 0 22px -10px;
  padding: 6px 14px; border-radius: 10px; background: var(--tx); color: var(--st);
  font-size: 16px; line-height: 1.2; font-weight: 900; text-align: center; transform: rotate(-1deg);
}

/* T4: the answer sticker */
.stk {
  /* R5: clear of the iPhone home indicator */
  flex: none; display: grid; gap: 7px; margin: 0 18px calc(14px + env(safe-area-inset-bottom)); padding: 10px;
  border-radius: 22px; background: var(--tx); color: var(--ink);
  box-shadow: 0 10px 28px rgba(15, 22, 30, .3); transform: rotate(-1deg);
  counter-reset: omq-ans;
}
.quiz-engine-answer {
  position: relative; display: flex; align-items: center; justify-content: center;
  min-height: 52px; padding: 8px 14px; border-radius: 14px;
  background: var(--pill); color: var(--ink);
  font-size: 17px; line-height: 1.16; font-weight: 800; text-align: center;
  cursor: pointer; counter-increment: omq-ans;
  transition: background-color .1s, color .1s, transform .1s;
}
.quiz-engine-form > .quiz-engine-question > .quiz-engine-answer + .quiz-engine-answer { margin-top: 7px; }
.quiz-engine-answer input { position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none; }
.quiz-engine-answer:has(input:focus-visible) { outline: 3px solid var(--deep); outline-offset: 2px; }
.quiz-engine-answer:active { transform: scale(.98); }
.quiz-engine-answer.is-picked,
.quiz-engine-answer:has(input:checked) { background: var(--st); color: var(--tx); }
/* keyboard hints 1-4 at the left, only with a mouse on a wide screen */
.quiz-engine-answer::before {
  content: counter(omq-ans); display: none; position: absolute; left: 14px; top: 50%;
  transform: translateY(-50%); font-size: 14px; font-weight: 900; opacity: .4;
}

/* the engine's button: needed without JS; with JS the run submits itself
   (auto_submit) and the button returns only when sending failed */
.quiz-engine-submit {
  display: flex; align-items: center; justify-content: center; width: calc(100% - 36px); min-height: 52px;
  margin: 18px 18px 0; padding: 8px 18px; border-radius: 26px;
  background: var(--tx); color: var(--st); font-size: 17px; font-weight: 900; text-align: center;
}
.js .quiz-engine-submit { display: none; }
.js #quiz-engine-app:has(> .quiz-engine-errors:not([hidden])) .quiz-engine-submit { display: flex; flex: none; margin-bottom: 10px; }
.quiz-engine-errors { margin: 0 18px 10px; padding: 10px 14px; border-radius: 14px; background: var(--glass); font-size: 15px; text-align: center; }
.quiz-engine-form.is-completed > .quiz-engine-question { display: none; }

/* T5: the invisible back zone, left 16% over the question only (test.js sizes it) */
.tapback { position: absolute; left: 0; z-index: 2; width: 16%; }

/* ---------- below the first screen ---------- */
.more { display: grid; grid-template-columns: minmax(0, 1fr); gap: 34px; padding: 34px var(--gut) 0; }

/* T8-T11: collapsed sections, content in the markup */
.secs { border-top: 1px solid var(--glass2); }
.sec { border-bottom: 1px solid var(--glass2); }
.sec summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 58px; padding: 8px 4px; list-style: none; cursor: pointer; }
.sec summary::-webkit-details-marker { display: none; }
.sec summary h2 { font-size: 19px; line-height: 1.2; font-weight: 900; }
.sec summary svg { flex: none; width: 18px; height: 18px; transform: rotate(90deg); transition: transform .15s; }
.sec[open] summary svg { transform: rotate(-90deg); }
.sec .in, .sec .in .quiz-engine-faq { display: grid; gap: 9px; }
.sec .in { max-width: 34em; padding: 0 4px 20px; }
.sec .in h2 { display: none; }
.sec .in h3 { margin-top: 6px; font-weight: 900; }
.sec .in p, .sec .in li { color: var(--soft); font-weight: 700; }
.sec .in ul, .sec .in ol { display: grid; gap: 4px; padding-left: 1.2em; list-style: disc; }
.sec .in a { text-underline-offset: 3px; }

/* T12: Lex Rating WP widget (its own stylesheet stays); the theme adds the
   heading. Star size and colours are the plugin's settings (40px, #fff, #a9b9c8). */
.rate h2, .rel h2 { margin-bottom: 12px; font-size: 22px; line-height: 1.12; font-weight: 900; letter-spacing: -.01em; }
.rate h2 { margin-bottom: 10px; }
.rate .lex-rating-wp { display: flex; align-items: center; gap: 12px; }
.rate .lex-rating-wp__value { font-size: 17px; font-weight: 900; font-variant-numeric: tabular-nums; }
/* taste 9: the hit areas 4 px wider on each side and 44 px high around the 40px stars */
.rate .lex-rating-wp__stars-input { top: -2px; left: -4px; width: calc(100% + 8px); height: calc(100% + 4px); }

/* T13: More like this */
.rl { display: grid; gap: 7px; }
.rl a { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 14px 8px 16px; border-radius: 16px; background: var(--glass); font-size: 17px; line-height: 1.2; font-weight: 900; text-decoration: none; }
.rl a span { flex: 1; min-width: 0; }
.rel .pill { margin-top: 10px; }
.rl a svg { flex: none; width: 18px; height: 18px; }

@media (max-height: 610px) {
  .quiz-engine-answer { min-height: 44px; font-size: 16px; }
  .stk { margin-bottom: calc(10px + env(safe-area-inset-bottom)); }
}
@media (min-width: 1000px) {
  .js .ask:not(.is-done) { height: 100vh; }
  .js .quiz-engine-question legend { letter-spacing: -.015em; }
  .stk { margin: 0 26px 30px; }
  .quiz-engine-answer { min-height: 58px; font-size: 18px; }
}
@media (hover: hover) and (pointer: fine) {
  .quiz-engine-answer:hover { background: var(--pillh); }
  .quiz-engine-answer.is-picked:hover, .quiz-engine-answer:has(input:checked):hover { background: var(--st); }
  .sec summary:hover h2 { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
  .rl a:hover { background: var(--glassh); }
}
@media (hover: hover) and (pointer: fine) and (min-width: 1000px) {
  .js .quiz-engine-answer::before { display: block; }
  /* the key hint 1-4 sits at the left: keep the centred text clear of it on both sides (fix 2026-11-14) */
  .js .quiz-engine-answer { padding-left: 36px; padding-right: 36px; }
}
