// Trove Wiki — article index + 3 long-form articles.
// Featured-snippet layout: short answer up top → deeper sections → related.

const WIKI_ARTICLES = [
  // ────────── Maths ──────────
  {
    slug: 'grams-in-a-kilogram',
    category: 'Maths',
    keystage: 'KS2',
    title: 'How many grams are in a kilogram?',
    summary: 'A kilogram is exactly 1,000 grams. Here\'s how to convert between grams and kilograms confidently, with a printable conversion strip for the classroom.',
    snippet: {
      question: 'How many grams in a kilogram?',
      answer: 'There are exactly 1,000 grams (g) in 1 kilogram (kg). To convert from kilograms to grams, multiply by 1,000. To convert from grams to kilograms, divide by 1,000.',
      formula: '1 kg = 1,000 g',
    },
    readTime: 4,
    sections: [
      {
        h: 'The quick answer',
        body: 'There are 1,000 grams in 1 kilogram. The prefix "kilo-" comes from the Greek for "thousand", so a kilogram is, literally, a thousand grams. This is true everywhere on Earth and is the same in every country that uses the metric system.',
      },
      {
        h: 'Converting kilograms to grams',
        body: 'To turn kilograms into grams, multiply by 1,000. The decimal point shifts three places to the right.',
        examples: [
          ['2 kg', '2 × 1,000', '2,000 g'],
          ['0.5 kg', '0.5 × 1,000', '500 g'],
          ['1.25 kg', '1.25 × 1,000', '1,250 g'],
          ['0.075 kg', '0.075 × 1,000', '75 g'],
        ],
      },
      {
        h: 'Converting grams to kilograms',
        body: 'To turn grams into kilograms, divide by 1,000. The decimal point shifts three places to the left.',
        examples: [
          ['3,000 g', '3,000 ÷ 1,000', '3 kg'],
          ['250 g', '250 ÷ 1,000', '0.25 kg'],
          ['1,750 g', '1,750 ÷ 1,000', '1.75 kg'],
          ['80 g', '80 ÷ 1,000', '0.08 kg'],
        ],
      },
      {
        h: 'Where this sits in the National Curriculum',
        body: 'Children meet grams and kilograms across KS1 and KS2. In Year 2, pupils compare and order masses using everyday objects. From Year 3 they begin to record measurements using the abbreviations g and kg, and from Year 4 they convert between metric units. By Year 5 they should be able to convert between grams and kilograms confidently using decimals (e.g. 0.25 kg = 250 g).',
      },
      {
        h: 'Common misconceptions',
        list: [
          'Mixing up "grams" and "kilograms" when reading a problem, particularly when the answer is given as a decimal.',
          'Believing that a heavier-looking object must always have a larger number of grams (e.g. a kilogram of feathers vs a kilogram of bricks).',
          'Treating the conversion as ×100 rather than ×1,000, borrowing from cm/m intuition.',
          'Forgetting that 0.5 kg is the same as 500 g, not 50 g.',
        ],
      },
      {
        h: 'A teacher tip',
        body: 'A 1 kg bag of sugar in the classroom is the single most useful manipulative for this concept. Pair it with a set of digital scales and a tray of mystery objects (a pencil case, a book, a banana, a brick) and ask children to predict, weigh, and convert each one between grams and kilograms.',
      },
    ],
    relatedSlugs: [],
    relatedResources: ['r-006', 'r-009', 'r-008'],
  },

  // ────────── English: Fronted adverbial ──────────
  {
    slug: 'what-is-a-fronted-adverbial',
    category: 'English',
    keystage: 'KS2',
    title: 'What is a fronted adverbial?',
    summary: 'A fronted adverbial is a word, phrase or clause used at the start of a sentence to describe the action that follows. Always followed by a comma.',
    snippet: {
      question: 'What is a fronted adverbial?',
      answer: 'A fronted adverbial is a word, phrase or clause placed at the beginning of a sentence to describe how, when, where or why the main action happens. In writing, a fronted adverbial is always followed by a comma.',
      formula: 'Fronted adverbial + comma + main clause.',
    },
    readTime: 6,
    sections: [
      {
        h: 'The quick answer',
        body: 'A fronted adverbial is an adverbial that has been moved to the front of a sentence, before the main subject and verb. It tells the reader something about the action that follows: when, where, how, how often or why. In writing, a fronted adverbial is always separated from the rest of the sentence by a comma.',
      },
      {
        h: 'Examples in action',
        examples: [
          ['Suddenly,', 'the lights went out.', 'when'],
          ['At the top of the hill,', 'we stopped to catch our breath.', 'where'],
          ['Without making a sound,', 'she crept past the sleeping cat.', 'how'],
          ['Every Friday,', 'the class visits the library.', 'how often'],
          ['Because it was raining,', 'we ate our lunch indoors.', 'why'],
        ],
      },
      {
        h: 'Why teach fronted adverbials?',
        body: 'Fronted adverbials are part of the Year 4 English programme of study, but they shape sentence-level writing right through KS2. They give pupils control over sentence rhythm, help them avoid starting every sentence with the subject, and add a little texture to descriptive and narrative writing. They also turn up reliably in the Year 6 SPaG paper.',
      },
      {
        h: 'The comma rule (and why it matters)',
        body: 'A fronted adverbial is always followed by a comma. The comma marks the boundary between the adverbial and the main clause; without it, the sentence reads as a run-on. This is one of the few comma rules pupils can apply mechanically, which makes it a useful early lesson in punctuation control.',
      },
      {
        h: 'Common pupil errors',
        list: [
          'Forgetting the comma: the most common error and the one most likely to be marked in the SPaG paper.',
          'Confusing a fronted adverbial with a subordinate clause (e.g. "When she arrived, she sat down."). The test is whether the opener describes the action; if it does, treat it as a fronted adverbial.',
          'Stacking two fronted adverbials together without re-punctuating ("Yesterday at school we…"). Pupils need to learn to choose one.',
          'Using fronted adverbials in every sentence of a paragraph, which produces a stilted rhythm.',
        ],
      },
      {
        h: 'How to teach it in three lessons',
        list: [
          'Lesson 1: Identify. Sort sentences into "fronted adverbial" and "no fronted adverbial". Establish the comma rule.',
          'Lesson 2: Generate. Match adverbials to main clauses. Children write five of their own using a word bank.',
          'Lesson 3: Apply. Pupils edit a short paragraph by adding fronted adverbials where they improve the writing, and remove them where they don\'t.',
        ],
      },
    ],
    relatedSlugs: ['noun-vs-pronoun'],
    relatedResources: ['r-011', 'r-028', 'r-012'],
  },

  // ────────── English: Noun vs pronoun ──────────
  {
    slug: 'noun-vs-pronoun',
    category: 'English',
    keystage: 'KS1',
    title: 'What\'s the difference between a noun and a pronoun?',
    summary: 'A noun names a person, place, thing or idea. A pronoun is a short word used in place of a noun to avoid repetition (he, she, it, they, we).',
    snippet: {
      question: 'What is the difference between a noun and a pronoun?',
      answer: 'A noun is a word that names a person, place, thing or idea (e.g. teacher, school, book). A pronoun is a word used in place of a noun to avoid repeating it (e.g. he, she, it, they, we, them).',
      formula: 'Noun → names. Pronoun → replaces.',
    },
    readTime: 5,
    sections: [
      {
        h: 'The quick answer',
        body: 'A noun is a word that names something: a person, an animal, a place, an object or an idea. A pronoun is a short, general word that stands in for a noun so we don\'t have to repeat it. The point of a pronoun is to keep writing flowing without sounding clunky.',
      },
      {
        h: 'See it in a sentence',
        examples: [
          ['Without pronouns:', '"Sam went to the shop. Sam bought some milk. Then Sam came home."'],
          ['With pronouns:', '"Sam went to the shop. He bought some milk. Then he came home."'],
        ],
      },
      {
        h: 'Types of noun',
        list: [
          'Common noun: names a general thing (dog, school, teacher).',
          'Proper noun: names a specific person, place or thing and starts with a capital letter (Sam, London, Trove).',
          'Abstract noun: names something you can\'t physically touch (happiness, courage, time).',
          'Collective noun: names a group (class, team, herd).',
        ],
      },
      {
        h: 'Types of pronoun',
        list: [
          'Personal pronouns: I, you, he, she, it, we, they.',
          'Object pronouns: me, you, him, her, it, us, them.',
          'Possessive pronouns: mine, yours, his, hers, ours, theirs.',
          'Reflexive pronouns: myself, yourself, himself, herself, itself, ourselves, themselves.',
        ],
      },
      {
        h: 'When pupils get stuck',
        list: [
          'They confuse "I" and "me". A useful test: if you can replace it with "he", use "I"; if you can replace it with "him", use "me".',
          'They forget that "it" is a pronoun; it doesn\'t feel like one because it\'s so short.',
          'They use a pronoun before they\'ve named the noun, leaving the reader confused about who "he" or "she" is.',
          'They overuse pronouns and lose track of who they\'re writing about, especially in a paragraph with two characters of the same gender.',
        ],
      },
      {
        h: 'Where this fits in the curriculum',
        body: 'Pupils meet nouns from Year 1 and pronouns formally from Year 2. By Year 4, children should understand pronouns well enough to use them deliberately to avoid repetition and ambiguity in their own writing. The terminology turns up in the KS2 SPaG paper from Year 6 onwards.',
      },
    ],
    relatedSlugs: ['what-is-a-fronted-adverbial'],
    relatedResources: ['r-003', 'r-026', 'r-028'],
  },
];

// Compact builder for the next batch — same shape, less typing.
function _addArticle({ slug, category, keystage, title, lead, sections, related = [] }) {
  WIKI_ARTICLES.push({
    slug, category, keystage, title,
    summary: lead,
    snippet: { question: title, answer: lead },
    readTime: Math.max(3, Math.round(sections.reduce((n, s) => n + (s.body?.length || 0) + (s.list?.join(' ').length || 0) + (s.examples?.flat().join(' ').length || 0), 0) / 600)),
    sections,
    relatedSlugs: [],
    relatedResources: related,
  });
}

// ────────── Maths ──────────
_addArticle({
  slug: 'what-is-a-prime-number', category: 'Maths', keystage: 'KS2',
  title: 'What is a prime number?',
  lead: 'A prime number is a whole number greater than 1 that has exactly two factors: itself and 1. Examples: 2, 3, 5, 7, 11, 13.',
  sections: [
    { h: 'The quick answer', body: 'A prime number has exactly two factors: 1 and itself. Every other whole number greater than 1 is called a composite number; it has more than two factors. 1 is neither prime nor composite because it has only one factor.' },
    { h: 'The primes to 100', list: ['2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97.', 'That\'s 25 primes in total.', '2 is the only even prime; every other even number divides by 2.'] },
    { h: 'How to check if a number is prime', list: ['Try dividing by every prime number smaller than its square root.', 'If none divide it evenly, it\'s prime.', 'Example: is 37 prime? √37 ≈ 6, so test 2, 3 and 5. None work, so 37 is prime.'] },
    { h: 'Where this sits in the curriculum', body: 'Children meet prime numbers in Year 5 as part of multiplication and division. They should recognise primes to 19 by Year 6.' },
  ],
});
_addArticle({
  slug: 'perimeter-vs-area', category: 'Maths', keystage: 'KS2',
  title: "What's the difference between perimeter and area?",
  lead: 'Perimeter is the distance around the edge of a shape (you add). Area is the space inside it (you multiply, for rectangles).',
  sections: [
    { h: 'The quick answer', body: 'Perimeter is measured in units (cm, m). Area is measured in square units (cm², m²). For a rectangle: perimeter = 2 × (length + width); area = length × width.' },
    { h: 'A worked example', examples: [['A rectangle 6 cm × 4 cm', 'Perimeter = 2 × (6 + 4)', '20 cm'], ['Same rectangle', 'Area = 6 × 4', '24 cm²']] },
    { h: 'Common mistakes', list: ['Confusing the two; remember "perimeter" sounds like "rim" (the edge).', 'Forgetting the squared unit for area.', 'Multiplying when adding (and vice versa).'] },
  ],
});
_addArticle({
  slug: 'what-is-bodmas', category: 'Maths', keystage: 'KS2',
  title: 'What is BODMAS (or BIDMAS)?',
  lead: 'BODMAS is the order in which you do operations in a sum: Brackets, Orders (powers), Division, Multiplication, Addition, Subtraction.',
  sections: [
    { h: 'The quick answer', body: 'BODMAS (or BIDMAS, with "Indices" instead of "Orders") tells you which part of a sum to do first. Without it, the same sum can give different answers.' },
    { h: 'A worked example', examples: [['3 + 4 × 2', 'Multiply first: 4 × 2 = 8', '3 + 8 = 11'], ['(3 + 4) × 2', 'Brackets first: 3 + 4 = 7', '7 × 2 = 14']] },
    { h: 'Common mistakes', list: ['Working left-to-right and ignoring the order.', 'Treating addition as higher priority than multiplication.', 'Forgetting that division and multiplication share the same rank, as do addition and subtraction, so work left to right within those pairs.'] },
  ],
});
_addArticle({
  slug: 'what-is-place-value', category: 'Maths', keystage: 'KS2',
  title: 'What is place value?',
  lead: 'Place value is what each digit in a number is worth, based on its position: ones, tens, hundreds, thousands, and so on.',
  sections: [
    { h: 'The quick answer', body: 'In 347, the 3 means three hundreds, the 4 means four tens, the 7 means seven ones. Move a digit one place to the left and it becomes ten times bigger.' },
    { h: 'Examples', examples: [['347', 'three hundreds, four tens, seven ones', '300 + 40 + 7'], ['2,058', 'two thousands, zero hundreds, five tens, eight ones', '2,000 + 50 + 8']] },
    { h: 'In the classroom', body: 'Base-ten blocks (units, rods, flats and cubes) are the standard way to make place value concrete in KS1 and lower KS2.' },
  ],
});
_addArticle({
  slug: 'what-is-a-fraction', category: 'Maths', keystage: 'KS1',
  title: 'What is a fraction?',
  lead: 'A fraction is a way of showing part of a whole. The bottom number (denominator) says how many equal parts the whole is split into; the top number (numerator) says how many of those parts you have.',
  sections: [
    { h: 'The quick answer', body: 'In ½, the 2 means the whole is split into two equal parts, and the 1 means we have one of them. In ¾, the 4 means four equal parts, and the 3 means we have three of them.' },
    { h: 'Common fractions', list: ['½ means one half', '⅓ means one third', '¼ means one quarter', '⅕ means one fifth', '¾ means three quarters'] },
  ],
});
_addArticle({
  slug: 'fraction-to-decimal', category: 'Maths', keystage: 'KS2',
  title: 'How do you convert a fraction to a decimal?',
  lead: 'Divide the top number by the bottom number. ¾ becomes 0.75 because 3 ÷ 4 = 0.75.',
  sections: [
    { h: 'The quick answer', body: 'Every fraction can be written as a decimal. Divide the numerator by the denominator, using long division if needed. Some give "clean" decimals (½ = 0.5); others recur (⅓ = 0.333…).' },
    { h: 'Conversion table', examples: [['½', '1 ÷ 2', '0.5'], ['¼', '1 ÷ 4', '0.25'], ['¾', '3 ÷ 4', '0.75'], ['⅕', '1 ÷ 5', '0.2'], ['⅓', '1 ÷ 3', '0.333…']] },
  ],
});
_addArticle({
  slug: 'mean-median-mode-range', category: 'Maths', keystage: 'KS2',
  title: "What's the difference between mean, median, mode and range?",
  lead: 'Mean is the average. Median is the middle value. Mode is the most common value. Range is the difference between the biggest and smallest.',
  sections: [
    { h: 'On the same data set', examples: [['Data: 3, 5, 5, 7, 10', 'Mean (sum ÷ count)', '6'], ['Same data', 'Median (middle, sorted)', '5'], ['Same data', 'Mode (most common)', '5'], ['Same data', 'Range (max − min)', '7']] },
  ],
});
_addArticle({
  slug: 'square-and-cube-numbers', category: 'Maths', keystage: 'KS2',
  title: 'What is a square number? What is a cube number?',
  lead: 'A square number is a whole number multiplied by itself (1, 4, 9, 16…). A cube number is a whole number multiplied by itself twice (1, 8, 27, 64…).',
  sections: [
    { h: 'Squares to 12²', examples: [['1²', '1 × 1', '1'], ['5²', '5 × 5', '25'], ['10²', '10 × 10', '100'], ['12²', '12 × 12', '144']] },
    { h: 'Cubes to 5³', examples: [['1³', '1 × 1 × 1', '1'], ['2³', '2 × 2 × 2', '8'], ['3³', '3 × 3 × 3', '27'], ['5³', '5 × 5 × 5', '125']] },
  ],
});
_addArticle({
  slug: 'millilitres-in-a-litre', category: 'Maths', keystage: 'KS2',
  title: 'How many millilitres are in a litre?',
  lead: 'There are exactly 1,000 millilitres (ml) in 1 litre (l). To convert litres to ml, multiply by 1,000.',
  sections: [
    { h: 'Conversions', examples: [['2 l', '2 × 1,000', '2,000 ml'], ['0.5 l', '0.5 × 1,000', '500 ml'], ['1,500 ml', '1,500 ÷ 1,000', '1.5 l']] },
  ],
});
_addArticle({
  slug: '2d-vs-3d-shapes', category: 'Maths', keystage: 'KS1',
  title: "What's the difference between 2D and 3D shapes?",
  lead: '2D shapes are flat (like a square or triangle). 3D shapes are solid (like a cube or sphere) and have faces, edges and vertices.',
  sections: [
    { h: '3D shape properties', examples: [['Cube', '6 faces · 12 edges · 8 vertices'], ['Cuboid', '6 faces · 12 edges · 8 vertices'], ['Square-based pyramid', '5 faces · 8 edges · 5 vertices'], ['Triangular prism', '5 faces · 9 edges · 6 vertices']] },
  ],
});
_addArticle({
  slug: 'what-is-rounding', category: 'Maths', keystage: 'KS2',
  title: 'What is rounding?',
  lead: 'Rounding means making a number simpler by changing it to a nearby "round" number. Look at the digit after the one you\'re rounding to: 5 or more, round up; less than 5, round down.',
  sections: [
    { h: 'Worked examples', examples: [['347 to the nearest 10', 'next digit is 7', '350'], ['347 to the nearest 100', 'next digit is 4', '300'], ['1,556 to the nearest 1,000', 'next digit is 5', '2,000']] },
  ],
});

