// Individual course pages — one per catalogue entry

const COURSE_DETAILS = {
  HLTAID009: {
    intro: 'HLTAID009 – Provide CPR is a nationally recognised unit for anyone who may need to start CPR before help arrives. In rural and remote areas, where an ambulance can be a long way off, those first minutes count.',
    renewalShort: '12 months recommended',
    overview: [
      'You’ll learn to recognise a cardiac emergency, follow the DRSABCD action plan and perform CPR on adults and infants, including chest compressions, rescue breaths and using an AED. Everything is practised hands-on in realistic scenarios.',
      'All training is delivered in accordance with Australian Resuscitation Council (ARC) guidelines.'
    ],
    sections: [
      { title: 'Course Delivery', body: ['This course can be delivered and assessed at your workplace or at a facility organised by the training provider.'] },
      { title: 'Course Duration',
        body: ['Durations can vary, so the times below are the minimum face-to-face contact time.'],
        list: [
          'Refresher – at least 1 hour 30 mins',
          'Blended – at least 1 hour 30 mins',
          'Face to face – at least 2 hours',
          'Online with face-to-face assessment – at least 20 mins'
        ],
        after: ['Online pre-course learning and theory assessment takes around 1.5 hours, depending on prior experience.'] },
      { title: 'Assessment Requirements',
        body: ['You’ll complete both written and practical assessment tasks. To take part, you’ll need:'],
        list: [
          'Official photo ID, such as a driver’s licence, passport or student ID',
          'Physical ability to perform CPR on the floor – this is required for an accredited certificate, with no exemptions',
          'Language, literacy, numeracy and digital skills to complete the course',
          'For online study: basic digital skills and a computer, smartphone or tablet with internet access'
        ] },
      { title: 'Assessment Activities',
        body: ['Practical tasks:'],
        list: [
          'Perform CPR on an adult (incl. using an AED and placing a casualty into the recovery position)',
          'Perform CPR on an infant'
        ],
        after: [
          'Theory assessment: a written assessment of multiple-choice questions.',
          'This course is delivered and assessed on behalf of Allens Training Pty Ltd RTO 90909'
        ] },
      { title: 'Certificate Renewal Requirements', body: ['This certificate has an industry recommended renewal period of 12 months.'] }
    ]
  },
  HLTAID010: {
    intro: [
      'HLTAID010 – Provide Basic Emergency Life Support is a nationally recognised unit that teaches you to assess an emergency and give immediate, life-saving care. You\u2019ll learn CPR for adults, children and infants, how to use an AED, and how to manage choking, severe bleeding, shock, asthma and anaphylaxis until help arrives. Everything is practised hands-on in realistic scenarios.',
      'Your certificate includes both HLTAID010 Provide basic emergency life support and HLTAID009 Provide CPR. All training is delivered in accordance with Australian Resuscitation Council (ARC) guidelines.'
    ],
    renewalShort: '36 months recommended',
    overview: [],
    sections: [
      { title: 'Course Delivery', body: ['This course can be delivered and assessed at your workplace or at a facility organised by the training provider.'] },
      { title: 'Course Duration',
        body: ['Durations can vary, so the times below are the minimum face-to-face contact time.'],
        list: [
          'Refresher – at least 3 hours',
          'Blended – at least 3 hours',
          'Face to face – at least 4 hours',
          'Online with face-to-face assessment – at least 35 mins'
        ],
        after: ['Online pre-course learning and theory assessment takes around 3 hours, depending on prior experience.'] },
      { title: 'Assessment Requirements',
        body: ['You’ll complete both written and practical assessment tasks. To take part, you’ll need:'],
        list: [
          'Official photo ID, such as a driver’s licence, passport or student ID',
          'Physical ability to perform CPR on the floor – this is required for an accredited certificate, with no exemptions',
          'Language, literacy, numeracy and digital skills to complete the course',
          'For online study: basic digital skills and a computer, smartphone or tablet with internet access'
        ] },
      { title: 'Assessment Activities',
        body: ['Practical tasks:'],
        list: [
          'Perform CPR on an adult (incl. using an AED and placing a casualty into the recovery position)',
          'Perform CPR on an infant',
          'Manage a casualty with anaphylaxis',
          'Manage a casualty with asthma',
          'Manage a choking casualty',
          'Manage a casualty with non-life-threatening bleeding and shock'
        ],
        after: [
          'Theory assessment: a written assessment of multiple-choice questions.',
          'This course is delivered and assessed on behalf of Allens Training Pty Ltd RTO 90909'
        ] },
      { title: 'Certificate Renewal Requirements', body: ['This certificate has an industry recommended renewal period of 36 months.'] }
    ]
  },
  HLTAID012: {
    intro: 'HLTAID012 – Provide First Aid in an Education and Care Setting is a nationally recognised course for educators, childcare workers, teachers and support staff. In rural and remote schools and early learning services, where help can be a long way off, staff need to be ready to care for a sick or injured child straight away.',
    renewalShort: '36 months recommended',
    overview: [
      'You’ll learn CPR and AED use for infants and children, and how to manage choking, asthma, allergic reactions and anaphylaxis, bleeding and nosebleeds, fractures, burns, and snake and spider bites. You’ll follow the DRSABCD action plan and practise hands-on in realistic scenarios.',
      'Your certificate includes HLTAID012, HLTAID011 Provide First Aid, HLTAID010 Provide basic emergency life support and HLTAID009 Provide CPR. All training is delivered in accordance with Australian Resuscitation Council (ARC) guidelines and education and care requirements.'
    ],
    sections: [
      { title: 'Course Delivery', body: ['This course can be delivered and assessed at your workplace or at a facility organised by the training provider.'] },
      { title: 'Course Duration',
        body: ['Durations can vary, so the times below are the minimum face-to-face contact time.'],
        list: [
          'Refresher – at least 7 hours',
          'Blended – at least 7 hours',
          'Face to face – at least 9 hours',
          'Online with face-to-face assessment – at least 1 hour'
        ],
        after: ['Online pre-course learning and theory assessment takes around 7 hours, depending on prior experience.'] },
      { title: 'Assessment Requirements',
        body: ['You’ll complete both written and practical assessment tasks. To take part, you’ll need:'],
        list: [
          'Official photo ID, such as a driver’s licence, passport or student ID',
          'Physical ability to perform CPR on the floor – this is required for an accredited certificate, with no exemptions',
          'Language, literacy, numeracy and digital skills to complete the course',
          'For online study: basic digital skills and a computer, smartphone or tablet with internet access'
        ] },
      { title: 'Assessment Activities',
        body: ['Practical tasks:'],
        list: [
          'Perform CPR on an adult (incl. using an AED and placing a casualty into the recovery position)',
          'Perform CPR on a child',
          'Perform CPR on an infant',
          'Manage a child with anaphylaxis',
          'Manage a child with asthma',
          'Manage a choking child and a choking infant',
          'Manage a child with non-life-threatening bleeding requiring minor wound cleaning',
          'Manage a child with shock',
          'Manage a child with a nosebleed',
          'Manage a child with a fracture and dislocation',
          'Manage a child with a sprain and strain',
          'Manage a child with envenomation (snake/ funnel-web spider bite)',
          'Complete a first aid incident report form based on the simulated scenario'
        ],
        after: [
          'Theory assessment: a written assessment of multiple-choice questions.',
          'This course is delivered and assessed on behalf of Allens Training Pty Ltd RTO 90909'
        ] },
      { title: 'Certificate Renewal Requirements', body: ['This certificate has an industry recommended renewal period of 36 months.'] }
    ]
  },
  HLTAID014: {
    intro: 'HLTAID014 – Provide Advanced First Aid is a nationally recognised course for first aid officers, team leaders and anyone working in higher-risk settings like mine sites, stations, construction and remote workplaces. When an ambulance or retrieval is hours away, you’ll be the one managing the scene and keeping casualties stable.',
    renewalShort: '36 months recommended',
    overview: [
      'You’ll learn to manage complex emergencies, including airway obstruction, life-threatening bleeding and severe trauma, heart attack, stroke and anaphylaxis, as well as fractures, burns and spinal injuries. You’ll also practise using an AED, coordinating a multiple casualty incident, working with emergency services and maintaining care until help arrives.',
      'Your certificate includes HLTAID014, HLTAID011 Provide First Aid, HLTAID010 Provide basic emergency life support and HLTAID009 Provide CPR. All training is delivered in accordance with Australian Resuscitation Council (ARC) guidelines.'
    ],
    sections: [
      { title: 'Course Delivery', body: ['This course can be delivered and assessed at your workplace or at a facility organised by the training provider.'] },
      { title: 'Course Duration',
        body: ['Durations can vary, so the times below are the minimum face-to-face contact time.'],
        list: [
          'Face to face – at least 16 hours',
          'Online with face-to-face assessment – at least 6 hours'
        ],
        after: ['Online pre-course learning and theory assessment takes around 6 hours, depending on prior experience.'] },
      { title: 'Assessment Requirements',
        body: ['You’ll complete both written and practical assessment tasks. To take part, you’ll need:'],
        list: [
          'Official photo ID, such as a driver’s licence, passport or student ID',
          'Physical ability to perform CPR on the floor – this is required for an accredited certificate, with no exemptions',
          'Language, literacy, numeracy and digital skills to complete the course, including recording what happened and passing information to emergency services',
          'For online study: basic digital skills and a computer, smartphone or tablet with internet access'
        ] },
      { title: 'Assessment Activities',
        body: ['Practical tasks:'],
        list: [
          'Perform CPR on an adult (incl. using an AED and placing a casualty into the recovery position)',
          'Perform CPR on an infant',
          'Manage a casualty with anaphylaxis',
          'Manage a casualty with asthma',
          'Manage a choking casualty',
          'Manage a casualty with non-life-threatening bleeding requiring minor wound cleaning',
          'Manage a casualty with a nosebleed',
          'Manage a casualty with a fracture and dislocation',
          'Manage a casualty with a sprain and strain',
          'Manage a casualty with envenomation (snake/ funnel-web spider bite)',
          'Manage a casualty with a life-threatening bleed and shock',
          'Coordinate a multiple casualty incident',
          'Complete first aid incident report forms for the adult CPR and life-threatening bleed scenarios'
        ],
        after: [
          'Theory assessment: a written assessment of multiple-choice questions.',
          'This course is delivered and assessed on behalf of Allens Training Pty Ltd RTO 90909'
        ] },
      { title: 'Certificate Renewal Requirements', body: ['This certificate has an industry recommended renewal period of 36 months.'] }
    ]
  },
  PUAEME007: {
    intro: 'PUAEME007 – Provide Emergency Care for Suspected Spinal Injury is a nationally recognised unit that teaches you to protect the spine and keep a casualty safe until medical help arrives. Out on stations, worksites, sports grounds and waterways, where a fall, vehicle rollover or horse or quad bike accident can be hours from a hospital, getting this right matters.',
    renewalShort: 'Not required',
    overview: [
      'You’ll learn to assess for a possible spinal injury, stabilise the spine, keep the airway open without moving the neck, and safely handle, immobilise and move a casualty away from danger using spinal equipment. You’ll also practise communicating with the casualty and working as a team.'
    ],
    sections: [
      { title: 'Course Delivery', body: ['This course can be delivered and assessed at your workplace or at a facility organised by the training provider.'] },
      { title: 'Course Duration',
        body: ['Durations can vary, so the times below are the minimum face-to-face contact time.'],
        list: [
          'Face to face – at least 5 hours',
          'Online with face-to-face assessment – at least 2 hours'
        ] },
      { title: 'Assessment Requirements',
        body: ['You’ll complete both written and practical assessment tasks. To take part, you’ll need:'],
        list: [
          'A current HLTAID011 Provide First Aid (prerequisite)',
          'Official photo ID, such as a driver’s licence, passport or student ID',
          'Physical ability to perform manual in-line stabilisation, kneel on the floor for a team log roll, help a casualty onto their back, and use equipment to immobilise and move a casualty',
          'Slip-resistant or safety footwear and comfortable, practical clothing for the practical sessions',
          'Language, literacy, numeracy and digital skills to complete the course',
          'For online study: basic digital skills and a computer, smartphone or tablet with internet access'
        ] },
      { title: 'Assessment Activities',
        body: ['Practical scenarios:'],
        list: [
          'Assist a conscious casualty with suspected spinal injury into a supine position',
          'Manage an unconscious, breathing casualty with suspected spinal injury',
          'Manage an unconscious, non-breathing casualty with suspected spinal injury',
          'Complete an incident report'
        ],
        after: [
          'Theory assessment: a written assessment of multiple-choice questions.',
          'This course is delivered and assessed on behalf of Allens Training Pty Ltd RTO 90909'
        ] },
      { title: 'Certificate Renewal Requirements', body: ['This certificate does not require renewal.'] }
    ]
  },
  UETDRMP018: {
    intro: 'UETDRMP018 – Perform Rescue from a Live Low Voltage Panel is a nationally recognised unit for electricians, electrical workers, contractors and safety observers. On remote sites, mines and stations, the person standing next to you is the rescue plan, so you need to know how to get someone off a live panel safely and keep them alive until help arrives.',
    renewalShort: '12 months recommended',
    overview: [
      'You’ll learn to assess the risks, inspect and position your LVR kit, use safety equipment correctly and perform a rescue from a live LV panel using safe work practices. The course also covers CPR, delivered in accordance with Australian Resuscitation Council (ARC) guidelines.'
    ],
    sections: [
      { title: 'Course Delivery', body: ['This course can be delivered and assessed at your workplace or at a facility organised by the training provider.'] },
      { title: 'Course Duration',
        body: ['Durations can vary, so the times below are the minimum face-to-face contact time.'],
        list: [
          'Refresher – at least 2 hours',
          'Face to face – at least 3 hours',
          'Online with face-to-face assessment – at least 30 mins'
        ],
        after: ['Online pre-course learning and theory assessment takes around 2 hours, depending on prior experience.'] },
      { title: 'Assessment Requirements',
        body: ['You’ll complete both written and practical assessment tasks. To take part, you’ll need:'],
        list: [
          'Official photo ID, such as a driver’s licence, passport or student ID',
          'Physical ability to meet the practical demands, including CPR',
          'Language, literacy, numeracy and digital skills to complete the course, including reading safety labels and voltages',
          'For online study: basic digital skills and a computer, smartphone or tablet with internet access'
        ] },
      { title: 'Assessment Activities',
        body: ['Practical tasks:'],
        list: [
          'Inspect and position LVR kit and equipment',
          'Simulated scenario: perform a rescue from a live LV panel'
        ],
        after: [
          'Theory assessment: a written assessment of multiple-choice questions.',
          'This course is delivered and assessed on behalf of Allens Training Pty Ltd RTO 90909'
        ] },
      { title: 'Certificate Renewal Requirements', body: ['This certificate has an industry recommended renewal period of 12 months.'] }
    ]
  },
  '11244NAT': {
    intro: '11244NAT – Course in Mental Health Support for First Responders is a nationally recognised course for emergency services, volunteers, police, paramedics, firefighters and anyone first on scene. In small rural and remote communities, responders often know the people they’re helping, and support can be hard to reach, so looking after yourself and your crew matters.',
    renewalShort: 'Not required',
    overview: [
      'You’ll learn to recognise signs of stress, anxiety, PTSD and depression, build resilience and self-care, start a conversation about mental health, support a colleague through a concern or crisis, and connect them with professional help.',
      'Your certificate includes 11244NAT, NAT11244001 Develop knowledge of mental health support for first responders and NAT11244002 Provide mental health support for first responders.'
    ],
    sections: [
      { title: 'Course Delivery', body: ['This course can be delivered and assessed at your workplace or at a facility organised by the training provider.'] },
      { title: 'Course Duration',
        list: [
          'Face to face – 6 hours',
          'Online with face-to-face delivery – 90 mins face to face'
        ] },
      { title: 'Assessment Requirements',
        body: ['You’ll complete both written and practical assessment tasks. To take part, you’ll need:'],
        list: [
          'Communication skills to take part in discussion and understand mental health concepts',
          'For online study: a computer, smartphone, tablet or other device with internet access'
        ] },
      { title: 'Assessment Activities',
        body: ['Practical tasks:'],
        list: [
          'Case study: demonstrate an understanding of mental health',
          'Scenario: provide support for a mental health concern',
          'Scenario: provide support for a mental health crisis'
        ],
        after: [
          'Theory assessment: multiple-choice and short answer questions.',
          'This course is delivered and assessed on behalf of Allens Training Pty Ltd RTO 90909'
        ] },
      { title: 'Certificate Renewal Requirements', body: ['This certificate does not require renewal.'] }
    ]
  },
  '11124NAT': {
    intro: '11124NAT – Course in Safe Handling of Sharps and Infectious Waste is a nationally recognised course for anyone who may come across needles, syringes or infectious waste at work, including remote clinics, aged care, cleaning, community services and waste management.',
    renewalShort: 'Not required',
    overview: [
      'You’ll learn to safely pick up, transport and dispose of sharps and infectious waste, use PPE correctly, apply infection control, complete a risk assessment and manage a needlestick injury. Theory is combined with hands-on practice.',
      'Your certificate includes 11124NAT and NAT11124001 Remove sharps and infectious waste safely.'
    ],
    sections: [
      { title: 'Course Delivery', body: ['This course can be delivered and assessed at your workplace or at a facility organised by the training provider.'] },
      { title: 'Course Duration',
        body: ['Durations can vary, so the times below are the minimum face-to-face contact time.'],
        list: [
          'Refresher – at least 2 hours 30 mins',
          'Face to face – at least 4 hours',
          'Online with face-to-face assessment – at least 1 hour'
        ] },
      { title: 'Assessment Requirements',
        body: ['You’ll complete both written and practical assessment tasks. To take part, you’ll need:'],
        list: [
          'Official photo ID, such as a driver’s licence, passport or student ID',
          'Physical ability to complete the practical demonstration',
          'Language, literacy, numeracy and digital skills to complete the course',
          'For online study: basic digital skills and a computer, smartphone or tablet with internet access'
        ] },
      { title: 'Assessment Activities',
        body: ['Practical tasks:'],
        list: [
          'Basic disposal of a single exposed sharp',
          'Complex disposal of multiple exposed sharps and management of a needlestick injury',
          'Disposal of infectious waste',
          'Complete a risk assessment'
        ],
        after: [
          'Theory assessment: a written assessment of multiple-choice questions.',
          'This course is delivered and assessed on behalf of Allens Training Pty Ltd RTO 90909'
        ] },
      { title: 'Certificate Renewal Requirements', body: ['This certificate does not require renewal.'] }
    ]
  },
  HLTAID011: {
    intro: 'HLTAID011 – Provide First Aid is a nationally recognised unit that gives you the skills and confidence to respond to injuries, illnesses and emergencies. In rural and remote areas, where help can be a long way off, it combines theory with hands-on practice so you’re ready to act quickly and effectively when it matters.',
    overview: [
      'You’ll learn to assess an emergency scene, manage casualties and follow the DRSABCD action plan. Practical skills include CPR, using an AED, and treating bleeding, wounds, burns, fractures and sprains. The course also covers allergic reactions, asthma and shock.',
      'HLTAID011 is required under many workplace health and safety standards and suits workplaces, schools, sports clubs, community groups and anyone who wants to be prepared. All training follows Australian Resuscitation Council (ARC) guidelines.'
    ],
    sections: [
      { title: 'Course Delivery', body: ['This course can be delivered and assessed at your workplace or at a facility organised by the training provider.'] },
      { title: 'Course Duration',
        body: ['Durations can vary, so the times below are the minimum face-to-face contact time.'],
        list: [
          'Refresher – at least 6 hours',
          'Blended – at least 6 hours',
          'Face to face – at least 7 hours 30 mins',
          'Online with face-to-face assessment – at least 1 hour'
        ],
        after: ['Full face-to-face delivery (instead of blended online learning) requires a minimum of five participants per session.'] },
      { title: 'Assessment Requirements',
        body: ['You’ll complete both written and practical assessment tasks. To take part, you’ll need:'],
        list: [
          'Physical ability to perform 2 minutes of uninterrupted CPR on the floor and rescue breathing on manikins',
          'For online study: a computer, smartphone or tablet with internet access'
        ] },
      { title: 'Assessment Activities',
        body: ['Practical tasks:'],
        list: [
          'Perform CPR on an adult (incl. using an AED and placing a casualty into the recovery position)',
          'Perform CPR on an infant',
          'Manage a casualty with anaphylaxis',
          'Manage a casualty with asthma',
          'Manage a choking casualty',
          'Manage a casualty with non-life-threatening bleeding and shock, requiring minor wound cleaning',
          'Manage a casualty with a nosebleed',
          'Manage a casualty with a fracture and dislocation',
          'Manage a casualty with a sprain and strain',
          'Manage a casualty with envenomation (snake/ funnel-web spider bite)',
          'Complete a first aid incident report form based on the simulated scenario'
        ],
        after: [
          'Theory assessment: a written assessment of multiple-choice questions.',
          'This course is delivered and assessed on behalf of Allens Training Pty Ltd RTO 90909'
        ] },
      { title: 'Certificate Renewal Requirements', body: ['This certificate has an industry recommended renewal period of 36 months.'] }
    ]
  }
};

