/* ============================================================
   QUIZ section on the homepage (entry point cards)
   ============================================================ */
.quiz-section {
  background: linear-gradient(180deg, var(--parchment) 0%, var(--cream) 100%);
  padding: 80px 24px;
  border-top: 1px solid var(--border);
}
.quiz-section-inner {
  max-width: 1100px;
  margin: 0 auto;
}
.quiz-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  margin-top: 32px;
}
.quiz-card {
  display: block;
  background: var(--paper);
  border: 1px solid var(--border);
  border-top: 4px solid var(--red);
  border-radius: var(--radius);
  padding: 28px 30px;
  text-decoration: none;
  color: inherit;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  cursor: pointer;
}
.quiz-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(28,42,58,.12);
  border-top-color: var(--red-dark);
  text-decoration: none;
}
.quiz-card-icon { font-size: 36px; line-height: 1; margin-bottom: 12px; }
.quiz-card h3 {
  font-family: var(--font-serif);
  font-size: 24px;
  color: var(--ink);
  margin: 0 0 12px;
  line-height: 1.2;
}
.quiz-card p {
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text);
  margin: 0 0 16px;
}
.quiz-card-cta {
  display: inline-block;
  color: var(--red);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}
@media (max-width: 768px) {
  .quiz-section { padding: 60px 18px; }
  .quiz-cards { grid-template-columns: 1fr; }
}

/* ============================================================
   QUIZ pages — shared styles for "Indovina la lingua" + "Metti in ordine"
   Builds on pages.css template (page-detail body, page-article, etc).
   ============================================================ */

.quiz-page .page-num {
  font-size: 48px;
  line-height: 1;
  margin-bottom: 16px;
}

/* Intro screen */
.quiz-intro p {
  font-family: var(--font-serif);
  font-size: 19px;
  line-height: 1.65;
  color: var(--ink);
  margin-bottom: 28px;
}

/* Round / Game */
.quiz-progress {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--muted);
  letter-spacing: .04em;
  margin-bottom: 14px;
}
.quiz-progress strong {
  color: var(--red);
  font-size: 15px;
}

.quiz-question {
  font-family: var(--font-serif);
  font-size: 22px;
  line-height: 1.4;
  color: var(--ink);
  margin: 22px 0 16px;
}

/* YouTube embed wrapper — mask to hide title/branding */
.quiz-yt-wrap {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
  margin-bottom: 8px;
}
.quiz-yt-wrap iframe,
.quiz-yt-wrap #ytQuiz,
.quiz-yt-wrap #ytQuizMount {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}
/* Cover the YouTube top-bar (title + watch on YT) so users can't read the language label.
   YouTube top-bar is ~46px on desktop, ~32px on mobile. */
.quiz-yt-mask {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #000;
  pointer-events: none;
  z-index: 2;
}

/* Answer options */
.quiz-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.quiz-opt {
  background: var(--paper);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), transform var(--transition);
  text-align: center;
}
.quiz-opt:hover:not(:disabled) {
  background: var(--cream);
  border-color: var(--red);
  transform: translateY(-1px);
}
.quiz-opt:disabled { cursor: default; }
.quiz-opt.correct {
  background: #d6e8c8;
  border-color: #6b9c3a;
  color: #2c4416;
}
.quiz-opt.wrong {
  background: #f3d0cb;
  border-color: var(--red);
  color: var(--red-dark);
}

/* Feedback */
.quiz-feedback {
  background: var(--cream);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 14px;
  border-left: 3px solid var(--gold);
}
.quiz-feedback .fb-ok { color: #2c4416; margin: 0; }
.quiz-feedback .fb-bad { color: var(--red-dark); margin: 0; }
.quiz-feedback strong { color: var(--ink); }
.quiz-feedback em { color: var(--muted); font-style: italic; }

/* Next/Start/Restart buttons */
.quiz-start,
.quiz-next {
  display: inline-block;
  background: var(--red);
  color: #fff;
  border: none;
  border-radius: 50px;
  padding: 14px 32px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .02em;
  cursor: pointer;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  box-shadow: 0 4px 16px rgba(192,57,43,.4);
}
.quiz-start:hover,
.quiz-next:hover {
  background: var(--red-light);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(192,57,43,.5);
}

/* End screen */
.quiz-end h2 {
  font-family: var(--font-serif);
  font-size: 28px;
  color: var(--ink);
  margin-bottom: 12px;
}
.quiz-final-score {
  font-family: var(--font-serif);
  margin: 18px 0;
}
.quiz-final-score strong {
  font-size: 64px;
  color: var(--red);
  line-height: 1;
}
.quiz-final-score span {
  font-size: 22px;
  color: var(--muted);
  margin-left: 4px;
}
.quiz-final-msg {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 20px;
  line-height: 1.5;
  color: var(--ink);
  margin: 0 0 28px;
}
.quiz-back {
  display: inline-block;
  margin-left: 18px;
  color: var(--red);
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  vertical-align: middle;
}
.quiz-back:hover { color: var(--red-dark); }

/* ── METTI IN ORDINE ─────────────────────────────────────── */
.order-list {
  list-style: none;
  padding: 0;
  margin: 0 0 24px;
}
.order-item {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 14px;
  background: var(--paper);
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 10px;
  cursor: grab;
  transition: transform .15s ease, box-shadow var(--transition), border-color var(--transition);
}
.order-item:active { cursor: grabbing; }
.order-item.dragging {
  opacity: .5;
  transform: scale(.98);
}
.order-item.drag-over {
  border-left-color: var(--red);
  background: var(--cream);
}
.order-item.solution {
  cursor: default;
  border-left-color: #6b9c3a;
  grid-template-columns: 110px 1fr;
}
.order-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
  justify-content: center;
}
.order-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--cream);
  border: 1px solid var(--border);
  color: var(--ink);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition);
}
.order-btn:hover:not(:disabled) {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.order-btn:disabled { opacity: .25; cursor: default; }
.order-content h4 {
  font-family: var(--font-serif);
  font-size: 18px;
  color: var(--ink);
  margin: 0 0 6px;
  line-height: 1.25;
}
.order-content p {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  margin: 0;
}
.order-year {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 14px;
  color: var(--red);
  letter-spacing: .04em;
  align-self: center;
  text-align: center;
}

/* Mobile */
@media (max-width: 640px) {
  .quiz-options { grid-template-columns: 1fr; }
  .quiz-question { font-size: 19px; }
  .quiz-final-score strong { font-size: 48px; }
  .order-item { grid-template-columns: 50px 1fr; padding: 12px 14px; }
  .order-btn { width: 32px; height: 32px; font-size: 12px; }
  .order-content h4 { font-size: 16px; }
  .order-content p { font-size: 13px; }
}