// ────────── English ──────────
_addArticle({
  slug: 'what-is-a-subordinate-clause', category: 'English', keystage: 'KS2',
  title: 'What is a subordinate clause?',
  lead: 'A subordinate clause is a part of a sentence that adds extra information to the main clause but cannot stand alone as a sentence.',
  sections: [
    { h: 'Main vs subordinate', body: 'A main clause makes sense on its own. A subordinate clause depends on the main clause for meaning. Subordinate clauses often start with words like because, although, when, if, while.' },
    { h: 'Examples', examples: [['We went home', 'because it was raining', '(subordinate)'], ['Although she was tired', 'she finished her homework', ''], ['The dog barked', 'when the postman arrived', '']] },
    { h: 'Comma rule', body: 'When the subordinate clause comes first, follow it with a comma. When it comes second, you usually don\'t need one.' },
  ],
});
_addArticle({
  slug: 'what-is-a-relative-clause', category: 'English', keystage: 'KS2',
  title: 'What is a relative clause?',
  lead: 'A relative clause adds information about a noun. It begins with a relative pronoun: who, which, that, whose or where.',
  sections: [
    { h: 'Examples', examples: [['The girl', 'who lives next door', 'is my best friend.'], ['The book', 'that I borrowed', 'is brilliant.'], ['The park', 'where we play football', 'is on Mill Road.']] },
    { h: 'Embedded relative clauses', body: 'When a relative clause is dropped into the middle of a sentence, it\'s called an embedded clause. Mark it off with commas: "My brother, who is six, loves dinosaurs."' },
  ],
});
_addArticle({
  slug: 'what-is-a-modal-verb', category: 'English', keystage: 'KS2',
  title: 'What is a modal verb?',
  lead: 'A modal verb shows how likely something is, or how much obligation it carries. The most common are can, could, may, might, must, shall, should, will and would.',
  sections: [
    { h: 'What they do', list: ['Likelihood: "It might rain", "She will come".', 'Obligation: "You must wear a coat", "We should go".', 'Ability: "I can swim".', 'Permission: "May I leave the room?"'] },
  ],
});
_addArticle({
  slug: 'their-there-theyre', category: 'English', keystage: 'KS2',
  title: "What's the difference between \"their\", \"there\" and \"they're\"?",
  lead: 'Their shows possession. There refers to a place or starts a sentence. They\'re is short for "they are".',
  sections: [
    { h: 'Side by side', examples: [['Their', 'belongs to them', 'Their dog is small.'], ['There', 'a place / sentence opener', 'There is a fox in the garden.'], ['They\'re', 'they are', 'They\'re going home.']] },
    { h: 'A quick test', body: 'If you can swap the word for "they are" and the sentence still works, use they\'re. If it\'s about a place, use there. Otherwise, use their.' },
  ],
});
_addArticle({
  slug: 'metaphor-vs-simile', category: 'English', keystage: 'KS2',
  title: 'What is a metaphor? How is it different from a simile?',
  lead: 'A metaphor says something IS something else. A simile says something is LIKE or AS something else.',
  sections: [
    { h: 'Side by side', examples: [['Metaphor', 'The classroom was a zoo.', ''], ['Simile', 'The classroom was like a zoo.', ''], ['Simile', 'She was as quick as a flash.', '']] },
  ],
});
_addArticle({
  slug: 'what-is-alliteration', category: 'English', keystage: 'KS1',
  title: 'What is alliteration?',
  lead: 'Alliteration is when two or more nearby words start with the same sound, for example "slippery snake" or "big brown bear".',
  sections: [
    { h: 'Examples', list: ['Sally sells seashells by the seashore.', 'The wild winter wind whistled.', 'Peter Piper picked a peck of pickled peppers.'] },
    { h: 'Why writers use it', body: 'Alliteration makes phrases memorable and gives writing rhythm. That\'s why tongue twisters, brand names and headlines often use it.' },
  ],
});
_addArticle({
  slug: 'what-is-personification', category: 'English', keystage: 'KS2',
  title: 'What is personification?',
  lead: 'Personification is when you give a human quality to something that isn\'t human: an object, an animal, a feeling or an idea.',
  sections: [
    { h: 'Examples', list: ['The wind whispered through the trees.', 'The car groaned up the hill.', 'Time flies when you\'re having fun.', 'The flowers nodded their heads in the breeze.'] },
  ],
});
_addArticle({
  slug: 'active-vs-passive-voice', category: 'English', keystage: 'KS2',
  title: "What's the difference between active and passive voice?",
  lead: 'In the active voice, the subject does the action. In the passive voice, the action is done to the subject.',
  sections: [
    { h: 'Side by side', examples: [['Active', 'The cat chased the mouse.', '(cat does it)'], ['Passive', 'The mouse was chased by the cat.', '(mouse has it done to them)']] },
    { h: 'When to use each', body: 'Active voice is usually clearer and shorter. Passive voice is useful when you don\'t know who did the action, or when the action matters more than the doer ("The window was broken").' },
  ],
});
_addArticle({
  slug: 'expanded-noun-phrase', category: 'English', keystage: 'KS2',
  title: 'What is an expanded noun phrase?',
  lead: 'An expanded noun phrase is a noun plus extra words that describe it, usually one or more adjectives, or a phrase that adds detail.',
  sections: [
    { h: 'Building one up', examples: [['Noun', 'cat', ''], ['+ adjective', 'black cat', ''], ['+ another adjective', 'sleepy black cat', ''], ['+ a phrase', 'sleepy black cat on the windowsill', '']] },
    { h: 'Comma rule', body: 'When two or more adjectives describe the noun, separate them with commas: "the dark, cold forest".' },
  ],
});
_addArticle({
  slug: 'when-to-use-semicolon', category: 'English', keystage: 'KS2',
  title: 'When do you use a semicolon?',
  lead: 'A semicolon (;) joins two complete sentences that are closely related, without needing a connective. It can also separate items in a long list.',
  sections: [
    { h: 'Two rules, two examples', examples: [['Joining sentences', 'I love reading; my sister prefers writing.', ''], ['Long list', 'We visited York, in the north; Bath, in the west; and Brighton, in the south.', '']] },
  ],
});
_addArticle({
  slug: 'what-is-direct-speech', category: 'English', keystage: 'KS2',
  title: 'What is direct speech?',
  lead: 'Direct speech is when you write the exact words a character says, inside speech marks (" ").',
  sections: [
    { h: 'The rules', list: ['Use speech marks around the spoken words.', 'Start the speech with a capital letter.', 'End the speech with a punctuation mark inside the closing speech mark.', 'Start a new line each time a new character speaks.'] },
    { h: 'Examples', examples: [['', '"I\'m going home," said Sam.', ''], ['', '"Where are you off to?" asked Mum.', '']] },
  ],
});
_addArticle({
  slug: 'what-are-homophones', category: 'English', keystage: 'KS2',
  title: 'What are homophones?',
  lead: 'Homophones are words that sound the same but have different meanings and different spellings, like "hear" and "here", or "sea" and "see".',
  sections: [
    { h: 'Common pairs', examples: [['hear / here', 'to listen / a place', ''], ['sea / see', 'the ocean / to look', ''], ['flower / flour', 'a plant / for baking', ''], ['knight / night', 'a soldier / after dark', ''], ['piece / peace', 'a part / calm', '']] },
  ],
});
_addArticle({
  slug: 'adjective-vs-adverb', category: 'English', keystage: 'KS2',
  title: "What's the difference between an adjective and an adverb?",
  lead: 'An adjective describes a noun (a thing). An adverb describes a verb (an action), an adjective, or another adverb.',
  sections: [
    { h: 'Side by side', examples: [['Adjective', 'the quick fox', '(describes "fox")'], ['Adverb', 'the fox ran quickly', '(describes "ran")']] },
    { h: 'Quick test', body: 'Many adverbs end in -ly: quickly, slowly, carefully. But not all: words like "very", "well", "here" and "now" are also adverbs.' },
  ],
});

// ────────── Science ──────────
_addArticle({
  slug: 'what-is-photosynthesis', category: 'Science', keystage: 'KS2',
  title: 'What is photosynthesis?',
  lead: 'Photosynthesis is how plants make their own food. They use sunlight, water and carbon dioxide to make glucose (sugar) and oxygen.',
  sections: [
    { h: 'The equation', body: 'sunlight + water + carbon dioxide → glucose + oxygen. This happens in the leaves, in tiny green parts called chloroplasts, which contain a green pigment called chlorophyll.' },
    { h: 'Why it matters', body: 'Without photosynthesis, there would be no oxygen in our air and no plants for animals (or humans) to eat.' },
  ],
});
_addArticle({
  slug: 'what-is-the-water-cycle', category: 'Science', keystage: 'KS2',
  title: 'What is the water cycle?',
  lead: 'The water cycle is the journey water takes between the sea, the sky and the land, through evaporation, condensation, precipitation and collection.',
  sections: [
    { h: 'The four stages', list: ['Evaporation: the sun warms water in oceans and lakes; it turns into water vapour and rises.', 'Condensation: high in the sky, the vapour cools and forms clouds.', 'Precipitation: the clouds release water as rain, snow, sleet or hail.', 'Collection: water flows back into rivers, lakes and the sea, and the cycle starts again.'] },
  ],
});
_addArticle({
  slug: 'solid-liquid-gas', category: 'Science', keystage: 'KS1',
  title: "What's the difference between a solid, liquid and gas?",
  lead: 'Solids hold their shape. Liquids flow and take the shape of their container. Gases spread out to fill any container.',
  sections: [
    { h: 'Particle behaviour', examples: [['Solid', 'particles packed tightly, vibrating', 'ice, wood, stone'], ['Liquid', 'particles close but flowing', 'water, milk'], ['Gas', 'particles spread out, moving fast', 'air, steam']] },
  ],
});
_addArticle({
  slug: 'planets-solar-system', category: 'Science', keystage: 'KS2',
  title: 'What are the planets in our solar system?',
  lead: 'There are eight planets orbiting our Sun: Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus and Neptune.',
  sections: [
    { h: 'A mnemonic', body: '"My Very Easy Method Just Speeds Up Naming" stands for Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune.' },
    { h: 'Quick facts', list: ['Mercury: closest to the Sun, the smallest planet.', 'Venus: the hottest, with thick clouds.', 'Earth: our home, the only planet with liquid water on the surface.', 'Mars: the "red planet", with the tallest volcano in the solar system.', 'Jupiter: the biggest, with a famous Great Red Spot storm.', 'Saturn: famous for its rings.', 'Uranus: spins on its side.', 'Neptune: the windiest planet.'] },
  ],
});
_addArticle({
  slug: 'what-is-gravity', category: 'Science', keystage: 'KS2',
  title: 'What is gravity?',
  lead: 'Gravity is a force that pulls objects with mass towards each other. The Earth\'s gravity is what keeps us on the ground and what makes things fall when we drop them.',
  sections: [
    { h: 'Why we don\'t fly off', body: 'The Earth is so massive that everything on or near it is pulled toward its centre. Without gravity, you\'d float, things wouldn\'t fall, and there would be no atmosphere.' },
  ],
});
_addArticle({
  slug: 'vertebrate-vs-invertebrate', category: 'Science', keystage: 'KS2',
  title: "What's the difference between a vertebrate and an invertebrate?",
  lead: 'A vertebrate has a backbone. An invertebrate does not.',
  sections: [
    { h: 'Examples', examples: [['Vertebrates', 'mammals, birds, fish, reptiles, amphibians', '(dog, eagle, salmon, snake, frog)'], ['Invertebrates', 'insects, spiders, worms, jellyfish, snails', '(bee, spider, earthworm, jellyfish, snail)']] },
  ],
});
_addArticle({
  slug: 'what-is-a-food-chain', category: 'Science', keystage: 'KS1',
  title: 'What is a food chain?',
  lead: 'A food chain shows what eats what. It starts with a producer (a plant), which is eaten by a consumer (an animal), which may itself be eaten by a predator.',
  sections: [
    { h: 'An example', body: 'Grass (producer) → rabbit (consumer) → fox (predator). The arrows mean "is eaten by".' },
  ],
});
_addArticle({
  slug: 'mass-vs-weight', category: 'Science', keystage: 'KS2',
  title: "What's the difference between mass and weight?",
  lead: 'Mass is how much "stuff" is in something. Weight is the pull of gravity on that mass, so weight changes depending on which planet you\'re on.',
  sections: [
    { h: 'Astronaut example', body: 'An astronaut\'s mass on the Moon is the same as on Earth. But the Moon\'s gravity is about one-sixth of Earth\'s, so they weigh about one-sixth as much, so they can bounce around easily.' },
  ],
});

// ────────── Geography ──────────
_addArticle({
  slug: 'weather-vs-climate', category: 'Geography', keystage: 'KS2',
  title: "What's the difference between weather and climate?",
  lead: 'Weather is what\'s happening outside right now: sunny, raining, windy. Climate is the average weather pattern of a place over a long time (usually 30 years or more).',
  sections: [
    { h: 'A way to remember it', body: '"Climate is what you expect; weather is what you get."' },
  ],
});
_addArticle({
  slug: 'seven-continents', category: 'Geography', keystage: 'KS1',
  title: 'What are the seven continents?',
  lead: 'The seven continents are Africa, Antarctica, Asia, Australia (Oceania), Europe, North America and South America.',
  sections: [
    { h: 'Quick facts', list: ['Asia: the biggest continent and the most populated.', 'Africa: second biggest, home to the Sahara desert.', 'North America: includes the USA, Canada and Mexico.', 'South America: home to the Amazon rainforest.', 'Antarctica: the coldest continent, mostly covered in ice.', 'Europe: where the UK is.', 'Australia: also called Oceania, the smallest continent.'] },
  ],
});
_addArticle({
  slug: 'what-is-the-equator', category: 'Geography', keystage: 'KS1',
  title: 'What is the equator?',
  lead: 'The equator is an imaginary line around the middle of the Earth, halfway between the North Pole and the South Pole. Places on the equator are very hot all year round.',
  sections: [
    { h: 'On a map', body: 'You\'ll usually see it drawn as a horizontal line across the centre of a world map. It divides the Earth into two halves: the Northern Hemisphere and the Southern Hemisphere.' },
  ],
});
_addArticle({
  slug: 'what-are-tectonic-plates', category: 'Geography', keystage: 'KS2',
  title: 'What are tectonic plates?',
  lead: 'The Earth\'s outer shell is broken into huge pieces called tectonic plates. They move very slowly, a few centimetres a year, and where they meet, you get earthquakes, volcanoes and mountain ranges.',
  sections: [
    { h: 'Plate boundaries', list: ['When two plates push together, they can crumple upwards to form mountains.', 'When they slide past each other, they cause earthquakes.', 'When one plate slides under another, magma rises and forms volcanoes.'] },
  ],
});
_addArticle({
  slug: 'river-source-and-mouth', category: 'Geography', keystage: 'KS2',
  title: "What's the difference between a river's source and its mouth?",
  lead: 'The source is where a river starts (usually high in the hills or mountains). The mouth is where the river ends, flowing into the sea, a lake or a larger river.',
  sections: [
    { h: 'A typical journey', body: 'A river usually starts as a small stream from rainwater, melted snow or a spring. It flows downhill, getting bigger as smaller streams (tributaries) join it. It ends at its mouth, often a wide estuary where fresh water meets salt water.' },
  ],
});

