/* =============================================================
   quiz.css · "How well do you know the couple?" quiz
   All selectors are namespaced under .quiz__ so this can drop
   into the existing stylesheet cascade without touching anything
   else. Colours, type and easing all come from the :root tokens
   already defined in style.css — nothing is redefined here.
   ============================================================= */

/* ---------- Section shell ---------- */
.quiz {
  background: linear-gradient(180deg, var(--cream-2), var(--cream));
  text-align: center;
}

.quiz__head {
  max-width: 700px;
  margin: 0 auto clamp(2.5rem, 5vw, 3.5rem);
}

.quiz__sub {
  margin-top: 1.1rem;
  font-size: clamp(1.05rem, 2.2vw, 1.25rem);
  font-style: italic;
  font-weight: 300;
  color: var(--ink-soft);
}

/* ---------- Stage + card ---------- */
.quiz__stage {
  max-width: 620px;
  margin: 0 auto;
}

.quiz__card {
  position: relative;
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: clamp(2rem, 5vw, 3rem);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  text-align: center;
}
/* thin gold hairline across the top, echoes the ornament dividers used elsewhere */
.quiz__card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold-light), var(--gold-deep), var(--terracotta));
  opacity: 0.7;
}

.quiz__noscript {
  color: var(--ink-soft);
  font-style: italic;
}

/* Every panel plays this on mount — no class juggling needed for
   the "enter" half of the transition, the browser just runs it
   whenever a fresh .quiz__panel lands in the DOM. */
.quiz__panel {
  animation: quizPanelIn 0.55s var(--ease-out) both;
}
@keyframes quizPanelIn {
  from { opacity: 0; transform: translateY(18px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* the "exit" half — JS adds this to the outgoing panel and waits
   for it to finish before swapping the markup underneath it */
.quiz__panel.is-leaving {
  animation: none;
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.22s var(--ease-out), transform 0.22s var(--ease-out);
}

.quiz__monogram {
  display: inline-flex;
  align-items: center;
  gap: 0.18em;
  font-family: var(--font-serif);
  font-size: 1.7rem;
  font-weight: 600;
  color: var(--gold-deep);
  margin-bottom: 1.1rem;
}
.quiz__monogram .script { font-size: 1.3em; color: var(--gold); }

/* ---------- Start panel ---------- */
.quiz__panel-title {
  font-size: clamp(1.7rem, 4.5vw, 2.4rem);
  font-weight: 500;
  line-height: 1.2;
  margin-bottom: 0.8rem;
}
.quiz__panel-title .script { color: var(--gold-deep); font-size: 1.15em; }

.quiz__panel-copy {
  font-size: 1.08rem;
  color: var(--ink-soft);
  font-style: italic;
  font-weight: 300;
  max-width: 440px;
  margin: 0 auto 1.9rem;
}

.quiz__meta {
  display: flex;
  justify-content: center;
  gap: 1.6rem;
  margin-bottom: 1.8rem;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold-deep);
}

/* ---------- Progress indicator ---------- */
.quiz__progress {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: clamp(1.6rem, 3vw, 2.2rem);
  text-align: left;
}
.quiz__progress-label {
  flex: 0 0 auto;
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-deep);
  white-space: nowrap;
}
.quiz__progress-track {
  flex: 1 1 auto;
  height: 4px;
  border-radius: 100px;
  background: var(--line);
  overflow: hidden;
}
.quiz__progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold-light), var(--gold-deep));
  transition: width 0.5s var(--ease-out);
}

/* ---------- Question + options ---------- */
.quiz__question {
  font-size: clamp(1.4rem, 4vw, 1.95rem);
  font-weight: 500;
  line-height: 1.25;
  text-align: left;
  margin-bottom: 1.5rem;
}

.quiz__options {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.quiz__option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  width: 100%;
  text-align: left;
  font-family: var(--font-serif);
  font-size: 1.08rem;
  color: var(--ink);
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0.95rem 1.25rem;
  min-height: 3rem;
  transition: border-color 0.3s var(--ease-out), background 0.3s var(--ease-out),
              transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}
