/* Heat Tolerance Quiz page blocks (templates/tools/heat-quiz.php). Loaded after tools.css (data-page-style).
   Frame classes do the rest: .tool-layout, .tool-card, .tool-result, .tool-btn, .tier-chip, .heat-axis, .tool-tips, .tool-faq, .tool-links.
   Comp: tmp/design-v3/comps/tool-heat-quiz.png. Prefix: .quiz-* */

.quiz-main { min-width: 0; }
.quiz-kicker {
  color: var(--ktp-muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .12em;
  line-height: 1.3;
  text-transform: uppercase;
}

/* Progress: five tier-coloured segments, filled up to the current question */
.quiz-progress { display: flex; align-items: center; gap: var(--ktp-space-4); margin-bottom: var(--ktp-space-6); }
.quiz-progress__segs { display: flex; flex: 1; gap: 4px; min-width: 0; }
.quiz-progress__segs { align-items: center; }
.quiz-progress__seg { flex: 1; height: 6px; border-radius: 3px; background: color-mix(in srgb, var(--tier, var(--ktp-muted)) 28%, var(--ktp-white)); transition: background-color .2s, height .2s; }
.quiz-progress__seg.is-done,
.quiz-progress__seg.is-answered { background: var(--tier, var(--ktp-muted)); }
.quiz-progress__seg.is-current { height: 10px; border-radius: 5px; background: var(--tier, var(--ktp-muted)); box-shadow: 0 0 0 2px var(--ktp-white), 0 0 0 3.5px var(--tier, var(--ktp-muted)); }
.quiz-progress__name { flex: none; color: var(--ktp-muted); font-size: var(--ktp-fs-small); font-weight: 600; line-height: 1.3; }

/* Question and the 2 by 2 options */
.quiz-fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.quiz-question {
  display: block;
  width: 100%;
  margin: 0 0 var(--ktp-space-5);
  padding: 0;
  color: var(--ktp-ink);
  font-family: var(--ktp-font-display);
  font-size: clamp(1.4rem, 2.6vw, 1.75rem);
  font-weight: var(--ktp-fw-display);
  letter-spacing: -0.015em;
  line-height: 1.25;
}
.quiz-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--ktp-space-4); }
.quiz-option {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--ktp-space-3);
  min-width: 0;
  min-height: 96px;
  padding: var(--ktp-space-4) var(--ktp-space-5);
  border: var(--ktp-line);
  border-radius: var(--ktp-radius);
  background: var(--ktp-white);
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.quiz-option:hover { border-color: var(--tool-input-line); }
.quiz-option__input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.quiz-option__body { display: block; min-width: 0; }
.quiz-option__title {
  display: flex;
  align-items: center;
  gap: var(--ktp-space-2);
  color: var(--ktp-ink);
  font-family: var(--ktp-font-display);
  font-size: 1.1rem; /* ~18px with the 16px root of the frame */
  font-weight: 700;
  line-height: 1.25;
}
.quiz-option__title::before { /* the tier dot: heat rises from the first to the fourth answer */
  content: "";
  flex: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--tier, var(--ktp-muted));
}
.quiz-option__desc { display: block; margin-top: var(--ktp-space-1); color: var(--ktp-muted); font-size: 16px; line-height: 1.45; }
.quiz-option__ring {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border: 2px solid var(--tool-input-line);
  border-radius: 50%;
  background: var(--ktp-white);
  box-sizing: border-box;
}
.quiz-option.is-selected { border-color: var(--ktp-chili); background: var(--ktp-blush); box-shadow: inset 0 0 0 1px var(--ktp-chili); }
.quiz-option.is-selected .quiz-option__title { color: var(--ktp-chili-dark); }
.quiz-option.is-selected .quiz-option__ring { border-color: var(--ktp-chili); background: radial-gradient(circle, var(--ktp-chili) 0 5.5px, var(--ktp-white) 6px); }
.quiz-option:focus-within { outline: 3px solid var(--ktp-chili); outline-offset: 2px; }
.quiz-hint { min-height: var(--ktp-space-5); margin-top: var(--ktp-space-3); color: var(--ktp-chili); font-size: var(--ktp-fs-small); font-weight: 700; line-height: 1.4; }
.quiz-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--ktp-space-4);
  padding-top: var(--ktp-space-5);
  border-top: 1px solid var(--ktp-hairline);
}
.quiz-nav__prev { border-color: transparent; color: var(--ktp-muted); }
.quiz-nav__prev:hover { color: var(--ktp-ink); }
.quiz-nav__prev:disabled { opacity: .35; cursor: not-allowed; background: transparent; }
.quiz-nav .ktp-icon--arrow { --icon-size: 16px; }
.quiz-nav__prev .ktp-icon { transform: scaleX(-1); }

