<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{{ version.document.title }}</title>
    <style>
        @page {
            size: A4;
            margin: 2cm;
            @bottom-right {
                content: "Page " counter(page) " of " counter(pages);
                font-size: 10pt;
            }
        }
        body {
            font-family: "Helvetica", sans-serif;
            font-size: 12pt;
            line-height: 1.6;
        }
        h1, h2, h3, h4 {
            font-family: "Times New Roman", serif;
            color: #005595; /* Siemens-like blue */
        }
        h1 {
            font-size: 24pt;
            text-align: center;
            margin-bottom: 0.5cm;
        }
        .version-subtitle {
            font-size: 14pt;
            text-align: center;
            color: #555;
            margin-bottom: 2cm;
        }
        h2 {
            font-size: 18pt;
            border-bottom: 2px solid #009999; /* Siemens-like teal */
            padding-bottom: 5px;
            margin-top: 1.5cm;
        }
        p {
            text-align: justify;
        }

        /* --- ADD THIS BLOCK --- */
        /* Forces WeasyPrint to respect the width/height set by TinyMCE */
        img[width] {
            width: attr(width px);
        }
        img[height] {
            height: attr(height px);
        }
        img {
            max-width: 100%;
            height: auto;
        }
    </style>
</head>
<body>
    <!-- Use the parent document's title -->
    <h1>{{ version.document.title }}</h1>
    <!-- Add a clear subtitle for the version number -->
    <div class="version-subtitle">Version {{ version.version_number }}</div>

    <h2>Introduction</h2>
    <div>{{ version.introduction|safe }}</div>

    <h2>Main Body</h2>
    <div>{{ version.main_body|safe }}</div>

    <h2>Conclusion</h2>
    <div>{{ version.conclusion|safe }}</div>
</body>
</html>