// ────────── History ──────────
_addArticle({
  slug: 'who-were-the-anglo-saxons', category: 'History', keystage: 'KS2',
  title: 'Who were the Anglo-Saxons?',
  lead: 'The Anglo-Saxons were settlers from northern Europe who arrived in Britain after the Romans left, around AD 410. They came from what is now Germany, Denmark and the Netherlands.',
  sections: [
    { h: 'What they left behind', list: ['The English language: most everyday words come from Old English.', 'Many place names ending in -ham, -ton or -ing.', 'Famous treasures like the Sutton Hoo helmet.', 'Christianity, which spread across Britain in this period.'] },
  ],
});
_addArticle({
  slug: 'who-were-the-vikings', category: 'History', keystage: 'KS2',
  title: 'Who were the Vikings?',
  lead: 'The Vikings were seafaring people from Scandinavia (Norway, Sweden and Denmark) who raided, traded and settled in Britain from around AD 793 to 1066.',
  sections: [
    { h: 'Key facts', list: ['They sailed long, narrow wooden ships called longships.', 'They first raided the monastery at Lindisfarne in 793.', 'They settled across northern and eastern England, the area called the Danelaw.', 'Place names ending in -by or -thorpe come from Viking settlers (Whitby, Grimsby, Scunthorpe).'] },
  ],
});
_addArticle({
  slug: 'what-was-the-stone-age', category: 'History', keystage: 'KS2',
  title: 'What was the Stone Age?',
  lead: 'The Stone Age is the earliest period of human history, when people made tools and weapons from stone. It lasted from around 2.5 million years ago to about 4,500 years ago.',
  sections: [
    { h: 'Three parts', list: ['Palaeolithic ("Old Stone Age"): hunter-gatherers, simple stone tools.', 'Mesolithic ("Middle Stone Age"): finer tools, fishing, smaller groups.', 'Neolithic ("New Stone Age"): farming, settled villages, polished stone tools.'] },
  ],
});
_addArticle({
  slug: 'great-fire-of-london', category: 'History', keystage: 'KS1',
  title: 'What was the Great Fire of London?',
  lead: 'The Great Fire of London was a huge fire that destroyed most of central London in September 1666. It started in a bakery on Pudding Lane and burned for four days.',
  sections: [
    { h: 'Key facts', list: ['Started on 2 September 1666 in Thomas Farriner\'s bakery.', 'Spread quickly because most houses were wooden and built very close together.', 'Destroyed around 13,000 houses and 87 churches, including the old St Paul\'s Cathedral.', 'Only a handful of deaths were recorded, though the real number was probably higher.', 'Samuel Pepys wrote about it in his famous diary.'] },
  ],
});
_addArticle({
  slug: 'who-was-florence-nightingale', category: 'History', keystage: 'KS1',
  title: 'Who was Florence Nightingale?',
  lead: 'Florence Nightingale (1820-1910) was a British nurse who transformed nursing during the Crimean War, where her work dramatically reduced the number of soldiers dying from infection.',
  sections: [
    { h: 'Why she\'s remembered', list: ['She was nicknamed "the Lady with the Lamp" for tending soldiers at night.', 'She founded the Nightingale Training School for nurses in 1860.', 'She used statistics to prove the importance of hygiene in hospitals.', 'Modern nursing as a profession is built on her work.'] },
  ],
});

// ────────── Computing ──────────
_addArticle({
  slug: 'what-is-an-algorithm', category: 'Computing', keystage: 'KS1',
  title: 'What is an algorithm?',
  lead: 'An algorithm is a set of step-by-step instructions for completing a task. Computers use algorithms to solve problems, but humans use them too, like following a recipe.',
  sections: [
    { h: 'Make a cup of tea', list: ['1. Boil the kettle.', '2. Put a teabag in a mug.', '3. Pour the hot water into the mug.', '4. Wait three minutes.', '5. Take out the teabag.', '6. Add milk and sugar if you like.'] },
  ],
});
_addArticle({
  slug: 'hardware-vs-software', category: 'Computing', keystage: 'KS2',
  title: "What's the difference between hardware and software?",
  lead: 'Hardware is the physical parts of a computer you can touch (the screen, keyboard, chips). Software is the instructions that tell the hardware what to do: programs and apps.',
  sections: [
    { h: 'Examples', examples: [['Hardware', 'screen, keyboard, hard drive', 'physical'], ['Software', 'web browser, games, word processor', 'instructions']] },
  ],
});
_addArticle({
  slug: 'what-is-debugging', category: 'Computing', keystage: 'KS2',
  title: 'What is debugging?',
  lead: 'Debugging is finding and fixing the mistakes (called "bugs") in a computer program so that it does what it\'s supposed to.',
  sections: [
    { h: 'How programmers debug', list: ['Run the program and watch where it goes wrong.', 'Read the code line by line to spot mistakes.', 'Print messages to check what the program is doing.', 'Change one thing at a time and test again.'] },
  ],
});

// ────────── RE ──────────
_addArticle({
  slug: 'what-is-diwali', category: 'RE', keystage: 'KS1',
  title: 'What is Diwali?',
  lead: 'Diwali is the festival of lights, celebrated by Hindus, Sikhs and Jains. It usually lasts five days and falls in October or November.',
  sections: [
    { h: 'How it\'s celebrated', list: ['Families light small oil lamps called diyas to welcome the goddess Lakshmi.', 'Houses are cleaned and decorated with rangoli, patterns made from coloured powder.', 'People share sweets, exchange gifts and watch firework displays.', 'It celebrates the victory of light over darkness and good over evil.'] },
  ],
});
_addArticle({
  slug: 'what-is-easter', category: 'RE', keystage: 'KS1',
  title: 'What is Easter?',
  lead: 'Easter is the most important Christian festival. It celebrates the resurrection of Jesus Christ: the belief that he rose from the dead, three days after he was crucified.',
  sections: [
    { h: 'How it\'s celebrated', list: ['Christians attend church services on Good Friday and Easter Sunday.', 'Many families share Easter eggs, a symbol of new life.', 'Hot cross buns are traditionally eaten on Good Friday.', 'The date moves each year, but it\'s always on a Sunday between late March and late April.'] },
  ],
});


// ══════════════════════════════════════════════════════════════
// More articles (batch 2)
// ══════════════════════════════════════════════════════════════

// ────────── Maths ──────────
_addArticle({
  slug: 'factors-and-multiples', category: 'Maths', keystage: 'KS2',
  title: "What's the difference between a factor and a multiple?",
  lead: 'A factor is a whole number that divides exactly into another number. A multiple is what you get when you multiply a number by a whole number.',
  sections: [
    { h: 'The quick answer', body: 'The factors of 12 are 1, 2, 3, 4, 6 and 12, because each divides into 12 with nothing left over. The multiples of 12 are 12, 24, 36, 48 and so on, because they are 12 times a whole number. A handy way to remember it: factors are smaller (or equal), multiples are bigger (or equal).' },
    { h: 'Examples', examples: [['Factors of 8', '1, 2, 4, 8', 'divide into 8'], ['Factors of 15', '1, 3, 5, 15', 'divide into 15'], ['Multiples of 5', '5, 10, 15, 20, 25', '5 × 1, 2, 3…'], ['Multiples of 10', '10, 20, 30, 40', '10 × 1, 2, 3…']] },
    { h: 'Common mix-ups', list: ['Swapping the two words. Factors are the building blocks of a number; multiples are the times-table answers.', 'Forgetting that 1 and the number itself are always factors.', 'Thinking a number has only a few multiples. Multiples go on forever.'] },
    { h: 'Where this sits in the curriculum', body: 'Children meet factors and multiples in Year 4 and 5, and use them to find common factors, common multiples and to simplify fractions later in KS2.' },
  ],
});
_addArticle({
  slug: 'equivalent-fractions', category: 'Maths', keystage: 'KS2',
  title: 'What are equivalent fractions?',
  lead: 'Equivalent fractions are different fractions that show the same amount, like ½, 2/4 and 4/8. You make them by multiplying or dividing the top and bottom by the same number.',
  sections: [
    { h: 'The quick answer', body: 'Two fractions are equivalent if they represent the same part of a whole. ½ is the same as 2/4 and 5/10. To find an equivalent fraction, multiply (or divide) the numerator and the denominator by the same number.' },
    { h: 'Examples', examples: [['½', '× 2 top and bottom', '2/4'], ['½', '× 5 top and bottom', '5/10'], ['6/8', '÷ 2 top and bottom', '3/4'], ['10/20', '÷ 10 top and bottom', '1/2']] },
    { h: 'A teacher tip', body: 'A fraction wall or a set of fraction strips is the clearest way to show that ½, 2/4 and 4/8 line up exactly. Pair it with folding strips of paper into equal parts.' },
  ],
});
_addArticle({
  slug: 'what-is-a-percentage', category: 'Maths', keystage: 'KS2',
  title: 'What is a percentage?',
  lead: 'A percentage is a way of showing a number as a part of 100. The symbol % means "out of 100", so 25% means 25 out of 100.',
  sections: [
    { h: 'The quick answer', body: 'Per cent means "per hundred". 50% is 50 out of 100, which is the same as ½. To find a percentage of an amount, turn the percentage into a fraction or a decimal and multiply.' },
    { h: 'Common percentages', examples: [['50%', 'one half', '÷ 2'], ['25%', 'one quarter', '÷ 4'], ['10%', 'one tenth', '÷ 10'], ['1%', 'one hundredth', '÷ 100']] },
    { h: 'Finding a percentage of a number', examples: [['50% of 80', '80 ÷ 2', '40'], ['10% of 60', '60 ÷ 10', '6'], ['25% of 40', '40 ÷ 4', '10']] },
    { h: 'Where this sits in the curriculum', body: 'Percentages appear from Year 5, and pupils connect them to fractions and decimals through Year 6.' },
  ],
});
_addArticle({
  slug: 'types-of-angle', category: 'Maths', keystage: 'KS2',
  title: 'What are the different types of angle?',
  lead: 'Angles are measured in degrees. The main types are acute (less than 90°), right (exactly 90°), obtuse (between 90° and 180°), straight (180°) and reflex (more than 180°).',
  sections: [
    { h: 'The five to know', examples: [['Acute', 'less than 90°', 'a slice of pizza'], ['Right', 'exactly 90°', 'the corner of a book'], ['Obtuse', 'between 90° and 180°', 'a reclining chair'], ['Straight', 'exactly 180°', 'a flat line'], ['Reflex', 'more than 180°', 'more than halfway round']] },
    { h: 'Common mistakes', list: ['Mixing up acute and obtuse. Acute angles are small and "cute".', 'Forgetting that angles around a point add up to 360°, and angles on a straight line add up to 180°.'] },
    { h: 'Where this sits in the curriculum', body: 'Pupils name and compare angles from Year 3, and measure and draw them with a protractor from Year 5.' },
  ],
});

// ────────── English ──────────
_addArticle({
  slug: 'when-to-use-an-apostrophe', category: 'English', keystage: 'KS2',
  title: 'When do you use an apostrophe?',
  lead: 'An apostrophe does two jobs: it shows where letters are missing in a contraction (do not becomes don\'t), and it shows that something belongs to someone (the dog\'s lead).',
  sections: [
    { h: 'Two jobs', list: ['Contraction: the apostrophe replaces missing letters. "Do not" becomes "don\'t"; "it is" becomes "it\'s".', 'Possession: the apostrophe shows ownership. "The cat\'s whiskers" means the whiskers belonging to the cat.'] },
    { h: 'Singular vs plural possession', examples: [['One dog', "the dog's bowl", "'s"], ['Two dogs', "the dogs' bowls", "s'"], ['The children', "the children's toys", "'s (irregular plural)"]] },
    { h: 'The "its" trap', body: 'Its (no apostrophe) shows possession, like "his" or "hers". It\'s (with an apostrophe) always means "it is" or "it has". If you can swap in "it is", use the apostrophe.' },
    { h: 'Where this sits in the curriculum', body: 'Contractions are taught from Year 2, and possessive apostrophes, including plural possession, through Year 4 and 5.' },
  ],
});
_addArticle({
  slug: 'what-is-a-conjunction', category: 'English', keystage: 'KS2',
  title: 'What is a conjunction?',
  lead: 'A conjunction is a joining word. It links words, phrases or clauses together. The two main types are coordinating (and, but, or) and subordinating (because, although, when).',
  sections: [
    { h: 'Two types', list: ['Coordinating conjunctions join two equal parts: "I like tea and coffee." Common ones: and, but, or, so.', 'Subordinating conjunctions join a main clause to a subordinate clause: "We stayed in because it was raining." Common ones: because, although, when, if, while, until.'] },
    { h: 'Examples', examples: [['and', 'adds information', 'fish and chips'], ['but', 'shows a contrast', 'small but strong'], ['because', 'gives a reason', 'we ran because we were late'], ['although', 'shows a contrast', 'although it was cold, we swam']] },
    { h: 'Where this sits in the curriculum', body: 'Children join clauses with "and" in Year 1, meet subordinating conjunctions in Year 2, and use a wider range across KS2.' },
  ],
});
_addArticle({
  slug: 'what-is-a-preposition', category: 'English', keystage: 'KS2',
  title: 'What is a preposition?',
  lead: 'A preposition is a word that tells you where or when something is, like in, on, under, before and after. It usually comes just before a noun.',
  sections: [
    { h: 'Place and time', list: ['Place: in, on, under, beside, between, above, below. "The cat sat under the table."', 'Time: before, after, during, until. "We will eat after the film."'] },
    { h: 'A quick test', body: 'Many prepositions fit the gap in "the cat went ___ the box": in, on, under, behind, beside, over. If the word describes the position, it is probably a preposition.' },
    { h: 'Where this sits in the curriculum', body: 'Prepositions are introduced in Year 3, and prepositional phrases (a preposition plus a noun) are built on through KS2.' },
  ],
});
_addArticle({
  slug: 'prefixes-and-suffixes', category: 'English', keystage: 'KS2',
  title: 'What are prefixes and suffixes?',
  lead: 'A prefix is added to the start of a word to change its meaning (unhappy). A suffix is added to the end (happiness). The base word in the middle is called the root.',
  sections: [
    { h: 'Side by side', examples: [['Prefix', 'goes at the start', 'un + kind = unkind'], ['Suffix', 'goes at the end', 'kind + ness = kindness'], ['Root', 'the base word', 'kind']] },
    { h: 'Common prefixes', list: ['un- means "not": unhappy, unlock.', 're- means "again": redo, replay.', 'dis- means "the opposite of": disagree, disappear.'] },
    { h: 'Common suffixes', list: ['-ed makes a past tense: jump becomes jumped.', '-ing makes a present action: jump becomes jumping.', '-ful means "full of": care becomes careful.', '-less means "without": care becomes careless.'] },
    { h: 'Where this sits in the curriculum', body: 'Prefixes and suffixes are taught throughout KS1 and KS2 as part of spelling, including how adding them changes the spelling of a word (happy becomes happiness).' },
  ],
});

// ────────── Science ──────────
_addArticle({
  slug: 'parts-of-a-plant', category: 'Science', keystage: 'KS1',
  title: 'What are the parts of a plant?',
  lead: 'The main parts of a plant are the roots, stem, leaves and flower. Each part has its own job in keeping the plant alive.',
  sections: [
    { h: 'What each part does', examples: [['Roots', 'take in water and hold the plant steady'], ['Stem', 'carries water up and holds the plant upright'], ['Leaves', 'make food using sunlight'], ['Flower', 'makes seeds so new plants can grow']] },
    { h: 'Where this sits in the curriculum', body: 'Pupils name the parts of a plant in Year 1, then learn what each part does, and that plants need water, light and warmth to grow, in Year 2 and 3.' },
  ],
});
_addArticle({
  slug: 'what-is-a-habitat', category: 'Science', keystage: 'KS1',
  title: 'What is a habitat?',
  lead: 'A habitat is the natural home of a plant or animal. It provides the food, water, shelter and space that the living things there need to survive.',
  sections: [
    { h: 'Examples', examples: [['Pond', 'frogs, newts, pond weed'], ['Woodland', 'foxes, owls, oak trees'], ['Desert', 'camels, cacti, lizards'], ['Ocean', 'fish, crabs, seaweed']] },
    { h: 'Microhabitats', body: 'A microhabitat is a very small habitat within a bigger one, such as under a log or beneath a stone. Different minibeasts live in different microhabitats.' },
    { h: 'Where this sits in the curriculum', body: 'Habitats are part of the Year 2 science curriculum, where pupils explore how animals and plants are suited to where they live.' },
  ],
});
_addArticle({
  slug: 'herbivore-carnivore-omnivore', category: 'Science', keystage: 'KS1',
  title: "What's the difference between a herbivore, carnivore and omnivore?",
  lead: 'A herbivore eats only plants. A carnivore eats only meat. An omnivore eats both plants and animals.',
  sections: [
    { h: 'Side by side', examples: [['Herbivore', 'eats plants', 'rabbit, cow, sheep'], ['Carnivore', 'eats meat', 'lion, shark, owl'], ['Omnivore', 'eats both', 'human, bear, pig']] },
    { h: 'A memory hook', body: 'The ending "-vore" comes from a Latin word meaning "to eat". "Herb" points to plants, "carn" to meat, and "omni" to all.' },
    { h: 'Where this sits in the curriculum', body: 'Pupils sort animals by what they eat in Year 1, and link this to food chains in later years.' },
  ],
});
_addArticle({
  slug: 'what-causes-day-and-night', category: 'Science', keystage: 'KS2',
  title: 'What causes day and night?',
  lead: 'Day and night happen because the Earth spins on its axis. The side facing the Sun has day; the side facing away has night. One full spin takes 24 hours.',
  sections: [
    { h: 'The quick answer', body: 'The Earth turns all the way round once every 24 hours. As it spins, different parts face the Sun. It is the Earth that moves, not the Sun, even though the Sun looks like it rises and sets.' },
    { h: 'A common misconception', body: 'Many children think the Sun travels around the Earth, or that the Earth\'s orbit causes day and night. It is the daily spin (rotation) that makes day and night; the year-long orbit around the Sun is what gives us the seasons.' },
    { h: 'Where this sits in the curriculum', body: 'This is part of the Year 5 topic on Earth and space, alongside the movement of the Moon and the planets.' },
  ],
});