const courseText = { fontFamily: 'var(--font-body)', fontSize: 17, lineHeight: 1.7, color: 'var(--stone)', margin: 0, maxWidth: '68ch', textWrap: 'pretty' };

const goToCatalogue = () => {
  window.navigateTo('services');
  setTimeout(() => {
    const el = document.getElementById('catalogue');
    if (el) window.scrollTo({ top: el.getBoundingClientRect().top + window.scrollY - 80, behavior: 'instant' });
  }, 60);
};

const CourseSection = ({ title, body = [], list, after = [] }) => (
  <details className="course-acc">
    <summary>
      <h2 style={{ fontFamily: 'var(--font-display)', fontWeight: 400, fontSize: 'clamp(22px, 2vw, 28px)', lineHeight: 1.15, color: 'var(--char)', margin: 0 }}>{title}</h2>
      <span className="pp-acc__plus" aria-hidden="true" style={{ color: 'var(--pindan-red)', width: 20, height: 20 }}></span>
    </summary>
    <div className="course-acc__body">
    {body.map((p, i) => <p key={i} style={courseText}>{p}</p>)}
    {list && (
      <ul style={{ display: 'grid', gap: 10, margin: 0, padding: 0, listStyle: 'none', maxWidth: '68ch' }}>
        {list.map((li, i) => (
          <li key={i} style={{ display: 'grid', gridTemplateColumns: '18px minmax(0, 1fr)', gap: 12, alignItems: 'start', ...courseText }}>
            <span style={{ width: 8, height: 8, marginTop: 10, background: 'var(--pindan-red)', borderRadius: 1 }}></span>
            <span>{li}</span>
          </li>
        ))}
      </ul>
    )}
    {after.map((p, i) => <p key={i} style={courseText}>{p}</p>)}
    </div>
  </details>
);

