/* ==========================================================================
   KF Elements — Suitability Quiz (kfe_quiz)
   --------------------------------------------------------------------------
   NEW at w4.quiz.1 (w4 plan decisions 12, 13 and 15; ADR-0008). Registered as
   `kfe-quiz` from the registry row and loaded only where the widget renders
   (KFE-003).

   WHAT IT DRAWS: the reference's suitability test (its `.quiz` section on the
   home page), rule for rule. The GEOMETRY — sizes, paddings, gaps, radii, the
   plus disc's 135° turn, the 0.55s panel and the 0.6s result fade — is the
   reference's, written as it draws it. EVERY COLOUR AND FONT is a pack token
   or a widget-scoped custom property `--kfe-quiz-<role>` whose default is a
   pack token or a neutral value, so no EuroEyes colour is a default
   (ADR-0002 decision 5). A site's kit sets them:

     --kfe-quiz-serif     legend, toggle and result title face  (var(--kfe-font-heading))
     --kfe-quiz-accent       the reference's "gold": the plus ring, an answer's
                             hover border, every filled circle  (var(--kfe-accent))
     --kfe-quiz-accent-deep  the reference's "gold-deep": the plus glyph, the
                             question numbers, the result label, the chosen
                             answer's border and ring, the toggle's hover
                                                                (var(--kfe-primary-deep))
     --kfe-quiz-head-muted   the eyebrow and the lede           (var(--kfe-muted))
     --kfe-quiz-ink-soft  answer text and the result's reason   (var(--kfe-ink))
     --kfe-quiz-ring      the answer's empty circle              (var(--kfe-muted))
     --kfe-quiz-rule      the result card's top rule             (var(--kfe-line))
     --kfe-quiz-shadow    the result card's shadow               (a neutral grey)
     --kfe-quiz-alert     the missing-answer line                (a neutral red, 6.6:1 on the surface)
     --kfe-quiz-faint     the disclaimer under the quiz          (var(--kfe-muted))
     --kfe-quiz-light     the light weight of lede, reason, small print and disclaimer (var(--kfe-body-weight, 400))
     --kfe-quiz-focus     the focus ring                         (var(--kfe-primary))
     --kfe-quiz-link      the read-more link                     (var(--kfe-link, var(--kfe-primary)))
     --kfe-quiz-link-decoration  the read-more link's line      (underline: set here, so a link
                             is never told apart by colour alone, WCAG 1.4.1; the reference
                             draws its link with none, and a site's kit may set that)

   THE EYEBROW IS DRAWN AS THE REFERENCE DRAWS IT, not as its stylesheet
   declares it: the reference's `.sec-head p` rule (ref727.html:136) also
   reaches its `p.eyebrow` and wins, so the computed eyebrow is 17px, light,
   in the muted colour, 20px below the section's top edge, with the .32em
   tracking of `.eyebrow` (measured in V9). The title reads `--kfe-title-size`
   and `--kfe-heading`; the buttons are the pack's `kfe-btn solid` and take
   the site's `--kfe-btn-*` tokens.

   ARMED, THEN SHOWN: the toggle and the result button are hidden until
   quiz.js adds `is-armed` to the root, so without JavaScript nothing dead is
   drawn: the `accordion` variant keeps its panel collapsed (as the reference
   does) and the `open` variant shows its questions and its disclaimer.

   THE HIT AREA: every button and link the visitor presses is at least 44px
   tall (w3 widget decision 10); the reference's buttons draw at 41px, so ours
   are drawn at 44px — a listed difference.
   ========================================================================== */

.kfe .kfe-quiz {
  --kfe-quiz-serif-face: var(--kfe-quiz-serif, var(--kfe-font-heading));
  line-height: 1.6;
}
.kfe .kfe-quiz [hidden] { display: none !important; }

/* ---------- the head (the reference's `.sec-head`, centred) ---------- */
.kfe .kfe-quiz-head {
  max-width: 780px;
  margin: 0 auto 48px;
  text-align: var(--kfe-head-align, center);
}
.kfe .kfe-quiz .kfe-quiz-eyebrow {
  margin: 20px 0 0;
  font-size: 17px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  font-weight: var(--kfe-quiz-light, var(--kfe-body-weight, 400));
  color: var(--kfe-quiz-head-muted, var(--kfe-muted));
}
.kfe .kfe-quiz .kfe-quiz-title {
  margin: 18px 0 0;
  font-family: var(--kfe-quiz-serif-face);
  font-weight: var(--kfe-heading-weight);
  font-size: var(--kfe-title-size, var(--kfe-h2-size, clamp(36px, 5vw, 60px)));
  line-height: 1.05;
  letter-spacing: -0.018em;
  color: var(--kfe-heading, var(--kfe-primary));
}
.kfe .kfe-quiz .kfe-quiz-eyebrow + .kfe-quiz-lede,
.kfe .kfe-quiz .kfe-quiz-title + .kfe-quiz-lede { margin-top: 20px; }
.kfe .kfe-quiz .kfe-quiz-lede {
  max-width: 58ch;
  margin: 0 auto;
  color: var(--kfe-quiz-head-muted, var(--kfe-muted));
  font-size: var(--kfe-body-size, 17px);
  font-weight: var(--kfe-quiz-light, var(--kfe-body-weight, 400));
}

