<?php
$rules = current_lang() === 'id'
    ? [
        [
            'letter' => 'A.',
            'title' => 'Pendaftaran & Kelayakan',
            'items' => [
                'Peserta minimal berusia 17 tahun pada hari lomba untuk kategori 9K.',
                'Peserta minimal berusia 15 tahun pada hari lomba untuk kategori 7K.',
                'Pendaftaran tidak dapat dikembalikan dan tidak dapat dipindahtangankan setelah dikonfirmasi.',
                'Peserta wajib memberikan informasi pribadi dan medis yang akurat saat pendaftaran.',
                'Penyelenggara berhak menolak atau membatalkan pendaftaran tanpa pemberitahuan sebelumnya jika peserta melanggar kriteria kelayakan.',
                'Semua peserta wajib menandatangani formulir waiver/disclaimer sebelum mengambil race kit.',
                'Kategori Pelajar hanya berlaku bagi peserta aktif tingkat SMP-SMA sederajat. Peserta wajib menunjukkan kartu pelajar atau identitas resmi yang masih berlaku pada saat registrasi atau pengambilan race pack.',
            ],
        ],
        [
            'letter' => 'B.',
            'title' => 'Perlengkapan Wajib',
            'items' => [
                [
                    'text' => 'Semua pelari wajib membawa perlengkapan berikut selama lomba:',
                    'children' => [
                        'Race bib yang terlihat jelas dan tidak diubah',
                        'Ponsel terisi penuh dengan nomor darurat tersimpan',
                    ],
                ],
               ],
        ],
        [
            'letter' => 'C.',
            'title' => 'Nomor Bib & Pencatatan Waktu',
            'items' => [
                'Race bib wajib dipakai di bagian depan tubuh dan terlihat jelas setiap saat.',
                'Bib tidak boleh dilipat, dipotong, atau diubah sehingga menutupi nomor atau chip timing.',
                'Waktu resmi lomba dimulai dari gun start, bukan chip time.',
            ],
        ],
        [
            'letter' => 'D.',
            'title' => 'Aturan Pacer dan Crew Support',
            'items' => [
                'Crew/support team hanya diperbolehkan di aid station dan checkpoint yang ditentukan.',
                'Kendaraan bermotor, sepeda, atau pelari yang tidak terdaftar tidak boleh mendampingi peserta di jalur.',
            ],
        ],
        [
            'letter' => 'E.',
            'title' => 'Checkpoint & Cut-off Time',
            'items' => [
                'Semua pelari wajib check-in di setiap checkpoint sepanjang rute.',
                'Cut-off time berlaku di setiap checkpoint. Pelari yang tiba melewati cut-off akan dihentikan dari lomba.',
                'Keputusan cut-off oleh marshal bersifat <strong>final dan tidak dapat dinegosiasikan</strong>.',
                ],
        ],
        [
            'letter' => 'F.',
            'title' => 'Protokol Did Not Finish (DNF)',
            'items' => [
                'Pelari yang ingin mengundurkan diri wajib memberi tahu marshal atau petugas checkpoint terdekat.',
                'Pelari DNF wajib menyerahkan bib dan menunggu evakuasi di checkpoint terdekat. Jangan meninggalkan jalur tanpa pendampingan.',
                'Pelari yang meninggalkan lomba tanpa memberi tahu petugas dapat dilarang mengikuti event berikutnya.',
            ],
        ],
        [
            'letter' => 'G.',
            'title' => 'Pengajuan Protes',
            'items' => [
                'Protes wajib diajukan secara tertulis kepada Race Director maksimal 60 menit setelah hasil resmi dipublikasikan.',
                'Biaya protes sebesar IDR 100.000 diperlukan dan dapat dikembalikan jika protes diterima.',
                'Keputusan Race Director atas semua protes bersifat final.',
            ],
        ],
        [
            'letter' => 'H.',
            'title' => 'Tanggung Jawab Lingkungan & Etika Jalur',
            'items' => [
                'Lomba menerapkan kebijakan <strong>Leave No Trace</strong>. Semua sampah pribadi wajib dibawa hingga titik sampah yang disediakan.',
                'Membuang sampah di jalur akan menyebabkan diskualifikasi langsung.',
                'Pelari wajib tetap berada di jalur yang ditandai. Memotong jalur melalui vegetasi atau area terlarang tidak diperbolehkan.',
                'Hormati satwa liar, masyarakat lokal, dan pengguna jalur lainnya.',
            ],
        ],
        [
            'letter' => 'I.',
            'title' => 'Medis dan Keselamatan',
            'items' => [
                'Tim medis akan ditempatkan di semua checkpoint dan titik penting sepanjang rute.',
                'Pelari wajib berhenti dan membantu peserta lain yang terlihat dalam kondisi darurat sampai marshal tiba.',
                'Race Medical Officer berwenang menghentikan pelari dari lomba demi alasan kesehatan dan keselamatan. Keputusan ini bersifat final.',
                'Peserta dengan kondisi medis sebelumnya wajib menyatakannya saat pendaftaran.',
            ],
        ],
        [
            'letter' => 'J.',
            'title' => 'Asuransi Pribadi & Evakuasi',
            'items' => [
                'Semua peserta sangat disarankan memiliki asuransi olahraga/kecelakaan pribadi.',
                'Penyelenggara menyediakan layanan medis dasar di lokasi, tetapi tidak bertanggung jawab atas biaya evakuasi, rawat inap, atau perawatan lanjutan.',
                'Evakuasi dari area terpencil dapat melibatkan helikopter atau tim penyelamat khusus. Biaya dapat dibebankan kepada peserta jika tidak ditanggung asuransi.',
                'Peserta dengan kondisi medis yang sudah ada sebelumnya wajib menyatakannya saat pendaftaran.',
            ],
        ],
        [
            'letter' => 'K.',
            'title' => 'Kode Etik',
            'items' => [
                'Semua peserta wajib bersikap hormat kepada marshal, relawan, tenaga medis, dan sesama pelari.',
                'Perilaku agresif, pelecehan verbal, atau tindakan tidak sportif akan menyebabkan diskualifikasi langsung dan potensi larangan mengikuti event berikutnya.',
                'Penggunaan zat peningkat performa dilarang keras.',
            ],
        ],
        [
            'letter' => 'L.',
            'title' => 'Force Majeure',
            'items' => [
                'Penyelenggara berhak mengubah, mempersingkat, menunda, atau membatalkan lomba karena cuaca ekstrem, bencana alam, aturan pemerintah, atau kondisi di luar kendali wajar.',
                'Dalam kondisi tersebut, biaya pendaftaran tidak dapat dikembalikan kecuali dinyatakan lain oleh penyelenggara.',
                'Keselamatan peserta selalu menjadi prioritas utama dalam keputusan force majeure.',
            ],
        ],
        [
    'letter' => 'M.',
    'title' => 'Waiver, Risiko, dan Tanggung Jawab Peserta',
    'items' => [
        'Peserta memahami bahwa trail running merupakan aktivitas olahraga dengan risiko cedera ringan, cedera serius, kehilangan arah, kondisi cuaca ekstrem, hingga risiko lainnya yang dapat terjadi selama kegiatan berlangsung.',
        'Peserta menyatakan mengikuti lomba dalam kondisi sehat jasmani dan rohani serta bertanggung jawab penuh atas kondisi fisik pribadi sebelum, selama, dan setelah lomba.',
        'Peserta wajib menghentikan partisipasi apabila merasa tidak fit, mengalami gangguan kesehatan, atau dinilai tidak layak melanjutkan oleh tim medis maupun marshal.',
        'Penyelenggara tidak bertanggung jawab atas cedera, kehilangan, kecelakaan, atau kerugian lain yang terjadi akibat kelalaian pribadi peserta, kondisi kesehatan peserta, maupun tindakan peserta di luar arahan panitia.',
        'Peserta membebaskan penyelenggara, panitia, sponsor, marshal, tenaga medis, dan seluruh pihak terkait dari tuntutan hukum maupun klaim ganti rugi yang timbul akibat partisipasi dalam acara.',
        'Peserta memberikan izin kepada penyelenggara untuk menggunakan dokumentasi foto dan video selama acara untuk kebutuhan publikasi dan promosi tanpa kompensasi tambahan.',
    ],
],
        
    ]
    : [
        [
            'letter' => 'A.',
            'title' => 'Registration & Eligibility',
            'items' => [
                'Participants must be at least 17 years old on Open Category.',
                'Participants must be at least 15 years old on Student Category.',
                'Registration is non-refundable and non-transferable once confirmed.',
                'Participants must provide accurate personal and medical information during registration.',
                'The organizer reserves the right to reject or cancel any registration without prior notice if the participant violates the eligibility criteria.',
                'All participants must sign a waiver/disclaimer form before collecting their race kit.',
                'The Student Category is exclusively available to active high school and vocational school students (or equivalent). Participants are required to present a valid student ID card or official identification during registration or race pack collection.',
            ],
        ],
        [
            'letter' => 'B.',
            'title' => 'Mandatory Equipment',
            'items' => [
                [
                    'text' => 'All runners must carry the following at all times during the race:',
                    'children' => [
                        'Race bib &mdash; visible and unaltered',
                        'Fully charged mobile phone with emergency numbers saved',
                    ],
                ],
                ],
        ],
        [
            'letter' => 'C.',
            'title' => 'Bib Number & Timing',
            'items' => [
                'Race bibs must be worn on the front of the body and be clearly visible at all times.',
                'Bibs must not be folded, cut, or modified in any way that covers the number or timing chip.',
                'The official race time starts from the gun start, not chip time.',
            ],
        ],
        [
            'letter' => 'D.',
            'title' => 'Pacer and Crew Support Rules',
            'items' => [
                'Crew/support teams are only allowed at designated aid stations and checkpoints.',
                'No motorized vehicles, bicycles, or non-registered runners may accompany participants on the trail.',
            ],
        ],
        [
            'letter' => 'E.',
            'title' => 'Checkpoints & Cut-off Times',
            'items' => [
                'All runners must check in at every checkpoint along the route.',
                'Specific cut-off times apply at each checkpoint. Runners who arrive after the cut-off will be pulled from the race.',
                'Cut-off decisions by race marshals are <strong>final and non-negotiable</strong>.',
                'Runners who miss a checkpoint scan will be classified as DNF (Did Not Finish).',
            ],
        ],
        [
            'letter' => 'F.',
            'title' => 'Did Not Finish (DNF) Protocol',
            'items' => [
                'Any runner who wishes to withdraw from the race must notify the nearest marshal or checkpoint official.',
                'DNF runners must surrender their bib and wait for evacuation at the nearest checkpoint. Do not leave the course unassisted.',
                'Runners who abandon the race without notifying officials may be banned from future events.',
            ],
        ],
        [
            'letter' => 'G.',
            'title' => 'Filing a Protest (Submitting an Objection)',
            'items' => [
                'Protests must be submitted in writing to the Race Director within 60 minutes of the official results being posted.',
                'A protest fee of IDR 100.000 is required (refundable if the protest is upheld).',
                'The Race Director\'s decision on all protests is final.',
            ],
        ],
        [
            'letter' => 'H.',
            'title' => 'Environmental Responsibility & Course Etiquette',
            'items' => [
                'The race follows a <strong>Leave No Trace</strong> policy. All personal waste must be carried until a designated trash point.',
                'Littering on the trail will result in immediate disqualification.',
                'Runners must stay on the marked trail at all times. Shortcutting through vegetation or restricted areas is prohibited.',
                'Respect wildlife, local communities, and other trail users.',
            ],
        ],
        [
            'letter' => 'I.',
            'title' => 'Medical and Safety',
            'items' => [
                'Medical teams will be stationed at all checkpoints and key locations along the course.',
                'Runners must stop and assist any fellow participant in visible distress until a marshal arrives.',
                'The Race Medical Officer has the authority to pull any runner from the race for health and safety reasons. This decision is final.',
                'Participants with pre-existing medical conditions must declare them during registration.',
            ],
        ],
        [
            'letter' => 'J.',
            'title' => 'Personal Insurance & Evacuation',
            'items' => [
                'All participants are strongly encouraged to have personal sports/accident insurance.',
                'The organizer provides basic on-site medical coverage but is not responsible for costs arising from evacuation, hospitalization, or extended treatment.',
                'Evacuation from remote sections of the trail may involve helicopter or specialized rescue teams. Costs may be borne by the participant if not covered by insurance.',
            ],
        ],
        [
            'letter' => 'K.',
            'title' => 'Code of Conduct',
            'items' => [
                'All participants must behave respectfully toward marshals, volunteers, medical staff, and fellow runners.',
                'Aggressive behavior, verbal abuse, or unsportsmanlike conduct will result in immediate disqualification and a potential ban from future events.',
                'The use of performance-enhancing substances is strictly prohibited.',
            ],
        ],
        [
            'letter' => 'L.',
            'title' => 'Force Majeure',
            'items' => [
                'The organizer reserves the right to modify, shorten, delay, or cancel the race due to extreme weather, natural disaster, government regulation, or any circumstance beyond reasonable control.',
                'In such cases, registration fees are non-refundable unless stated otherwise by the organizer.',
                'Participant safety will always be the top priority in any force majeure decision.',
            ],
        ],
        [
    'letter' => 'M.',
    'title' => 'Waiver, Risk, and Participant Responsibility',
    'items' => [
        'Participants acknowledge that trail running is a sporting activity involving risks including minor injuries, serious injuries, disorientation, extreme weather conditions, and other potential hazards during the event.',
        'Participants declare that they are physically and mentally fit to participate and take full responsibility for their condition before, during, and after the race.',
        'Participants must stop participating if they feel unwell, experience health problems, or are deemed unfit to continue by medical staff or race marshals.',
        'The organizer shall not be held responsible for any injury, loss, accident, or damage caused by participant negligence, personal medical conditions, or actions taken outside the organizer’s instructions.',
        'Participants release and discharge the organizer, committee, sponsors, marshals, medical staff, and all related parties from any legal claims or liabilities arising from participation in the event.',
        'Participants grant permission to the organizer to use event photographs and videos for publication and promotional purposes without additional compensation.',
    ],
],
        
    ];