/* Answer summary (ancho card): one row per question */
.quiz-answer-list { margin: var(--ktp-space-5) 0 0; padding: 0; list-style: none; }
.quiz-answer-list li {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: var(--ktp-space-3);
  padding: var(--ktp-space-3) 0 var(--ktp-space-3) var(--ktp-space-4);
  border-top: 1px solid rgba(255, 233, 220, .18);
}
.quiz-answer-list li::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 2px; background: transparent; }
.quiz-answer-list li.is-current::before { background: var(--ktp-chili); }
.quiz-answer-list li.is-complete::before { background: var(--ktp-on-dark-muted); opacity: .5; }
.quiz-answer-list__text { min-width: 0; }
.quiz-answer-list__num { color: var(--ktp-on-dark-muted); font-size: 15px; font-weight: 800; letter-spacing: .04em; line-height: 1.7; }
.quiz-answer-list__title,
.quiz-answer-list__value { display: block; }
.quiz-answer-list__title { color: var(--ktp-on-dark-muted); font-size: 13px; font-weight: 700; letter-spacing: .08em; line-height: 1.4; text-transform: uppercase; }
.quiz-answer-list__value { margin-top: 2px; color: var(--ktp-white); font-family: var(--ktp-font-display); font-size: 1.3rem; font-weight: 800; line-height: 1.35; }
.quiz-answer-list li:not(.is-complete) .quiz-answer-list__value { color: var(--ktp-on-dark-muted); font-weight: 500; font-family: var(--ktp-font-body); font-size: 1.1rem; opacity: .75; }

/* Result card */
.quiz-result__top { display: flex; align-items: center; gap: var(--ktp-space-4); }
.quiz-result__top .tool-card__title { margin-top: var(--ktp-space-1); }
.quiz-badge {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--tier-tint, var(--ktp-smoke));
  color: var(--tier, var(--ktp-ink));
}
.quiz-badge .ktp-icon { width: 32px; height: 32px; }
.quiz-result__lede { margin-top: var(--ktp-space-5); color: var(--ktp-ink); font-size: var(--ktp-fs-body); line-height: var(--ktp-lh-body); }
.quiz-range {
  --axis-card: var(--ktp-smoke);
  margin-top: var(--ktp-space-5);
  padding: var(--ktp-space-5) var(--ktp-space-6) var(--ktp-space-4);
  border-radius: var(--ktp-radius);
  background: var(--ktp-smoke);
}
.quiz-range__value {
  margin-top: var(--ktp-space-1);
  color: var(--ktp-ink);
  font-family: var(--ktp-font-display);
  font-size: clamp(1.6rem, 3.2vw, 2.25rem);
  font-weight: var(--ktp-fw-display);
  letter-spacing: -0.02em;
  line-height: 1.15;
}
.quiz-range .heat-axis { margin-top: var(--ktp-space-4); }
.quiz-subheading {
  margin: var(--ktp-space-6) 0 var(--ktp-space-4);
  color: var(--ktp-ink);
  font-family: var(--ktp-font-display);
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1.3;
}
.quiz-recs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--ktp-space-4); margin: 0; padding: 0; list-style: none; }
.quiz-rec {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--ktp-space-2);
  height: 100%;
  padding: var(--ktp-space-3) var(--ktp-space-3) var(--ktp-space-4);
  text-align: center;
  border: var(--ktp-line);
  border-radius: var(--ktp-radius);
  background: var(--ktp-white);
  color: var(--ktp-ink);
  text-decoration: none;
}
.quiz-rec:hover { border-color: var(--ktp-ink); }
.quiz-rec__art {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  aspect-ratio: 4 / 3;
}
.quiz-rec__art .ktp-pepper-art { width: auto; height: 82%; max-width: 82%; object-fit: contain; }
.quiz-rec__art .ktp-icon { width: 56px; height: 56px; }
.quiz-rec__name { padding-inline: var(--ktp-space-1); font-family: var(--ktp-font-display); font-size: 1.1rem; font-weight: 800; line-height: 1.25; }
.quiz-rec .tier-chip { font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.quiz-rec__shu { padding-inline: var(--ktp-space-1); padding-bottom: var(--ktp-space-1); color: var(--ktp-muted); font-size: 15px; line-height: 1.4; }
.quiz-result__actions { display: flex; flex-wrap: wrap; gap: var(--ktp-space-3); margin-top: var(--ktp-space-6); }
.quiz-result__actions .tool-btn { flex: 1 1 160px; }

/* Icon tile (round smoke circle), shared by the tips and the tolerance flow */
.quiz-tile {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--ktp-smoke);
  color: var(--ktp-ink);
}
.quiz-tile .ktp-icon { width: 24px; height: 24px; }
.quiz-tips > li { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: var(--ktp-space-4); align-items: start; }

