/* Public paper-preview pages (public/past-papers/<paper>/), styled like the signed-in
   question bank's list view, full width with no search or filter controls. */
:root {
  color-scheme: dark;
  --pp-bg: #0a0d14;
  --pp-overlay: rgba(8, 11, 19, 0.78);
  --pp-surface: rgba(17, 23, 34, 0.86);
  --pp-border: #283345;
  --pp-text: #f5f7fb;
  --pp-muted: #a9b4c3;
  --pp-accent: #8aa4ff;
  --pp-video: #4c3f9e;
}

* { box-sizing: border-box; }

body.paper-preview {
  margin: 0;
  color: var(--pp-text);
  font: 400 16px/1.55 system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background:
    linear-gradient(var(--pp-overlay), var(--pp-overlay)),
    var(--pp-bg-image, none) center / cover fixed,
    var(--pp-bg);
}

.skip-link { position: absolute; left: -999px; }
.skip-link:focus { left: 1rem; top: 1rem; z-index: 10; padding: 0.5rem 1rem; background: var(--pp-surface); color: var(--pp-text); }

.pp-bar,
.pp-main {
  width: min(1760px, calc(100% - 32px));
  margin-inline: auto;
}

.pp-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 12rem 14px 0; /* room for the site-wide search button */
}
.pp-brand { color: var(--pp-text); font-weight: 800; text-decoration: none; white-space: nowrap; }
.pp-subject {
  padding: 3px 9px;
  border-radius: 7px;
  background: #8aa4ff;
  color: #09101c;
  font-size: 13px;
  font-weight: 800;
}
.pp-login { margin-left: auto; color: var(--pp-text); font-weight: 700; white-space: nowrap; }

.pp-head h1 { margin: 6px 0 4px; font-size: clamp(26px, 3.4vw, 40px); line-height: 1.1; }
.pp-head p { margin: 0; color: var(--pp-muted); }
.pp-head .pp-intro { margin-top: 6px; max-width: 70ch; font-size: 14px; }
.pp-count { margin: 18px 0 12px; color: var(--pp-muted); font-size: 14px; font-weight: 700; }

.pp-list { display: grid; gap: 18px; margin: 0; padding: 0; list-style: none; }

.pp-card {
  padding: clamp(14px, 1.8vw, 20px);
  border: 1px solid var(--pp-border);
  border-radius: 14px;
  background: var(--pp-surface);
}
.pp-card h2 { margin: 0 0 12px; font-size: clamp(17px, 1.5vw, 20px); }
.pp-card img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--pp-border);
  border-radius: 9px;
  background: #fff;
}
.pp-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; }
.pp-open { color: var(--pp-accent); font-weight: 700; text-decoration: none; }
.pp-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--pp-border);
  border-radius: 10px;
  background: rgba(10, 13, 20, 0.6);
  color: var(--pp-text);
  font-weight: 700;
  text-decoration: none;
}
.pp-meta { display: flex; flex-wrap: wrap; gap: 4px 10px; margin: 10px 0 0; padding: 0; color: var(--pp-muted); font-size: 13px; list-style: none; }
.pp-topics { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 0; padding: 0; list-style: none; }
.pp-topics li {
  padding: 2px 9px;
  border: 1px solid var(--pp-border);
  border-radius: 999px;
  color: var(--pp-muted);
  font-size: 12px;
}

