<!DOCTYPE html>
<html lang="de">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Abenteuerblatt - {{.Character.Name}}</title>
    <link rel="stylesheet" href="shared/export_format_a4_quer.css">
</head>
<body>
    <div class="container">
        <div class="header">
            <span class="header-left">Abenteuerblatt</span>
            <span class="header-right">Datum: {{.Meta.Date}}</span>
        </div>        
        <div class="title-row">
            <img src="shared/images/headerimg.png" alt="Schmuckgrafik" class="header-decoration">
            <div class="info-box">
                <div><strong>Figur</strong> {{.Character.Name}} &nbsp;&nbsp; <strong>Grad</strong> {{.Character.Grade}}</div>
                <hr>
                <div><strong>Typ</strong> {{.Character.Type}} &nbsp;&nbsp; <strong>GG</strong> {{.DerivedValues.GG}} &nbsp;&nbsp; <strong>SG</strong> {{.DerivedValues.SG}}</div>
            </div>
            <img src="shared/images/headerimg.png" alt="Schmuckgrafik" class="header-decoration">
        </div>        
        <div class="flex main-content">
            <!-- Left section -->
            <div class="left-section">             
                <!-- Skills tables -->
                <div class="skills-row">
                    <!-- BLOCK: skills_learned_1, TYPE: skills, MAX: 31, FILTER: learned -->
                    <table class="skills-table">
                        <tr>
                            <th>Fertigkeit</th>
                            <th>EW</th>
                            <th>PP</th>
                        </tr>
                        {{range .SkillsLearned1}}
                        <tr><td>{{.Name}}{{if .Bemerkung}}:<span style="font-size: smaller;">{{.Bemerkung}}</span>{{end}}</td><td>{{if .Value}}+ {{.Value}}{{else}}&nbsp;{{end}}</td><td>{{if .PracticePoints}}{{.PracticePoints}}{{end}}</td></tr>
                        {{end}}
                    </table>
                    <div class="skills-stack">                        
                        <!-- BLOCK: skills_languages, TYPE: skills, MAX: 14, FILTER: language, NOEMPTY -->
                        {{if .SkillsLanguage}}{{if (index .SkillsLanguage 0).Name}}
                        <table class="skills-table" style="width: 100%; height: unset;">
                            <tr>
                                <th>Fertigkeit</th>
                                <th>EW</th>
                                <th>PP</th>
                            </tr>
                            {{range .SkillsLanguage}}
                            <tr><td>{{.Name}}{{if .Bemerkung}}:<span style="font-size: smaller;">{{.Bemerkung}}</span>{{end}}</td><td>{{if .Value}}+ {{.Value}}{{else}}&nbsp;{{end}}</td><td>{{if .PracticePoints}}{{.PracticePoints}}{{end}}</td></tr>
                            {{end}}
                        </table>
                        {{end}}{{end}}
                        <!-- BLOCK: skills_learned_2, TYPE: skills, MAX: 16, FILTER: learned -->
                        <table class="skills-table" style="width: 100%; height: unset;">
                            <tr>
                                <th>Fertigkeit</th>
                                <th>EW</th>
                                <th>PP</th>
                            </tr>
                            {{range .SkillsLearned2}}
                            <tr><td>{{.Name}}{{if .Bemerkung}}:<span style="font-size: smaller;">{{.Bemerkung}}</span>{{end}}</td><td>{{if .Value}}+ {{.Value}}{{else}}&nbsp;{{end}}</td><td>{{if .PracticePoints}}{{.PracticePoints}}{{end}}</td></tr>
                            {{end}}
                        </table>
                    </div>
                </div>
            </div>            
            <!-- Right section -->
            <div class="right-section">
                <!-- Weapons table -->
                <div class="margin-bottom-3">
                    <!-- BLOCK: weapons_main, TYPE: weapons, MAX: 29 -->
                    <table class="weapons-table">
                        <tr>
                            <th>Waffe</th>
                            <th>Fert.<br>wert</th>
                            <th>Schaden</th>
                            <th>Reichweite<br/>nah/mitte/fern</th>
                        </tr>
                        {{range .Weapons}}
                        <tr>
                            <td>{{.Name}}</td>
                            <td>{{if .Value}}{{.Value}}{{else}}&nbsp;{{end}}</td>
                            <td>{{if .Damage}}{{.Damage}}{{else}}&nbsp;{{end}}</td>
                            <td>{{if .Range}}{{.Range}}{{else}}&nbsp;{{end}}</td>
                        </tr>
                        {{end}}
                    </table>
                </div>
                
                <!-- Senses row at bottom -->
                <div class="senses-row">
                    <span><b>Sehen</b> +{{.DerivedValues.Sehen}}</span>
                    <span><b>Nachtsicht</b> +{{.DerivedValues.Sehen}}</span>
                    <span><b>Hören</b> +{{.DerivedValues.Horen}}</span>
                    <span><b>Riechen/Schmecken</b> +{{.DerivedValues.Riechen}}</span>
                    <span><b>Sechster Sinn</b> +{{.DerivedValues.Sechster}}</span>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