?>
<main class="page-shell page-shell--flush">
    <section class="rules-hero">
        <div class="container">
            <h1 class="rules-hero__title"><?php echo tr('Race Rules', 'Peraturan Lomba'); ?></h1>
            <p class="rules-hero__sub"><?php echo tr('All participants must read, understand, and comply with these rules before, during, and after the race.', 'Semua peserta wajib membaca, memahami, dan mematuhi peraturan ini sebelum, selama, dan setelah lomba.'); ?></p>
        </div>
    </section>

    <section class="container rules-section">
        <?php foreach ($rules as $index => $rule): ?>
            <div class="accordion fade-up <?php echo $index % 2 === 1 ? 'delay-1' : ''; ?>">
                <button class="accordion__toggle" type="button" aria-expanded="false">
                    <span class="accordion__letter"><?php echo h($rule['letter']); ?></span>
                    <span><?php echo h($rule['title']); ?></span>
                    <svg class="accordion__chevron" viewBox="0 0 24 24" aria-hidden="true"><path d="m6 9 6 6 6-6"></path></svg>
                </button>
                <div class="accordion__body">
                    <ul>
                        <?php foreach ($rule['items'] as $item): ?>
                            <?php if (is_array($item)): ?>
                                <li>
                                    <?php echo $item['text']; ?>
                                    <ul>
                                        <?php foreach ($item['children'] as $child): ?>
                                            <li><?php echo $child; ?></li>
                                        <?php endforeach; ?>
                                    </ul>
                                </li>
                            <?php else: ?>
                                <li><?php echo $item; ?></li>
                            <?php endif; ?>
                        <?php endforeach; ?>
                    </ul>
                </div>
            </div>
        <?php endforeach; ?>
    </section>
</main>