.pp-panel { margin-top: 12px; }
.pp-panel[hidden] { display: none; }
.pp-answer {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--pp-border);
  border-radius: 9px;
  background: #fff;
}
.pp-answer figcaption { margin-bottom: 8px; color: #3b414b; font-size: 12px; font-weight: 700; }
.pp-answer img { width: 100%; max-width: 100%; border: 0; border-radius: 0; }
.pp-answer img + img { margin-top: 8px; }
.pp-note { margin: 0; color: var(--pp-muted); font-size: 14px; }
.pp-video-region {
  width: 100%;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--pp-border);
}
.pp-video-region[hidden] { display: none; }
.pp-video-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: calc(100dvh - 6rem);
  overflow: hidden;
  border-radius: 10px;
  background: #000;
}
.pp-video-frame iframe { display: block; width: 100%; height: 100%; border: 0; }
.pp-video-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; justify-content: space-between; }
.pp-video-caption,
.pp-video-credit { margin: 8px 0 0; color: var(--pp-muted); font-size: 13px; line-height: 1.45; }
.pp-video-credit a { color: inherit; }
.pp-video { min-width: 4.4rem; border-color: rgba(163, 152, 244, 0.62); background: #3b3577; color: #f2f0ff; }
.pp-video:hover { background: #464090; border-color: rgba(186, 178, 250, 0.86); }
.pp-button[aria-expanded="true"] { border-color: var(--pp-accent); }
.pp-video[aria-expanded="true"] { background: #564fae; border-color: rgba(200, 194, 255, 0.9); }
button.pp-button { font: inherit; font-weight: 700; cursor: pointer; }

/* The invitation after question 5: a card in the list's own shape (radius, spacing, column)
   so it belongs to the page, filled with a vivid blue so it pops. White text on the blue is
   at least 6.6:1; the red button (80% opacity over the blue) keeps its white label above 4.5:1. */
.pp-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px 28px;
  margin: 18px 0 32px;
  padding: clamp(18px, 2.4vw, 28px);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 14px;
  background:
    radial-gradient(600px 260px at 100% 0%, rgba(255, 255, 255, 0.12), transparent 65%),
    linear-gradient(135deg, rgba(36, 72, 196, 0.8) 0%, rgba(47, 84, 214, 0.8) 55%, rgba(52, 81, 200, 0.8) 100%);
  color: #fff;
  font-family: var(--font-sans, Inter, system-ui, sans-serif);
  box-shadow: 0 18px 44px rgba(18, 38, 120, 0.45);
}
.pp-cta-copy { flex: 1 1 32rem; min-width: 0; }
.pp-cta-eyebrow { margin: 0 0 6px; color: rgba(255, 255, 255, 0.85); font-size: 14px; font-weight: 600; }
.pp-cta h2 { margin: 0; max-width: 46ch; font-size: clamp(18px, 1.7vw, 22px); font-weight: 800; line-height: 1.35; }
.pp-cta-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.pp-cta-primary,
.pp-cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 10px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.pp-cta-primary { justify-content: center; background: rgba(212, 43, 51, 0.8); color: #fff; box-shadow: 0 6px 18px rgba(120, 10, 20, 0.35); }
.pp-cta-primary:hover { background: rgba(191, 35, 43, 0.8); transform: translateY(-1px); box-shadow: 0 8px 22px rgba(120, 10, 20, 0.45); }
.pp-cta-secondary { border: 2px solid rgba(255, 255, 255, 0.85); color: #fff; }
.pp-cta-secondary:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-1px); }
.pp-cta a:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }



.pp-main a:focus-visible, .pp-bar a:focus-visible { outline: 3px solid #f4c95d; outline-offset: 3px; }

@media (max-width: 640px) {
  .pp-bar { gap: 10px; padding-right: 3.5rem; font-size: 15px; }
  .pp-subject { display: none; }
  .pp-bar, .pp-main { width: calc(100% - 24px); }
}

/* Breadcrumb, sibling-paper row and /past-papers/ hub (added with the SEO links; card styles above untouched). */
.pp-crumbs { color: var(--pp-muted); font-size: 14px; }
.pp-crumbs a, .pp-others a, .pp-hub a { color: var(--pp-accent); }
.pp-others { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 10px; color: var(--pp-muted); font-size: 14px; }
.pp-hub-section { margin: 22px 0; }
.pp-hub-section h2 { margin: 0 0 6px; font-size: 22px; }
.pp-hub-section h3 { margin: 14px 0 6px; font-size: 17px; }
.pp-hub-section ul { margin: 0; padding-left: 1.2rem; }

/* "About this paper": plain text above the call to action. */
.pp-faq { margin: 28px 0 0; max-width: 80ch; color: var(--pp-muted); font-size: 14px; }
.pp-faq h2 { margin: 0 0 6px; color: var(--pp-text); font-size: 18px; }
.pp-faq h3 { margin: 14px 0 4px; color: var(--pp-text); font-size: 15px; }
.pp-faq p { margin: 0; line-height: 1.5; }
.pp-level-list { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.pp-level-list a { color: var(--pp-accent); font-weight: 700; }
.pp-level-count { color: var(--pp-muted); font-size: 13px; }