// ────────── Geography ──────────
_addArticle({
  slug: 'uk-great-britain-british-isles', category: 'Geography', keystage: 'KS2',
  title: "What's the difference between the UK, Great Britain and the British Isles?",
  lead: 'Great Britain is the largest island (England, Scotland and Wales). The United Kingdom adds Northern Ireland. The British Isles is the whole group of islands, including the Republic of Ireland.',
  sections: [
    { h: 'The three terms', list: ['Great Britain: the island containing England, Scotland and Wales.', 'United Kingdom (UK): England, Scotland, Wales and Northern Ireland.', 'British Isles: a geographical group of over 6,000 islands, including Great Britain, Ireland and many smaller islands.'] },
    { h: 'Easy to confuse', body: 'The Republic of Ireland sits within the British Isles, which is a geographical term, but it is an independent country and is not part of the UK.' },
    { h: 'Where this sits in the curriculum', body: 'This supports the Year 3 and 4 geography focus on the UK, its four countries and their capital cities.' },
  ],
});
_addArticle({
  slug: 'physical-vs-human-geography', category: 'Geography', keystage: 'KS2',
  title: "What's the difference between physical and human geography?",
  lead: 'Physical geography is the natural world: mountains, rivers, weather and coasts. Human geography is about people: where they live, how they work and the things they build.',
  sections: [
    { h: 'Side by side', examples: [['Physical', 'made by nature', 'mountains, rivers, beaches, volcanoes'], ['Human', 'made or shaped by people', 'cities, roads, farms, bridges']] },
    { h: 'Where this sits in the curriculum', body: 'The difference between physical and human features runs through KS1 and KS2 geography, from describing the local area to comparing different regions.' },
  ],
});
_addArticle({
  slug: 'points-of-a-compass', category: 'Geography', keystage: 'KS1',
  title: 'What are the points of a compass?',
  lead: 'A compass shows direction. The four main points are North, East, South and West. In between are North-East, South-East, South-West and North-West.',
  sections: [
    { h: 'The eight points', list: ['The four main (cardinal) points are North, East, South and West.', 'The four in-between points are North-East, South-East, South-West and North-West.', 'A common way to remember the order clockwise from North is "Never Eat Shredded Wheat".'] },
    { h: 'Where this sits in the curriculum', body: 'Pupils use the four main compass points in Year 1 and 2, and the eight points plus simple grid references in KS2.' },
  ],
});

// ────────── History ──────────
_addArticle({
  slug: 'who-were-the-romans', category: 'History', keystage: 'KS2',
  title: 'Who were the Romans?',
  lead: 'The Romans came from the city of Rome in Italy and built a huge empire. They invaded and then ruled most of Britain from AD 43 for nearly 400 years.',
  sections: [
    { h: 'What they brought to Britain', list: ['Straight roads, many of which modern routes still follow.', 'Towns, including Londinium (London), along with public baths and central heating.', 'New foods, coins and the Latin language.', 'Hadrian\'s Wall, built to mark the northern edge of the empire.'] },
    { h: 'Key dates', examples: [['55 BC', 'Julius Caesar first lands in Britain', ''], ['AD 43', 'Emperor Claudius invades and Roman rule begins', ''], ['AD 410', 'The last Roman soldiers leave Britain', '']] },
    { h: 'Where this sits in the curriculum', body: 'The Roman Empire and its impact on Britain is a key Year 3 or 4 history topic.' },
  ],
});
_addArticle({
  slug: 'who-were-the-ancient-egyptians', category: 'History', keystage: 'KS2',
  title: 'Who were the Ancient Egyptians?',
  lead: 'The Ancient Egyptians lived along the River Nile in north Africa thousands of years ago. They are famous for pyramids, pharaohs, mummies and one of the earliest forms of writing.',
  sections: [
    { h: 'Key facts', list: ['They settled along the River Nile, which flooded each year and left soil that was good for farming.', 'They were ruled by kings and queens called pharaohs, such as Tutankhamun and Cleopatra.', 'They built pyramids as tombs and preserved bodies as mummies because they believed in an afterlife.', 'They wrote using picture symbols called hieroglyphs.'] },
    { h: 'Where this sits in the curriculum', body: 'Ancient Egypt is a popular choice for the KS2 study of an early civilisation.' },
  ],
});
_addArticle({
  slug: 'what-do-bc-and-ad-mean', category: 'History', keystage: 'KS2',
  title: 'What do BC and AD mean?',
  lead: 'BC means "Before Christ" and AD means "Anno Domini", Latin for "in the year of our Lord". They are used to count years before and after the traditional birth of Jesus.',
  sections: [
    { h: 'How the timeline works', list: ['AD years count forwards: AD 1, AD 2, up to today.', 'BC years count backwards: the bigger the BC number, the longer ago it was.', 'There is no year zero; the timeline goes from 1 BC straight to AD 1.'] },
    { h: 'You may also see', body: 'Some books use BCE ("Before Common Era") and CE ("Common Era") instead. They mark exactly the same years.' },
    { h: 'Where this sits in the curriculum', body: 'Understanding chronology, including BC and AD, underpins all of KS2 history.' },
  ],
});

// ────────── Computing ──────────
_addArticle({
  slug: 'what-is-the-internet', category: 'Computing', keystage: 'KS2',
  title: 'What is the internet?',
  lead: 'The internet is a huge network that connects computers all over the world so they can share information. The World Wide Web, the pages we visit, is one of the things that runs on it.',
  sections: [
    { h: 'Internet vs the web', body: 'The internet is the network of cables, signals and computers. The World Wide Web is the collection of websites and pages you look at using a browser. The web is one service that uses the internet, just as email is another.' },
    { h: 'How a message travels', list: ['Information is broken into small pieces called packets.', 'The packets travel across many connected computers and cables.', 'They arrive and are put back together on the other device.'] },
    { h: 'Where this sits in the curriculum', body: 'How the internet and search engines work is part of the KS2 computing curriculum, alongside using technology safely and respectfully.' },
  ],
});
_addArticle({
  slug: 'staying-safe-online', category: 'Computing', keystage: 'KS2',
  title: 'How can children stay safe online?',
  lead: 'Staying safe online means protecting your personal information, being kind to others, and telling a trusted adult if anything online worries you.',
  sections: [
    { h: 'The key rules', list: ['Keep personal information private: your full name, address, school and passwords.', 'Be kind and respectful; never post something you would not say in person.', 'Remember that not everything online is true, so check with a trusted source.', 'If something makes you feel worried or upset, tell a trusted adult straight away.'] },
    { h: 'The SMART idea', body: 'Many schools use the SMART rules: Safe, Meeting, Accepting, Reliable and Tell. They are a simple way to remember how to stay safe online.' },
    { h: 'Where this sits in the curriculum', body: 'Using technology safely and respectfully, and knowing where to go for help, is a required part of computing across KS1 and KS2.' },
  ],
});

// ────────── RE ──────────
_addArticle({
  slug: 'what-is-ramadan', category: 'RE', keystage: 'KS1',
  title: 'What is Ramadan?',
  lead: 'Ramadan is a holy month for Muslims. Many adults fast, which means they do not eat or drink during daylight hours, and they spend extra time praying and helping others.',
  sections: [
    { h: 'How it is observed', list: ['Muslims fast from dawn until sunset for the whole month.', 'Children, older people and those who are unwell do not have to fast.', 'Families wake early for a meal before dawn and break the fast together at sunset.', 'Ramadan ends with a celebration called Eid al-Fitr.'] },
    { h: 'Why it matters', body: 'Fasting helps Muslims focus on their faith, feel grateful, and understand what it is like for people who do not have enough food.' },
    { h: 'Where this sits in the curriculum', body: 'Festivals and special times such as Ramadan and Eid are explored across KS1 and KS2 RE.' },
  ],
});
_addArticle({
  slug: 'what-is-christianity', category: 'RE', keystage: 'KS2',
  title: 'What is Christianity?',
  lead: 'Christianity is the world\'s largest religion. Christians believe in one God and follow the teachings of Jesus Christ. Their holy book is the Bible.',
  sections: [
    { h: 'Key beliefs', list: ['Christians believe in one God.', 'They believe Jesus is the Son of God, whom they follow as their guide.', 'Their holy book is the Bible, made up of the Old and New Testaments.', 'They worship in a church, often on a Sunday.'] },
    { h: 'Main festivals', list: ['Christmas celebrates the birth of Jesus.', 'Easter celebrates the belief that Jesus rose from the dead.'] },
    { h: 'Where this sits in the curriculum', body: 'Christianity is studied throughout primary RE, alongside other major world religions.' },
  ],
});
_addArticle({
  slug: 'what-is-harvest-festival', category: 'RE', keystage: 'KS1',
  title: 'What is harvest festival?',
  lead: 'Harvest festival is a celebration of the food gathered in from the fields at the end of the growing season. It is a time to give thanks and to share food with people in need.',
  sections: [
    { h: 'How it is celebrated', list: ['Schools and churches hold special assemblies and services in the autumn.', 'People bring tins and fresh food, which is often given to food banks or to older people.', 'There are harvest songs, decorations and displays of fruit, vegetables and bread.'] },
    { h: 'Where this sits in the curriculum', body: 'Harvest is a common focus in KS1, linking RE with the seasons and with caring for others.' },
  ],
});


// ══════════════════════════════════════════════════════════════
// More articles (batch 3)
// ══════════════════════════════════════════════════════════════

// ────────── Maths ──────────
_addArticle({
  slug: 'what-is-the-column-method', category: 'Maths', keystage: 'KS2',
  title: 'What is the column method?',
  lead: 'The column method is a way of adding or subtracting numbers by lining them up in columns by place value: ones under ones, tens under tens, and so on.',
  sections: [
    { h: 'The quick answer', body: 'You write the numbers one above the other, lined up on the right so the place values match. Then you work through each column from right to left, carrying when an addition column reaches 10 or more, or exchanging when you cannot subtract.' },
    { h: 'A worked addition (246 + 137)', examples: [['Add the ones', '6 + 7 = 13', 'write 3, carry 1'], ['Add the tens', '4 + 3 + 1 = 8', 'write 8'], ['Add the hundreds', '2 + 1 = 3', 'write 3'], ['Answer', '', '383']] },
    { h: 'Common mistakes', list: ['Not lining up the place values, which matters most with decimals.', 'Forgetting to carry, or forgetting to exchange when subtracting.', 'Starting from the left instead of the right.'] },
    { h: 'Where this sits in the curriculum', body: 'Formal column methods for addition and subtraction are introduced in Year 3 and used throughout the rest of KS2.' },
  ],
});
_addArticle({
  slug: 'what-are-negative-numbers', category: 'Maths', keystage: 'KS2',
  title: 'What are negative numbers?',
  lead: 'Negative numbers are numbers less than zero. They are written with a minus sign in front, like -3, and are used for things like cold temperatures and money owed.',
  sections: [
    { h: 'The quick answer', body: 'A number line helps: zero sits in the middle, positive numbers go to the right and negative numbers go to the left. The further left you go, the smaller the number, so -5 is smaller than -2.' },
    { h: 'Everyday examples', list: ['Temperature: -4°C is four degrees below freezing.', 'Money: being ten pounds overdrawn can be shown as -£10.', 'Buildings: floor -1 is one level below the ground floor.'] },
    { h: 'Where this sits in the curriculum', body: 'Pupils order and count with negative numbers, including counting back through zero, from Year 4 to Year 6.' },
  ],
});
_addArticle({
  slug: 'what-is-a-line-of-symmetry', category: 'Maths', keystage: 'KS2',
  title: 'What is a line of symmetry?',
  lead: 'A line of symmetry is a line you could fold a shape along so that both halves match exactly. A shape can have one, several or no lines of symmetry.',
  sections: [
    { h: 'Lines of symmetry in shapes', examples: [['Square', '4 lines of symmetry', ''], ['Rectangle', '2 lines of symmetry', ''], ['Equilateral triangle', '3 lines of symmetry', ''], ['Circle', 'an infinite number', ''], ['Scalene triangle', 'no lines of symmetry', '']] },
    { h: 'A classroom test', body: 'Give pupils a cut-out shape and ask them to fold it. If the two halves sit exactly on top of each other, the fold line is a line of symmetry.' },
    { h: 'Where this sits in the curriculum', body: 'Symmetry is introduced in Year 2, and pupils complete symmetric figures and find lines of symmetry through KS2.' },
  ],
});
_addArticle({
  slug: 'how-do-roman-numerals-work', category: 'Maths', keystage: 'KS2',
  title: 'How do Roman numerals work?',
  lead: 'Roman numerals use letters to stand for numbers: I = 1, V = 5, X = 10, L = 50, C = 100, D = 500 and M = 1,000. You combine them to make other numbers.',
  sections: [
    { h: 'Add or subtract', body: 'If a smaller letter comes after a larger one, you add it (VI = 6). If a smaller letter comes before a larger one, you subtract it (IV = 4, IX = 9).' },
    { h: 'Worked examples', examples: [['VIII', '5 + 1 + 1 + 1', '8'], ['XIV', '10 + (5 - 1)', '14'], ['XL', '50 - 10', '40'], ['MMXXIV', '1,000 + 1,000 + 10 + 10 + 4', '2,024']] },
    { h: 'Where this sits in the curriculum', body: 'Pupils read Roman numerals to 100 in Year 4, and to 1,000 including years, in Year 5.' },
  ],
});

// ────────── English ──────────
_addArticle({
  slug: 'what-is-a-verb', category: 'English', keystage: 'KS1',
  title: 'What is a verb?',
  lead: 'A verb is a doing or being word. It tells you what someone or something does (run, eat, think) or is (am, is, are).',
  sections: [
    { h: 'Types of verb', list: ['Action verbs show something happening: jump, write, sing.', 'Being verbs (am, is, are, was, were) tell you how something is: "She is happy."', 'Some verbs describe thinking or feeling: believe, know, love.'] },
    { h: 'A quick test', body: 'If you can put "I can ___" or "yesterday I ___" in front of a word and it still makes sense, it is usually a verb.' },
    { h: 'Where this sits in the curriculum', body: 'Children learn that verbs are doing words in Year 1, then use the term and explore tenses through KS1 and KS2.' },
  ],
});
_addArticle({
  slug: 'what-are-synonyms-and-antonyms', category: 'English', keystage: 'KS2',
  title: 'What are synonyms and antonyms?',
  lead: 'A synonym is a word that means the same, or nearly the same, as another (big and large). An antonym is a word that means the opposite (big and small).',
  sections: [
    { h: 'Side by side', examples: [['Synonym', 'means the same', 'happy / glad'], ['Antonym', 'means the opposite', 'happy / sad'], ['Synonym', 'means the same', 'fast / quick'], ['Antonym', 'means the opposite', 'fast / slow']] },
    { h: 'Why they matter', body: 'Choosing synonyms helps writing feel varied instead of repeating the same word. A thesaurus is a book, or tool, that lists synonyms for you.' },
    { h: 'A memory hook', body: 'Antonym starts with "ant", which can remind you of "anti", meaning against or opposite.' },
    { h: 'Where this sits in the curriculum', body: 'Synonyms and antonyms are taught from Year 2, supporting vocabulary work and the use of a thesaurus in KS2.' },
  ],
});
_addArticle({
  slug: 'what-is-onomatopoeia', category: 'English', keystage: 'KS2',
  title: 'What is onomatopoeia?',
  lead: 'Onomatopoeia is when a word sounds like the noise it describes, such as bang, splash, buzz and hiss.',
  sections: [
    { h: 'Examples', list: ['Animal sounds: moo, woof, oink, tweet.', 'Things happening: crash, pop, sizzle, drip.', 'In comics: bang, zap, boom.'] },
    { h: 'Why writers use it', body: 'It helps the reader almost hear what is happening, which makes writing more vivid. Poets and comic writers use it often.' },
    { h: 'Where this sits in the curriculum', body: 'Onomatopoeia is explored as a poetic device in KS2, alongside similes, metaphors and alliteration.' },
  ],
});
_addArticle({
  slug: 'past-present-and-future-tense', category: 'English', keystage: 'KS2',
  title: 'What are the past, present and future tenses?',
  lead: 'Tense tells you when something happens. The past tense is what already happened, the present tense is what is happening now, and the future tense is what will happen.',
  sections: [
    { h: 'Side by side', examples: [['Past', 'already happened', 'I walked to school.'], ['Present', 'happening now', 'I walk to school.'], ['Future', 'not happened yet', 'I will walk to school.']] },
    { h: 'The tricky bit', body: 'Most verbs add -ed for the past tense (walk becomes walked), but some change completely (go becomes went, is becomes was). These are called irregular verbs.' },
    { h: 'Where this sits in the curriculum', body: 'Pupils use the past and present tense from Year 1 and 2, and learn to keep tense consistent in their writing through KS2.' },
  ],
});

