<!DOCTYPE html>
<html lang="en-US">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{{htmlEscape .Title}}</title>
    <meta name="description" content="{{htmlEscape .Description}}">
    <link rel="canonical" href="{{htmlEscape .Canonical}}">
    <script type="application/ld+json">{{safe .Schema}}</script>
    <style>
        body { font-family: 'Arial', sans-serif; line-height: 1.4; color: #111; max-width: 800px; margin: 0 auto; padding: 15px; }
        header { padding-bottom: 20px; }
        .ai-article-section { margin-bottom: 30px; }
        .ai-article-section img { width: 100%; border-radius: 4px; }
        table { width: 100%; border-collapse: collapse; margin: 20px 0; border: 1px solid #ddd; }
        th, td { padding: 12px; border: 1px solid #ddd; text-align: left; }
        th { background-color: #f8f8f8; font-weight: bold; }
        tr:nth-child(even) { background-color: #fafafa; }
    </style>
    {{safe .HeaderInject}}
</head>
<body>
    <header><h1>{{htmlEscape .Title}}</h1></header>
    <main>
        {{if .InjectAds}}<div class="ads-container">{{safe .InjectAds}}</div>{{end}}
        <div class="ai-article-section">
            {{renderCompleteArticle .AIBlocks .Images .InjectAds "flat-modern"}}
        </div>
    </main>
    {{if .HasRelated}}
    <div style="margin-top: 40px; padding: 20px; border-top: 1px solid #eee;">
        <h4 style="margin-bottom: 20px; font-weight: bold; text-transform: uppercase; letter-spacing: 1px;">Related Articles</h4>
        <div style="display: flex; flex-wrap: wrap; gap: 10px;">
            {{range .RelatedArticles}}
            <a href="{{htmlEscape .Slug}}.html" style="padding: 10px 20px; background: #f8f8f8; border-radius: 5px; text-decoration: none; color: #333; font-size: 0.9rem; border: 1px solid #ddd;">{{htmlEscape .Keyword}}</a>
            {{end}}
        </div>
    </div>
    {{end}}
    <footer>{{safe .FooterInject}}</footer>
</body>
</html>