/* ---------- the toggle (the `accordion` variant) ---------- */
.kfe .kfe-quiz-start { text-align: center; }
.kfe .kfe-quiz .kfe-quiz-toggle {
  display: none;
  align-items: center;
  gap: 14px;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  border-radius: 0;
  cursor: pointer;
  color: inherit;
  font: inherit;
}
.kfe .kfe-quiz.is-armed .kfe-quiz-toggle { display: inline-flex; }
.kfe .kfe-quiz .kfe-quiz-toggle span {
  font-family: var(--kfe-quiz-serif-face);
  font-style: italic;
  font-size: clamp(21px, 2.7vw, 28px);
  line-height: normal;
  color: var(--kfe-ink);
  transition: color 0.25s;
}
.kfe .kfe-quiz .kfe-quiz-toggle:hover span { color: var(--kfe-quiz-accent-deep, var(--kfe-primary-deep)); }
.kfe .kfe-quiz .kfe-quiz-plus {
  width: 46px;
  height: 46px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--kfe-quiz-accent, var(--kfe-accent));
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
  font-style: normal;
  color: var(--kfe-quiz-accent-deep, var(--kfe-primary-deep));
  transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.kfe .kfe-quiz.is-open .kfe-quiz-plus { transform: rotate(135deg); }

/* The panel: collapsed in the `accordion` variant until the toggle opens it.
   `visibility` follows the height, so a closed panel's answers are not in the
   tab order; it changes after the height has finished closing. */
.kfe .kfe-quiz.variant-accordion .kfe-quiz-panel {
  max-height: 0;
  overflow: hidden;
  visibility: hidden;
  transition: max-height 0.55s cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0s linear 0.55s;
}
.kfe .kfe-quiz.variant-accordion.is-open .kfe-quiz-panel {
  visibility: visible;
  transition: max-height 0.55s cubic-bezier(0.2, 0.7, 0.2, 1), visibility 0s linear 0s;
}
.kfe .kfe-quiz.variant-accordion .kfe-quiz-shell { padding-top: 40px; }

/* ---------- the questions ---------- */
.kfe .kfe-quiz-shell { max-width: 760px; margin: 0 auto; }
.kfe .kfe-quiz-form { max-width: 760px; margin: 0 auto; }
.kfe .kfe-quiz .kfe-quiz-block {
  border: none;
  padding: 0;
  margin: 0 0 38px;
  min-width: 0;
}
.kfe .kfe-quiz .kfe-quiz-block legend {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin: 0 0 18px;
  padding: 0;
  font-family: var(--kfe-quiz-serif-face);
  font-size: clamp(22px, 3vw, 30px);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--kfe-ink);
}
.kfe .kfe-quiz .kfe-quiz-qn {
  flex: none;
  font-family: var(--kfe-font-body);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--kfe-quiz-accent-deep, var(--kfe-primary-deep));
}
.kfe .kfe-quiz-opts { display: flex; flex-direction: column; gap: 12px; }
.kfe .kfe-quiz .kfe-quiz-opt {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  margin: 0;
  padding: 18px 22px;
  text-align: left;
  font-family: var(--kfe-font-body);
  font-size: 16px;
  font-weight: inherit;
  line-height: 1.4;
  letter-spacing: normal;
  text-transform: none;
  /* An answer wraps inside its box (wp-eedk #427 item 3). The option is a
     <button>, and a theme's button reset may set `white-space: nowrap`
     (Hello Elementor's does). The answer then stayed on one line, and at 390
     "At beholde min naturlige linse, hvis det er muligt" ran off the screen. */
  white-space: normal;
  color: var(--kfe-quiz-ink-soft, var(--kfe-ink));
  background: var(--kfe-surface);
  border: 1px solid var(--kfe-line);
  border-radius: 3px;
  cursor: pointer;
  transition: 0.28s;
}
.kfe .kfe-quiz .kfe-quiz-opt > span { min-width: 0; }
.kfe .kfe-quiz .kfe-quiz-opt::before {
  content: "";
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--kfe-quiz-ring, var(--kfe-muted));
  transition: 0.28s;
}
.kfe .kfe-quiz .kfe-quiz-opt:hover { border-color: var(--kfe-quiz-accent, var(--kfe-accent)); background: var(--kfe-white); transform: translateX(3px); }
.kfe .kfe-quiz .kfe-quiz-opt:hover::before { border-color: var(--kfe-quiz-accent-deep, var(--kfe-primary-deep)); box-shadow: inset 0 0 0 4px var(--kfe-quiz-accent, var(--kfe-accent)); }
.kfe .kfe-quiz .kfe-quiz-opt.is-selected { border-color: var(--kfe-quiz-accent-deep, var(--kfe-primary-deep)); background: var(--kfe-white); transform: translateX(3px); }
.kfe .kfe-quiz .kfe-quiz-opt.is-selected::before { border-color: var(--kfe-quiz-accent-deep, var(--kfe-primary-deep)); box-shadow: inset 0 0 0 4px var(--kfe-quiz-accent, var(--kfe-accent)); }