const CoursePage = ({ code }) => {
  const course = (window.COURSE_CATALOGUE || []).find(c => c.code === code) || { code, name: '' };
  const d = COURSE_DETAILS[code];
  const renewal = d && d.sections.find(s => s.title === 'Certificate Renewal Requirements');
  return (
    <>
      <section style={{ background: 'var(--bone-deep)', padding: '56px 0 72px', borderBottom: '1px solid var(--border-strong)' }}>
        <Container>
          <a href="#services" onClick={(e) => { e.preventDefault(); goToCatalogue(); }} style={{
            fontFamily: 'var(--font-body)', fontSize: 14, fontWeight: 600, color: 'var(--pindan-red)',
            textDecoration: 'none', display: 'inline-flex', alignItems: 'center', gap: 8, marginBottom: 40
          }}>
            <span style={{ display: 'inline-flex', transform: 'rotate(180deg)' }}><Icon name="arrow-right" size={14} color="var(--pindan-red)" /></span>
            All courses
          </a>
          <div>
            <div style={{ display: 'flex', flexDirection: 'column', gap: 24, maxWidth: 820 }}>
              <span style={{ fontFamily: 'var(--font-mono)', fontSize: 14, letterSpacing: '0.06em', color: 'var(--pindan-red)' }}>{course.code}</span>
              <h1 style={{ fontFamily: 'var(--font-display)', fontWeight: 400, fontSize: 'clamp(40px, 5vw, 68px)', lineHeight: 1.0, letterSpacing: '-0.015em', color: 'var(--char)', margin: 0, maxWidth: '18ch' }}>{course.name}</h1>
              {(d ? [].concat(d.intro, d.overview || []) : [course.desc]).map((p, i) => <p key={i} style={{ ...courseText, fontSize: 18, color: 'var(--char)' }}>{p}</p>)}
              <div style={{ display: 'flex', gap: 12, flexWrap: 'wrap' }}>
                <Button variant="flare" size="lg" onClick={() => window.navigateTo('contact')}>
                  Book Now
                  <Icon name="arrow-right" size={16} />
                </Button>
              </div>
            </div>
          </div>
        </Container>
      </section>

      <section style={{ background: 'var(--bone)', padding: '64px 0 120px' }}>
        <Container>
          {d ? (
            <div className="grid-2" style={{ display: 'grid', gridTemplateColumns: 'minmax(0, 1fr) 320px', gap: 72, alignItems: 'start' }}>
              <div style={{ display: 'flex', flexDirection: 'column', gap: 24 }}>
                <div style={{ display: 'flex', alignItems: 'center', gap: 16 }}>
                  <span aria-hidden="true" style={{ width: 40, height: 2, background: 'var(--pindan-red)' }}></span>
                  <h2 style={{ fontFamily: 'var(--font-body)', fontSize: 12, fontWeight: 700, letterSpacing: '0.16em', textTransform: 'uppercase', color: 'var(--pindan-red)', margin: 0 }}>Course details</h2>
                </div>
                <div style={{ borderBottom: '1px solid var(--border-strong)' }}>
                  {d.sections.map(s => <CourseSection key={s.title} {...s} />)}
                </div>
              </div>
              <aside style={{ position: 'sticky', top: 120, background: 'var(--char)', color: 'var(--bone)', borderRadius: 6, padding: 32, display: 'flex', flexDirection: 'column', gap: 20 }}>
                <span style={{ fontFamily: 'var(--font-mono)', fontSize: 12, letterSpacing: '0.08em', color: 'var(--pindan-flare)' }}>{course.code}</span>
                <div style={{ fontFamily: 'var(--font-display)', fontSize: 26, lineHeight: 1.1 }}>{course.name}</div>
                <div style={{ display: 'grid', gap: 14, paddingTop: 20, borderTop: '1px solid var(--border-dark)' }}>
                  {[
                    ['Delivery', 'At your workplace or a training facility'],
                    ['Recognition', 'Nationally recognised · Allens Training Pty Ltd RTO 90909'],
                    renewal ? ['Renewal', d.renewalShort || '36 months recommended'] : null
                  ].filter(Boolean).map(([k, v]) => (
                    <div key={k} style={{ display: 'grid', gap: 4 }}>
                      <span style={{ fontFamily: 'var(--font-body)', fontSize: 11, fontWeight: 700, letterSpacing: '0.14em', textTransform: 'uppercase', color: 'var(--fg-on-dark2)' }}>{k}</span>
                      <span style={{ fontFamily: 'var(--font-body)', fontSize: 15, lineHeight: 1.45, color: 'var(--bone)' }}>{v}</span>
                    </div>
                  ))}
                </div>
                <Button variant="flare" onClick={() => window.navigateTo('contact')} style={{ justifyContent: 'center' }}>
                  Book Now
                  <Icon name="arrow-right" size={14} />
                </Button>
              </aside>
            </div>
          ) : (
            <p style={courseText}>Full course details coming soon. Get in touch to ask about this course.</p>
          )}
        </Container>
      </section>
    </>
  );
};

Object.assign(window, { CoursePage, COURSE_DETAILS });
