/* CTET chapter-test pages: hub, player (client-scored), and /ctet/ browse pages.
   Uses tokens from site-base.css (--navy, --teal, --orange, --border, etc.). */

.chapter-hub,
.test-player,
.landing-page {
  width: min(var(--max-width), calc(100% - 40px));
  max-width: 920px;
  margin: 0 auto;
  padding: 28px 0 72px;
}
.landing-page { max-width: var(--max-width); }

/* breadcrumb */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--slate);
  margin-bottom: 22px;
}
.breadcrumb a { color: var(--slate); text-decoration: none; }
.breadcrumb a:hover { color: var(--teal); }
.breadcrumb [aria-current="page"] { color: var(--navy); font-weight: 600; }
.breadcrumb-sep { color: var(--border); }

/* ── chapter hub ─────────────────────────────────────────── */
.hub-chip,
.player-tier-chip,
.hub-meta {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.hub-chip {
  display: inline-block;
  background: var(--soft-teal);
  color: var(--teal);
  padding: 6px 14px;
  border-radius: 999px;
  text-transform: uppercase;
}
.hub-h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 14px 0 8px; color: var(--navy); }
.hub-meta { color: var(--slate); text-transform: none; }
.hub-summary { margin: 26px 0; }
.hub-summary h2,
.hub-tests h2,
.hub-source h2 { font-size: 1.1rem; color: var(--navy); margin-bottom: 12px; }
.hub-summary p { color: #374151; line-height: 1.75; }

.test-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}
.test-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
  border-top: 4px solid var(--teal);
}
.test-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-strong); }
.test-card--practice { border-top-color: var(--teal); }
.test-card--quiz { border-top-color: var(--orange); }
.test-card--hard { border-top-color: var(--yellow); }
.test-card--mastery { border-top-color: var(--navy); }
.test-card-tier { font-size: 1.15rem; font-weight: 700; color: var(--navy); }
.test-card-q { font-size: 0.95rem; font-weight: 600; color: var(--teal); }
.test-card-time { font-size: 0.8rem; color: var(--slate); }
.test-card-desc { font-size: 0.88rem; color: #4b5563; line-height: 1.55; margin: 6px 0 4px; }
.test-card-cta { font-weight: 600; color: var(--orange); font-size: 0.9rem; margin-top: auto; }
.hub-source { margin-top: 30px; font-size: 0.85rem; color: var(--slate); }

/* ── player header ───────────────────────────────────────── */
.player-tier-chip {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--soft-teal);
  color: var(--teal);
  text-transform: uppercase;
}
.player-tier-chip--quiz { background: var(--soft-orange); color: var(--orange); }
.player-tier-chip--hard { background: var(--soft-yellow); color: #9a7a00; }
.player-tier-chip--mastery { background: #eef1f6; color: var(--navy); }
.player-h1 { font-size: clamp(1.5rem, 3.5vw, 2.1rem); margin: 14px 0 10px; color: var(--navy); }
.player-meta { display: flex; flex-wrap: wrap; gap: 18px; color: var(--slate); font-size: 0.9rem; }
.player-meta strong { color: var(--navy); }

/* ── result banner ───────────────────────────────────────── */
.test-result[hidden], .test-explain[hidden] { display: none; }
.test-result {
  margin: 22px 0 6px;
  padding: 22px 24px;
  border-radius: var(--radius-md);
  background: var(--soft-teal);
  border: 1px solid #b8e9dc;
}
.test-result h2 { font-size: 1.3rem; color: var(--navy); margin-bottom: 6px; }
.test-result .score-big { font-size: 2.2rem; font-weight: 800; color: var(--teal); }
.test-result .score-pct { font-weight: 700; }
.test-result p { color: #374151; margin-top: 4px; }

/* ── questions ───────────────────────────────────────────── */
.test-questions { list-style: none; padding: 0; margin: 26px 0 0; counter-reset: q; }
.test-q {
  padding: 22px;
  margin-bottom: 16px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-soft);
}
.test-stem { font-size: 1.02rem; font-weight: 600; color: var(--navy); line-height: 1.6; margin-bottom: 14px; }
.test-q-num { color: var(--teal); margin-right: 4px; }
.test-options { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.test-option label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.test-option label:hover { border-color: var(--teal); background: #fafdfc; }
.test-option input { margin-top: 3px; accent-color: var(--teal); }
.test-option-letter { font-weight: 700; color: var(--slate); }
.test-option-text { color: #1f2937; line-height: 1.5; }

/* scored states */
.test-q.scored .test-option label { cursor: default; }
.test-option.is-correct label { border-color: var(--teal); background: var(--soft-teal); }
.test-option.is-wrong label { border-color: #e5868b; background: #fdeced; }
.test-option.is-correct .test-option-letter { color: var(--teal); }
.test-option.is-wrong .test-option-letter { color: #c0392b; }

.test-explain {
  margin-top: 14px;
  padding: 14px 16px;
  border-left: 3px solid var(--teal);
  background: var(--offwhite);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 0.92rem;
  color: #374151;
  line-height: 1.6;
}
.test-explain .ex-src { display: block; margin-top: 6px; font-size: 0.82rem; color: var(--slate); }
.test-q.scored.was-correct { border-color: #b8e9dc; }
.test-q.scored.was-wrong { border-color: #f0c2c5; }

.test-submit-row { margin-top: 26px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.test-submit { font-size: 1rem; padding: 14px 34px; cursor: pointer; }
.test-submit-note { font-size: 0.85rem; color: var(--slate); }
.player-aside { margin-top: 30px; font-size: 0.92rem; }
.player-aside a { color: var(--teal); font-weight: 600; text-decoration: none; }

/* ── landing / browse ────────────────────────────────────── */
.landing-hero { margin-bottom: 30px; }
.landing-h1 { font-size: clamp(1.8rem, 4.5vw, 2.6rem); color: var(--navy); margin-bottom: 10px; }
.landing-intro { color: #4b5563; line-height: 1.7; max-width: 760px; }
.landing-cards { margin-bottom: 40px; }
.landing-cards h2 { font-size: 1.15rem; color: var(--navy); margin-bottom: 16px; }
.card-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.catalog-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  box-shadow: var(--shadow-soft);
  transition: transform .15s ease, box-shadow .15s ease;
}
.catalog-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-strong); }
.catalog-card-chip {
  align-self: flex-start;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  background: var(--soft-purple);
  color: #6750A4;
  padding: 4px 10px;
  border-radius: 999px;
}
.catalog-card-title { font-size: 1.1rem; color: var(--navy); }
.catalog-card-subtitle { font-size: 0.9rem; color: #4b5563; line-height: 1.5; }
.catalog-card-meta { font-size: 0.85rem; color: var(--teal); font-weight: 600; }

@media (max-width: 600px) {
  .chapter-hub, .test-player, .landing-page { padding-top: 18px; }
  .test-q, .test-card, .catalog-card { padding: 18px; }
}