// ────────── Science ──────────
_addArticle({
  slug: 'what-is-an-electrical-circuit', category: 'Science', keystage: 'KS2',
  title: 'What is an electrical circuit?',
  lead: 'An electrical circuit is a loop that electricity can flow around. It needs a power source, like a battery, and wires connecting it to something such as a bulb.',
  sections: [
    { h: 'The quick answer', body: 'Electricity can only flow if the loop is complete, with no gaps. If there is a break, such as an open switch, the circuit is broken and the bulb will not light.' },
    { h: 'Common parts', list: ['Cell or battery: provides the power.', 'Wires: carry the electricity around the loop.', 'Bulb, buzzer or motor: the part the electricity makes work.', 'Switch: opens or closes the loop to turn the circuit on or off.'] },
    { h: 'Where this sits in the curriculum', body: 'Pupils build simple series circuits in Year 4 and investigate what changes the brightness of a bulb in Year 6.' },
  ],
});
_addArticle({
  slug: 'what-is-friction', category: 'Science', keystage: 'KS2',
  title: 'What is friction?',
  lead: 'Friction is a force that slows things down when two surfaces rub together. It acts in the opposite direction to the movement.',
  sections: [
    { h: 'The quick answer', body: 'When one surface moves against another, friction works against the movement. Rough surfaces make more friction than smooth ones, which is why it is harder to slide something across a carpet than across ice.' },
    { h: 'Friction in everyday life', list: ['Shoe soles grip the ground so we do not slip.', 'Brakes use friction to slow a bike or a car.', 'Oil reduces friction so machine parts move smoothly.'] },
    { h: 'Where this sits in the curriculum', body: 'Friction is part of the Year 5 topic on forces, alongside gravity, air resistance and water resistance.' },
  ],
});
_addArticle({
  slug: 'why-do-we-have-seasons', category: 'Science', keystage: 'KS2',
  title: 'Why do we have seasons?',
  lead: 'We have seasons because the Earth is tilted as it orbits the Sun. Over a year, different parts of the Earth lean towards or away from the Sun.',
  sections: [
    { h: 'The quick answer', body: 'The Earth takes a year to travel around the Sun. Because it is tilted, the part leaning towards the Sun has summer, with longer, warmer days, while the part leaning away has winter. It is the tilt, not the distance from the Sun, that causes the seasons.' },
    { h: 'A common misconception', body: 'Many people think summer happens because the Earth is closer to the Sun. It is really about the tilt. When it is summer in the UK, it is winter in Australia.' },
    { h: 'Where this sits in the curriculum', body: 'Seasons are explored in Year 1, and the Earth\'s orbit and tilt are studied in the Year 5 Earth and space topic.' },
  ],
});
_addArticle({
  slug: 'what-is-pollination', category: 'Science', keystage: 'KS2',
  title: 'What is pollination?',
  lead: 'Pollination is when pollen is moved from one flower to another, which lets a plant make seeds. It is often carried by insects such as bees, or by the wind.',
  sections: [
    { h: 'How it works', list: ['A flower makes pollen, a fine powder, in a part called the stamen.', 'An insect or the wind carries the pollen to another flower.', 'The pollen reaches the stigma, and the flower can then make seeds.', 'The seeds grow into new plants.'] },
    { h: 'Why bees matter', body: 'Bees and other insects move pollen as they collect nectar. Many of the foods we eat rely on insect pollination, which is one reason bees are so important.' },
    { h: 'Where this sits in the curriculum', body: 'Pollination and the life cycle of flowering plants are part of the Year 3 and Year 5 science curriculum.' },
  ],
});

// ────────── Geography ──────────
_addArticle({
  slug: 'what-is-a-volcano', category: 'Geography', keystage: 'KS2',
  title: 'What is a volcano?',
  lead: 'A volcano is an opening in the Earth\'s surface where molten rock, ash and gas can escape from deep underground. When it erupts, melted rock called lava flows out.',
  sections: [
    { h: 'The quick answer', body: 'Deep inside the Earth it is hot enough to melt rock, which is called magma. Where the crust is weak, often at the edge of tectonic plates, the magma can push up to the surface and erupt. Once it is out, it is called lava.' },
    { h: 'Key words', examples: [['Magma', 'melted rock underground', ''], ['Lava', 'melted rock above ground', ''], ['Crater', 'the opening at the top', ''], ['Eruption', 'when material bursts out', '']] },
    { h: 'Where this sits in the curriculum', body: 'Volcanoes link to the KS2 study of physical geography and tectonic plates.' },
  ],
});
_addArticle({
  slug: 'what-is-erosion', category: 'Geography', keystage: 'KS2',
  title: 'What is erosion?',
  lead: 'Erosion is the wearing away of rock, soil or land by water, wind or ice, which then carries the worn-away material somewhere else.',
  sections: [
    { h: 'The quick answer', body: 'Moving water, wind and ice slowly break down and carry away the land. Over a very long time this shapes valleys, coastlines and caves. Erosion moves material away; weathering is when rock is broken down where it sits.' },
    { h: 'Examples', list: ['Rivers wear away their banks and carve out valleys.', 'Waves wear away cliffs at the coast.', 'Wind blows away loose sand in deserts.'] },
    { h: 'Where this sits in the curriculum', body: 'Erosion is part of KS2 physical geography, especially topics on rivers and coasts.' },
  ],
});
_addArticle({
  slug: 'what-are-longitude-and-latitude', category: 'Geography', keystage: 'KS2',
  title: 'What are longitude and latitude?',
  lead: 'Longitude and latitude are imaginary lines on a map or globe that help us describe exactly where a place is. Latitude lines run across; longitude lines run up and down.',
  sections: [
    { h: 'Side by side', examples: [['Latitude', 'lines run across (east to west)', 'measures how far north or south'], ['Longitude', 'lines run top to bottom (north to south)', 'measures how far east or west']] },
    { h: 'Important lines', list: ['The equator is the line of latitude around the middle of the Earth.', 'The Prime Meridian is the line of longitude that runs through Greenwich in London.', 'Where a line of latitude and a line of longitude cross gives a place its coordinates.'] },
    { h: 'A memory hook', body: 'Lines of latitude run across, like the rungs of a ladder ("lat" sounds like the start of "ladder").' },
    { h: 'Where this sits in the curriculum', body: 'Latitude, longitude, the equator and the Prime Meridian are named in the Year 5 and 6 geography curriculum.' },
  ],
});

// ────────── History ──────────
_addArticle({
  slug: 'who-were-the-ancient-greeks', category: 'History', keystage: 'KS2',
  title: 'Who were the Ancient Greeks?',
  lead: 'The Ancient Greeks lived in Greece and around the Mediterranean thousands of years ago. Many of their ideas about democracy, sport, stories and learning still shape life today.',
  sections: [
    { h: 'What we get from them', list: ['Democracy, a way of governing where people vote, began in the city of Athens.', 'The Olympic Games started in Ancient Greece.', 'Famous myths and legends, such as Theseus and the Minotaur.', 'Early ideas in science and maths from thinkers like Archimedes and Pythagoras.'] },
    { h: 'City states', body: 'Greece was not one country but many separate city states, such as Athens and Sparta, which sometimes worked together and sometimes went to war.' },
    { h: 'Where this sits in the curriculum', body: 'Ancient Greece and its legacy is a Year 5 or 6 history topic.' },
  ],
});
_addArticle({
  slug: 'what-was-the-gunpowder-plot', category: 'History', keystage: 'KS2',
  title: 'What was the Gunpowder Plot?',
  lead: 'The Gunpowder Plot was a failed plan in 1605 to blow up the Houses of Parliament and King James I. Guy Fawkes was caught guarding the gunpowder.',
  sections: [
    { h: 'Key facts', list: ['A group of plotters, led by Robert Catesby, were unhappy with how Catholics were treated.', 'They hid barrels of gunpowder in a cellar beneath Parliament.', 'Guy Fawkes was caught with the gunpowder on the night of 4 November 1605.', 'The plotters were arrested and punished.'] },
    { h: 'Why we remember it', body: 'We mark the event every year on 5 November, Bonfire Night, with fireworks and bonfires.' },
    { h: 'Where this sits in the curriculum', body: 'The Gunpowder Plot is often taught around Bonfire Night, and links to the study of monarchs and parliament.' },
  ],
});
_addArticle({
  slug: 'who-was-mary-anning', category: 'History', keystage: 'KS1',
  title: 'Who was Mary Anning?',
  lead: 'Mary Anning (1799-1847) was a British fossil collector who made important discoveries on the Dorset coast. Her finds helped people understand prehistoric life.',
  sections: [
    { h: 'Why she is remembered', list: ['She found the first complete ichthyosaur skeleton when she was still a child.', 'She later discovered plesiosaur and pterosaur fossils.', 'Her work helped scientists realise that animals had become extinct.', 'As a woman, she was not given the credit she deserved at the time.'] },
    { h: 'Where this sits in the curriculum', body: 'Mary Anning is a popular figure for the KS1 study of significant individuals, often alongside dinosaurs and fossils.' },
  ],
});

// ────────── Computing ──────────
_addArticle({
  slug: 'what-is-a-variable-in-coding', category: 'Computing', keystage: 'KS2',
  title: 'What is a variable in coding?',
  lead: 'A variable is like a labelled box that a program uses to store a piece of information, such as a score or a name. The value inside can change as the program runs.',
  sections: [
    { h: 'An example', body: 'In a game, you might have a variable called "score". It starts at 0, and every time the player collects a coin, the program adds 1 to it. The label stays the same but the value inside changes.' },
    { h: 'An everyday comparison', body: 'Think of a variable like a named jar. The label on the jar (the name) stays the same, but you can change what is inside it (the value).' },
    { h: 'Where this sits in the curriculum', body: 'Variables are introduced in KS2 computing, often using Scratch, as pupils write and debug their own programs.' },
  ],
});
_addArticle({
  slug: 'what-is-a-loop-in-coding', category: 'Computing', keystage: 'KS2',
  title: 'What is a loop in coding?',
  lead: 'A loop is an instruction that tells a program to repeat something, instead of writing the same instruction over and over again.',
  sections: [
    { h: 'Why loops are useful', body: 'To draw a square, you could write "move forward, turn" four times. A loop lets you write it once and say "repeat 4 times", which is shorter and easier to fix.' },
    { h: 'Types of loop', list: ['A count loop repeats a set number of times: "repeat 10 times".', 'A forever loop keeps going until the program is stopped.', 'A condition loop repeats until something happens: "repeat until you reach the wall".'] },
    { h: 'Where this sits in the curriculum', body: 'Repetition and loops are a key part of KS2 programming, especially in Scratch.' },
  ],
});

// ────────── RE ──────────
_addArticle({
  slug: 'what-is-islam', category: 'RE', keystage: 'KS2',
  title: 'What is Islam?',
  lead: 'Islam is one of the world\'s largest religions. Its followers are called Muslims, who believe in one God, called Allah, and follow the teachings of the Prophet Muhammad.',
  sections: [
    { h: 'Key beliefs', list: ['Muslims believe in one God, Allah.', 'They follow the Prophet Muhammad, whom they believe was God\'s final messenger.', 'Their holy book is the Qur\'an.', 'They worship in a building called a mosque.'] },
    { h: 'The Five Pillars', body: 'Muslims try to follow five important duties called the Five Pillars, which include praying five times a day, fasting during Ramadan, and giving to those in need.' },
    { h: 'Where this sits in the curriculum', body: 'Islam is one of the major world religions studied across primary RE.' },
  ],
});
_addArticle({
  slug: 'what-is-hinduism', category: 'RE', keystage: 'KS2',
  title: 'What is Hinduism?',
  lead: 'Hinduism is one of the world\'s oldest religions, mainly followed in India. Hindus believe in one supreme spirit shown through many gods and goddesses.',
  sections: [
    { h: 'Key beliefs', list: ['Hindus believe in a single spirit, Brahman, shown through many gods such as Brahma, Vishnu and Shiva.', 'They believe in reincarnation, the idea that the soul is reborn into a new life.', 'There are many Hindu holy writings, including the Vedas.', 'Hindus often worship at a temple, called a mandir.'] },
    { h: 'Festivals', body: 'Diwali, the festival of lights, and Holi, the festival of colours, are two of the best-known Hindu celebrations.' },
    { h: 'Where this sits in the curriculum', body: 'Hinduism is one of the major world religions explored in primary RE.' },
  ],
});
_addArticle({
  slug: 'what-is-judaism', category: 'RE', keystage: 'KS2',
  title: 'What is Judaism?',
  lead: 'Judaism is one of the oldest religions still followed today. Its followers are called Jews, who believe in one God and follow teachings found in the Torah.',
  sections: [
    { h: 'Key beliefs', list: ['Jews believe in one God.', 'Their holy book is the Torah.', 'They worship in a synagogue, often led by a rabbi.', 'The Sabbath (Shabbat), a day of rest, lasts from Friday evening to Saturday evening.'] },
    { h: 'Festivals', body: 'Hanukkah, the festival of lights, and Passover, which remembers the freeing of the Jewish people from slavery, are important Jewish festivals.' },
    { h: 'Where this sits in the curriculum', body: 'Judaism is one of the major world religions studied in primary RE.' },
  ],
});


// ══════════════════════════════════════════════════════════════
// More articles (batch 4)
// ══════════════════════════════════════════════════════════════

// ────────── Maths ──────────
_addArticle({
  slug: 'improper-fractions-and-mixed-numbers', category: 'Maths', keystage: 'KS2',
  title: 'What is an improper fraction?',
  lead: 'An improper fraction has a numerator (top) that is equal to or larger than its denominator (bottom), like 7/4. It can be rewritten as a mixed number, such as 1¾.',
  sections: [
    { h: 'The quick answer', body: 'A proper fraction is smaller than one whole (¾). An improper fraction is one whole or more (7/4). A mixed number shows the same amount as a whole number and a fraction together (1¾).' },
    { h: 'Converting between them', examples: [['7/4', '7 ÷ 4 = 1 remainder 3', '1¾'], ['9/2', '9 ÷ 2 = 4 remainder 1', '4½'], ['2⅓', '(2 × 3) + 1 = 7', '7/3']] },
    { h: 'Where this sits in the curriculum', body: 'Pupils work with improper fractions and mixed numbers, and convert between them, in Year 5 and 6.' },
  ],
});
_addArticle({
  slug: 'how-do-you-read-an-analogue-clock', category: 'Maths', keystage: 'KS1',
  title: 'How do you read an analogue clock?',
  lead: 'On an analogue clock, the short hand shows the hour and the long hand shows the minutes. The minute hand travels all the way round once every hour.',
  sections: [
    { h: 'The two hands', list: ['The short hand points to the hour.', 'The long hand points to the minutes. Each number it passes is five minutes.', 'When the long hand points straight up to 12, it is "o\'clock".'] },
    { h: 'Quarters and half past', examples: [['Long hand on 12', "o'clock", ''], ['Long hand on 3', 'quarter past', '15 minutes'], ['Long hand on 6', 'half past', '30 minutes'], ['Long hand on 9', 'quarter to', '45 minutes']] },
    { h: 'Where this sits in the curriculum', body: 'Pupils tell the time to the hour and half hour in Year 1, to five minutes in Year 2, and read clocks including Roman numerals and 24-hour time through KS2.' },
  ],
});
_addArticle({
  slug: 'how-to-learn-times-tables', category: 'Maths', keystage: 'KS2',
  title: 'How can children learn their times tables?',
  lead: 'Times tables are the multiplication facts up to 12 × 12. Knowing them by heart makes almost all later maths quicker and easier.',
  sections: [
    { h: 'Helpful patterns', list: ['The 2, 4 and 8 times tables double each time: 2, 4, 8.', 'The 5 times table always ends in 5 or 0.', 'The 10 times table just adds a zero.', 'In the 9 times table the digits add up to 9 (18, 27, 36), and you can use your fingers.'] },
    { h: 'Ways to practise', list: ['Chant or sing them, then mix up the order so they are not just memorised in sequence.', 'Use array pictures and counters to show what multiplication means.', 'Practise the matching division facts at the same time: if 6 × 7 = 42, then 42 ÷ 7 = 6.'] },
    { h: 'Where this sits in the curriculum', body: 'Pupils should know all tables up to 12 × 12 by the end of Year 4, when they sit the national Multiplication Tables Check.' },
  ],
});
_addArticle({
  slug: 'how-do-you-read-a-bar-chart', category: 'Maths', keystage: 'KS2',
  title: 'How do you read a bar chart?',
  lead: 'A bar chart uses bars of different heights to show amounts. The taller the bar, the bigger the amount. You read the height of each bar against the scale up the side.',
  sections: [
    { h: 'Reading one', list: ['The labels along the bottom (the x-axis) tell you what each bar shows.', 'The numbers up the side (the y-axis) give the scale.', 'Find the top of a bar, then read across to the scale to get its value.'] },
    { h: 'Watch the scale', body: 'Always check what each step on the scale is worth. If the scale goes up in 2s or 10s, a bar that reaches the third line is not always worth 3.' },
    { h: 'Where this sits in the curriculum', body: 'Pupils read and draw pictograms, tally charts and bar charts from Year 2, moving on to tables, line graphs and pie charts later in KS2.' },
  ],
});