.quiz__option:hover:not(:disabled) {
  border-color: var(--gold);
  background: var(--cream-2);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}
.quiz__option:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 2px;
}
.quiz__option:disabled { cursor: default; }

/* the tick / cross badges are drawn with ::after so no extra markup or images needed */
.quiz__option::after {
  content: "";
  flex: 0 0 auto;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}

.quiz__option.is-correct {
  border-color: var(--sage);
  background: rgba(138, 154, 123, 0.14);
  color: var(--ink);
}
.quiz__option.is-correct::after {
  content: "✓";
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cream);
  background: var(--sage);
  opacity: 1;
  transform: scale(1);
  font-size: 0.85rem;
}
.quiz__option.is-wrong {
  border-color: var(--terracotta);
  background: rgba(181, 98, 63, 0.12);
  color: var(--ink);
}
.quiz__option.is-wrong::after {
  content: "✕";
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--cream);
  background: var(--terracotta);
  opacity: 1;
  transform: scale(1);
  font-size: 0.8rem;
}
/* answered-but-not-picked, non-correct options just fade back a touch */
.quiz__option:disabled:not(.is-correct):not(.is-wrong) {
  opacity: 0.55;
}

/* ---------- Feedback ---------- */
.quiz__feedback {
  margin-top: 1.6rem;
  padding: 1.2rem 1.4rem;
  background: var(--cream-2);
  border-left: 3px solid var(--gold);
  border-radius: 4px 10px 10px 4px;
  text-align: left;
}
.quiz__feedback--correct { border-left-color: var(--sage); }
.quiz__feedback--wrong { border-left-color: var(--terracotta); }

.quiz__feedback-lead {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 0.5rem;
}
.quiz__feedback--correct .quiz__feedback-lead { color: var(--sage); }
.quiz__feedback--wrong .quiz__feedback-lead { color: var(--terracotta); }

.quiz__quip {
  font-style: italic;
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin-bottom: 1.2rem;
}

.quiz__feedback .btn {
  display: flex;
  margin-left: auto;
}

/* ---------- Result panel ---------- */
.quiz__score {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0.35rem;
  margin: 1.4rem 0 1.6rem;
}
.quiz__score-num {
  font-size: clamp(3.4rem, 13vw, 5.6rem);
  font-weight: 500;
  line-height: 1;
  color: var(--gold-deep);
  font-variant-numeric: tabular-nums;
}
.quiz__score-den {
  font-family: var(--font-sans);
  font-size: 1.3rem;
  color: var(--ink-soft);
  padding-bottom: 0.7rem;
}

.quiz__verdict {
  font-size: clamp(1.15rem, 3vw, 1.5rem);
  font-style: italic;
  color: var(--ink-soft);
  max-width: 460px;
  margin: 0 auto;
}

.quiz__result-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: clamp(1.8rem, 4vw, 2.4rem);
}

.quiz__copy-note {
  display: block;
  margin-top: 0.9rem;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--sage);
  opacity: 0;
  transition: opacity 0.3s var(--ease-out);
}
.quiz__copy-note.is-visible { opacity: 1; }

/* ---------- Small screens ---------- */
@media (max-width: 480px) {
  .quiz__card { padding: 1.6rem 1.2rem; border-radius: 14px; }
  .quiz__question { font-size: clamp(1.25rem, 6vw, 1.6rem); }
  .quiz__option { padding: 0.85rem 1rem; font-size: 1rem; }
  .quiz__progress-label { font-size: 0.62rem; letter-spacing: 0.1em; }
  .quiz__result-actions { flex-direction: column; align-items: stretch; }
  .quiz__result-actions .btn { justify-content: center; }
  .quiz__feedback .btn { margin-left: 0; width: 100%; justify-content: center; }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .quiz__panel {
    animation: none !important;
  }
  .quiz__panel.is-leaving {
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
  .quiz__option,
  .quiz__option::after,
  .quiz__progress-fill,
  .quiz__copy-note {
    transition: none !important;
  }
  .quiz__option:hover:not(:disabled) { transform: none; }
}
