<!DOCTYPE html>
<!--suppress CssUnusedSymbol -->
<html lang="en_GB">
    <head>
        <title>{{ meta.title }}</title>
        <meta charset="utf-8">
        <style>
            @page {
                size: A4 landscape;
                margin: 1cm;

                @top-left {
                    content: "{{ meta.title }}";
                }
                @top-right {
                    content: "Page " counter(page) " of " counter(pages);
                }
                @bottom-left {
                    content: "Information version: {{ meta.time }}";
                }
                @bottom-right {
                    content: "Template File: {{ meta.template }}";
                }
            }

            html {
                font-family: sans-serif;
            }

            article {
                margin: 20px 0;
            }
            article:first-child {
                margin-top: 0;
            }
            article#all-items {
                break-before: page;
            }

            h1 {
                margin: 0;
                padding: 5px 3px 5px 7px;
                font-size: 12pt;
                color: white;
                background-color: black;
            }

            table {
                width: 100%;
                border-collapse: collapse;
                font-size: 10pt;
                border: 4px solid #a3a3a3;
            }

            td, th {
                border: 1px solid #a3a3a3;
            }
            td:first-child, th:first-child {
                border-left: 0;
            }
            td:last-child, th:last-child {
                border-right: 0;
            }

            /* stripped table rows */
            tbody tr:nth-child(odd) {
                background-color: #f0f0f0;
            }

            .mono {
                font-family: monospace;
            }

            .width-20 {
                width: 20%;
            }

            /* category colours */
            {% for category, colour in meta.category_colours | items %}
                article#category-{{ category }} h1 {
                    background-color: {{ colour }};
                }
                article#category-{{ category }} table {
                    border-color: {{ colour }};
                }
            {% endfor %}

            article#all-items h1 {
                background-color: #000;
            }
            article#all-items table {
                border-color: #000;
            }
        </style>
    </head>
    <body>
        {% for category_rows in item_categories %}
            {% set id = 'category-' ~ category_rows.category.slug %}
            {% set title = category_rows.category.name %}
            {% set items = category_rows.rows %}
            {% include 'air_unit_waypoints_table.j2' with context %}
        {% endfor %}

        {% set id = 'all-items' %}
        {% set title = 'All Waypoints' %}
        {% include 'air_unit_waypoints_table.j2' with context %}
    </body>
</html>