// ────────── English ──────────
_addArticle({
  slug: 'what-are-the-four-sentence-types', category: 'English', keystage: 'KS2',
  title: 'What are the four types of sentence?',
  lead: 'The four sentence types are statements, questions, commands and exclamations. Each does a different job and uses different punctuation.',
  sections: [
    { h: 'The four types', examples: [['Statement', 'tells you something', 'The dog is asleep.'], ['Question', 'asks something', 'Is the dog asleep?'], ['Command', 'tells you to do something', 'Walk the dog.'], ['Exclamation', 'shows strong feeling', 'What a lazy dog!']] },
    { h: 'A common mix-up', body: 'A true exclamation sentence starts with "What" or "How" (What a mess!). A sentence that simply ends with an exclamation mark is not always an exclamation in grammar terms.' },
    { h: 'Where this sits in the curriculum', body: 'The four sentence types are taught from Year 1 and 2, and tested in the KS1 and KS2 grammar papers.' },
  ],
});
_addArticle({
  slug: 'what-is-a-syllable', category: 'English', keystage: 'KS1',
  title: 'What is a syllable?',
  lead: 'A syllable is a beat in a word. Each syllable has one vowel sound. "Cat" has one syllable; "rab-bit" has two.',
  sections: [
    { h: 'Counting syllables', list: ['Clap as you say a word. Each clap is one syllable.', 'Or rest your hand under your chin: it drops once for each syllable.', 'Examples: dog (1), pen-cil (2), el-e-phant (3), cat-er-pil-lar (4).'] },
    { h: 'Where this sits in the curriculum', body: 'Syllables support reading, spelling and phonics from Reception and Year 1 onwards.' },
  ],
});
_addArticle({
  slug: 'your-vs-youre', category: 'English', keystage: 'KS2',
  title: "What's the difference between \"your\" and \"you're\"?",
  lead: 'Your shows that something belongs to you (your coat). You\'re is short for "you are" (you\'re late).',
  sections: [
    { h: 'Side by side', examples: [['Your', 'belongs to you', 'Is this your bag?'], ["You're", 'you are', "You're my best friend."]] },
    { h: 'A quick test', body: 'Try saying "you are" instead. If the sentence still makes sense, write you\'re. If it does not, write your.' },
    { h: 'Where this sits in the curriculum', body: 'These commonly confused words are tackled across KS2 spelling and grammar.' },
  ],
});
_addArticle({
  slug: 'what-is-a-paragraph', category: 'English', keystage: 'KS2',
  title: 'What is a paragraph?',
  lead: 'A paragraph is a group of sentences about one idea or topic. Starting a new paragraph tells the reader that something has changed.',
  sections: [
    { h: 'When to start a new one', list: ['A new idea or topic.', 'A change of time ("The next morning…").', 'A change of place.', 'A new person speaking, in a story.'] },
    { h: 'How to lay it out', body: 'In handwriting, you usually start a new paragraph on a new line and indent it. When typing, people often leave a blank line between paragraphs instead.' },
    { h: 'Where this sits in the curriculum', body: 'Pupils begin grouping ideas into paragraphs in Year 3 and organise longer writing with them through the rest of KS2.' },
  ],
});

// ────────── Science ──────────
_addArticle({
  slug: 'what-does-the-skeleton-do', category: 'Science', keystage: 'KS1',
  title: 'What does the skeleton do?',
  lead: 'The skeleton is the frame of bones inside the body. It supports the body, helps it move, and protects the soft parts inside.',
  sections: [
    { h: 'Three main jobs', list: ['Support: the bones hold the body up and give it its shape.', 'Movement: muscles pull on the bones so we can move.', 'Protection: the skull protects the brain and the ribs protect the heart and lungs.'] },
    { h: 'Some key bones', examples: [['Skull', 'protects the brain', ''], ['Ribs', 'protect the heart and lungs', ''], ['Spine', 'holds the body upright', ''], ['Femur', 'the thigh bone, the biggest in the body', '']] },
    { h: 'Where this sits in the curriculum', body: 'The skeleton and muscles are part of the Year 3 science topic on animals, including humans.' },
  ],
});
_addArticle({
  slug: 'what-are-the-main-food-groups', category: 'Science', keystage: 'KS2',
  title: 'What are the main food groups?',
  lead: 'A healthy diet includes a balance of food groups: carbohydrates, protein, fruit and vegetables, dairy, and small amounts of fats and sugars.',
  sections: [
    { h: 'The groups', examples: [['Carbohydrates', 'give us energy', 'bread, pasta, rice, potatoes'], ['Protein', 'helps us grow and repair', 'meat, fish, beans, eggs'], ['Fruit and vegetables', 'vitamins and fibre', 'apples, carrots, peas'], ['Dairy', 'strong bones and teeth', 'milk, cheese, yoghurt'], ['Fats and sugars', 'energy, but only a little', 'butter, oils, treats']] },
    { h: 'Why balance matters', body: 'No single food gives us everything we need, so eating a range from each group keeps the body healthy. The Eatwell Guide shows roughly how much of each we should have.' },
    { h: 'Where this sits in the curriculum', body: 'Healthy eating and a balanced diet are part of the Year 3 science topic on nutrition.' },
  ],
});
_addArticle({
  slug: 'how-does-sound-travel', category: 'Science', keystage: 'KS2',
  title: 'How does sound travel?',
  lead: 'Sound is made when something vibrates. The vibrations travel through the air as waves until they reach our ears, which is how we hear.',
  sections: [
    { h: 'The quick answer', body: 'When an object vibrates, it makes the air around it vibrate too. These vibrations spread out as sound waves. When they reach your ear, your eardrum vibrates and your brain hears a sound.' },
    { h: 'Key ideas', list: ['Sound needs something to travel through, usually air. It cannot travel through empty space.', 'A bigger vibration makes a louder sound.', 'A faster vibration makes a higher-pitched sound.', 'Sound gets quieter the further you are from it.'] },
    { h: 'Where this sits in the curriculum', body: 'Sound, including pitch, volume and how it travels, is the Year 4 science topic on sound.' },
  ],
});
_addArticle({
  slug: 'what-are-the-five-vertebrate-groups', category: 'Science', keystage: 'KS1',
  title: 'What are the five vertebrate groups?',
  lead: 'Animals with a backbone fall into five groups: mammals, birds, fish, reptiles and amphibians. Each group shares certain features.',
  sections: [
    { h: 'The five groups', examples: [['Mammals', 'fur or hair, feed young milk', 'dog, human, whale'], ['Birds', 'feathers, wings, lay eggs', 'robin, owl, penguin'], ['Fish', 'gills, scales, live in water', 'salmon, shark'], ['Reptiles', 'dry scaly skin, lay eggs', 'snake, lizard, tortoise'], ['Amphibians', 'moist skin, live in water and on land', 'frog, newt, toad']] },
    { h: 'Where this sits in the curriculum', body: 'Pupils sort and classify animals into these groups from Year 1, building towards more detailed classification in Year 6.' },
  ],
});

// ────────── Geography ──────────
_addArticle({
  slug: 'how-do-you-read-a-map', category: 'Geography', keystage: 'KS2',
  title: 'How do you read a map?',
  lead: 'A map is a drawing of an area seen from above. A key, a scale and compass directions help you understand what is there and how far apart things are.',
  sections: [
    { h: 'Map features', list: ['The key (or legend) explains what each symbol means.', 'The scale tells you how distance on the map relates to real distance.', 'A compass shows which way is north.', 'Grid lines and references help you describe an exact location.'] },
    { h: 'Where this sits in the curriculum', body: 'Map skills, including symbols, keys, compass directions and grid references, run through KS1 and KS2 geography.' },
  ],
});
_addArticle({
  slug: 'what-is-a-rainforest', category: 'Geography', keystage: 'KS2',
  title: 'What is a rainforest?',
  lead: 'A rainforest is a thick, green forest that gets a lot of rain and is home to more types of plant and animal than anywhere else on Earth.',
  sections: [
    { h: 'The four layers', examples: [['Emergent', 'the tallest trees poke out of the top', ''], ['Canopy', 'a thick roof of leaves and branches', ''], ['Understorey', 'shrubs and young trees in the shade', ''], ['Forest floor', 'dark and damp, where leaves rot down', '']] },
    { h: 'Why they matter', body: 'Rainforests make a great deal of the world\'s oxygen, store carbon, and are home to millions of species. The biggest is the Amazon in South America.' },
    { h: 'Where this sits in the curriculum', body: 'Tropical rainforests and climate zones are studied in KS2 geography.' },
  ],
});
_addArticle({
  slug: 'city-town-and-village', category: 'Geography', keystage: 'KS1',
  title: "What's the difference between a city, a town and a village?",
  lead: 'These are places where people live, sorted roughly by size. A village is small, a town is bigger, and a city is the largest.',
  sections: [
    { h: 'Side by side', examples: [['Village', 'small, few houses and shops', 'a church, a shop, a school'], ['Town', 'bigger, more shops and services', 'a high street, a market'], ['City', 'large and busy', 'often has a cathedral or city status']] },
    { h: 'A UK note', body: 'In the UK, a place becomes a city when it is given that status by the monarch. London, Manchester and Cardiff are cities.' },
    { h: 'Where this sits in the curriculum', body: 'Comparing places like these is part of the KS1 geography study of the local area and the wider UK.' },
  ],
});

// ────────── History ──────────
_addArticle({
  slug: 'who-were-the-tudors', category: 'History', keystage: 'KS2',
  title: 'Who were the Tudors?',
  lead: 'The Tudors were a royal family who ruled England from 1485 to 1603. The best known are King Henry VIII and his daughter Queen Elizabeth I.',
  sections: [
    { h: 'Key facts', list: ['The Tudor period began when Henry VII won the Battle of Bosworth in 1485.', 'Henry VIII had six wives and broke away from the Catholic Church in Rome.', 'Elizabeth I ruled for 45 years, a time of exploration and famous writers like Shakespeare.', 'It was the age of the first voyages to the Americas and the defeat of the Spanish Armada.'] },
    { h: 'Where this sits in the curriculum', body: 'The Tudors are a popular choice for a KS2 study of a period beyond 1066.' },
  ],
});
_addArticle({
  slug: 'what-happened-to-the-titanic', category: 'History', keystage: 'KS2',
  title: 'What happened to the Titanic?',
  lead: 'The Titanic was a huge passenger ship that sank in 1912 on its first voyage, after hitting an iceberg in the Atlantic Ocean. More than 1,500 people died.',
  sections: [
    { h: 'Key facts', list: ['It set sail from Southampton, in England, heading for New York.', 'It was thought to be almost unsinkable, but it struck an iceberg on 14 April 1912.', 'There were not enough lifeboats for everyone on board.', 'The wreck was found deep on the seabed in 1985.'] },
    { h: 'Where this sits in the curriculum', body: 'The Titanic is often used in KS1 and KS2 as a study of a significant event in the past.' },
  ],
});
_addArticle({
  slug: 'who-were-evacuees', category: 'History', keystage: 'KS2',
  title: 'Who were evacuees in World War Two?',
  lead: 'Evacuees were children moved out of British cities during World War Two to keep them safe from bombing. They went to live with families in the countryside.',
  sections: [
    { h: 'Key facts', list: ['From 1939, children were sent away from cities like London that were likely to be bombed.', 'They travelled by train with a label, a gas mask and a small case of belongings.', 'They stayed with host families, often far from home and away from their parents.', 'Many saw the countryside for the first time.'] },
    { h: 'Where this sits in the curriculum', body: 'Evacuation is a common focus within the KS2 study of World War Two and the home front.' },
  ],
});

// ────────── Computing ──────────
_addArticle({
  slug: 'what-is-an-input-and-output', category: 'Computing', keystage: 'KS2',
  title: 'What is an input and an output?',
  lead: 'An input is information going into a computer (what you put in). An output is what the computer produces in return (what comes out).',
  sections: [
    { h: 'Side by side', examples: [['Inputs', 'go into the computer', 'keyboard, mouse, microphone, camera'], ['Outputs', 'come out of the computer', 'screen, speakers, printer']] },
    { h: 'An everyday example', body: 'When you press a key (input), a letter appears on the screen (output). When you click "print" (input), the printer makes a page (output).' },
    { h: 'Where this sits in the curriculum', body: 'Inputs and outputs are part of understanding how computers and devices work, across KS1 and KS2 computing.' },
  ],
});
_addArticle({
  slug: 'how-does-a-search-engine-work', category: 'Computing', keystage: 'KS2',
  title: 'How does a search engine work?',
  lead: 'A search engine is a tool that helps you find websites. You type in what you are looking for, and it lists pages that match, with the most useful ones near the top.',
  sections: [
    { h: 'The quick answer', body: 'Search engines use programs to visit and list huge numbers of web pages. When you type a search, the engine looks through its list and ranks the pages it thinks are most helpful for your words.' },
    { h: 'Searching well', list: ['Use a few clear keywords rather than a whole long sentence.', 'Check more than one result, as the first is not always the best.', 'Remember that anyone can put information online, so think about whether a source can be trusted.'] },
    { h: 'Where this sits in the curriculum', body: 'How search engines select and rank results is named in the KS2 computing curriculum.' },
  ],
});

// ────────── RE ──────────
_addArticle({
  slug: 'what-is-sikhism', category: 'RE', keystage: 'KS2',
  title: 'What is Sikhism?',
  lead: 'Sikhism is a religion that began in the Punjab region about 500 years ago. Its followers are called Sikhs, who believe in one God and in treating everyone equally.',
  sections: [
    { h: 'Key beliefs', list: ['Sikhs believe in one God and that everyone is equal.', 'Their religion was started by Guru Nanak and shaped by ten Gurus in total.', 'Their holy book is the Guru Granth Sahib.', 'They worship in a building called a gurdwara, which serves a free shared meal called langar to anyone who comes.'] },
    { h: 'Where this sits in the curriculum', body: 'Sikhism is one of the major world religions studied in primary RE.' },
  ],
});
_addArticle({
  slug: 'what-is-buddhism', category: 'RE', keystage: 'KS2',
  title: 'What is Buddhism?',
  lead: 'Buddhism is a religion and way of life that began in India over 2,000 years ago, based on the teachings of the Buddha. It focuses on kindness, calm and not being greedy.',
  sections: [
    { h: 'Key beliefs', list: ['Buddhists follow the teachings of the Buddha, which means "the awakened one".', 'They try to live in a kind, peaceful and thoughtful way.', 'Many practise meditation to help train a calm mind.', 'They believe in reincarnation, the idea that life leads to rebirth.'] },
    { h: 'Where this sits in the curriculum', body: 'Buddhism is one of the major world religions explored in primary RE.' },
  ],
});


// ══════════════════════════════════════════════════════════════
// More articles (batch 5) — school calendar events
// ══════════════════════════════════════════════════════════════