/* ---------- the result button and the missing-answer line ---------- */
.kfe .kfe-quiz-submit-wrap { display: none; margin-top: 8px; text-align: center; }
.kfe .kfe-quiz.is-armed .kfe-quiz-submit-wrap { display: block; }
.kfe .kfe-quiz .kfe-quiz-submit,
.kfe .kfe-quiz .kfe-quiz-book {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border: 0;
  white-space: nowrap;
  cursor: pointer;
  font-family: var(--kfe-btn-font, var(--kfe-font-body));
}
.kfe .kfe-quiz .kfe-quiz-hint {
  margin: 16px 0 0;
  text-align: center;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--kfe-quiz-alert, #a3321f);
}

/* ---------- the result card ---------- */
.kfe .kfe-quiz .kfe-quiz-card {
  position: relative;
  overflow: hidden;
  margin-top: 40px;
  padding: 46px 40px;
  background: var(--kfe-white);
  border: 1px solid var(--kfe-line);
  border-radius: 4px;
  box-shadow: var(--kfe-quiz-shadow, 0 30px 80px -40px rgba(20, 24, 40, 0.3));
}
.kfe .kfe-quiz .kfe-quiz-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 3px;
  background: var(--kfe-quiz-rule, var(--kfe-line));
}
.kfe .kfe-quiz-res { text-align: center; }
.kfe .kfe-quiz-res.is-in { animation: kfe-quiz-fade 0.6s cubic-bezier(0.2, 0.7, 0.2, 1); }
@keyframes kfe-quiz-fade {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
.kfe .kfe-quiz .kfe-quiz-tag {
  margin: 0;
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--kfe-quiz-accent-deep, var(--kfe-primary-deep));
}
.kfe .kfe-quiz .kfe-quiz-res-title {
  margin: 14px 0 8px;
  font-family: var(--kfe-quiz-serif-face);
  font-size: clamp(30px, 4.2vw, 46px);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--kfe-ink);
}
.kfe .kfe-quiz .kfe-quiz-why {
  max-width: 52ch;
  margin: 0 auto 26px;
  font-size: 16px;
  font-weight: var(--kfe-quiz-light, var(--kfe-body-weight, 400));
  line-height: 1.7;
  white-space: pre-line;
  color: var(--kfe-quiz-ink-soft, var(--kfe-ink));
}
.kfe .kfe-quiz-acts { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px; }
.kfe .kfe-quiz .kfe-quiz-more {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-left: 16px;
  color: var(--kfe-quiz-link, var(--kfe-link, var(--kfe-primary)));
  text-decoration: var(--kfe-quiz-link-decoration, underline);
}
.kfe .kfe-quiz .kfe-quiz-fine {
  max-width: 56ch;
  margin: 30px auto 0;
  padding-top: 24px;
  border-top: 1px solid var(--kfe-line);
  font-size: 12.5px;
  font-weight: var(--kfe-quiz-light, var(--kfe-body-weight, 400));
  line-height: 1.6;
  color: var(--kfe-muted);
}

/* ---------- the disclaimer (inside the panel, under the form) ---------- */
.kfe .kfe-quiz .kfe-quiz-disc {
  margin: 20px 0 0;
  text-align: center;
  font-size: 12px;
  font-weight: var(--kfe-quiz-light, var(--kfe-body-weight, 400));
  line-height: 1.5;
  color: var(--kfe-quiz-faint, var(--kfe-muted));
}

/* ---------- focus ---------- */
.kfe .kfe-quiz .kfe-quiz-toggle:focus-visible,
.kfe .kfe-quiz .kfe-quiz-opt:focus-visible,
.kfe .kfe-quiz .kfe-quiz-submit:focus-visible,
.kfe .kfe-quiz .kfe-quiz-book:focus-visible,
.kfe .kfe-quiz .kfe-quiz-more:focus-visible {
  outline: 2px solid var(--kfe-quiz-focus, var(--kfe-primary));
  outline-offset: 3px;
}

/* ---------- the editor's empty-state line ---------- */
.kfe .kfe-quiz .kfe-quiz-notice { text-align: center; color: var(--kfe-muted); }

/* ---------- reduced motion: no panel transition, no fade, no slide ---------- */
@media (prefers-reduced-motion: reduce) {
  .kfe .kfe-quiz.variant-accordion .kfe-quiz-panel,
  .kfe .kfe-quiz.variant-accordion.is-open .kfe-quiz-panel { transition: none; }
  .kfe .kfe-quiz-res.is-in { animation: none; }
  .kfe .kfe-quiz .kfe-quiz-plus,
  .kfe .kfe-quiz .kfe-quiz-opt,
  .kfe .kfe-quiz .kfe-quiz-opt::before,
  .kfe .kfe-quiz .kfe-quiz-toggle span { transition: none; }
}
