/* ========================================
   CHALLENGE TEMPLATE
   Scored questions + join / petition / donation offer
======================================== */

.challenge-with-video {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.challenge-video-wrapper {
  margin: 0;
  padding: 0;
  max-width: 100%;
}

.challenge-video-wrapper .video-card {
  margin: 0 !important;
  padding: 0 !important;
  max-width: 100%;
}

.challenge-template {
  --challenge-accent: #c62828;
  --challenge-ink: #1f2d3d;
  --challenge-muted: #4b5d6b;
  --challenge-border: #e2e8f0;
  --petition-accent: var(--challenge-accent);
  --petition-ink: var(--challenge-ink);
  --petition-border: var(--challenge-border);
  background: #ffffff;
  box-sizing: border-box;
  min-width: 0;
}

.challenge-content,
.challenge-question,
.challenge-offer {
  min-width: 0;
  overflow-x: clip;
}

.challenge-content--chrome-hidden {
  margin: 0;
  min-height: 0;
}

.challenge-template--in-quiz .challenge-quiz {
  margin-top: 0.25rem;
}

.challenge-template--complete .challenge-quiz-header,
.challenge-template--complete .challenge-quiz-progress-track {
  display: none;
}

.challenge-content::after {
  content: "";
  display: table;
  clear: both;
}

.challenge-template h1.challenge-title {
  color: var(--challenge-ink);
  font-size: clamp(1.35rem, 3.6vw, 1.75rem);
  line-height: 1.25;
  margin: 0 0 0.75rem;
  text-align: center;
  overflow-wrap: anywhere;
}

.challenge-intro,
.challenge-offer-body {
  min-width: 0;
  overflow-wrap: anywhere;
}

.challenge-intro[hidden],
.challenge-image[hidden],
.challenge-title[hidden] {
  display: none;
}

.challenge-intro p {
  font-size: 1rem;
  margin: 0 0 0.6rem;
  color: var(--challenge-muted);
}

.challenge-intro img,
.challenge-intro iframe,
.challenge-intro table,
.challenge-intro .wp-block-image,
.challenge-intro .wp-block-embed,
.challenge-offer-body img,
.challenge-offer-body iframe,
.challenge-offer-body table,
.challenge-offer-body .wp-block-image,
.challenge-offer-body .wp-block-embed {
  max-width: 100% !important;
  height: auto;
}

.challenge-intro .alignwide,
.challenge-intro .alignfull,
.challenge-intro .alignleft,
.challenge-intro .alignright,
.challenge-offer-body .alignwide,
.challenge-offer-body .alignfull {
  margin-left: 0 !important;
  margin-right: 0 !important;
  max-width: 100% !important;
  width: 100% !important;
  float: none;
}

.challenge-quiz {
  margin-top: 1rem;
  min-width: 0;
}

.challenge-quiz-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.challenge-quiz-header:has(.challenge-quiz-kicker) {
  justify-content: space-between;
}

.challenge-quiz-kicker {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--challenge-muted);
  margin: 0;
}

.challenge-quiz-progress {
  white-space: nowrap;
  flex: 0 0 auto;
}

.challenge-look-classic .challenge-quiz-progress {
  font-size: 0.85rem;
  color: #6a7a8a;
}

.challenge-quiz-progress-sep {
  margin: 0 0.25em;
}

.challenge-quiz-progress-track {
  background: #e8edf2;
  border-radius: 999px;
  overflow: hidden;
}

.challenge-look-classic .challenge-quiz-progress-track {
  height: 6px;
  margin: -0.35rem 0 0.85rem;
}

.challenge-quiz-progress-bar {
  height: 100%;
  width: 0;
  background: var(--challenge-accent);
  border-radius: 999px;
  transition: width 0.25s ease;
}

@media (prefers-reduced-motion: reduce) {
  .challenge-quiz-progress-bar {
    transition: none;
  }
}

.challenge-question {
  min-width: 0;
  box-sizing: border-box;
}

.challenge-look-classic .challenge-question {
  border: 1px solid var(--challenge-border);
  border-radius: 8px;
  padding: 1rem;
  background: #ffffff;
}

.challenge-question[hidden] {
  display: none;
}