_addArticle({
  slug: 'what-is-bonfire-night', category: 'History', keystage: 'KS1',
  title: 'What is Bonfire Night?',
  lead: 'Bonfire Night, on 5 November, is when people light bonfires and watch fireworks. It remembers the failed Gunpowder Plot of 1605.',
  sections: [
    { h: 'Why we mark it', list: ['In 1605, a group of plotters tried to blow up the Houses of Parliament.', 'Guy Fawkes was caught guarding the gunpowder on 5 November.', 'People lit bonfires to celebrate that the King was safe, and we have marked it ever since.'] },
    { h: 'Staying safe', body: 'Fireworks and sparklers are fun but can be dangerous, so schools often teach firework safety around this time.' },
    { h: 'Where this sits in the curriculum', body: 'Bonfire Night links to the KS1 and KS2 study of the Gunpowder Plot and significant events in the past.' },
  ],
});
_addArticle({
  slug: 'what-is-remembrance-day', category: 'History', keystage: 'KS2',
  title: 'What is Remembrance Day?',
  lead: 'Remembrance Day, on 11 November, is when we remember the people who died serving in wars. Many people wear a red poppy and hold a two-minute silence.',
  sections: [
    { h: 'Key facts', list: ['It marks the end of the First World War, which stopped at 11am on 11 November 1918.', 'People hold a two-minute silence at 11am.', 'The red poppy is the symbol of remembrance.', 'Remembrance Sunday, the nearest Sunday, is marked with services and parades.'] },
    { h: 'Why poppies', body: 'Poppies were among the first plants to grow on the battlefields after the First World War, which is why they became a symbol of remembrance.' },
    { h: 'Where this sits in the curriculum', body: 'Remembrance is often explored in KS2 history, alongside the World Wars.' },
  ],
});
_addArticle({
  slug: 'what-is-christmas', category: 'RE', keystage: 'KS1',
  title: 'What is Christmas?',
  lead: 'Christmas, on 25 December, is the Christian festival celebrating the birth of Jesus. It is also widely marked with presents, trees and time with family.',
  sections: [
    { h: 'The Christian story', body: 'Christians believe Jesus was born in a stable in Bethlehem. The story is retold in school nativity plays each year.' },
    { h: 'How it is celebrated', list: ['Decorating a Christmas tree and homes.', 'Giving and receiving presents.', 'Singing Christmas carols and attending church services.', 'Spending time with family and sharing a special meal.'] },
    { h: 'Where this sits in the curriculum', body: 'Christmas is studied in KS1 and KS2 RE as a major Christian festival.' },
  ],
});
_addArticle({
  slug: 'what-is-world-book-day', category: 'English', keystage: 'KS1',
  title: 'What is World Book Day?',
  lead: 'World Book Day is a yearly celebration of reading and books. In the UK it falls on the first Thursday in March.',
  sections: [
    { h: 'How schools mark it', list: ['Children often dress up as a favourite book character.', 'Schools share stories and run book swaps and reading activities.', 'Children are given a £1 book token to spend on a book.'] },
    { h: 'Why it matters', body: 'The day is all about the joy of reading, and helping every child find books they love.' },
    { h: 'Where this sits in the curriculum', body: 'World Book Day supports reading for pleasure across the whole primary school.' },
  ],
});
_addArticle({
  slug: 'what-is-pancake-day', category: 'RE', keystage: 'KS1',
  title: 'What is Pancake Day?',
  lead: 'Pancake Day, also called Shrove Tuesday, is the day before Lent begins. People traditionally make and eat pancakes.',
  sections: [
    { h: 'Why pancakes', body: 'Lent is a Christian period of giving things up. People used up rich foods like eggs, butter and milk by making pancakes the day before it started.' },
    { h: 'When it is', body: 'The date changes each year because it depends on the date of Easter. It always falls on a Tuesday in February or March.' },
    { h: 'Where this sits in the curriculum', body: 'Shrove Tuesday is studied in KS1 RE alongside Lent and Easter.' },
  ],
});
_addArticle({
  slug: 'what-is-lunar-new-year', category: 'RE', keystage: 'KS1',
  title: 'What is Lunar New Year?',
  lead: 'Lunar New Year, often called Chinese New Year, welcomes a new year in the lunar calendar. Each year is named after one of twelve animals.',
  sections: [
    { h: 'How it is celebrated', list: ['Families clean their homes and share special meals.', 'There are lion and dragon dances, lanterns and the colour red for good luck.', 'Children often receive money in red envelopes.', 'Each year has an animal, such as the dragon, snake or horse.'] },
    { h: 'When it is', body: 'The date changes each year, usually falling in late January or February.' },
    { h: 'Where this sits in the curriculum', body: 'Lunar New Year is explored in primary RE and as a celebration marked around the world.' },
  ],
});
_addArticle({
  slug: 'what-is-holi', category: 'RE', keystage: 'KS1',
  title: 'What is Holi?',
  lead: 'Holi is a Hindu festival known as the festival of colours. People throw brightly coloured powder and welcome the arrival of spring.',
  sections: [
    { h: 'How it is celebrated', list: ['People throw coloured powder and water over each other.', 'It celebrates the arrival of spring and good winning over evil.', 'Families share sweets and spend time together.'] },
    { h: 'Where this sits in the curriculum', body: 'Holi is studied in primary RE as a Hindu festival, alongside Diwali.' },
  ],
});
_addArticle({
  slug: 'what-is-eid', category: 'RE', keystage: 'KS1',
  title: 'What is Eid?',
  lead: 'Eid is the name of two important Muslim festivals: Eid al-Fitr, which ends the fasting month of Ramadan, and Eid al-Adha, the festival of sacrifice.',
  sections: [
    { h: 'The two Eids', list: ['Eid al-Fitr celebrates the end of Ramadan, the month of fasting.', 'Eid al-Adha, later in the year, is the festival of sacrifice.', 'Both are celebrated with prayers, new clothes, gifts and special meals with family.'] },
    { h: 'Where this sits in the curriculum', body: 'Eid is studied in primary RE alongside Ramadan and the beliefs of Islam.' },
  ],
});
_addArticle({
  slug: 'what-is-hanukkah', category: 'RE', keystage: 'KS1',
  title: 'What is Hanukkah?',
  lead: 'Hanukkah is a Jewish festival, also called the festival of lights. It lasts for eight nights, usually in December.',
  sections: [
    { h: 'How it is celebrated', list: ['A candle holder called a menorah is lit, with one more candle each night for eight nights.', 'Families play games with a spinning top called a dreidel.', 'People eat foods cooked in oil, such as doughnuts and potato cakes.', 'Children often receive small gifts.'] },
    { h: 'Where this sits in the curriculum', body: 'Hanukkah is studied in primary RE as an important Jewish festival.' },
  ],
});
_addArticle({
  slug: 'patron-saints-of-the-uk', category: 'History', keystage: 'KS2',
  title: 'Who are the patron saints of the UK?',
  lead: 'Each country of the UK has its own patron saint and special day: St George for England, St Andrew for Scotland, St David for Wales and St Patrick for Ireland.',
  sections: [
    { h: 'The four saints', examples: [['England', 'St George', '23 April'], ['Scotland', 'St Andrew', '30 November'], ['Wales', 'St David', '1 March'], ['Ireland', 'St Patrick', '17 March']] },
    { h: 'A little more', list: ['St George is often shown with a dragon.', 'St David is linked with the daffodil and the leek, symbols of Wales.', 'St Patrick is said to have brought Christianity to Ireland.', 'Each saint\'s day is marked with national symbols and celebrations.'] },
    { h: 'Where this sits in the curriculum', body: 'The countries, capitals and symbols of the UK, including patron saints, are part of KS2 geography and history.' },
  ],
});
_addArticle({
  slug: 'what-is-earth-day', category: 'Geography', keystage: 'KS1',
  title: 'What is Earth Day?',
  lead: 'Earth Day, on 22 April, is a day to celebrate the planet and to learn how to look after the environment.',
  sections: [
    { h: 'How it is marked', list: ['Schools learn about recycling, saving energy and protecting nature.', 'Some plant trees or take part in litter picks.', 'It is a chance to think about small changes that help the planet.'] },
    { h: 'Where this sits in the curriculum', body: 'Earth Day links to learning about the environment, habitats and looking after the world in science and geography.' },
  ],
});
_addArticle({
  slug: 'what-is-holocaust-memorial-day', category: 'History', keystage: 'KS2',
  title: 'What is Holocaust Memorial Day?',
  lead: 'Holocaust Memorial Day, on 27 January, remembers the millions of people murdered in the Holocaust during the Second World War, and the victims of more recent genocides.',
  sections: [
    { h: 'Key facts', list: ['It is held on 27 January, the day the Auschwitz camp was freed in 1945.', 'It remembers the six million Jewish people, and many others, killed by the Nazis.', 'It is a day to reflect, and to stand against hatred and prejudice today.'] },
    { h: 'A note for teachers', body: 'This is a sensitive topic, usually introduced carefully in upper KS2 in an age-appropriate way.' },
    { h: 'Where this sits in the curriculum', body: 'It links to the KS2 study of the Second World War and to learning about respect and difference.' },
  ],
});


// ══════════════════════════════════════════════════════════════
// More articles (batch 6) — calendar events that lacked a page
// ══════════════════════════════════════════════════════════════

_addArticle({
  slug: 'what-is-british-science-week', category: 'Science', keystage: 'KS2',
  title: 'What is British Science Week?',
  lead: 'British Science Week is a ten-day celebration of science, technology, engineering and maths, held each year in March with a new theme.',
  sections: [
    { h: 'How schools take part', list: ['Classes run hands-on experiments and investigations.', 'There is a yearly theme and a poster competition pupils can enter.', 'Some schools invite scientists in or take trips linked to science.'] },
    { h: 'Why it matters', body: 'It is a chance to show that science is everywhere and that anyone can be a scientist, sparking curiosity about how the world works.' },
    { h: 'Where this sits in the curriculum', body: 'It supports the whole primary science curriculum, especially working scientifically: asking questions, testing ideas and recording results.' },
  ],
});
_addArticle({
  slug: 'what-was-ve-day', category: 'History', keystage: 'KS2',
  title: 'What was VE Day?',
  lead: 'VE Day, on 8 May 1945, stands for Victory in Europe Day. It marked the end of the Second World War in Europe, when Germany surrendered.',
  sections: [
    { h: 'Key facts', list: ['It marked the end of nearly six years of war in Europe.', 'People celebrated in the streets with parties, flags and bonfires.', 'Church bells rang and crowds gathered, including outside Buckingham Palace.', 'The war continued elsewhere until later in 1945.'] },
    { h: 'Why we remember it', body: 'VE Day is remembered with services and street parties, especially on big anniversaries, to honour those who lived through and died in the war.' },
    { h: 'Where this sits in the curriculum', body: 'VE Day links to the KS2 study of the Second World War, including the home front and evacuation.' },
  ],
});
_addArticle({
  slug: 'what-is-valentines-day', category: 'History', keystage: 'KS1',
  title: "What is Valentine's Day?",
  lead: "Valentine's Day, on 14 February, is a day linked with friendship and love, when people send cards and kind messages to those they care about.",
  sections: [
    { h: 'Where it comes from', body: 'The day is named after St Valentine. Over time it became a day for sending cards, often signed in secret, to people we are fond of.' },
    { h: 'In primary schools', body: 'In school it is usually about kindness and friendship: writing kind notes, talking about caring for others and being a good friend.' },
    { h: 'Where this sits in the curriculum', body: 'It links to learning about friendship, kindness and feelings.' },
  ],
});
_addArticle({
  slug: 'what-is-international-womens-day', category: 'History', keystage: 'KS2',
  title: "What is International Women's Day?",
  lead: "International Women's Day, on 8 March, celebrates the achievements of women and girls around the world and calls for fair treatment for everyone.",
  sections: [
    { h: 'What it is about', list: ['It celebrates what women have achieved in science, sport, art, politics and more.', 'It is a chance to learn about inspiring women from history and today.', 'It reminds us that everyone should be treated fairly, whatever their gender.'] },
    { h: 'Women to discover', body: 'Schools often learn about figures such as Florence Nightingale, Rosa Parks, Marie Curie or Mary Anning around this day.' },
    { h: 'Where this sits in the curriculum', body: 'It links to the study of significant individuals in history and to learning about fairness and respect.' },
  ],
});
_addArticle({
  slug: 'what-is-burns-night', category: 'History', keystage: 'KS2',
  title: 'What is Burns Night?',
  lead: 'Burns Night, on 25 January, is a Scottish celebration of the poet Robert Burns. People mark it with poetry, music, dancing and traditional food.',
  sections: [
    { h: 'Who was Robert Burns', body: 'Robert Burns was a famous Scottish poet, born in 1759. He wrote in the Scots language, and his best-known song, "Auld Lang Syne", is sung around the world at New Year.' },
    { h: 'How it is celebrated', list: ['A special meal called a Burns Supper, with haggis, neeps and tatties (haggis, turnips and potatoes).', 'Reading and reciting Burns\'s poems.', 'Scottish music, bagpipes and dancing.'] },
    { h: 'Where this sits in the curriculum', body: 'Burns Night links to learning about poetry and about the countries and cultures of the UK.' },
  ],
});


window.WIKI_ARTICLES = WIKI_ARTICLES;

// ────────────────────────────────────────────────────────────────
// Index page
// ────────────────────────────────────────────────────────────────

// Calm, muted accent + one-line blurb per subject (oklch tones tuned to the palette).
const WIKI_CAT_META = {
  Maths:     { color: 'oklch(0.62 0.11 250)', blurb: 'Number, measurement, geometry and statistics.' },
  English:   { color: 'oklch(0.60 0.12 25)',  blurb: 'Grammar, punctuation and the words that trip pupils up.' },
  Science:   { color: 'oklch(0.58 0.10 155)', blurb: 'Living things, materials, forces and space.' },
  Geography: { color: 'oklch(0.60 0.09 215)', blurb: 'The world, its places and the processes that shape it.' },
  History:   { color: 'oklch(0.58 0.10 65)',  blurb: 'The people and periods of the primary curriculum.' },
  Computing: { color: 'oklch(0.55 0.10 305)', blurb: 'Algorithms, hardware and how programs work.' },
  RE:        { color: 'oklch(0.60 0.09 345)', blurb: 'Festivals and beliefs across different faiths.' },
};

// Lightweight article search: title / summary / category / keystage / section text.
function searchWikiArticles(query, articles) {
  const q = (query || '').trim().toLowerCase();
  if (!q) return [];
  const terms = q.split(/\s+/).filter(Boolean);
  const scored = [];
  for (const a of articles) {
    const title = a.title.toLowerCase();
    const summary = (a.summary || '').toLowerCase();
    const cat = a.category.toLowerCase();
    const ks = (a.keystage || '').toLowerCase().replace(/\s+/g, '');
    const body = (a.sections || []).map(s =>
      `${s.h || ''} ${s.body || ''} ${(s.list || []).join(' ')} ${(s.examples || []).flat().join(' ')}`
    ).join(' ').toLowerCase();

    let score = 0;
    const matched = terms.every(t => {
      const tt = t.replace(/\s+/g, '');
      let hit = false;
      if (title.includes(t)) { score += title.startsWith(t) ? 14 : 10; hit = true; }
      if (cat.includes(t)) { score += 7; hit = true; }
      if (summary.includes(t)) { score += 4; hit = true; }
      if (ks.includes(tt) && tt.length >= 2) { score += 3; hit = true; }
      if (body.includes(t)) { score += 2; hit = true; }
      return hit;
    });
    if (matched && score > 0) scored.push({ a, score });
  }
  scored.sort((x, y) => y.score - x.score || x.a.title.localeCompare(y.a.title));
  return scored.map(s => s.a);
}

function WikiArticleCard({ a, onOpenArticle, showCategory }) {
  const meta = WIKI_CAT_META[a.category] || {};
  return (
    <button
      onClick={() => onOpenArticle(a.slug)}
      className="card"
      style={{ textAlign: 'left', padding: 22, cursor: 'pointer', background: 'var(--surface)', display: 'flex', flexDirection: 'column', gap: 12, minHeight: 180 }}>
      <div style={{ display: 'flex', gap: 6, alignItems: 'center', flexWrap: 'wrap' }}>
        <span className={`pill ${a.keystage === 'KS1' ? 'pill-ks1' : 'pill-ks2'}`}>{a.keystage}</span>
        {showCategory && (
          <span className="pill" style={{ display: 'inline-flex', alignItems: 'center', gap: 6 }}>
            <span style={{ width: 7, height: 7, borderRadius: 999, background: meta.color || 'var(--accent)' }} />{a.category}
          </span>
        )}
        <span style={{ fontSize: 11.5, color: 'var(--fg-subtle)' }}>· {a.readTime} min read</span>
      </div>
      <h3 style={{ fontFamily: 'var(--font-serif)', fontWeight: 500, fontSize: 20, lineHeight: 1.22, letterSpacing: '-.012em', margin: 0, color: 'var(--fg)' }}>
        {a.title}
      </h3>
      <p style={{ fontSize: 13.5, color: 'var(--fg-muted)', lineHeight: 1.5, margin: 0, flex: 1 }}>{a.summary}</p>
      <div style={{ display: 'inline-flex', alignItems: 'center', gap: 6, fontSize: 13, fontWeight: 500, color: 'var(--gold-deep)' }}>
        Read article<Icon.ArrowRight width="13" height="13" />
      </div>
    </button>
  );
}

