/* Exam PYQ hub pages. Colours come from the shared theme variables so the
   page follows the site's light and dark modes. */

.xs-page {
  --xs-bg: var(--bg-color, #f8fafc);
  --xs-card: var(--card-bg, #ffffff);
  --xs-muted-bg: var(--surface-muted, #f1f5f9);
  --xs-text: var(--text-main, #0f172a);
  --xs-text-2: var(--text-secondary, #334155);
  --xs-muted: var(--text-muted, #64748b);
  --xs-border: var(--border-color, #e2e8f0);
  --xs-primary: var(--primary, #4f46e5);
  --xs-primary-solid: var(--primary-solid, #4f46e5);
  --xs-primary-light: var(--primary-light, #eef2ff);
  margin: 0;
  background: var(--xs-bg);
  color: var(--xs-text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.xs-page *, .xs-page *::before, .xs-page *::after { box-sizing: border-box; }

.xs-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.25rem 1rem 4rem;
}

@media (min-width: 768px) {
  .xs-shell { padding: 1.75rem 2rem 5rem; }
}

.xs-page a { color: inherit; }
.xs-page a:focus-visible { outline: 2px solid var(--xs-primary); outline-offset: 2px; border-radius: 6px; }

/* Breadcrumbs */
.xs-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  font-size: 0.82rem;
  color: var(--xs-muted);
}
.xs-breadcrumbs li + li::before { content: "›"; margin-right: 0.35rem; opacity: 0.7; }
.xs-breadcrumbs a { text-decoration: none; }
.xs-breadcrumbs a:hover { color: var(--xs-primary); text-decoration: underline; }
.xs-breadcrumbs [aria-current] { color: var(--xs-text-2); font-weight: 600; }

/* Hero */
.xs-hero {
  position: relative;
  overflow: hidden;
  border-radius: 1.5rem;
  color: #fff;
  background:
    radial-gradient(520px circle at 8% -20%, rgba(99, 102, 241, 0.45), transparent 60%),
    radial-gradient(460px circle at 100% 0%, rgba(16, 185, 129, 0.28), transparent 55%),
    linear-gradient(180deg, #0f172a 0%, #111827 100%);
  box-shadow: 0 18px 40px -24px rgba(15, 23, 42, 0.55);
}
.xs-hero-glow {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(circle at 30% 20%, #000 0%, transparent 70%);
  -webkit-mask-image: radial-gradient(circle at 30% 20%, #000 0%, transparent 70%);
}
.xs-hero-body { position: relative; padding: 1.75rem 1.25rem 1.5rem; }
@media (min-width: 768px) { .xs-hero-body { padding: 2.5rem 2.5rem 2rem; } }

.xs-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.9rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
}
.xs-dot { width: 0.45rem; height: 0.45rem; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.2); }

.xs-hero h1 {
  margin: 0;
  max-width: 46rem;
  font-size: clamp(1.6rem, 3.6vw, 2.5rem);
  line-height: 1.15;
  font-weight: 750;
  letter-spacing: -0.02em;
}
.xs-intro {
  margin: 0.9rem 0 0;
  max-width: 44rem;
  color: #cbd5e1;
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
}

.xs-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.4rem; }

.xs-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.75rem;
  padding: 0.7rem 1.3rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  transition: background-color 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}
.xs-btn svg { width: 1rem; height: 1rem; }
.xs-page .xs-btn-primary { background: #4f46e5; color: #fff; box-shadow: 0 8px 20px -10px rgba(79, 70, 229, 0.9); }
.xs-page .xs-btn-primary:hover { background: #6366f1; transform: translateY(-1px); }
.xs-page .xs-btn-ghost { background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.18); color: #fff; }
.xs-page .xs-btn-ghost:hover { background: rgba(255, 255, 255, 0.16); }
.xs-btn-block { width: 100%; }

.xs-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin: 1.6rem 0 0;
}
@media (min-width: 640px) { .xs-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 40rem; } }
.xs-stat {
  padding: 0.7rem 0.9rem;
  border-radius: 0.9rem;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
}
.xs-stat dt { font-size: 0.72rem; color: #94a3b8; }
.xs-stat dd { margin: 0.1rem 0 0; font-size: 1.15rem; font-weight: 700; color: #fff; white-space: nowrap; }

/* Collection tabs */
.xs-tabs {
  display: flex;
  gap: 0.5rem;
  margin: 1.25rem 0 0;
  padding-bottom: 0.25rem;
  overflow-x: auto;
  scrollbar-width: none;
}
.xs-tabs::-webkit-scrollbar { display: none; }
.xs-tab {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.95rem;
  border-radius: 999px;
  border: 1px solid var(--xs-border);
  background: var(--xs-card);
  color: var(--xs-text-2);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.xs-tab:hover { border-color: var(--xs-primary); color: var(--xs-primary); }
.xs-tab-count {
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: var(--xs-muted-bg);
  color: var(--xs-muted);
  font-size: 0.72rem;
}
.xs-page .xs-tab.is-active { background: var(--xs-primary-solid); border-color: var(--xs-primary-solid); color: #fff; }
.xs-tab.is-active .xs-tab-count { background: rgba(255, 255, 255, 0.2); color: #fff; }

/* Layout */
.xs-layout { display: grid; gap: 1.25rem; margin-top: 1.25rem; }
@media (min-width: 1100px) {
  .xs-layout { grid-template-columns: minmax(0, 1fr) 300px; align-items: start; }
  .xs-aside { position: sticky; top: 1.5rem; }
}
.xs-main, .xs-aside { display: grid; gap: 1.25rem; min-width: 0; }

.xs-card {
  background: var(--xs-card);
  border: 1px solid var(--xs-border);
  border-radius: 1.1rem;
  padding: 1.15rem;
}
@media (min-width: 768px) { .xs-card { padding: 1.4rem; } }
.xs-card-head { margin-bottom: 0.9rem; }
.xs-card-title { margin: 0 0 0.75rem; font-size: 1.02rem; font-weight: 700; letter-spacing: -0.01em; }
.xs-card-head .xs-card-title { margin-bottom: 0.15rem; }
.xs-card-sub, .xs-muted { margin: 0; color: var(--xs-muted); font-size: 0.85rem; }

/* Year grid */
.xs-year-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 0.6rem; }
.xs-year {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.75rem 0.85rem;
  border-radius: 0.85rem;
  border: 1px solid var(--xs-border);
  background: var(--xs-muted-bg);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease, background-color 0.15s ease;
}
.xs-year:hover { border-color: var(--xs-primary); background: var(--xs-primary-light); transform: translateY(-1px); }
.xs-year-label { font-size: 1.1rem; font-weight: 700; color: var(--xs-text); }
.xs-year-count { font-size: 0.75rem; color: var(--xs-muted); }

/* Chips */
.xs-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.xs-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.5rem 0.4rem 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--xs-border);
  background: var(--xs-card);
  color: var(--xs-text-2);
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.xs-chip span {
  padding: 0.05rem 0.45rem;
  border-radius: 999px;
  background: var(--xs-muted-bg);
  color: var(--xs-muted);
  font-size: 0.72rem;
}
.xs-chip:hover { border-color: var(--xs-primary); color: var(--xs-primary); }

/* Questions */
.xs-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin: 0.25rem 0 0.85rem;
}
.xs-section-head h2 { margin: 0; font-size: 1.2rem; font-weight: 700; letter-spacing: -0.01em; }

.xs-qlist { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.85rem; }
.xs-q article {
  background: var(--xs-card);
  border: 1px solid var(--xs-border);
  border-radius: 1.1rem;
  padding: 1.1rem 1.1rem 0.95rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
@media (min-width: 768px) { .xs-q article { padding: 1.35rem 1.4rem 1.1rem; } }
.xs-q article:hover { border-color: var(--xs-primary); box-shadow: 0 6px 22px -14px rgba(15, 23, 42, 0.35); }

.xs-q-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.45rem; margin-bottom: 0.6rem; font-size: 0.78rem; }
.xs-q-num { font-weight: 700; color: var(--xs-primary); }
.xs-pill {
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  background: var(--xs-primary-light);
  color: var(--xs-primary);
  font-weight: 600;
}
.xs-q-paper { color: var(--xs-muted); }

.xs-q-text { margin: 0; font-size: 1rem; font-weight: 600; line-height: 1.55; }
.xs-q-text a { text-decoration: none; }
.xs-q-text a:hover { color: var(--xs-primary); }

.xs-options { list-style: none; margin: 0.85rem 0 0; padding: 0; display: grid; gap: 0.45rem; }
@media (min-width: 768px) { .xs-options { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.xs-options li {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.55rem 0.75rem;
  border-radius: 0.75rem;
  background: var(--xs-muted-bg);
  color: var(--xs-text-2);
  font-size: 0.92rem;
}
.xs-opt-label {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  background: var(--xs-card);
  border: 1px solid var(--xs-border);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--xs-text);
}

.xs-q-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.95rem;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--xs-border);
}
.xs-q-tags { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.xs-tag {
  padding: 0.12rem 0.5rem;
  border-radius: 0.4rem;
  background: var(--xs-muted-bg);
  color: var(--xs-muted);
  font-size: 0.72rem;
}
.xs-page .xs-q-link { color: var(--xs-primary); font-size: 0.86rem; font-weight: 600; text-decoration: none; }
.xs-q-link:hover { text-decoration: underline; }

/* Pagination */
.xs-pagination {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.1rem;
}
.xs-pagination > :last-child { justify-self: end; }
.xs-page-btn {
  display: inline-flex;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid var(--xs-border);
  background: var(--xs-card);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
}
.xs-page-btn:hover { border-color: var(--xs-primary); color: var(--xs-primary); }

/* Guide and FAQ */
.xs-guide h2 { margin: 1.25rem 0 0.4rem; font-size: 1.05rem; font-weight: 700; }
.xs-guide h2:first-child { margin-top: 0; }
.xs-guide p { margin: 0; color: var(--xs-text-2); }

.xs-faq { display: grid; gap: 0.5rem; }
.xs-faq details { border: 1px solid var(--xs-border); border-radius: 0.85rem; background: var(--xs-muted-bg); }
.xs-faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1rem;
  font-weight: 600;
  font-size: 0.95rem;
}
.xs-faq summary::-webkit-details-marker { display: none; }
.xs-faq summary::after { content: "+"; color: var(--xs-muted); font-weight: 400; font-size: 1.2rem; line-height: 1; }
.xs-faq details[open] summary::after { content: "–"; }
.xs-faq details p { margin: 0; padding: 0 1rem 0.95rem; color: var(--xs-text-2); font-size: 0.92rem; }

/* Aside */
.xs-cta {
  background: linear-gradient(160deg, var(--xs-primary-light), var(--xs-card) 70%);
}
.xs-cta h2 { margin: 0 0 0.35rem; font-size: 1.02rem; font-weight: 700; }
.xs-cta p { margin: 0 0 0.95rem; color: var(--xs-muted); font-size: 0.88rem; }

.xs-mini-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; }
.xs-mini {
  padding: 0.45rem 0;
  border-radius: 0.6rem;
  border: 1px solid var(--xs-border);
  text-align: center;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}
.xs-mini:hover { border-color: var(--xs-primary); color: var(--xs-primary); }
.xs-page .xs-mini.is-active { background: var(--xs-primary-solid); border-color: var(--xs-primary-solid); color: #fff; }

.xs-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.15rem; }
.xs-links a, .xs-links-static li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.6rem;
  border-radius: 0.6rem;
  font-size: 0.88rem;
  color: var(--xs-text-2);
  text-decoration: none;
}
.xs-links a:hover { background: var(--xs-muted-bg); color: var(--xs-primary); }
.xs-links a[aria-current] { background: var(--xs-primary-light); color: var(--xs-primary); font-weight: 600; }
.xs-links a span, .xs-links-static li span + span { color: var(--xs-muted); font-size: 0.75rem; }

.xs-disclaimer { margin: 2rem 0 0; text-align: center; color: var(--xs-muted); font-size: 0.78rem; }

/* Premium gating */
.xs-lock { width: 0.9rem; height: 0.9rem; margin-left: 0.35rem; vertical-align: -0.05rem; color: #d97706; }
.xs-year.is-locked { background: var(--xs-card); border-style: dashed; }
.xs-year.is-locked .xs-year-label { color: var(--xs-text-2); }
.xs-mini.is-locked { border-style: dashed; color: var(--xs-muted); }
.xs-q.is-locked article { border-style: dashed; }
.xs-q.is-locked .xs-q-text { color: var(--xs-text-2); }

.xs-unlock {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
  padding: 1.15rem 1.25rem;
  border-radius: 1.1rem;
  border: 1px solid rgba(217, 119, 6, 0.35);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.14), var(--xs-card) 65%);
}
.xs-unlock-icon {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.9rem;
  background: rgba(251, 191, 36, 0.2);
  color: #d97706;
}
.xs-unlock-icon svg { width: 1.3rem; height: 1.3rem; }
.xs-unlock-body { flex: 1 1 16rem; min-width: 0; }
.xs-unlock-body h3 { margin: 0 0 0.2rem; font-size: 1rem; font-weight: 700; }
.xs-unlock-body p { margin: 0; color: var(--xs-text-2); font-size: 0.88rem; }
@media (max-width: 639px) { .xs-unlock .xs-btn { width: 100%; } }

@media (prefers-reduced-motion: reduce) {
  .xs-page * { transition: none !important; }
}

/* Stage labels and stage cards (mixed-stage pages) */
.xs-stage {
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.xs-stage-mcq { background: rgba(14, 165, 233, 0.12); color: #0369a1; }
.xs-stage-sub { background: rgba(16, 185, 129, 0.13); color: #047857; }

.xs-stage-grid { display: grid; gap: 0.75rem; }
@media (min-width: 640px) { .xs-stage-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.xs-stage-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  padding: 1rem 1.1rem;
  border-radius: 1rem;
  border: 1px solid var(--xs-border);
  background: var(--xs-muted-bg);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.xs-stage-card:hover { transform: translateY(-1px); box-shadow: 0 6px 22px -14px rgba(15, 23, 42, 0.35); }
.xs-stage-card-mcq:hover { border-color: #0ea5e9; }
.xs-stage-card-sub:hover { border-color: #10b981; }
.xs-stage-card-title { font-size: 1rem; font-weight: 700; color: var(--xs-text); }
.xs-stage-card-blurb { font-size: 0.85rem; color: var(--xs-muted); }
.xs-stage-card-foot { margin-top: 0.25rem; font-size: 0.82rem; font-weight: 600; color: var(--xs-primary); }
html.dark-mode .xs-stage-mcq { background: rgba(56, 189, 248, 0.16); color: #7dd3fc; }
html.dark-mode .xs-stage-sub { background: rgba(52, 211, 153, 0.16); color: #6ee7b7; }

/* Inline answer previews are limited excerpts; full answers remain on detail pages. */
.xs-options li.is-correct {
  border-color: #10b981;
  background: rgba(16, 185, 129, 0.1);
}
.xs-correct-mark {
  margin-left: auto;
  color: #047857;
  font-size: 1rem;
  font-weight: 800;
}
.xs-answer-preview {
  margin-top: 0.9rem;
  padding: 0.8rem 0.9rem;
  border-left: 3px solid var(--xs-primary);
  border-radius: 0 0.7rem 0.7rem 0;
  background: var(--xs-primary-light);
  color: var(--xs-text-2);
  font-size: 0.9rem;
}
.xs-answer-preview strong { color: var(--xs-text); }
.xs-answer-preview p { margin: 0.25rem 0 0; }
html.dark-mode .xs-options li.is-correct { border-color: #34d399; background: rgba(52, 211, 153, 0.14); }
html.dark-mode .xs-correct-mark { color: #6ee7b7; }