.challenge-question-text {
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.challenge-look-classic .challenge-question-text {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.65rem;
  color: var(--challenge-ink);
}

.challenge-answers {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.challenge-answer.petition-choice {
  max-width: 100%;
}

.challenge-look-classic .challenge-answer.petition-choice {
  margin: 0.12rem 0;
  /* 2.1rem radio gutter + inset so the circle is not flush with the
     highlight / row edge. */
  padding-left: 3.1rem;
  padding-right: 0.5rem;
}

.challenge-look-classic .challenge-answer.petition-choice:has(input:checked):not(.challenge-correct):not(.challenge-incorrect) {
  background: #f3f4f6;
  border-radius: 6px;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.challenge-question--checked .challenge-answer {
  cursor: default;
}

/* Do not use a padding shorthand here — it would wipe the radio gutter
   and shove the circles out of the card. */
.challenge-look-classic .challenge-answer.challenge-correct,
.challenge-look-classic .challenge-answer.quiz-correct,
.challenge-look-classic .challenge-answer.challenge-incorrect,
.challenge-look-classic .challenge-answer.quiz-incorrect {
  background: #e8f5e9;
  border-radius: 6px;
  padding-top: 0.35rem;
  padding-bottom: 0.35rem;
}

.challenge-look-classic .challenge-answer.challenge-incorrect,
.challenge-look-classic .challenge-answer.quiz-incorrect {
  background: #ffebee;
}

.challenge-result-status {
  font-size: 0.95rem;
  font-weight: 700;
}

.challenge-look-classic .challenge-result-status {
  margin: 0.65rem 0 0;
}

.challenge-result-status--correct {
  color: #1b5e20;
}

.challenge-result-status--incorrect {
  color: #b71c1c;
}

.challenge-result-status[hidden] {
  display: none;
}

.challenge-explanation {
  margin-top: 0.7rem;
  padding: 0.65rem 0.8rem;
  background: #f3f4f6;
  border-radius: 6px;
  font-size: 0.92rem;
  color: #4b5d6b;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.challenge-explanation p {
  margin: 0;
}

.challenge-question:not(.challenge-question--checked) .challenge-question-actions {
  display: none;
}

.challenge-question-actions {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.challenge-question-actions .btn:not([hidden]) {
  display: inline-block;
  width: auto;
  max-width: 100%;
  margin: 0;
}

.challenge-question-actions .btn[hidden] {
  display: none;
}

.challenge-results {
  position: relative;
  text-align: center;
  padding: 1rem 0 0.25rem;
}

.challenge-fireworks {
  position: absolute;
  left: 0;
  right: 0;
  top: -0.5rem;
  height: 0;
  pointer-events: none;
  overflow: visible;
}

.challenge-fireworks[hidden] {
  display: none;
}

.challenge-firework {
  position: absolute;
  left: var(--fx-x, 50%);
  top: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fx-color, #c62828);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
  animation: challenge-firework 1.2s ease-out var(--fx-delay, 0s) forwards;
}

@keyframes challenge-firework {
  0% {
    transform: translate(-50%, 8px) scale(0.35);
    opacity: 1;
  }
  75% {
    opacity: 1;
  }
  100% {
    transform: translate(-50%, var(--fx-lift, -90px)) rotate(var(--fx-rot, 0deg)) scale(1.05);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .challenge-firework {
    animation: none;
    display: none;
  }
}

.challenge-results[hidden] {
  display: none;
}

.challenge-score {
  color: var(--challenge-ink);
}

.challenge-look-classic .challenge-score {
  font-size: 1.1rem;
}

.challenge-offer {
  margin-top: 1.25rem;
  min-width: 0;
}

.challenge-offer[hidden],
.challenge-list-member-done[hidden] {
  display: none;
}

.challenge-offer-heading {
  text-align: center;
  color: var(--challenge-ink);
  margin: 0 0 0.4em;
  overflow-wrap: anywhere;
}

.challenge-look-classic .challenge-offer-heading {
  font-size: 1.25rem;
}

.challenge-offer-body p {
  font-size: 1rem;
  margin: 0 0 0.6rem;
  color: var(--challenge-ink);
}

.challenge-form {
  margin-top: 1rem;
  min-width: 0;
}

.challenge-form .form-grid {
  max-width: 100%;
  width: 100%;
}

.challenge-form button[type="submit"] {
  margin-top: 0.5em;
  display: block;
  width: auto;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.challenge-cta-note {
  margin: 0.75rem 0 0.4rem;
  text-align: center;
  color: #787878;
  font-size: 0.95rem;
}

.challenge-privacy {
  display: none;
  margin-top: 1em;
  font-size: 0.9em;
  color: #6a7a8a;
  text-align: center;
}

.challenge-template--complete .challenge-privacy {
  display: block;
}

.challenge-list-member-done {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 1.05rem;
  color: var(--challenge-ink);
}

.challenge-section-donation {
  min-width: 0;
  max-width: 100%;
}

.challenge-section-donation .donation-template,
.challenge-section-donation .donation-template.card.ctf-template {
  width: 100%;
  max-width: 100%;
  margin: 0;
  padding: 0;
  box-shadow: none;
  border: none;
}

.challenge-error {
  text-align: center;
  margin-top: 1em;
}

@media (max-width: 768px) {
  .challenge-quiz-header {
    margin-bottom: 0.6rem;
  }

  .challenge-look-classic .challenge-question {
    padding: 0.85rem;
  }

  .challenge-look-classic .challenge-question-text {
    font-size: 1rem;
  }

  .challenge-question-actions .btn:not([hidden]),
  .challenge-form button[type="submit"] {
    width: auto;
    min-width: min(14rem, 100%);
  }
}

/* ========================================
   LOOK: CARDS
   Additive skin. Add another look the same way:
   registry id + .challenge-look-{id} block.
======================================== */

.challenge-look-cards .challenge-quiz-header {
  margin-bottom: 0.5rem;
}

.challenge-look-cards .challenge-quiz-progress {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--challenge-ink);
}

.challenge-look-cards .challenge-quiz-progress-track {
  height: 8px;
  margin: 0 0 1rem;
  background: #edf1f5;
}

.challenge-look-cards .challenge-question {
  overflow: visible;
}

.challenge-look-cards .challenge-question-text {
  margin: 0;
  padding: 0.95rem 1.05rem;
  background: var(--challenge-ink);
  color: #ffffff;
  border-radius: 10px 10px 0 0;
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.35;
}

.challenge-look-cards .challenge-question-body {
  padding: 0.85rem 0.9rem 1rem;
  background: #ffffff;
  border: 1px solid var(--challenge-border);
  border-top: none;
  border-radius: 0 0 10px 10px;
}

.challenge-look-cards .challenge-answer.petition-choice {
  margin: 0.4rem 0;
  padding: 0.75rem 0.85rem 0.75rem 3.2rem;
  border: 2px solid #d7dee6;
  border-radius: 10px;
  background: #f8fafc;
}

.challenge-look-cards .challenge-answer.petition-choice span::before {
  left: -2.45rem;
  top: 0.2rem;
  width: 1.4rem;
  height: 1.4rem;
}

.challenge-look-cards .challenge-answer.petition-choice span::after {
  left: -2.15rem;
  top: 0.16rem;
}

.challenge-look-cards .challenge-answer.petition-choice:has(input:checked):not(.challenge-correct):not(.challenge-incorrect) {
  background: #fff5f5;
  border-color: var(--challenge-accent);
}

.challenge-look-cards .challenge-answer.challenge-correct,
.challenge-look-cards .challenge-answer.quiz-correct {
  background: #e8f5e9;
  border-color: #2e7d32;
}

.challenge-look-cards .challenge-answer.challenge-incorrect,
.challenge-look-cards .challenge-answer.quiz-incorrect {
  background: #ffebee;
  border-color: #c62828;
}

.challenge-look-cards .challenge-result-status {
  margin: 0.75rem 0 0;
  padding: 0.45rem 0.7rem;
  border-radius: 8px;
  background: #f3f4f6;
}

.challenge-look-cards .challenge-result-status--correct {
  background: #e8f5e9;
}

.challenge-look-cards .challenge-result-status--incorrect {
  background: #ffebee;
}

.challenge-look-cards .challenge-question-actions .btn:not([hidden]) {
  min-width: min(16rem, 100%);
}

.challenge-look-cards .challenge-results {
  padding: 1.4rem 0.5rem 0.4rem;
}

.challenge-look-cards .challenge-score {
  font-size: 1.35rem;
  font-weight: 700;
}

.challenge-look-cards .challenge-offer-heading {
  font-size: 1.4rem;
}

@media (max-width: 768px) {
  .challenge-look-cards .challenge-question {
    padding: 0;
  }

  .challenge-look-cards .challenge-question-text {
    font-size: 1.05rem;
    padding: 0.85rem 0.9rem;
  }

  .challenge-look-cards .challenge-question-actions .btn:not([hidden]) {
    width: 100%;
  }
}
