/* Helicate website. Mobile-first; brand colours match the paper templates. */
:root {
  --navy: #0d203b;
  --blue: #00b7ff;        /* light blue: accents, and text on navy only */
  --blue-dark: #066d9f;   /* links on white (5.6:1 contrast) */
  --blue-tint: #e6f7ff;
  --ink: #1b2533;
  --muted: #4a5668;
  --line: #d5dde8;
  --bg: #ffffff;
  --radius: 10px;
  --wrap: 68rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 1.0625rem/1.6 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}
img { max-width: 100%; height: auto; }
a { color: var(--blue-dark); text-underline-offset: 0.15em; }
a:hover { color: var(--navy); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 3px; }
h1, h2, h3 { color: var(--navy); line-height: 1.25; }
h1 { font-size: clamp(1.75rem, 5vw, 2.6rem); margin: 0; }
h2 { font-size: 1.4rem; margin: 2rem 0 0.75rem; }
h3 { font-size: 1.15rem; margin: 0 0 0.4rem; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 1rem; }
.narrow > * { max-width: 46rem; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 0.5rem; top: -3rem; background: #fff; color: var(--navy); padding: 0.5rem 0.75rem; z-index: 10; }
.skip:focus { top: 0.5rem; }

/* Header */
.site-header { background: var(--navy); border-bottom: 4px solid var(--blue); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.5rem; padding-top: 0.6rem; padding-bottom: 0.6rem; }
.brand { display: block; line-height: 0; }
.brand img { width: 94px; height: 60px; }
.site-header nav { flex: 1 1 100%; }
.site-header ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 0.25rem; }
.site-header nav a { display: block; color: #fff; text-decoration: none; padding: 0.45rem 0.6rem; border-radius: 6px; font-weight: 600; font-size: 0.98rem; }
.site-header nav a:hover { background: rgba(255,255,255,0.1); color: #fff; }
.site-header nav a[aria-current="page"] { color: var(--blue); box-shadow: inset 0 -3px 0 var(--blue); border-radius: 6px 6px 0 0; }
@media (min-width: 52rem) {
  .site-header nav { flex: 0 1 auto; margin-left: auto; }
}

/* Page heading band */
.page-head { background: var(--blue-tint); border-bottom: 1px solid var(--line); padding: 1.75rem 0 1.5rem; margin-bottom: 1.5rem; }

/* Home hero */
.hero { background: var(--navy); color: #fff; padding: 2.5rem 0 2.75rem; }
.hero h1 { color: #fff; max-width: 22ch; }
.hero .lead { color: #dfe8f3; max-width: 40rem; }
.lead { font-size: 1.15rem; color: var(--muted); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.btn { display: inline-block; background: var(--blue); color: var(--navy); font-weight: 700; text-decoration: none; padding: 0.75rem 1.2rem; border-radius: 8px; }
.btn:hover { background: #fff; color: var(--navy); }
.btn-alt { background: transparent; color: #fff; border: 2px solid var(--blue); }
.btn-alt:hover { background: var(--blue); color: var(--navy); }

/* Cards */
.grid { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 40rem) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 52rem) { .grid { grid-template-columns: repeat(3, 1fr); } .grid-2 { grid-template-columns: repeat(2, 1fr); } }
.card { border: 1px solid var(--line); border-top: 4px solid var(--blue); border-radius: var(--radius); padding: 1.1rem 1.2rem; background: #fff; }
.card h2, .card h3 { margin-top: 0; }
.card h2 a, .card h3 a { color: var(--navy); }
.card p { margin: 0.4rem 0 0; color: var(--muted); }
.code { font-weight: 600; color: var(--blue-dark); font-size: 0.85em; }
.pill { display: inline-block; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; background: var(--blue); color: var(--navy); padding: 0.1rem 0.5rem; border-radius: 999px; vertical-align: middle; }
.pill-muted { background: var(--navy); color: #fff; }
.section-label { font-size: 1.1rem; color: var(--muted); }

/* Past paper tables */
.jump ul { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.jump a { display: inline-block; border: 1px solid var(--line); border-radius: 999px; padding: 0.25rem 0.8rem; text-decoration: none; }
.paper { margin-top: 2rem; }
.paper h2 { margin-bottom: 0.1rem; }
.meta-line { color: var(--muted); margin: 0 0 0.75rem; font-size: 0.95rem; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
table { border-collapse: collapse; width: 100%; min-width: 36rem; }
th, td { text-align: left; vertical-align: top; padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--line); }
thead th { background: var(--navy); color: #fff; font-size: 0.9rem; }
tbody tr:last-child > * { border-bottom: 0; }
tbody th { color: var(--navy); white-space: nowrap; }
tbody th .meta { white-space: normal; max-width: 14rem; }
.meta { display: block; font-size: 0.8rem; font-weight: 400; color: var(--muted); }
a.file { font-weight: 600; }
.na { color: var(--muted); font-size: 0.9rem; }

/* Topic bank page */
.facts { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.75rem; margin: 1.5rem 0; }
@media (min-width: 40rem) { .facts { grid-template-columns: repeat(4, 1fr); } }
.facts li { border: 1px solid var(--navy); border-radius: 8px; padding: 0.6rem 0.8rem; font-weight: 700; color: var(--navy); }
.facts .k { display: block; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--blue-dark); }
.downloads { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.downloads a.file { display: inline-block; background: var(--navy); color: #fff; text-decoration: none; padding: 0.7rem 1.1rem; border-radius: 8px; }
.downloads a.file:hover { background: var(--blue-dark); color: #fff; }
.downloads a.file .meta { color: #cfe3f5; }
.subtopics li { margin: 0.25rem 0; }
.subtopics .meta { display: inline; margin-left: 0.4rem; }

/* Credit / notices */
.credit { margin: 2.5rem 0 1rem; background: var(--blue-tint); border-left: 4px solid var(--blue); border-radius: 0 var(--radius) var(--radius) 0; padding: 0.5rem 1.2rem 1rem; }
.credit h2 { font-size: 1.1rem; margin-top: 0.75rem; }
.small { font-size: 0.92rem; color: var(--muted); }
.prose h2 { font-size: 1.2rem; }
.big-link { font-size: 1.3rem; font-weight: 700; word-break: break-all; }

/* Sign-up (inactive) */
.signup { background: var(--blue-tint); border-top: 1px solid var(--line); margin-top: 3rem; padding: 2rem 0 2.25rem; }
.signup h2 { margin-top: 0; }
.signup .status { color: var(--muted); }
.signup fieldset { border: 0; padding: 0; margin: 0; }
.signup label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
.signup .row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.signup input { flex: 1 1 14rem; font: inherit; padding: 0.6rem 0.75rem; border: 2px solid var(--line); border-radius: 8px; background: #f3f5f8; }
.signup button { font: inherit; font-weight: 700; padding: 0.6rem 1.1rem; border: 0; border-radius: 8px; background: #b9c3cf; color: var(--navy); }
.signup fieldset:disabled { opacity: 0.8; cursor: not-allowed; }

/* Footer */
main { display: block; min-height: 50vh; padding-bottom: 2rem; }
.signup + * { margin-top: 0; }
.site-footer { background: var(--navy); color: #dfe8f3; padding: 1.75rem 0 2rem; font-size: 0.95rem; }
.site-footer a { color: var(--blue); }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; padding: 0; margin: 1rem 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; }
.site-footer .small { color: #b8c6d8; }
.aqa-note { margin: 0; }
.aqa-note strong { color: #fff; }

@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

/* Past-paper tables stack on small screens: each series becomes a block. */
@media (max-width: 39.99rem) {
  .table-wrap { overflow: visible; }
  table { min-width: 0; }
  table, tbody, tr, th, td { display: block; }
  thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  tbody tr { padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); }
  tbody tr:last-child { border-bottom: 0; }
  tbody th, td { border: 0; padding: 0.15rem 0; }
  tbody th { white-space: normal; margin-bottom: 0.2rem; }
  td .meta { display: inline; margin-left: 0.4rem; }
}