function WikiIndex({ onOpenArticle, onOpenLibrary }) {
  const { isMobile } = window.useViewport();
  const [query, setQuery] = React.useState('');
  const [open, setOpen] = React.useState({}); // { [category]: bool }, all collapsed by default
  const sectionRefs = React.useRef({});

  const grouped = React.useMemo(() => {
    const byCat = {};
    WIKI_ARTICLES.forEach(a => { (byCat[a.category] = byCat[a.category] || []).push(a); });
    return byCat;
  }, []);
  const cats = Object.keys(grouped);
  const total = WIKI_ARTICLES.length;

  const results = React.useMemo(() => searchWikiArticles(query, WIKI_ARTICLES), [query]);
  const searching = query.trim().length > 0;
  const allOpen = cats.length > 0 && cats.every(c => open[c]);

  function toggleCat(c) { setOpen(o => ({ ...o, [c]: !o[c] })); }
  function setAll(v) { const next = {}; if (v) cats.forEach(c => next[c] = true); setOpen(next); }
  function jumpToCat(c) {
    setOpen(o => ({ ...o, [c]: true }));
    requestAnimationFrame(() => {
      const el = sectionRefs.current[c];
      if (el) window.scrollTo({ top: el.getBoundingClientRect().top + window.scrollY - 76, behavior: 'smooth' });
    });
  }

  return (
    <main style={{ maxWidth: 1280, margin: '0 auto', padding: isMobile ? '36px 20px 70px' : '56px 48px 80px' }}>
      <div style={{ marginBottom: 28 }}>
        <div className="t-micro" style={{ color: 'var(--gold-deep)', marginBottom: 12 }}>Trove Wiki</div>
        <h1 style={{ fontFamily: 'var(--font-serif)', fontWeight: 700, fontSize: 'clamp(34px, 4.2vw, 50px)', letterSpacing: '-.024em', lineHeight: 1.1, margin: '0 0 12px' }}>
          Plain-English answers to the questions teachers actually get asked.
        </h1>
        <p style={{ fontSize: 17, color: 'var(--fg-muted)', lineHeight: 1.55, margin: 0 }}>
          {total} curriculum-aligned explainers across {cats.length} subjects, written by primary teachers, with no fluff. Free to read, always.
        </p>
      </div>

      {/* Search */}
      <div style={{ position: 'relative', marginBottom: 18 }}>
        <div style={{ position: 'absolute', left: 18, top: '50%', transform: 'translateY(-50%)', color: 'var(--fg-muted)', display: 'flex' }}>
          <Icon.Search width="20" height="20" />
        </div>
        <input
          value={query}
          onChange={(e) => setQuery(e.target.value)}
          placeholder='Search the wiki: "fronted adverbial", "prime number", "water cycle"…'
          aria-label="Search the wiki"
          className="wiki-search-input"
          style={{
            width: '100%', boxSizing: 'border-box',
            padding: '16px 48px 16px 50px',
            background: 'var(--surface)', border: '1px solid var(--border)',
            borderRadius: 16, color: 'var(--fg)', fontSize: 16, fontWeight: 500,
            fontFamily: 'inherit', outline: 0, boxShadow: 'var(--shadow-sm)',
          }}
        />
        {query && (
          <button
            onClick={() => setQuery('')}
            aria-label="Clear search"
            style={{ position: 'absolute', right: 12, top: '50%', transform: 'translateY(-50%)', background: 'transparent', border: 0, cursor: 'pointer', color: 'var(--fg-muted)', display: 'flex', padding: 6 }}>
            <Icon.X width="18" height="18" />
          </button>
        )}
      </div>

      {searching ? (
        /* ── Search results ── */
        <section>
          <div className="t-micro" style={{ color: 'var(--fg-subtle)', margin: '8px 0 16px' }}>
            {results.length} {results.length === 1 ? 'article matches' : 'articles match'} “{query.trim()}”
          </div>
          {results.length > 0 ? (
            <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fill, minmax(320px, 1fr))', gap: 16 }}>
              {results.map(a => (
                <WikiArticleCard key={a.slug} a={a} onOpenArticle={onOpenArticle} showCategory />
              ))}
            </div>
          ) : (
            <div style={{ padding: '40px 28px', textAlign: 'center', background: 'var(--bg-sunken)', border: '1px solid var(--border)', borderRadius: 'var(--radius-lg)' }}>
              <div style={{ fontFamily: 'var(--font-serif)', fontSize: 22, fontWeight: 500, marginBottom: 8 }}>No articles yet for that one.</div>
              <p style={{ fontSize: 14.5, color: 'var(--fg-muted)', margin: '0 auto 18px', maxWidth: 440, lineHeight: 1.55 }}>
                The wiki is still growing. Try a broader term, or a different spelling.
              </p>
            </div>
          )}
        </section>
      ) : (
        /* ── Browse by subject (collapsed accordions) ── */
        <React.Fragment>
          <div style={{ display: 'flex', alignItems: 'center', gap: 10, flexWrap: 'wrap', marginBottom: 22 }}>
            <div style={{ display: 'flex', gap: 8, flexWrap: 'wrap', flex: 1 }}>
              {cats.map(c => (
                <button key={c} onClick={() => jumpToCat(c)} className="pill" style={{ cursor: 'pointer', display: 'inline-flex', alignItems: 'center', gap: 7 }}>
                  <span style={{ width: 8, height: 8, borderRadius: 999, background: (WIKI_CAT_META[c] || {}).color || 'var(--accent)' }} />
                  {c}<span style={{ color: 'var(--fg-subtle)', fontWeight: 600 }}>{grouped[c].length}</span>
                </button>
              ))}
            </div>
            <button
              onClick={() => setAll(!allOpen)}
              style={{ background: 'transparent', border: 0, color: 'var(--gold-deep)', fontSize: 13, fontWeight: 600, cursor: 'pointer', whiteSpace: 'nowrap', padding: '6px 4px' }}>
              {allOpen ? 'Collapse all' : 'Expand all'}
            </button>
          </div>

          <div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
            {cats.map(cat => {
              const arts = grouped[cat];
              const meta = WIKI_CAT_META[cat] || {};
              const isOpen = !!open[cat];
              return (
                <section
                  key={cat}
                  ref={el => sectionRefs.current[cat] = el}
                  style={{ border: '1px solid var(--border)', borderRadius: 'var(--radius-lg)', background: 'var(--surface)', overflow: 'hidden', scrollMarginTop: 80 }}>
                  <button
                    onClick={() => toggleCat(cat)}
                    aria-expanded={isOpen}
                    style={{
                      width: '100%', display: 'flex', alignItems: 'center', gap: 16, textAlign: 'left',
                      padding: '20px 24px', background: 'transparent', border: 0, cursor: 'pointer',
                    }}
                    onMouseEnter={(e) => e.currentTarget.style.background = 'var(--bg-sunken)'}
                    onMouseLeave={(e) => e.currentTarget.style.background = 'transparent'}>
                    <span style={{ width: 12, height: 12, borderRadius: 999, background: meta.color || 'var(--accent)', flexShrink: 0 }} />
                    <div style={{ flex: 1, minWidth: 0 }}>
                      <div style={{ display: 'flex', alignItems: 'baseline', gap: 10 }}>
                        <h2 className="t-h2" style={{ margin: 0 }}>{cat}</h2>
                        <span style={{ fontSize: 13, color: 'var(--fg-subtle)', fontWeight: 600, whiteSpace: 'nowrap' }}>{arts.length} article{arts.length === 1 ? '' : 's'}</span>
                      </div>
                      <p style={{ fontSize: 13.5, color: 'var(--fg-muted)', margin: '3px 0 0' }}>{meta.blurb}</p>
                    </div>
                    <Icon.ChevronDown
                      width="20" height="20"
                      style={{ color: 'var(--fg-muted)', flexShrink: 0, transition: 'transform .2s', transform: isOpen ? 'rotate(180deg)' : 'none' }} />
                  </button>
                  {isOpen && (
                    <div className="fade-in" style={{ padding: '4px 24px 24px', borderTop: '1px solid var(--border)' }}>
                      <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fill, minmax(300px, 1fr))', gap: 16, marginTop: 20 }}>
                        {arts.map(a => (
                          <WikiArticleCard key={a.slug} a={a} onOpenArticle={onOpenArticle} />
                        ))}
                      </div>
                    </div>
                  )}
                </section>
              );
            })}
          </div>
        </React.Fragment>
      )}

      <div style={{ marginTop: 56, padding: '32px 36px', background: 'var(--bg-sunken)', border: '1px solid var(--border)', borderRadius: 'var(--radius-lg)', display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 24, flexWrap: 'wrap' }}>
        <div>
          <h3 className="t-h2" style={{ margin: '0 0 6px' }}>Need something for the whiteboard?</h3>
          <p style={{ fontSize: 14, color: 'var(--fg-muted)', margin: 0, maxWidth: 520 }}>Our interactive classroom tools are free to use, with no login. Number lines, place value charts, 100 squares and more.</p>
        </div>
        <a href={window.TOOLS_URL} className="btn btn-primary btn-lg" style={{ textDecoration: 'none' }}>Open Trove Tools<Icon.ArrowRight width="15" height="15" /></a>
      </div>
    </main>
  );
}

window.WikiIndex = WikiIndex;

// ────────────────────────────────────────────────────────────────
// Article page
// ────────────────────────────────────────────────────────────────
function WikiArticle({ slug, onOpenArticle, onOpenResource, onBack, onOpenWiki }) {
  const article = WIKI_ARTICLES.find(a => a.slug === slug);
  if (!article) return null;

  const relatedArts = (article.relatedSlugs || []).map(s => WIKI_ARTICLES.find(a => a.slug === s)).filter(Boolean);
  const relatedRes = (article.relatedResources || []).map(id => (window.RESOURCES || []).find(r => r.id === id)).filter(Boolean);

  // Build TOC from sections
  const toc = article.sections.map((s, i) => ({ id: `s-${i}`, h: s.h }));
  const { isTablet } = window.useViewport();

  return (
    <main style={{ maxWidth: 1280, margin: '0 auto', padding: isTablet ? '32px 20px 70px' : '40px 48px 80px' }}>
      {/* Crumb */}
      <div style={{ display: 'flex', alignItems: 'center', gap: 8, fontSize: 13, color: 'var(--fg-muted)', marginBottom: 24, flexWrap: 'wrap' }}>
        <button onClick={onOpenWiki} style={{ background: 'transparent', border: 0, padding: 0, color: 'var(--fg-muted)', cursor: 'pointer' }}>Wiki</button>
        <Icon.ChevronRight width="12" height="12" style={{ opacity: .5 }} />
        <span>{article.category}</span>
        <Icon.ChevronRight width="12" height="12" style={{ opacity: .5 }} />
        <span style={{ color: 'var(--fg)' }}>{article.title}</span>
      </div>

      {/* Mobile / tablet: collapsible jump-to menu instead of a side rail */}
      {isTablet && toc.length > 1 && (
        <details className="wiki-toc-mobile no-print" style={{ border: '1px solid var(--border)', borderRadius: 'var(--radius-lg)', background: 'var(--bg-sunken)', marginBottom: 24, overflow: 'hidden' }}>
          <summary style={{ listStyle: 'none', cursor: 'pointer', padding: '13px 16px', display: 'flex', alignItems: 'center', gap: 10, fontSize: 13.5, fontWeight: 700, letterSpacing: '.04em', textTransform: 'uppercase', color: 'var(--fg-subtle)' }}>
            <Icon.List width="16" height="16" />On this page
            <Icon.ChevronDown className="wiki-toc-chevron" width="16" height="16" style={{ marginLeft: 'auto', transition: 'transform .2s' }} />
          </summary>
          <nav style={{ display: 'flex', flexDirection: 'column', padding: '2px 8px 10px' }}>
            {toc.map(item => (
              <a key={item.id} href={`#${item.id}`}
                 onClick={(e) => { const el = e.currentTarget.closest('details'); if (el) el.open = false; }}
                 style={{ display: 'block', padding: '10px 12px', fontSize: 14.5, color: 'var(--fg-muted)', textDecoration: 'none', borderRadius: 8 }}>
                {item.h}
              </a>
            ))}
          </nav>
        </details>
      )}

      <div style={{ display: 'grid', gridTemplateColumns: isTablet ? '1fr' : '1fr 220px', gap: isTablet ? 0 : 56, alignItems: 'start' }}>
        <article style={{ minWidth: 0 }}>
          {/* Header */}
          <div style={{ display: 'flex', gap: 8, alignItems: 'center', marginBottom: 16 }}>
            <span className={`pill ${article.keystage === 'KS1' ? 'pill-ks1' : 'pill-ks2'}`}>{article.keystage}</span>
            <span className="pill">{article.category}</span>
            <span style={{ fontSize: 12.5, color: 'var(--fg-subtle)' }}>· {article.readTime} min read</span>
          </div>
          <h1 style={{ fontFamily: 'var(--font-serif)', fontWeight: 500, fontSize: 'clamp(32px, 3.8vw, 44px)', letterSpacing: '-.02em', lineHeight: 1.1, margin: '0 0 20px' }}>
            {article.title}
          </h1>

          {/* Featured snippet box */}
          <div style={{
            border: '1px solid var(--border)',
            borderLeft: '3px solid var(--accent)',
            background: 'var(--bg-sunken)',
            borderRadius: 'var(--radius-lg)',
            padding: '24px 28px',
            marginBottom: 36,
          }}>
            <div className="t-micro" style={{ color: 'var(--gold-deep)', marginBottom: 8 }}>Quick answer</div>
            <div style={{ fontSize: 17, lineHeight: 1.55, color: 'var(--fg)', marginBottom: article.snippet.formula ? 14 : 0 }}>
              {article.snippet.answer}
            </div>
            {article.snippet.formula && (
              <div style={{
                display: 'inline-block',
                padding: '8px 14px',
                background: 'var(--surface)',
                border: '1px solid var(--border)',
                borderRadius: 8,
                fontFamily: 'var(--font-mono)',
                fontSize: 14,
                color: 'var(--fg)',
                fontWeight: 500,
              }}>
                {article.snippet.formula}
              </div>
            )}
          </div>

          {/* Body sections */}
          {article.sections.map((s, i) => (
            <section key={i} id={`s-${i}`} style={{ marginBottom: 32, scrollMarginTop: 100 }}>
              <h2 style={{ fontFamily: 'var(--font-serif)', fontWeight: 500, fontSize: 24, letterSpacing: '-.014em', lineHeight: 1.2, margin: '0 0 14px' }}>{s.h}</h2>
              {s.body && <p style={{ fontSize: 16, lineHeight: 1.65, color: 'var(--fg)', margin: '0 0 14px', textWrap: 'pretty' }}>{s.body}</p>}
              {s.examples && (
                <div style={{ background: 'var(--bg-sunken)', borderRadius: 'var(--radius)', border: '1px solid var(--border)', overflow: 'hidden', margin: '8px 0 4px' }}>
                  {s.examples.map((row, ri) => (
                    <div key={ri} style={{
                      display: 'grid',
                      gridTemplateColumns: row.length === 3 ? '1fr 1.4fr 1fr' : '1fr 2fr',
                      gap: 16,
                      padding: '12px 18px',
                      borderTop: ri === 0 ? 0 : '1px solid var(--border)',
                      alignItems: 'center',
                    }}>
                      {row.map((cell, ci) => (
                        <div key={ci} style={{
                          fontFamily: ci === 0 || (row.length === 3 && ci === 1) ? 'var(--font-mono)' : 'inherit',
                          fontSize: 14,
                          color: ci === 0 ? 'var(--fg)' : ci === row.length - 1 ? 'var(--gold-deep)' : 'var(--fg-muted)',
                          fontWeight: ci === row.length - 1 ? 600 : 400,
                        }}>{cell}</div>
                      ))}
                    </div>
                  ))}
                </div>
              )}
              {s.list && (
                <ul style={{ margin: '8px 0 4px', padding: '0 0 0 22px', display: 'flex', flexDirection: 'column', gap: 10 }}>
                  {s.list.map((item, li) => (
                    <li key={li} style={{ fontSize: 16, lineHeight: 1.6, color: 'var(--fg)', textWrap: 'pretty' }}>{item}</li>
                  ))}
                </ul>
              )}
            </section>
          ))}

          {/* Related Library resources */}
          {relatedRes.length > 0 && (
            <section style={{ marginTop: 56, paddingTop: 32, borderTop: '1px solid var(--border)' }}>
              <div className="t-micro" style={{ color: 'var(--gold-deep)', marginBottom: 4 }}>Take it into the classroom</div>
              <h2 className="t-h2" style={{ margin: '0 0 18px' }}>Related Trove resources</h2>
              <div style={{ display: 'grid', gridTemplateColumns: 'repeat(auto-fill, minmax(220px, 1fr))', gap: 14 }}>
                {relatedRes.map(r => (
                  <button key={r.id} onClick={() => onOpenResource(r)} className="card" style={{ textAlign: 'left', padding: 14, cursor: 'pointer', display: 'flex', flexDirection: 'column', gap: 10, background: 'var(--surface)' }}>
                    <div style={{ aspectRatio: '4 / 3', borderRadius: 8, overflow: 'hidden', background: 'var(--bg-sunken)' }}>
                      <ResourceCover resource={r} />
                    </div>
                    <div style={{ display: 'flex', gap: 6, alignItems: 'center', flexWrap: 'wrap' }}>
                      <span className={`pill ${r.ks === 'KS1' ? 'pill-ks1' : 'pill-ks2'}`}>{r.year}</span>
                      <span style={{ fontSize: 11.5, color: 'var(--fg-subtle)' }}>{r.subject}</span>
                    </div>
                    <div style={{ fontSize: 13.5, fontWeight: 500, lineHeight: 1.35, color: 'var(--fg)' }}>{r.title}</div>
                  </button>
                ))}
              </div>
            </section>
          )}

          {/* Related articles */}
          {relatedArts.length > 0 && (
            <section style={{ marginTop: 40 }}>
              <h3 className="t-h3" style={{ margin: '0 0 14px', color: 'var(--fg-muted)' }}>Related articles</h3>
              <div style={{ display: 'flex', flexDirection: 'column', gap: 8 }}>
                {relatedArts.map(a => (
                  <button key={a.slug} onClick={() => onOpenArticle(a.slug)} style={{ textAlign: 'left', cursor: 'pointer', background: 'transparent', border: 0, padding: '10px 0', borderBottom: '1px solid var(--border)', display: 'flex', alignItems: 'center', justifyContent: 'space-between', gap: 16, color: 'var(--fg)' }}>
                    <span style={{ fontSize: 15, fontWeight: 500 }}>{a.title}</span>
                    <Icon.ArrowRight width="14" height="14" style={{ color: 'var(--gold-deep)' }} />
                  </button>
                ))}
              </div>
            </section>
          )}
        </article>

        {/* TOC sidebar (desktop only) */}
        {!isTablet && (
        <aside style={{ position: 'sticky', top: 88, alignSelf: 'start' }}>
          <div className="t-micro" style={{ color: 'var(--fg-subtle)', marginBottom: 12 }}>On this page</div>
          <nav style={{ display: 'flex', flexDirection: 'column', gap: 2, borderLeft: '1px solid var(--border)' }}>
            {toc.map(item => (
              <a key={item.id} href={`#${item.id}`} style={{ display: 'block', padding: '7px 14px', fontSize: 13, color: 'var(--fg-muted)', textDecoration: 'none', borderLeft: '2px solid transparent', marginLeft: -1 }}
                 onMouseEnter={(e) => { e.currentTarget.style.color = 'var(--fg)'; e.currentTarget.style.borderLeftColor = 'var(--accent)'; }}
                 onMouseLeave={(e) => { e.currentTarget.style.color = 'var(--fg-muted)'; e.currentTarget.style.borderLeftColor = 'transparent'; }}>
                {item.h}
              </a>
            ))}
          </nav>
        </aside>
        )}
      </div>
    </main>
  );
}

window.WikiArticle = WikiArticle;