/* Tolerance flow: three steps joined by a line (steps come from the paragraphs below it) */
.quiz-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--ktp-space-4); margin: var(--ktp-space-5) 0; padding: 0; list-style: none; counter-reset: flow; }
.quiz-flow__step { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: var(--ktp-space-3); min-width: 0; }
.quiz-flow__step::after { /* connector to the next step, drawn from the tile edge */
  content: "";
  position: absolute;
  top: 24px;
  left: 60px;
  right: calc(-1 * var(--ktp-space-4) + 12px);
  height: 0;
  border-top: 2px dashed var(--tool-input-line);
}
.quiz-flow__step:last-child::after { display: none; }
.quiz-flow__text { display: block; }
.quiz-flow__title { display: block; color: var(--ktp-ink); font-family: var(--ktp-font-display); font-size: 1.1rem; font-weight: 800; line-height: 1.25; }
.quiz-flow__sub { display: block; margin-top: 2px; color: var(--ktp-muted); font-size: 15px; line-height: 1.4; }

/* Heat-level list: pod art left, range bar on the log axis under the heading */
.quiz-levels > li { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: var(--ktp-space-5); align-items: start; }
.quiz-level__art { display: flex; align-items: center; justify-content: center; width: 72px; height: 72px; }
.quiz-level__art .ktp-pepper-art { width: 72px; height: 72px; object-fit: contain; }
.quiz-level__art .ktp-icon { width: 48px; height: 48px; }
.quiz-level__body { min-width: 0; }
.quiz-level__range { margin-block: var(--ktp-space-2) var(--ktp-space-3); max-width: 360px; }
.quiz-level__body p { margin: 0; }

@media (max-width: 640px) {
  .quiz-options { grid-template-columns: minmax(0, 1fr); }
  .quiz-option { min-height: 0; }
  .quiz-progress { flex-wrap: wrap; gap: var(--ktp-space-2); }
  .quiz-progress__segs { flex: 1 1 100%; }
  .quiz-recs { grid-template-columns: minmax(0, 1fr); }
  .quiz-flow { grid-template-columns: minmax(0, 1fr); gap: var(--ktp-space-5); }
  .quiz-flow__step { flex-direction: row; align-items: center; }
  .quiz-flow__step::after { display: none; }
  .quiz-levels > li { grid-template-columns: 56px minmax(0, 1fr); gap: var(--ktp-space-4); }
  .quiz-level__art, .quiz-level__art .ktp-pepper-art { width: 56px; height: 56px; }
  .quiz-rec { display: grid; grid-template-columns: 96px minmax(0, 1fr); grid-template-areas: "art name" "art chip" "art shu"; align-content: center; justify-items: start; gap: var(--ktp-space-1) var(--ktp-space-4); padding: var(--ktp-space-3) var(--ktp-space-4); text-align: left; }
  .quiz-rec__art { grid-area: art; width: 96px; align-self: center; }
  .quiz-rec__art .ktp-pepper-art { height: 100%; max-width: 100%; }
  .quiz-rec__name { grid-area: name; padding-inline: 0; }
  .quiz-rec .tier-chip { grid-area: chip; }
  .quiz-rec__shu { grid-area: shu; padding: 0; }
  .quiz-range { padding-inline: var(--ktp-space-5); }
}
